/**
  * Constructor
  *
  * @param   object  &$subject  Event observer
  * @param   array   $config    Optional config values
  * @return  void
  */
 public function __construct(&$subject, $config)
 {
     parent::__construct($subject, $config);
     // load plugin parameters
     $this->_config = Component::params('com_projects');
     $this->_database = App::get('db');
 }
 /**
  * Constructor
  *
  * @param      object &$subject Event observer
  * @param      array  $config   Optional config values
  * @return     void
  */
 public function __construct(&$subject, $config)
 {
     parent::__construct($subject, $config);
     include_once PATH_CORE . DS . 'components' . DS . 'com_publications' . DS . 'tables' . DS . 'category.php';
     include_once PATH_CORE . DS . 'components' . DS . 'com_publications' . DS . 'tables' . DS . 'publication.php';
     include_once PATH_CORE . DS . 'components' . DS . 'com_publications' . DS . 'tables' . DS . 'author.php';
 }
Exemple #3
0
 /**
  * Constructor
  *
  * @param      object &$subject Event observer
  * @param      array  $config   Optional config values
  * @return     void
  */
 public function __construct(&$subject, $config)
 {
     parent::__construct($subject, $config);
     $this->infolink = '/kb/points/';
     $this->banking = Component::params('com_members')->get('bankAccounts');
     include_once __DIR__ . DS . 'helper.php';
 }
Exemple #4
0
 /**
  * Constructor.
  *
  * @param   object  &$subject  The object to observe
  * @param   array   $config    An array that holds the plugin configuration
  *
  * @since 1.5
  */
 public function __construct(&$subject, $config)
 {
     parent::__construct($subject, $config);
     // Log the deprecated API.
     if ($this->params->get('log-deprecated')) {
         \JLog::addLogger(array('text_file' => 'deprecated.php'), \JLog::ALL, array('deprecated'));
     }
     // Log database errors
     if ($this->params->get('log-database-errors')) {
         \JLog::addLogger(array('text_file' => 'jdatabase.error.php'), \JLog::ALL, array('database'));
     }
     // Log database queries
     if ($this->params->get('log-database-queries')) {
         \JLog::addLogger(array('text_file' => 'jdatabase.query.php'), \JLog::ALL, array('databasequery'));
         // Register the HUBzero database logger as well
         // Don't worry, this won't log things twice...queries through joomla's database driver
         // will get logged above, and this will catch queries through hubzero's database driver
         \Event::listen(function ($event) {
             \Hubzero\Database\Log::add($event->getArgument('query'), $event->getArgument('time'));
         }, 'database_query');
     }
     // Only if debugging or language debug is enabled
     if (Config::get('debug') || Config::get('debug_lang')) {
         Config::set('gzip', 0);
         ob_start();
         ob_implicit_flush(false);
     }
     $this->linkFormat = ini_get('xdebug.file_link_format');
 }
 public function __construct(&$subject, $config)
 {
     parent::__construct($subject, $config);
     // Ensure that constructor is called one time
     self::$cookie = SID == '';
     if (!self::$default_lang) {
         $app = JFactory::getApplication();
         $router = $app->getRouter();
         if (App::isSite()) {
             // setup language data
             self::$mode_sef = $router->getMode() == JROUTER_MODE_SEF ? true : false;
             self::$sefs = JLanguageHelper::getLanguages('sef');
             self::$lang_codes = JLanguageHelper::getLanguages('lang_code');
             self::$default_lang = Component::params('com_languages')->get('site', 'en-GB');
             self::$default_sef = self::$lang_codes[self::$default_lang]->sef;
             self::$homes = MultilangstatusHelper::getHomepages();
             $user = User::getRoot();
             $levels = $user->getAuthorisedViewLevels();
             foreach (self::$sefs as $sef => &$language) {
                 if (isset($language->access) && $language->access && !in_array($language->access, $levels)) {
                     unset(self::$sefs[$sef]);
                 }
             }
             App::forget('language.filter');
             App::set('language.filter', true);
             $uri = JFactory::getURI();
             if (self::$mode_sef) {
                 // Get the route path from the request.
                 $path = JString::substr($uri->toString(), JString::strlen($uri->base()));
                 // Apache mod_rewrite is Off
                 $path = Config::get('sef_rewrite') ? $path : JString::substr($path, 10);
                 // Trim any spaces or slashes from the ends of the path and explode into segments.
                 $path = JString::trim($path, '/ ');
                 $parts = explode('/', $path);
                 // The language segment is always at the beginning of the route path if it exists.
                 $sef = $uri->getVar('lang');
                 if (!empty($parts) && empty($sef)) {
                     $sef = reset($parts);
                 }
             } else {
                 $sef = $uri->getVar('lang');
             }
             if (isset(self::$sefs[$sef])) {
                 $lang_code = self::$sefs[$sef]->lang_code;
                 // Create a cookie
                 $cookie_domain = Config::get('cookie_domain', '');
                 $cookie_path = Config::get('cookie_path', '/');
                 setcookie(App::hash('language'), $lang_code, $this->getLangCookieTime(), $cookie_path, $cookie_domain);
                 // set the request var
                 Request::setVar('language', $lang_code);
             }
         }
         parent::__construct($subject, $config);
         // 	Detect browser feature
         if (App::isSite()) {
             $app->setDetectBrowser($this->params->get('detect_browser', '1') == '1');
         }
     }
 }
