/**
  * @param    string    The context of the content being passed to the plugin.
  * @param    object    The article object.  Note $article->text is also available
  * @param    object    The article params
  * @param    int       The 'page' number
  *
  * @return    void
  * @since       1.1.0
  */
 public function onContentAfterDisplay($context, &$row, &$params, $page = 0)
 {
     JPluginHelper::importPlugin('fieldsandfiltersextensions');
     // Trigger the onFinderBeforeSave event.
     $results = $this->app->triggerEvent('onFieldsandfiltersContentAfterDisplay', array($context, &$row, &$params, $page = 0));
     return !empty($results) ? trim(implode("\n", $results)) : null;
 }
예제 #2
0
 /**
  * Prepares the CLI mode.
  * 
  * @param KCommandContext $context
  */
 protected function _actionPrepclienv(KCommandContext $context)
 {
     if (!empty($_SERVER['argv']) && count($_SERVER['argv']) > 1) {
         $args = array_slice($_SERVER['argv'], 1);
         if (is_readable(realpath($args[0]))) {
             $file = array_shift($args);
         }
         $args = explode('&-data&', implode($args, '&'));
         $args = array_filter($args, 'trim');
         foreach ($args as $i => $arg) {
             $arg = trim($arg);
             if ($i == 0) {
                 if (strpos($arg, '/') !== false) {
                     $arg = substr_replace($arg, '?', strpos($arg, '&'), 1);
                     $url = KService::get('koowa:http.url', array('url' => $arg));
                     KRequest::url()->path = KRequest::base() . $url->path;
                     $_GET = $url->query;
                 } else {
                     KRequest::url()->path = KRequest::base();
                     parse_str($arg, $_GET);
                 }
             } else {
                 parse_str($arg, $_POST);
             }
         }
     }
     $_GET['format'] = 'json';
     KRequest::url()->format = 'json';
     KRequest::url()->setQuery($_GET);
     jimport('joomla.plugin.helper');
     JPluginHelper::importPlugin('cli');
     $this->_application->triggerEvent('onCli');
     //if there's a file then just load the file and exit
     if (!empty($file)) {
         KService::get('koowa:loader')->loadFile($file);
         exit(0);
     }
 }