10 defined(
'_JEXEC') or die;
54 public function display($tpl = null)
56 $state = $this->
get(
'State');
57 $items = $this->
get(
'Items');
58 $parent = $this->
get(
'Parent');
63 if (count($errors = $this->
get(
'Errors')))
65 $app->enqueueMessage($errors,
'error');
72 $app->enqueueMessage(
JText::_(
'JGLOBAL_CATEGORY_NOT_FOUND'),
'error');
79 $app->enqueueMessage(
JText::_(
'JGLOBAL_CATEGORY_NOT_FOUND'),
'error');
84 $params = &$state->params;
86 $items = array($parent->id => $items);
89 $this->pageclass_sfx = htmlspecialchars($params->get(
'pageclass_sfx'));
91 $this->maxLevelcat = $params->get(
'maxLevelcat', -1);
92 $this->params = &$params;
93 $this->parent = &$parent;
94 $this->items = &$items;
96 $this->prepareDocument();
98 return parent::display($tpl);
108 protected function prepareDocument()
111 $menus = $app->getMenu();
114 $menu = $menus->getActive();
118 $this->params->def(
'page_heading', $this->params->get(
'page_title', $menu->title));
122 $this->params->def(
'page_heading',
JText::_($this->pageHeading));
125 $title = $this->params->get(
'page_title',
'');
129 $title = $app->get(
'sitename');
131 elseif ($app->get(
'sitename_pagetitles', 0) == 1)
133 $title =
JText::sprintf(
'JPAGETITLE', $app->get(
'sitename'), $title);
135 elseif ($app->get(
'sitename_pagetitles', 0) == 2)
137 $title =
JText::sprintf(
'JPAGETITLE', $title, $app->get(
'sitename'));
140 $this->document->setTitle($title);
142 if ($this->params->get(
'menu-meta_description'))
144 $this->document->setDescription($this->params->get(
'menu-meta_description'));
147 if ($this->params->get(
'menu-meta_keywords'))
149 $this->document->setMetadata(
'keywords', $this->params->get(
'menu-meta_keywords'));
152 if ($this->params->get(
'robots'))
154 $this->document->setMetadata(
'robots', $this->params->get(
'robots'));