Пример #1
0
 public function onAfterInitialise()
 {
     // read folder locations from plugin settings
     $oneLibFolder = JPATH_SITE . '/libraries/one/lib/';
     $oneCustomFolder = JPATH_SITE . '/libraries/one/custom/';
     // bootstrap one|content
     require_once $oneLibFolder . 'core/bootstrap.php';
     One_Bootstrap::bootstrap($oneLibFolder, $oneCustomFolder);
     // one|content for Joomla uses different views for front/backend and per language
     // which requires a particular setup of the locator pattern used for these
     $application = 'site';
     $app = JFactory::getApplication();
     if (strpos($app->getName(), 'admin') !== false) {
         $application = 'admin';
     }
     One_Config::set('app.name', $application);
     // pickup language setting
     $language = JFactory::getLanguage()->getTag();
     One_Config::set('app.language', $language);
     // setup locator tokens
     $locatorTokens = array('%APP%' => One_Config::get('app.name'), '%LANG%' => One_Config::get('app.language'));
     One_Config::set('locator.tokens', $locatorTokens);
     One_Config::set('view.locator', 'One_View_Locator_Joomla');
     // set the templater. You have the choice between One_View_Templater_Script and One_View_Templater_Php,
     // the latter being a standard PHP template hndler
     // *** TODO: needs to load this from plugin parameters
     One_Config::set('view.templater', 'One_View_Templater_Script');
     // debug behaviour
     One_Config::set('debug.exitOnError', $this->params->get('exitOnError'));
     One_Config::set('debug.query', $this->params->get('enableDebug', 0));
     // special form subfolder to use
     One_Config::set('form.chrome', $this->params->get('formChrome', ''));
 }
Пример #2
0
 public static function onAfterInitialise($arguments = array())
 {
     parent::onAfterInitialise($arguments);
     // set default toolset used in backend
     // *** TODO: should be in the support pack for the admin component, to be added to the locator pattern
     // by the admin component (or enabled in the plugin to support the one admin component
     //      One_Button::setToolset('joomla');
     // set DOM type. Not sure yet whether this is really a cool thing to do. This could override the standard
     // dom setting, and should be oved to the plugin initialiser
     One_Config::set('dom.type', 'joomla');
 }
Пример #3
0
 public static function bootstrap($oneLibFolder, $oneCustomFolder)
 {
     // Step 1: setup the basic configuration
     require_once $oneLibFolder . 'core/config.php';
     One_Config::set('locator.root', '{' . $oneCustomFolder . '*,' . $oneLibFolder . '*}/');
     // Step 2: register the autoloader
     require_once $oneLibFolder . 'core/loader.php';
     One_Loader::register($oneLibFolder, $oneCustomFolder);
     // Step 3: load extensions
     One_Config::loadExtensions();
     One_Config::callExtensions('afterInitialise');
     // Step 4: load the main One class
     require_once $oneLibFolder . 'core/one_tbd.php';
 }