public function getCommands() { $name = $this->getController()->getIdentifier()->name; $this->addCommand('Your Extensions', array('href' => 'option=com_extman&view=extensions', 'active' => $name === 'extension')); $this->addCommand('Install More', array('href' => 'option=com_installer&view=install', 'active' => false)); return KControllerToolbarAbstract::getCommands(); }
/** * 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->getIdentifier()->package; $manifest = JPATH_ADMINISTRATOR . '/components/com_' . $package . '/' . $package . '.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((string) $menu, array('href' => 'option=com_' . $package . '&view=' . $view, 'active' => $name == KStringInflector::singularize($view))); } } } return parent::getCommands(); }
/** * 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->getIdentifier()->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']; if (!isset($menu['href'])) { $menu['href'] = 'index.php?option=com_' . $package . '&view=' . $view; } if (!isset($menu['active'])) { $menu['active'] = $name == KInflector::singularize($view); } $this->addCommand(JText::_((string) $menu), array('href' => JRoute::_($menu['href']), 'active' => (string) $menu['active'])); } } } return parent::getCommands(); }
public function getCommands() { $this->addCommand('COM_SALES_SUBMENU_COUPONS', array('href' => 'option=com_sales&view=coupons', 'active' => 'coupon')); $this->addCommand('COM_SALES_SUBMENU_GATEWAYS', array('href' => 'option=com_sales&view=gateways', 'active' => 'gateway')); return KControllerToolbarAbstract::getCommands(); }