Beispiel #1
0
 /**
  * @see JPlugin::__construct()
  */
 public function __construct(&$subject, $config = array())
 {
     parent::__construct($subject, $config);
     if (is_null(self::$_params)) {
         self::$_params = JComponentHelper::getParams('com_logman');
     }
     $this->inject($this->_dependencies);
 }
Beispiel #2
0
    /**
     * Overridden for checking if Nooku Framework is loaded.
     *
     * @see JEvent::update()
     */
    public function update(&$args)
    {
        $return = null;

        // Fire event iff activity logging is enabled.
        if ($this->_enabled) {
            $return = parent::update($args);
        }

        return $return;
    }
Beispiel #3
0
 /**
  * Context based activity data getter.
  *
  * @see ComLogmanPluginInterface::getActivity()
  *
  * @param array Associative array containing context and event data.
  *
  * @return array|null The activity data, null if invalid/excluded context is given.
  */
 public final function getActivity($config)
 {
     $config = new KConfig($config);
     $context = $config->context;
     $parts = explode('.', $context);
     if (count($parts) == 2 && in_array($context, $this->_contexts)) {
         list($type, $package) = explode('_', $parts[0]);
         $method = '_get' . ucfirst($package) . ucfirst($parts[1]) . 'Subject';
         if (!method_exists($this, $method)) {
             $method = '_getDefaultSubject';
         }
         $subject = call_user_func(array($this, $method), $config->data);
         // Insert component and resource info.
         $subject['component'] = str_replace('com_', '', $parts[0]);
         $subject['resource'] = $parts[1];
         $config->subject = $subject;
         $activity = parent::getActivity($config);
     } else {
         $activity = null;
     }
     return $activity;
 }