Exemplo n.º 1
0
 /**
  * Get the list of commands
  *
  * Will attempt to use information from the xml manifest if possible
  *
  * @return  array
  */
 public function getCommands()
 {
     $menu = $this->getObject('com:pages.model.menus')->application('admin')->getRowset()->find(array('slug' => 'menubar'));
     if (count($menu)) {
         $package = $this->getObject('component')->getIdentifier()->package;
         $view = $this->getObject('component')->getController()->getIdentifier()->name;
         $extension = $this->getObject('application.extensions')->getExtension($package);
         $groups = $this->getObject('user')->getGroups();
         // Make sure that pages without an assigned group are also included.
         $groups[] = 0;
         $pages = $this->getObject('application.pages')->find(array('pages_menu_id' => $menu->top()->id, 'extensions_extension_id' => $extension->id, 'hidden' => 0, 'users_group_id' => $groups));
         foreach ($pages as $page) {
             if ($page->level > 2) {
                 $this->addCommand(JText::_((string) $page->title), array('href' => (string) $page->link_url, 'active' => (string) $view == Library\StringInflector::singularize($page->getLink()->query['view'])));
             }
         }
     }
     return parent::getCommands();
 }
Exemplo n.º 2
0
 /**
  * Initializes the config for the object
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param   Library\ObjectConfig $config Configuration options
  * @return  void
  */
 protected function _initialize(Library\ObjectConfig $config)
 {
     $config->append(array('type' => 'menubar'));
     parent::_initialize($config);
 }
Exemplo n.º 3
0
 protected function _initialize(Library\ObjectConfig $config)
 {
     $config->append(array('priority' => Library\CommandChain::PRIORITY_LOW));
     parent::_initialize($config);
 }