Пример #1
0
 /**
  * @magentoAppIsolation enabled
  * @magentoDataFixture Mage/Cms/_files/pages.php
  */
 public function testRenderPage()
 {
     $page = Mage::getSingleton('Mage_Cms_Model_Page');
     $page->load('page_design_modern', 'identifier');
     // fixture
     $helper = new Mage_Cms_Helper_Page();
     $result = $helper->renderPage(new Mage_Core_Controller_Front_Action(new Magento_Test_Request(), new Magento_Test_Response()), $page->getId());
     $this->assertEquals('default/modern/default', Mage::getDesign()->getDesignTheme());
     $this->assertTrue($result);
 }
Пример #2
0
 public function renderPage(Mage_Core_Controller_Front_Action $action, $pageId = null)
 {
     $storeId = Mage::app()->getStore()->getId();
     $customerGroupId = Mage::getSingleton('customer/session')->getCustomerGroupId();
     if (!$this->isAllowed($storeId, $customerGroupId, $pageId)) {
         return false;
     }
     return parent::renderPage($action, $pageId);
 }
Пример #3
0
 public function renderPage(Mage_Core_Controller_Front_Action $action, $pageId = null)
 {
     $storeId = Mage::app()->getStore()->getId();
     $customerGroupId = Mage::getSingleton('customer/session')->getCustomerGroupId();
     if (!$this->isAllowed($storeId, $customerGroupId, $pageId)) {
         $redirectPageId = Mage::getStoreConfig('bubble_cmstree/general/cms_not_allowed_page');
         if ($redirectPageId && $redirectPageId != $pageId && !Mage::registry('cms_page_not_allowed_redirect')) {
             Mage::register('cms_page_not_allowed_redirect', true);
             // avoid infinite loop
             return $this->renderPage($action, $redirectPageId);
         }
         return false;
     }
     return parent::renderPage($action, $pageId);
 }