/** * If Integrated search is installed, redirect if enabled * * @return $this */ public function preDispatch() { if (Mage::helper('wordpress')->isAddonInstalled('IntegratedSearch') && Mage::getStoreConfigFlag('wordpress/integratedsearch/blog')) { $this->_forceForwardViaException('index', 'result', 'catalogsearch', array('q' => Mage::helper('wordpress/router')->getTrimmedUri('search'))); } return parent::preDispatch(); }
/** * If the feed parameter is set, forward to the comments action * * @return $this */ public function preDispatch() { parent::preDispatch(); if ($this->_initPage()->isBlogPage()) { $this->_forceForwardViaException('index', 'index'); return false; } return $this; }
/** * If a term has been initiated in self_initPostCategory * forward to wordpress/term/view action * * @return $this */ public function preDispatch() { parent::preDispatch(); if (($term = Mage::registry('wordpress_term')) !== null) { $this->_forceForwardViaException('view', 'term'); return false; } return $this; }
/** * Display appropriate message for posted comment * * @return $this */ public function preDispatch() { parent::preDispatch(); $this->_handlePostedComment(); $post = $this->getEntityObject(); if ($post->isBlogListingPage()) { return $this->_forward('index', 'index', 'wordpress'); } return $this; }
/** * Ensure that the term loaded isn't a default term * Default terms (post_category, tag etc) have their own controller * * @return $this|false */ public function preDispatch() { parent::preDispatch(); $term = $this->_initTerm(); if ($term->isDefaultTerm()) { $this->_forceForwardViaException('noRoute'); return false; } return $this; }
/** * Display appropriate message for posted comment * * @return $this */ public function preDispatch() { parent::preDispatch(); $this->_handlePostedComment(); $post = $this->getEntityObject(); if ($post->isType('page') && (int) $post->getId() === (int) Mage::helper('wordpress/router')->getBlogPageId()) { return $this->_forward('index', 'index', 'wordpress'); } return $this; }
/** * If Integrated search is installed, redirect if enabled * * @return $this */ public function preDispatch() { if ($this->getRequest()->getParam('redirect_broken_url')) { $this->getResponse()->setRedirect(Mage::helper('wordpress')->getUrl('search/' . $this->getRequest()->getParam('s') . '/'))->sendResponse(); $this->getRequest()->setDispatched(true); } else { if (Mage::helper('wordpress')->isAddonInstalled('IntegratedSearch') && Mage::getStoreConfigFlag('wordpress/integratedsearch/blog')) { $this->_forceForwardViaException('index', 'result', 'catalogsearch', array('q' => $this->getRequest()->getParam('s'))); } } return parent::preDispatch(); }
/** * If the feed parameter is set, forward to the comments action * * @return $this */ public function preDispatch() { parent::preDispatch(); $page = $this->_initPage(); if (!Mage::getStoreConfigFlag('wordpress_blog/layout/ignore_custom_homepage')) { if ($page->isBlogPage()) { $this->_forceForwardViaException('index', 'index'); return false; } } return $this; }
/** * Ensure that this controller can run * * @return $this */ public function preDispatch() { parent::preDispatch(); if ($this->getRequest()->getActionName() === 'index') { if (!Mage::registry('wordpress_page')) { if (Mage::helper('wordpress')->getWpOption('show_on_front')) { if ($pageId = Mage::helper('wordpress')->getWpOption('page_on_front')) { $page = Mage::getModel('wordpress/page')->load($pageId); if ($page->getId()) { Mage::register('wordpress_page', $page); $this->_forceForwardViaException('view', 'page'); return false; } } } } } return $this; }
/** * Display appropriate message for posted comment * * @return $this */ public function preDispatch() { $this->_handlePostedComment(); return parent::preDispatch(); }
/** * Ensure that the term loaded isn't a default term * Default terms (post_category, tag etc) have their own controller * * @return $this|false */ public function preDispatch() { parent::preDispatch(); $term = $this->_initTerm(); return $this; }