Exemple #1
0
 public function __construct($config = array())
 {
     // Call the parent constructor
     parent::__construct($config);
     // Get the Joomla! version from the configuration or the session
     if (array_key_exists('jversion', $config)) {
         $jVersion = $config['jversion'];
     } else {
         $jVersion = ASession::getInstance()->get('jversion', '2.5.0');
     }
     // Load the configuration variables from the session or the default configuration shipped with ANGIE
     $this->configvars = ASession::getInstance()->get('configuration.variables');
     if (empty($this->configvars)) {
         // Get default configuration based on the Joomla! version
         if (version_compare($jVersion, '2.5.0', 'ge') && version_compare($jVersion, '3.0.0', 'lt')) {
             $v = '25';
         } else {
             $v = '30';
         }
         $className = 'J' . $v . 'Config';
         $filename = APATH_INSTALLATION . '/platform/models/jconfig/j' . $v . '.php';
         $this->configvars = $this->loadFromFile($filename, $className);
         if (!empty($this->configvars)) {
             $this->saveToSession();
         }
     }
 }
Exemple #2
0
 /**
  * Overridden constructor
  *
  * @param   array  $config  Configuration array
  */
 public function __construct($config = array())
 {
     parent::__construct($config);
     $this->configModel = AModel::getAnInstance('Configuration', 'AngieModel');
 }
Exemple #3
0
 /**
  * Overridden constructor
  *
  * @param   array       $config     Configuration array
  * @param   \AContainer $container
  */
 public function __construct($config = array(), AContainer $container = null)
 {
     parent::__construct($config, $container);
     $this->configModel = AModel::getAnInstance('Configuration', 'AngieModel', array(), $this->container);
 }