option; $id =& $this->id; $section =& $this->section; $template =& $this->template; $Itemid =& $this->Itemid; if (!$option) { trigger_error('Failed get option', E_USER_WARNING); return; } if (!$id) { trigger_error('Failed get id', E_USER_WARNING); return; } if (!$section) { trigger_error('Failed get section', E_USER_WARNING); return; } if (!$template) { trigger_error('Failed get template', E_USER_WARNING); return; } if (!preg_match('/^com_[0-9a-zA-Z_]+$/', $option)) { trigger_error("Failed get option: {$option}", E_USER_WARNING); return; } if (!is_int($id) || !($id > 0)) { trigger_error("Failed get id: {$id}", E_USER_WARNING); return; } if (!is_object($section)) { trigger_error("Failed get section", E_USER_WARNING); return; } if (!is_string($template)) { trigger_error("Failed get template", E_USER_WARNING); return; } if (isset($Itemid)) { if (!$Itemid) { trigger_error('Failed get Itemid', E_USER_WARNING); return; } else if (!preg_match('/^[1-9][0-9]*$/', $Itemid)) { trigger_error("Failed get Itemid: {$Itemid}", E_USER_WARNING); return; } } $template = <<<__TEMPLATE__ {$template} __TEMPLATE__; global $mosConfig_live_site; global $mosConfig_absolute_path; require_once "{$mosConfig_absolute_path}/includes/patTemplate/patTemplate.php"; $patTemplate = patFactory::createTemplate(); $patTemplate->readTemplatesFromInput($template, 'String'); $patTemplate->addVar('section', 'id', $id); $patTemplate->addVar('section', 'name', $section->name); $patTemplate->addVar('section', 'title', $section->title); $patTemplate->addVar('section', 'description', $section->description); $patTemplate->addVar('section', 'image', "{$mosConfig_live_site}/images/stories/{$section->image}"); $patTemplate->displayParsedTemplate('section'); } }