Example #1
0
 public function preDisplay()
 {
     $option = MRequest::getCmd('option');
     if ($option != 'com_' . $this->context) {
         return;
     }
     global $post;
     if ($this->_hasShortcode($post->post_content, $this->context . '_item')) {
         define('MIWI_IS_ITEM', true);
         return;
     }
     preg_match_all('/' . get_shortcode_regex() . '/s', $post->post_content, $matches, PREG_SET_ORDER);
     if (!empty($matches)) {
         foreach ($matches as $shortcode) {
             if ($this->context !== $shortcode[2]) {
                 continue;
             }
             $args = shortcode_parse_atts($shortcode[3]);
             break;
         }
         $view = MRequest::getCmd('view');
         if (!empty($args) and empty($view)) {
             MRequest::set($args, 'GET', false);
         }
     }
     $this->app->route();
     $this->app->dispatch();
 }
Example #2
0
 public function route($component = null)
 {
     if ($this->get('routed') == true) {
         return;
     }
     $vars = $this->parse($component);
     MRequest::set($vars, 'get', MFactory::getApplication()->isSite() ? true : false);
     // Trigger the onAfterRoute event.
     MPluginHelper::importPlugin('system');
     $this->triggerEvent('onAfterRoute');
     $this->set('routed', true);
 }