Exemple #6
0
 /**
  * Object Constructor.
  *
  * @param	object	The object to observe -- event dispatcher.
  * @param	object	The configuration object for the plugin.
  * @return	void
  * @since	1.0
  */
 public function __construct(&$subject, $config)
 {
     parent::__construct($subject, $config);
     if (App::isSite()) {
         // Set the error handler for E_ERROR to be the class handleError method.
         set_exception_handler(array('plgSystemRedirect', 'handleError'));
     }
 }
Exemple #7
0
 /**
  * Constructor
  *
  * @param      object &$subject Event observer
  * @param      array  $config   Optional config values
  * @return     void
  */
 public function plgSupportCaptcha(&$subject, $config)
 {
     parent::__construct($subject, $config);
     $this->loadLanguage();
     if (!User::isGuest()) {
         if (User::get('activation') == 1 || User::get('activation') == 3) {
             $this->_verified = true;
         }
     }
 }
Exemple #8
0
 /**
  * Constructor
  *
  * @param      object &$subject Event observer
  * @param      array  $config   Optional config values
  * @return     void
  */
 public function __construct(&$subject, $config)
 {
     parent::__construct($subject, $config);
     $this->_database = App::get('db');
     require_once PATH_CORE . DS . 'components' . DS . 'com_publications' . DS . 'tables' . DS . 'logs.php';
     require_once PATH_CORE . DS . 'components' . DS . 'com_publications' . DS . 'tables' . DS . 'publication.php';
     require_once PATH_CORE . DS . 'components' . DS . 'com_publications' . DS . 'tables' . DS . 'author.php';
     require_once PATH_CORE . DS . 'components' . DS . 'com_publications' . DS . 'tables' . DS . 'category.php';
     require_once PATH_CORE . DS . 'components' . DS . 'com_publications' . DS . 'helpers' . DS . 'html.php';
 }
