Example #1
0
 public function init()
 {
     $bootstrap = $this->getBootstrap();
     $bootstrap->bootstrap('FrontController');
     $bootstrap->bootstrap('View');
     $bootstrap->bootstrap('Layout');
     $front = $bootstrap->getResource('FronController');
     Zend_Controller_Action_HelperBroker::addPrefix('Bc_Controller_Action_Helper');
     $bootstrap->bootstrap('Doctrine');
     $manager = Zend_Registry::get('db_manager');
     $options = $this->getOptions();
     if (!isset($options[self::OPTION_PLUGINS_PATH])) {
         throw new Exception('Bad Config! pluginsPath shoud be setted');
     }
     $pluginManager = Bc_Application_Plugin_Manager::getInstance();
     $pluginManager->setPluginsPath($options[self::OPTION_PLUGINS_PATH]);
     $pluginManager->initializePlugins();
     if (!isset($options[self::OPTION_THEMES_PATH])) {
         throw new Exception('Bad Config! themesPath shoud be setted');
     }
     $themesManager = Bc_Application_Theme_Manager::getInstance();
     $themesManager->setThemesPath($options[self::OPTION_THEMES_PATH]);
     $themesManager->setView($bootstrap->getResource('View'));
     $themesManager->setActiveThemeName('minimal');
     $themesManager->setLayout($bootstrap->getResource('Layout'));
     $themesManager->initializeTheme();
 }
Example #2
0
 /**
  *
  * @return Bc_Application_Plugin_Manager
  */
 public static function getInstance()
 {
     if (self::$_instance == null) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
Example #3
0
 public function initializeTheme()
 {
     $this->getView()->addBasePath($this->getThemesPath() . '/' . $this->getActiveThemeName());
     $this->getLayout()->setLayoutPath($this->getThemesPath() . '/' . $this->getActiveThemeName() . '/layouts');
     $plugins = Bc_Application_Plugin_Manager::getInstance()->getPlugins();
     foreach ($plugins as $plugin) {
         if (!$plugin->active) {
             continue;
         }
         $this->getView()->addScriptPath($this->getThemesPath() . '/' . $this->getActiveThemeName() . '/' . $plugin->name);
     }
 }
 public function registerPluginsAction()
 {
     $manager = Bc_Application_Plugin_Manager::getInstance();
     $manager->registerPlugins();
 }