Exemplo n.º 1
0
 /**
  * Gets redCORE config param
  *
  * @param   string  $key      Config key
  * @param   mixed   $default  Default value
  *
  * @return  mixed
  */
 public static function getConfig($key, $default = null)
 {
     if (is_null(self::$config)) {
         $plugin = JPluginHelper::getPlugin('system', 'redcore');
         if ($plugin) {
             if (is_string($plugin->params)) {
                 self::$config = new JRegistry($plugin->params);
             } elseif (is_object($plugin->params)) {
                 self::$config = $plugin->params;
             }
         }
         return null;
     }
     return self::$config->get($key, $default);
 }
Exemplo n.º 2
0
 /**
  * Constructor
  *
  * @param   object  &$subject  The object to observe
  * @param   array   $config    An optional associative array of configuration settings.
  *                             Recognized key values include 'name', 'group', 'params', 'language'
  *                             (this list is not meant to be comprehensive).
  *
  * @since   1.5
  */
 public function __construct(&$subject, $config = array())
 {
     parent::__construct($subject, $config);
     $redcoreLoader = JPATH_LIBRARIES . '/redcore/bootstrap.php';
     if (file_exists($redcoreLoader)) {
         require_once $redcoreLoader;
         // Sets plugin parameters for further use
         RBootstrap::$config = $this->params;
         // Sets initalization variables for frontend in Bootstrap class, according to plugin parameters
         RBootstrap::$loadFrontendCSS = $this->params->get('frontend_css', false);
         RBootstrap::$loadFrontendjQuery = $this->params->get('frontend_jquery', true);
         RBootstrap::$loadFrontendjQueryMigrate = $this->params->get('frontend_jquery_migrate', true);
         RBootstrap::$disableFrontendMootools = $this->params->get('frontend_disable_mootools', false);
         if (!$this->isInstaller()) {
             RBootstrap::bootstrap(false);
         }
     }
 }