/** * 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). * * @return JPlugin * * @since 11.1 */ public function __construct(&$subject, $config = array()) { // Get the parameters. if (isset($config['params'])) { if ($config['params'] instanceof JRegistry) { $this->params = $config['params']; } else { $this->params = new JRegistry(); $this->params->loadString($config['params']); } } // Get the plugin name. if (isset($config['name'])) { $this->_name = $config['name']; } // Get the plugin type. if (isset($config['type'])) { $this->_type = $config['type']; } parent::__construct($subject); }
/** * Constructor. * * @param object &$subject The JDispatcher object to observe. * * @since 2.0 */ public function __construct(&$subject) { // Check if the current user is Ldap authenticated $this->isLdap = SHLdapHelper::isUserLdap(); parent::__construct($subject); }
/** * 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' * (this list is not meant to be comprehensive). * @since 1.5 */ public function __construct(&$subject, $config = array()) { // Get the parameters. if (isset($config['params'])) { if ($config['params'] instanceof JParameter) { $this->params = $config['params']; } else { $this->params = new JParameter($config['params']); } } // Get the plugin name. if (isset($config['name'])) { $this->_name = $config['name']; } // Get the plugin type. if (isset($config['type'])) { $this->_type = $config['type']; } $events = get_class_methods($this); foreach ($events as $event) { $method = array('event' => $event, 'handler' => array($this, 'onFireEvent')); $subject->attach($method); } parent::__construct($subject); }
/** * Constructor. * * @param object &$subject The JDispatcher object to observe. * * @since 2.0 */ public function __construct(&$subject) { // Gets the user adapter name for the current session user $session = JFactory::getSession(); $user = $session->get('user'); if ($user instanceof JUser && $user->id > 0) { // We try to cache the user adapter name to the user's session to save a db query if (!$session->get('SHUserAdapterName', false)) { // There should only be one user link, in any case we will only use one if ($userLink = SHAdapterMap::getUser($user->id, true)) { $session->set('SHUserAdapterName', $userLink[0]['adapter']); } } $this->adapterUser = $session->get('SHUserAdapterName'); } parent::__construct($subject); }
/** * Constructor */ function __construct(&$subject, $config = array()) { //Set the parameters if (isset($config['params'])) { if (is_a($config['params'], 'JParameter')) { $this->params = $config['params']; } else { $this->params = new JParameter($config['params']); } } if (isset($config['name'])) { $this->_name = $config['name']; } if (isset($config['type'])) { $this->_type = $config['type']; } parent::__construct($subject); }
/** * Constructor * * @access protected */ function __construct(&$subject) { parent::__construct($subject); }
/** * 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()) { // Get the parameters. if (isset($config['params'])) { if ($config['params'] instanceof JRegistry) { $this->params = $config['params']; } else { $this->params = new JRegistry(); $this->params->loadString($config['params']); } } // Get the plugin name. if (isset($config['name'])) { $this->_name = $config['name']; } // Get the plugin type. if (isset($config['type'])) { $this->_type = $config['type']; } // Load the language files if needed. if ($this->autoloadLanguage) { $this->loadLanguage(); } if (property_exists($this, 'app')) { $reflection = new ReflectionClass($this); $appProperty = $reflection->getProperty('app'); if ($appProperty->isPrivate() === false && is_null($this->app)) { $this->app = JFactory::getApplication(); } } if (property_exists($this, 'db')) { $reflection = new ReflectionClass($this); $dbProperty = $reflection->getProperty('db'); if ($dbProperty->isPrivate() === false && is_null($this->db)) { $this->db = JFactory::getDbo(); } } parent::__construct($subject); }
function __construct(&$subject) { parent::__construct($subject); $this->canDo = JCKHelper::getActions(); $this->app = JFactory::getApplication(); }
/** * Constructor * * @access protected */ function __construct(&$subject) { parent::__construct($subject); $this->_type = -1; }
/** * Constructor * * @param string $name The component name. * @param object &$subject The object to observe. */ public function __construct($name, &$subject) { $this->name = $name; parent::__construct($subject); }
public function __construct(&$subject, $config) { parent::__construct($subject, $config); }
function __construct() { $dispatcher = JTheFactoryDispatcher::getInstance(); parent::__construct($dispatcher); }