*/ /** * patTemplate Reader Wombat * * @package wombat * @author gERD Schaufelberger */ class patTemplate_Reader_Wombat extends patTemplate_Reader { /** * reader name * @var string */ public $_name = 'Wombat'; /** * Load Templates From Input * * @var string $input * @return array list of templates */ public function readTemplates($input) { $root = $this->_tmpl->getRoot(); $dir = realpath(WBParam::get('wb/dir/base') . '/' . $root); $file = realpath($dir . '/' . $input); if (!file_exists($file)) { $res = WBParam::get('wb/dir/resource', array()); foreach ($res as $r) { $dir = realpath($r . '/' . $root); $file = realpath($dir . '/' . $input); if (!empty($file)) { break; } } } if (empty($file)) { return patErrorManager::raiseError( PATTEMPLATE_READER_ERROR_NO_INPUT, "Could not load templates from $input." ); } $content = file_get_contents($file); $templates = $this->parseString($content); return $templates; } }