00001 <?php 00002 /** 00003 * Magento 00004 * 00005 * NOTICE OF LICENSE 00006 * 00007 * This source file is subject to the Open Software License (OSL 3.0) 00008 * that is bundled with this package in the file LICENSE.txt. 00009 * It is also available through the world-wide-web at this URL: 00010 * http://opensource.org/licenses/osl-3.0.php 00011 * If you did not receive a copy of the license and are unable to 00012 * obtain it through the world-wide-web, please send an email 00013 * to license@magentocommerce.com so we can send you a copy immediately. 00014 * 00015 * DISCLAIMER 00016 * 00017 * Do not edit or add to this file if you wish to upgrade Magento to newer 00018 * versions in the future. If you wish to customize Magento for your 00019 * needs please refer to http://www.magentocommerce.com for more information. 00020 * 00021 * @category Mage 00022 * @package Mage_Cms 00023 * @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com) 00024 * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 00025 */ 00026 00027 00028 /** 00029 * Cms index controller 00030 * 00031 * @category Mage 00032 * @package Mage_Cms 00033 * @author Magento Core Team <core@magentocommerce.com> 00034 */ 00035 class Mage_Cms_IndexController extends Mage_Core_Controller_Front_Action 00036 { 00037 /** 00038 * Renders CMS Home page 00039 * 00040 * @param string $coreRoute 00041 */ 00042 public function indexAction($coreRoute = null) 00043 { 00044 $pageId = Mage::getStoreConfig(Mage_Cms_Helper_Page::XML_PATH_HOME_PAGE); 00045 if (!Mage::helper('cms/page')->renderPage($this, $pageId)) { 00046 $this->_forward('defaultIndex'); 00047 } 00048 } 00049 00050 /** 00051 * Default index action (with 404 Not Found headers) 00052 * Used if default page don't configure or available 00053 * 00054 */ 00055 public function defaultIndexAction() 00056 { 00057 $this->getResponse()->setHeader('HTTP/1.1','404 Not Found'); 00058 $this->getResponse()->setHeader('Status','404 File not found'); 00059 00060 $this->loadLayout(); 00061 $this->renderLayout(); 00062 } 00063 00064 /** 00065 * Render CMS 404 Not found page 00066 * 00067 * @param string $coreRoute 00068 */ 00069 public function noRouteAction($coreRoute = null) 00070 { 00071 $this->getResponse()->setHeader('HTTP/1.1','404 Not Found'); 00072 $this->getResponse()->setHeader('Status','404 File not found'); 00073 00074 $pageId = Mage::getStoreConfig(Mage_Cms_Helper_Page::XML_PATH_NO_ROUTE_PAGE); 00075 if (!Mage::helper('cms/page')->renderPage($this, $pageId)) { 00076 $this->_forward('defaultNoRoute'); 00077 } 00078 } 00079 00080 /** 00081 * Default no route page action 00082 * Used if no route page don't configure or available 00083 * 00084 */ 00085 public function defaultNoRouteAction() 00086 { 00087 $this->getResponse()->setHeader('HTTP/1.1','404 Not Found'); 00088 $this->getResponse()->setHeader('Status','404 File not found'); 00089 00090 $this->loadLayout(); 00091 $this->renderLayout(); 00092 } 00093 00094 /** 00095 * Render Disable cookies page 00096 * 00097 */ 00098 public function noCookiesAction() 00099 { 00100 $pageId = Mage::getStoreConfig(Mage_Cms_Helper_Page::XML_PATH_NO_COOKIES_PAGE); 00101 if (!Mage::helper('cms/page')->renderPage($this, $pageId)) { 00102 $this->_forward('defaultNoCookies');; 00103 } 00104 } 00105 00106 /** 00107 * Default no cookies page action 00108 * Used if no cookies page don't configure or available 00109 * 00110 */ 00111 public function defaultNoCookiesAction() 00112 { 00113 $this->loadLayout(); 00114 $this->renderLayout(); 00115 } 00116 }