/** * Wert für die Ausgabe */ function matchTemplate($content) { $var = 'REX_TEMPLATE'; $matches = $this->getInputParams($content, $var); foreach ($matches as $match) { list($param_str, $template_id) = $match; $template = new rex_template($template_id); $content = str_replace($var . '[' . $param_str . ']', $template->getTemplate(), $content); } return $content; }
/** * Wert für die Ausgabe */ function matchTemplate($content) { $var = 'REX_TEMPLATE'; $matches = $this->getInputParams($content, $var); foreach ($matches as $match) { list($param_str, $template_id) = $match; // bezeichner wählen, der keine variablen // aus modulen/templates überschreibt $varname = '$__rex_tpl' . $template_id; $tpl = '<?php ' . $varname . ' = new rex_template(); ' . $varname . '->setId(' . $template_id . '); require ' . $varname . '->getFile(); ?>'; $template = new rex_template($template_id); $content = str_replace($var . '[' . $param_str . ']', $template->getTemplate(), $content); } return $content; }
function getArticleTemplate() { // global $REX hier wichtig, damit in den Artikeln die Variable vorhanden ist! global $REX; if ($this->getTemplateId() != 0 && $this->article_id != 0) { ob_start(); ob_implicit_flush(0); $TEMPLATE = new rex_template(); $TEMPLATE->setId($this->getTemplateId()); $tplContent = $TEMPLATE->getTemplate(); $tplContent = $this->replaceCommonVars($tplContent); eval("?>" . $tplContent); $CONTENT = ob_get_contents(); ob_end_clean(); } else { $CONTENT = "no template"; } return $CONTENT; }
public function getArticleTemplate() { if ($this->template_id != 0 && $this->article_id != 0) { ob_start(); ob_implicit_flush(0); $TEMPLATE = new rex_template($this->template_id); $tplContent = $this->replaceCommonVars($TEMPLATE->getTemplate()); require rex_stream::factory('template/' . $this->template_id, $tplContent); $CONTENT = ob_get_contents(); ob_end_clean(); $CONTENT = $this->replaceLinks($CONTENT); } else { $CONTENT = 'no template'; } return $CONTENT; }