10 defined(
'_JEXEC') or die;
100 public function commonCategoryDisplay()
104 $params = $app->getParams();
107 $state = $this->
get(
'State');
108 $items = $this->
get(
'Items');
109 $category = $this->
get(
'Category');
110 $children = $this->
get(
'Children');
111 $parent = $this->
get(
'Parent');
112 $pagination = $this->
get(
'Pagination');
115 if (count($errors = $this->
get(
'Errors')))
122 if ($category ==
false)
127 if ($parent ==
false)
133 $groups = $user->getAuthorisedViewLevels();
135 if (!in_array($category->access, $groups))
141 $cparams = $category->getParams();
142 $category->params = clone($params);
143 $category->params->merge($cparams);
145 $children = array($category->id => $children);
148 $this->pageclass_sfx = htmlspecialchars($params->get(
'pageclass_sfx'));
150 $maxLevel = $params->get(
'maxLevel', -1);
151 $this->maxLevel = &$maxLevel;
152 $this->state = &$state;
153 $this->items = &$items;
154 $this->category = &$category;
155 $this->children = &$children;
156 $this->params = &$params;
157 $this->parent = &$parent;
158 $this->pagination = &$pagination;
159 $this->user = &$user;
163 $active = $app->getMenu()->getActive();
165 if ((!$active) || ((strpos($active->link,
'view=category') ===
false) || (strpos($active->link,
'&id=' . (
string) $this->category->id) ===
false)))
167 if ($layout = $category->params->get(
'category_layout'))
169 $this->setLayout($layout);
172 elseif (isset($active->query[
'layout']))
175 $this->setLayout($active->query[
'layout']);
178 $this->category->tags =
new JHelperTags;
179 $this->category->tags->getItemTags($this->extension .
'.category', $this->category->id);
191 public function display($tpl = null)
193 $this->prepareDocument();
195 return parent::display($tpl);
205 protected function prepareDocument()
208 $menus = $app->getMenu();
209 $this->pathway = $app->getPathway();
213 $this->menu = $menus->getActive();
217 $this->params->def(
'page_heading', $this->params->get(
'page_title', $this->menu->title));
221 $this->params->def(
'page_heading',
JText::_($this->defaultPageTitle));
224 $title = $this->params->get(
'page_title',
'');
228 $title = $app->get(
'sitename');
230 elseif ($app->get(
'sitename_pagetitles', 0) == 1)
232 $title =
JText::sprintf(
'JPAGETITLE', $app->get(
'sitename'), $title);
234 elseif ($app->get(
'sitename_pagetitles', 0) == 2)
236 $title =
JText::sprintf(
'JPAGETITLE', $title, $app->get(
'sitename'));
239 $this->document->setTitle($title);
241 if ($this->params->get(
'menu-meta_description'))
243 $this->document->setDescription($this->params->get(
'menu-meta_description'));
246 if ($this->params->get(
'menu-meta_keywords'))
248 $this->document->setMetadata(
'keywords', $this->params->get(
'menu-meta_keywords'));
251 if ($this->params->get(
'robots'))
253 $this->document->setMetadata(
'robots', $this->params->get(
'robots'));
264 protected function addFeed()
266 if ($this->params->get(
'show_feed_link', 1) == 1)
268 $link =
'&format=feed&limitstart=';
269 $attribs = array(
'type' =>
'application/rss+xml',
'title' =>
'RSS 2.0');
270 $this->document->addHeadLink(
JRoute::_($link .
'&type=rss'),
'alternate',
'rel', $attribs);
271 $attribs = array(
'type' =>
'application/atom+xml',
'title' =>
'Atom 1.0');
272 $this->document->addHeadLink(
JRoute::_($link .
'&type=atom'),
'alternate',
'rel', $attribs);