/** * Initializes the default configuration for the object * * Called from {@link __construct()} as a first step of object instantiation. * * @param KConfig $config An optional KConfig object with configuration options. * * @return void */ protected function _initialize(KConfig $config) { $package = KInflector::humanize($this->getIdentifier()->package); $name = KInflector::humanize(KInflector::pluralize($this->getName())); $config->append(array('title' => $package . ' - ' . $name)); parent::_initialize($config); }
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(); }
/** * Constructor. * * @param KConfig $config An optional KConfig object with configuration options. * * @return void */ public function __construct(KConfig $config) { parent::__construct($config); //commands is template objects container $this->_commands = new LibBaseTemplateObjectContainer(); }
/** * Initializes the config for the object * * Called from {@link __construct()} as a first step of object instantiation. * * @param KObjectConfig $config Configuration options * @return void */ protected function _initialize(KObjectConfig $config) { $config->append(array('type' => 'actionbar')); parent::_initialize($config); }