/** * Before controller action. * * @param KEvent $event Event object * * @return string */ public function onBeforeControllerGet(KEvent $event) { parent::onBeforeControllerGet($event); $viewer = $this->getController()->viewer; $actor = pick($this->getController()->actor, $viewer); $layout = pick($this->getController()->layout, 'default'); $name = $this->getController()->getIdentifier()->name; $this->setTitle(JText::sprintf('COM-TOPICS-HEADER-TOPICS', $actor->name)); $this->addNavigation('topics', JText::_('COM-TOPICS-NAV-TOPICS'), array('option' => 'com_topics', 'view' => 'topics', 'oid' => $actor->id), $name == 'topic'); }
/** * Before controller action. * * @param KEvent $event Event object * * @return string */ public function onBeforeControllerGet(KEvent $event) { parent::onBeforeControllerGet($event); $viewer = get_viewer(); $actor = pick($this->getController()->actor, $viewer); $layout = pick($this->getController()->layout, 'default'); $name = $this->getController()->getIdentifier()->name; $this->setTitle(JText::sprintf('COM-PAGES-ACTOR-HEADER-' . strtoupper($name) . 'S', $actor->name)); //create navigations $this->addNavigation('pages', JText::_('COM-PAGES-LINK-PAGES'), array('option' => 'com_pages', 'view' => 'pages', 'oid' => $actor->id), $name == 'page'); }
/** * Before controller action * * @param KEvent $event Event object * * @return string */ public function onBeforeControllerGet(KEvent $event) { parent::onBeforeControllerGet($event); $viewer = $this->getController()->viewer; $actor = pick($this->getController()->actor, $viewer); $layout = pick($this->getController()->getRequest()->layout, 'default'); $name = $this->getController()->getIdentifier()->name; //create title if ($layout == 'upload') { $this->setTitle(JText::sprintf('COM-PHOTOS-UPLOAD-PHOTOS', $actor->name)); } elseif ($name == 'set') { $this->setTitle(JText::sprintf('COM-PHOTOS-HEADER-ACTOR-SETS', $actor->name)); } else { $this->setTitle(JText::sprintf('COM-PHOTOS-HEADER-ACTOR-PHOTOS', $actor->name)); } //create navigations $this->addNavigation('photos', JText::_('COM-PHOTOS-LINKS-PHOTOS'), array('option' => 'com_photos', 'view' => 'photos', 'oid' => $actor->uniqueAlias), $name == 'photo' && in_array($layout, array('default', 'add', 'masonry'))); if ($actor->photos->getTotal() > 0) { $this->addNavigation('sets', JText::_('COM-PHOTOS-LINKS-SETS'), array('option' => 'com_photos', 'view' => 'sets', 'oid' => $actor->uniqueAlias), $name == 'set' && in_array($layout, array('default', 'add', 'edit'))); } }