*/ class Fishpig_Bolt_Model_System_Config_Source_Module { /** * Options cache * * @return array */ protected $_options = null; /** * Retrieve the option array of modules * * @return array */ public function toOptionArray() { if (!is_null($this->_options)) { return $this->_options; } $config = Mage::app()->getConfig(); $modules = (array)$config->getNode('modules')->asArray(); ksort($modules); $this->_options = array(); foreach($modules as $module => $data) { if (isset($data['active']) && $data['active'] === 'true') { $frontNames = (array)$config->getNode('frontend')->xpath('routers//args[module="' . $module . '"]/frontName'); if (count($frontNames) === 0) { continue; } $frontName = array_shift($frontNames); $this->_options[] = array( 'value' => $frontName, 'label' => $module, ); } } return $this->_options; } }