Exemple #9
0
 /**
  * Constructor
  *
  * @param      object &$subject Event observer
  * @param      array  $config   Optional config values
  * @return     void
  */
 public function plgSupportCaptcha(&$subject, $config)
 {
     parent::__construct($subject, $config);
     $this->loadLanguage();
     if (!User::isGuest()) {
         $profile = \Hubzero\User\Profile::getInstance(User::get('id'));
         if ($profile->get('emailConfirmed') == 1 || $profile->get('emailConfirmed') == 3) {
             $this->_verified = true;
         }
     }
 }
 /**
  * Overloading Parent Constructor
  *
  * @param	array	$config		Optional configurations to be used
  * @return  void
  */
 public function __construct($subject, $config)
 {
     // get all public methods ending in 'action'
     $reflectionClass = new ReflectionClass($this);
     foreach ($reflectionClass->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {
         $name = $method->getName();
         if (substr(strtolower($name), -6) == 'action') {
             $this->_actionMap[] = $name;
         }
     }
     // call parent constructor
     parent::__construct($subject, $config);
 }
Exemple #11
0
 /**
  * Object Constructor.
  *
  * @param   object  $subject  The object to observe -- event dispatcher.
  * @param   object  $config   The configuration object for the plugin.
  * @return  void
  */
 public function __construct(&$subject, $config)
 {
     parent::__construct($subject, $config);
     $this->loadLanguage();
     $hash = App::hash('plgSystemLogout');
     if (App::isSite() and Request::getString($hash, null, 'cookie')) {
         // Destroy the cookie
         $cookie_domain = Config::get('config.cookie_domain', '');
         $cookie_path = Config::get('config.cookie_path', '/');
         setcookie($hash, false, time() - 86400, $cookie_path, $cookie_domain);
         // Set the error handler for E_ALL to be the class handleError method.
         set_exception_handler(array('plgSystemLogout', 'handleError'));
     }
 }
Exemple #12
0
 /**
  * Constructor
  *
  * @param   object  &$subject  Event observer
  * @param   array   $config    Optional config values
  * @return  void
  */
 public function __construct(&$subject, $config)
 {
     parent::__construct($subject, $config);
     Lang::load('com_jobs');
     $path = Component::path('com_jobs');
     include_once $path . DS . 'tables' . DS . 'admin.php';
     include_once $path . DS . 'tables' . DS . 'application.php';
     include_once $path . DS . 'tables' . DS . 'category.php';
     include_once $path . DS . 'tables' . DS . 'employer.php';
     include_once $path . DS . 'tables' . DS . 'job.php';
     include_once $path . DS . 'tables' . DS . 'prefs.php';
     include_once $path . DS . 'tables' . DS . 'resume.php';
     include_once $path . DS . 'tables' . DS . 'seeker.php';
     include_once $path . DS . 'tables' . DS . 'shortlist.php';
     include_once $path . DS . 'tables' . DS . 'stats.php';
     include_once $path . DS . 'tables' . DS . 'type.php';
     $this->config = Component::params('com_jobs');
 }
 /**
  * Constructor
  *
  * @param      object &$subject The object to observe
  * @param      array  $config   An optional associative array of configuration settings.
  * @return     void
  */
 public function __construct(&$subject, $config)
 {
     parent::__construct($subject, $config);
     include_once Component::path('com_publications') . DS . 'tables' . DS . 'category.php';
     include_once Component::path('com_publications') . DS . 'tables' . DS . 'publication.php';
 }
 /**
  * Constructor
  *
  * @access      protected
  * @param       object  $subject The object to observe
  * @param       array   $config  An array that holds the plugin configuration
  * @since       1.5
  */
 public function __construct(&$subject, $config)
 {
     parent::__construct($subject, $config);
     $this->loadLanguage();
 }
Exemple #15
0
 /**
  * Constructor
  *
  * @param   object  &$subject  Event observer
  * @param   array   $config    Optional config values
  * @return  void
  */
 public function __construct(&$subject, $config)
 {
     parent::__construct($subject, $config);
     $this->database = App::get('db');
 }
Exemple #16
0
 /**
  * Constructor
  *
  * @param   object  &$subject  Event observer
  * @param   array   $config    Optional config values
  * @return  void
  */
 public function __construct(&$subject, $config)
 {
     parent::__construct($subject, $config);
     $this->_path = PATH_APP . DS . 'cache';
 }
Exemple #17
0
 /**
  * Constructor
  *
  * @param      object &$subject Event observer
  * @param      array  $config   Optional config values
  * @return     void
  */
 public function __construct(&$subject, $config)
 {
     parent::__construct($subject, $config);
     include_once PATH_CORE . DS . 'components' . DS . 'com_resources' . DS . 'tables' . DS . 'type.php';
     include_once PATH_CORE . DS . 'components' . DS . 'com_resources' . DS . 'tables' . DS . 'resource.php';
 }
Exemple #18
0
 /**
  * Constructor
  *
  * @param   object  &$subject  Event observer
  * @param   array   $config    Optional config values
  * @return  void
  */
 public function __construct(&$subject, $config)
 {
     parent::__construct($subject, $config);
     $this->infolink = '/kb/points/';
     $this->banking = Component::params('com_members')->get('bankAccounts');
 }
Exemple #19
0
 /**
  * Constructor
  *
  * @param   object  $subject  The object to observe
  * @param   array   $config   An array that holds the plugin configuration
  * @return  void
  */
 public function __construct(&$subject, $config)
 {
     parent::__construct($subject, $config);
     $this->loadLanguage();
     JFormHelper::addFieldPath(dirname(__FILE__) . '/fields');
 }