Exemple #1
0
    /**
	 * Get the list of commands
	 *
	 * Will attempt to use information from the xml manifest if possible
	 *
	 * @return  array
	 */
	public function getCommands()
	{
	    $name     = $this->getController()->getIdentifier()->name;
	    $package  = $this->_identifier->package;
	    $manifest = JPATH_ADMINISTRATOR.'/components/com_'.$package.'/manifest.xml';

	    if(file_exists($manifest))
	    {
	        $xml = simplexml_load_file($manifest);
	        
	        if(isset($xml->administration->submenu)) 
	        {
	            foreach($xml->administration->submenu->children() as $menu)
	            {
	                $view = (string)$menu['view'];
	                
	                $this->addCommand(JText::_((string)$menu), array(
	            		'href'   => JRoute::_('index.php?option=com_'.$package.'&view='.$view),
	            		'active' => ($name == KInflector::singularize($view))
	                ));
	            }
	        }
	    }
	
	    return parent::getCommands();   
	}
Exemple #2
0
 /**
  * Get the sidebar links
  *
  * @return  array
  */
 public function getCommands()
 {
     $name = $this->getController()->getIdentifier()->name;
     $this->addCommand('Components', array('href' => JRoute::_('index.php?option=com_installer&view=components'), 'active' => $name == 'component'));
     $this->addCommand('Modules', array('href' => JRoute::_('index.php?option=com_installer&view=modules'), 'active' => $name == 'module'));
     $this->addCommand('Plugins', array('href' => JRoute::_('index.php?option=com_installer&view=plugins'), 'active' => $name == 'plugin'));
     $this->addCommand('Languages', array('href' => JRoute::_('index.php?option=com_installer&view=languages'), 'active' => $name == 'language'));
     $this->addCommand('Templates', array('href' => JRoute::_('index.php?option=com_installer&view=templates'), 'active' => $name == 'template'));
     return parent::getCommands();
 }