/** * @param JCategoryNode $category * @return String */ public static function getCategoryDescription($category) { $params = $category->getParams(); if (!$params->exists('eventgallery_description')) { return $category->description; } $lc = new EventgalleryLibraryDatabaseLocalizablestring($params->get('eventgallery_description')); return $lc->get(); }
/** * Prepares the document */ protected function _prepareDocument() { $app = JFactory::getApplication(); $menus = $app->getMenu(); $title = null; // Because the application sets a default page title, // we need to get it from the menu item itself $menu = $menus->getActive(); if ($menu) { $this->params->get('page_heading', $this->params->get('page_title', $menu->title)); } $title = $this->params->get('page_title', ''); // checks for empty title or sets the category title if // the current menu item has a different catid than the current catid is if (empty($title) || isset($menu->query['catid']) && $this->catid != $menu->query['catid']) { $title = $this->category->title; } if (empty($title)) { $title = $app->getCfg('sitename'); } elseif ($app->getCfg('sitename_pagetitles', 0) == 1) { $title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title); } elseif ($app->getCfg('sitename_pagetitles', 0) == 2) { $title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename')); } $this->document->setTitle($title); if (!empty($this->category->metadesc)) { $this->document->setDescription($this->category->metadesc); } else { if ($this->params->get('menu-meta_description')) { $this->document->setDescription($this->params->get('menu-meta_description')); } } if (!empty($this->category->metadesc)) { $this->document->setMetadata('keywords', $this->category->metakey); } else { if ($this->params->get('menu-meta_keywords')) { $this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords')); } } $robots = $this->category->getMetadata()->get('robots'); if (!empty($robots)) { $this->document->setMetadata('robots', $robots); } else { if ($this->params->get('robots')) { $this->document->setMetadata('robots', $this->params->get('robots')); } } /** * @var JPathway $pathway */ $pathway = $app->getPathway(); }
/** * Add child to this node * * If the child already has a parent, the link is unset * * @param JCategoryNode $child The child to be added. * * @return void * * @since 11.1 */ public function addChild($child) { if ($child instanceof JCategoryNode) { $child->setParent($this); } }
/** * Add child to this node * * If the child already has a parent, the link is unset * * @param JCategoryNode $child The child to be added. * * @return void * * @since 11.1 */ public function addChild(JCategoryNode $child) { $child->setParent($this); }