当前位置: 首页>>代码示例>>PHP>>正文


PHP Mage_Core_Controller_Front_Action::getLayout方法代码示例

本文整理汇总了PHP中Mage_Core_Controller_Front_Action::getLayout方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Controller_Front_Action::getLayout方法的具体用法?PHP Mage_Core_Controller_Front_Action::getLayout怎么用?PHP Mage_Core_Controller_Front_Action::getLayout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mage_Core_Controller_Front_Action的用法示例。


在下文中一共展示了Mage_Core_Controller_Front_Action::getLayout方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: renderPage

 /**
  * Renders CMS page
  *
  * Call from controller action
  *
  * @param Mage_Core_Controller_Front_Action $action
  * @param integer $pageId
  * @return boolean
  */
 public function renderPage(Mage_Core_Controller_Front_Action $action, $identifier = null)
 {
     $page = Mage::getModel('blog/post');
     if (!is_null($identifier) && $identifier !== $page->getId()) {
         $page->setStoreId(Mage::app()->getStore()->getId());
         if (!$page->load($identifier)) {
             return false;
         }
     }
     if (!$page->getId()) {
         return false;
     }
     if ($page->getStatus() == 2) {
         return false;
     }
     $page_title = Mage::getSingleton('blog/post')->load($identifier)->getTitle();
     $blog_title = Mage::getStoreConfig('blog/blog/title') . " - ";
     $action->loadLayout();
     if ($storage = Mage::getSingleton('customer/session')) {
         $action->getLayout()->getMessagesBlock()->addMessages($storage->getMessages(true));
     }
     $action->getLayout()->getBlock('head')->setTitle($blog_title . $page_title);
     $action->getLayout()->getBlock('root')->setTemplate(Mage::getStoreConfig('blog/blog/layout'));
     $action->renderLayout();
     return true;
 }
开发者ID:praxigento,项目名称:mage_app_prxgt_store,代码行数:35,代码来源:Post.php

示例2: renderPage

 public function renderPage(Mage_Core_Controller_Front_Action $action, $identifier = null, $data)
 {
     $page = Mage::getSingleton('blog/blog');
     if (!is_null($identifier) && $identifier !== $page->getId()) {
         $page->setStoreId(Mage::app()->getStore()->getId());
         if (!$page->load($identifier)) {
             return false;
         }
     }
     if (!$page->getId()) {
         return false;
     }
     if ($page->getStatus() == 2) {
         return false;
     }
     $page_title = Mage::getSingleton('blog/blog')->load($identifier)->getTitle();
     $blog_title = Mage::getStoreConfig('blog/blog/title') . " - ";
     $action->loadLayout();
     if ($storage = Mage::getSingleton('customer/session')) {
         $action->getLayout()->getMessagesBlock()->addMessages($storage->getMessages(true));
     }
     /*
      if (Mage::getStoreConfig('blog/rss/enable'))
      {
      Mage::helper('blog')->addRss($action->getLayout()->getBlock('head'), Mage::getUrl(Mage::getStoreConfig('blog/blog/route')) . "rss");
      }
     */
     $action->getLayout()->getBlock('head')->setTitle($blog_title . $page_title);
     $action->getLayout()->getBlock('root')->setTemplate(Mage::getStoreConfig('blog/blog/layout'));
     $action->getLayout()->getBlock('post')->setCommentDetails($data['user'], $data['email'], $data['comment']);
     $action->renderLayout();
     return true;
 }
开发者ID:praxigento,项目名称:mage_app_prxgt_store,代码行数:33,代码来源:Comment.php

示例3: initProductLayout

 /**
  * Inits layout for viewing product page
  *
  * @param Mage_Catalog_Model_Product $product
  * @param Mage_Core_Controller_Front_Action $controller
  *
  * @return Mage_Catalog_Helper_Product_View
  */
 public function initProductLayout($product, $controller)
 {
     $design = Mage::getSingleton('catalog/design');
     $settings = $design->getDesignSettings($product);
     if ($settings->getCustomDesign()) {
         $design->applyCustomDesign($settings->getCustomDesign());
     }
     $update = $controller->getLayout()->getUpdate();
     $update->addHandle('default');
     $controller->addActionLayoutHandles();
     $update->addHandle('PRODUCT_TYPE_' . $product->getTypeId());
     $update->addHandle('PRODUCT_' . $product->getId());
     if ($product->getAttributeSetId() == '9') {
         $categoryId = (int) Mage::app()->getStore()->getRootCategoryId();
         $category = Mage::getModel('catalog/category')->setStoreId(Mage::app()->getStore()->getId())->load($categoryId);
         $layer = Mage::getSingleton('catalog/layer');
         $productCollection = $layer->getProductCollection();
         Mage::getModel('amfinder/finder')->getCompatibleCollection($product, $productCollection);
         if (Mage::registry('current_category')) {
             Mage::unregister('current_category');
         }
         Mage::register('current_category', $category);
         Mage::getSingleton('catalog/session')->setLastVisitedCategoryId($category->getId());
         Mage::register('finder_product', true);
         $update->removeHandle('catalog_product_view');
         $update->addHandle('amfinder_index_index');
     }
     $controller->loadLayoutUpdates();
     // Apply custom layout update once layout is loaded
     $layoutUpdates = $settings->getLayoutUpdates();
     if ($layoutUpdates) {
         if (is_array($layoutUpdates)) {
             foreach ($layoutUpdates as $layoutUpdate) {
                 $update->addUpdate($layoutUpdate);
             }
         }
     }
     $controller->generateLayoutXml()->generateLayoutBlocks();
     // Apply custom layout (page) template once the blocks are generated
     if ($settings->getPageLayout()) {
         $controller->getLayout()->helper('page/layout')->applyTemplate($settings->getPageLayout());
     }
     $currentCategory = Mage::registry('current_category');
     $root = $controller->getLayout()->getBlock('root');
     if ($root) {
         $controllerClass = $controller->getFullActionName();
         if ($controllerClass != 'catalog-product-view') {
             $root->addBodyClass('catalog-product-view');
         }
         $root->addBodyClass('product-' . $product->getUrlKey());
         if ($currentCategory instanceof Mage_Catalog_Model_Category) {
             $root->addBodyClass('categorypath-' . $currentCategory->getUrlPath())->addBodyClass('category-' . $currentCategory->getUrlKey());
         }
     }
     return $this;
 }
开发者ID:xiaoguizhidao,项目名称:mydigibits,代码行数:64,代码来源:View.php

示例4: renderPage

 /**
  * Renders CMS page
  * Call from controller action
  *
  * @param Mage_Core_Controller_Front_Action $action
  * @param integer                           $identifier
  *
  * @return bool
  */
 public function renderPage(Mage_Core_Controller_Front_Action $action, $identifier = null)
 {
     if (!($catId = Mage::getSingleton('blog/cat')->load($identifier)->getCatId())) {
         return false;
     }
     $pageTitle = Mage::getSingleton('blog/cat')->load($identifier)->getTitle();
     $blogTitle = Mage::getStoreConfig('blog/blog/title') . " - " . $pageTitle;
     $action->loadLayout();
     if ($storage = Mage::getSingleton('customer/session')) {
         $action->getLayout()->getMessagesBlock()->addMessages($storage->getMessages(true));
     }
     $action->getLayout()->getBlock('head')->setTitle($blogTitle);
     $action->getLayout()->getBlock('root')->setTemplate(Mage::getStoreConfig('blog/blog/layout'));
     $action->renderLayout();
     return true;
 }
开发者ID:velozmontero,项目名称:tango-mango-page,代码行数:25,代码来源:Cat.php

示例5: initProductLayout

 /**
  * Inits layout for viewing product page
  *
  * @param Mage_Catalog_Model_Product $product
  * @param Mage_Core_Controller_Front_Action $controller
  *
  * @return Mage_Catalog_Helper_Product_View
  */
 public function initProductLayout($product, $controller)
 {
     $design = Mage::getSingleton('catalog/design');
     $settings = $design->getDesignSettings($product);
     if ($settings->getCustomDesign()) {
         $design->applyCustomDesign($settings->getCustomDesign());
     }
     $update = $controller->getLayout()->getUpdate();
     $update->addHandle('default');
     $controller->addActionLayoutHandles();
     /* START OF CODE FOR CUSTOMIZATION OF PREMIUM PACKAGING */
     /*
     $premium = false;
     
     $catIds = $product->getCategoryIds();
     
     $premium	=	Mage::getModel('packaging/packaging')->bool_isPremiumPackaging($catIds, true);
     
     if($premium) {
     	$update->addHandle('PRODUCT_TYPE_PREMIUM');
     	$update->addHandle('PRODUCT_' . $product->getId());
     } else {
     */
     $update->addHandle('PRODUCT_TYPE_' . $product->getTypeId());
     $update->addHandle('PRODUCT_' . $product->getId());
     /*
     }
     */
     /* END OF CODE FOR CUSTOMIZATION OF PREMIUM PACKAGING */
     $controller->loadLayoutUpdates();
     // Apply custom layout update once layout is loaded
     $layoutUpdates = $settings->getLayoutUpdates();
     if ($layoutUpdates) {
         if (is_array($layoutUpdates)) {
             foreach ($layoutUpdates as $layoutUpdate) {
                 $update->addUpdate($layoutUpdate);
             }
         }
     }
     $controller->generateLayoutXml()->generateLayoutBlocks();
     // Apply custom layout (page) template once the blocks are generated
     if ($settings->getPageLayout()) {
         $controller->getLayout()->helper('page/layout')->applyTemplate($settings->getPageLayout());
     }
     $currentCategory = Mage::registry('current_category');
     $root = $controller->getLayout()->getBlock('root');
     if ($root) {
         $controllerClass = $controller->getFullActionName();
         if ($controllerClass != 'catalog-product-view') {
             $root->addBodyClass('catalog-product-view');
         }
         $root->addBodyClass('product-' . $product->getUrlKey());
         if ($currentCategory instanceof Mage_Catalog_Model_Category) {
             $root->addBodyClass('categorypath-' . $currentCategory->getUrlPath())->addBodyClass('category-' . $currentCategory->getUrlKey());
         }
     }
     return $this;
 }
开发者ID:sagmahajan,项目名称:aswan_release,代码行数:66,代码来源:View.php

示例6: initProductLayout

 /**
  * Inits layout for viewing product page
  *
  * @param Mage_Catalog_Model_Product $product
  * @param Mage_Core_Controller_Front_Action $controller
  *
  * @return Mage_Catalog_Helper_Product_View
  */
 public function initProductLayout($product, $controller)
 {
     $design = Mage::getSingleton('catalog/design');
     $settings = $design->getDesignSettings($product);
     if ($settings->getCustomDesign()) {
         $design->applyCustomDesign($settings->getCustomDesign());
     }
     $update = $controller->getLayout()->getUpdate();
     $update->addHandle('default');
     $controller->addActionLayoutHandles();
     $update->addHandle('PRODUCT_TYPE_' . $product->getTypeId());
     $update->addHandle('PRODUCT_' . $product->getId());
     $controller->loadLayoutUpdates();
     // Apply custom layout update once layout is loaded
     $layoutUpdates = $settings->getLayoutUpdates();
     if ($layoutUpdates) {
         if (is_array($layoutUpdates)) {
             foreach ($layoutUpdates as $layoutUpdate) {
                 $update->addUpdate($layoutUpdate);
             }
         }
     }
     $controller->generateLayoutXml()->generateLayoutBlocks();
     // Apply custom layout (page) template once the blocks are generated
     if ($settings->getPageLayout()) {
         $controller->getLayout()->helper('page/layout')->applyTemplate($settings->getPageLayout());
     } else {
         if (Mage::getStoreConfig('mpanel/general/enabled') && Mage::getStoreConfig('mpanel/catalog/product_layout') != '') {
             $controller->getLayout()->helper('page/layout')->applyTemplate(Mage::getStoreConfig('mpanel/catalog/product_layout'));
         }
     }
     $currentCategory = Mage::registry('current_category');
     $root = $controller->getLayout()->getBlock('root');
     if ($root) {
         $controllerClass = $controller->getFullActionName();
         if ($controllerClass != 'catalog-product-view') {
             $root->addBodyClass('catalog-product-view');
         }
         $root->addBodyClass('product-' . $product->getUrlKey());
         if ($currentCategory instanceof Mage_Catalog_Model_Category) {
             $root->addBodyClass('categorypath-' . $currentCategory->getUrlPath())->addBodyClass('category-' . $currentCategory->getUrlKey());
         }
     }
     return $this;
 }
开发者ID:ramantalkin,项目名称:tmp01skin,代码行数:53,代码来源:View.php

示例7: renderPage

 /**
  * Renders page
  *
  * Call from controller action
  *
  * @param Mage_Core_Controller_Front_Action $action
  * @param integer $pageId
  * @return boolean
  */
 public function renderPage(Mage_Core_Controller_Front_Action $action, $id = null)
 {
     $model = Mage::getSingleton('manufacturer/manufacturer');
     if (!is_null($id) && $id !== $model->getId()) {
         if (!$model->load($id)) {
             return false;
         }
     }
     if (!$model->getId() or $model->getStatus() != 1) {
         return false;
     }
     //print_r($page->getData());exit;
     /*if ($page->getCustomTheme()) {
           $apply = true;
           $today = Mage::app()->getLocale()->date()->toValue();
           if (($from = $page->getCustomThemeFrom()) && strtotime($from)>$today) {
               $apply = false;
           }
           if ($apply && ($to = $page->getCustomThemeTo()) && strtotime($to)<$today) {
               $apply = false;
           }
           if ($apply) {
               list($package, $theme) = explode('/', $page->getCustomTheme());
               Mage::getSingleton('core/design_package')
                   ->setPackageName($package)
                   ->setTheme($theme);
           }
       }*/
     $action->loadLayout(array('default', 'manufacturer_view'), false, false);
     $action->getLayout()->getUpdate()->addUpdate($model->getLayoutUpdateXml());
     $action->generateLayoutXml()->generateLayoutBlocks();
     if ($storage = Mage::getSingleton('catalog/session')) {
         $action->getLayout()->getMessagesBlock()->addMessages($storage->getMessages(true));
     }
     if ($storage = Mage::getSingleton('checkout/session')) {
         $action->getLayout()->getMessagesBlock()->addMessages($storage->getMessages(true));
     }
     $action->renderLayout();
     return true;
 }
开发者ID:SuperAssassinNinja,项目名称:romances,代码行数:49,代码来源:Manufacturer.php

示例8: renderPage

 /**
  * Renders CMS page
  *
  * Call from controller action
  *
  * @param Mage_Core_Controller_Front_Action $action
  * @param integer $pageId
  * @return boolean
  */
 public function renderPage(Mage_Core_Controller_Front_Action $action, $identifier = null)
 {
     if (!($cat_id = Mage::getSingleton('blog/cat')->load($identifier)->getcatId())) {
         return false;
     }
     $page_title = Mage::getSingleton('blog/cat')->load($identifier)->getTitle();
     $blog_title = Mage::getStoreConfig('blog/blog/title') . " - ";
     $action->loadLayout();
     if ($storage = Mage::getSingleton('customer/session')) {
         $action->getLayout()->getMessagesBlock()->addMessages($storage->getMessages(true));
     }
     $action->getLayout()->getBlock('head')->setTitle($page_title);
     /*
      if (Mage::getStoreConfig('blog/rss/enable'))
      {
      Mage::helper('blog')->addRss($action->getLayout()->getBlock('head'), Mage::getUrl(Mage::getStoreConfig('blog/blog/route') . "/cat/" .$identifier) . "rss");
      }
     */
     $action->getLayout()->getBlock('root')->setTemplate(Mage::getStoreConfig('blog/blog/layout'));
     $action->renderLayout();
     return true;
 }
开发者ID:Aerotexextintores,项目名称:novosite,代码行数:31,代码来源:Cat.php

示例9: renderPage

 /**
  * Renders CMS page
  *
  * Call from controller action
  *
  * @param Mage_Core_Controller_Front_Action $action
  * @param integer $pageId
  * @return boolean
  */
 public function renderPage(Mage_Core_Controller_Front_Action $action, $pageId = null)
 {
     $page = AO::getSingleton('cms/page');
     if (!is_null($pageId) && $pageId !== $page->getId()) {
         $page->setStoreId(AO::app()->getStore()->getId());
         if (!$page->load($pageId)) {
             return false;
         }
     }
     if (!$page->getId()) {
         return false;
     }
     if ($page->getCustomTheme()) {
         $apply = true;
         $today = AO::app()->getLocale()->date()->toValue();
         if (($from = $page->getCustomThemeFrom()) && strtotime($from) > $today) {
             $apply = false;
         }
         if ($apply && ($to = $page->getCustomThemeTo()) && strtotime($to) < $today) {
             $apply = false;
         }
         if ($apply) {
             list($package, $theme) = explode('/', $page->getCustomTheme());
             AO::getSingleton('core/design_package')->setPackageName($package)->setTheme($theme);
         }
     }
     $action->loadLayout(array('default', 'cms_page'), false, false);
     $action->getLayout()->getUpdate()->addUpdate($page->getLayoutUpdateXml());
     $action->generateLayoutXml()->generateLayoutBlocks();
     if ($storage = AO::getSingleton('catalog/session')) {
         $action->getLayout()->getMessagesBlock()->addMessages($storage->getMessages(true));
     }
     if ($storage = AO::getSingleton('checkout/session')) {
         $action->getLayout()->getMessagesBlock()->addMessages($storage->getMessages(true));
     }
     $action->renderLayout();
     return true;
 }
开发者ID:ronseigel,项目名称:agent-ohm,代码行数:47,代码来源:Page.php

示例10: renderPage

 /**
  * Renders CMS page
  *
  * Call from controller action
  *
  * @param Mage_Core_Controller_Front_Action $action
  * @param integer $pageId
  * @return boolean
  */
 public function renderPage(Mage_Core_Controller_Front_Action $action, $identifier = null)
 {
     if (!($cat_id = Mage::getSingleton("blog/cat")->load($identifier)->getCatId())) {
         return false;
     }
     $action->loadLayout();
     $layout = $action->getLayout();
     if ($storage = Mage::getSingleton("customer/session")) {
         $layout->getMessagesBlock()->addMessages($storage->getMessages(true));
     }
     $blogTitle = Mage::getStoreConfig("fontis_blog/blog/title");
     $pageTitle = Mage::getSingleton("blog/cat")->load($identifier)->getTitle();
     if ($head = $layout->getBlock("head")) {
         $head->setTitle($blogTitle . " - " . $pageTitle);
         if (Mage::getStoreConfig("fontis_blog/rss/enabled")) {
             $head->addItem("rss", Mage::getUrl(Mage::helper("blog")->getBlogRoute() . "/cat/" . $identifier) . "rss");
         }
     }
     $layout->getBlock("root")->setTemplate(Mage::getStoreConfig("fontis_blog/blog/layout"));
     $action->renderLayout();
     return true;
 }
开发者ID:ikommerce,项目名称:fontis_blog,代码行数:31,代码来源:Cat.php

示例11: initProductLayout

 /**
  * Inits layout for viewing product page
  *
  * @param Mage_Catalog_Model_Product $product
  * @param Mage_Core_Controller_Front_Action $controller
  *
  * @return Mage_Catalog_Helper_Product_View
  */
 public function initProductLayout($product, $controller)
 {
     $design = Mage::getSingleton('Mage_Catalog_Model_Design');
     $settings = $design->getDesignSettings($product);
     if ($settings->getCustomDesign()) {
         $design->applyCustomDesign($settings->getCustomDesign());
     }
     $update = $controller->getLayout()->getUpdate();
     $controller->addPageLayoutHandles(array('id' => $product->getId(), 'sku' => $product->getSku(), 'type' => $product->getTypeId()));
     $controller->loadLayoutUpdates();
     // Apply custom layout update once layout is loaded
     $layoutUpdates = $settings->getLayoutUpdates();
     if ($layoutUpdates) {
         if (is_array($layoutUpdates)) {
             foreach ($layoutUpdates as $layoutUpdate) {
                 $update->addUpdate($layoutUpdate);
             }
         }
     }
     $controller->generateLayoutXml()->generateLayoutBlocks();
     // Apply custom layout (page) template once the blocks are generated
     if ($settings->getPageLayout()) {
         $controller->getLayout()->helper('Mage_Page_Helper_Layout')->applyTemplate($settings->getPageLayout());
     }
     $currentCategory = Mage::registry('current_category');
     $root = $controller->getLayout()->getBlock('root');
     if ($root) {
         $controllerClass = $controller->getFullActionName();
         if ($controllerClass != 'catalog-product-view') {
             $root->addBodyClass('catalog-product-view');
         }
         $root->addBodyClass('product-' . $product->getUrlKey());
         if ($currentCategory instanceof Mage_Catalog_Model_Category) {
             $root->addBodyClass('categorypath-' . $currentCategory->getUrlPath())->addBodyClass('category-' . $currentCategory->getUrlKey());
         }
     }
     return $this;
 }
开发者ID:nemphys,项目名称:magento2,代码行数:46,代码来源:View.php

示例12: renderPage

 /**
  * Renders CMS page
  *
  * Call from controller action
  *
  * @param Mage_Core_Controller_Front_Action $action
  * @param integer $pageId
  * @return boolean
  */
 public function renderPage(Mage_Core_Controller_Front_Action $action, $pageId = null)
 {
     $page = Mage::getSingleton('cms/page');
     if (!is_null($pageId) && $pageId !== $page->getId()) {
         $page->setStoreId(Mage::app()->getStore()->getId());
         if (!$page->load($pageId)) {
             return false;
         }
     }
     if (!$page->getId()) {
         return false;
     }
     //        $customerSession = Mage::getSingleton('customer/session');
     //        if (!$customerSession->authenticate($action)) {
     //            $customerSession->setBeforeAuthUrl(Mage::getBaseUrl().$page->getIdentifier());
     //            return true;
     //        }
     if ($page->getCustomTheme()) {
         $apply = true;
         $today = strtotime('today');
         if (($from = $page->getCustomThemeFrom()) && strtotime($from) > $today) {
             $apply = false;
         }
         if ($apply && ($to = $page->getCustomThemeTo()) && strtotime($to) < $today) {
             $apply = false;
         }
         if ($apply) {
             list($package, $theme) = explode('/', $page->getCustomTheme());
             Mage::getSingleton('core/design_package')->setPackageName($package)->setTheme($theme);
         }
     }
     $action->loadLayout(array('default', 'cms_page'), false, false);
     $action->getLayout()->getUpdate()->addUpdate($page->getLayoutUpdateXml());
     $action->generateLayoutXml()->generateLayoutBlocks();
     $action->renderLayout();
     return true;
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:46,代码来源:Page.php

示例13: renderPage

 /**
  * Renders CMS page
  *
  * Call from controller action
  *
  * @param Mage_Core_Controller_Front_Action $action
  * @param integer $pageId
  * @return boolean
  */
 public function renderPage(Mage_Core_Controller_Front_Action $action, $pageId = null)
 {
     $page = Mage::getSingleton('cms/page');
     if (!is_null($pageId) && $pageId !== $page->getId()) {
         $page->setStoreId(Mage::app()->getStore()->getId());
         if (!$page->load($pageId)) {
             return false;
         }
     }
     if (!$page->getId()) {
         return false;
     }
     if ($page->getCustomTheme()) {
         if (Mage::app()->getLocale()->IsStoreDateInInterval(null, $page->getCustomThemeFrom(), $page->getCustomThemeTo())) {
             list($package, $theme) = explode('/', $page->getCustomTheme());
             Mage::getSingleton('core/design_package')->setPackageName($package)->setTheme($theme);
         }
     }
     $action->getLayout()->getUpdate()->addHandle('default')->addHandle('cms_page');
     $action->addActionLayoutHandles();
     if ($page->getRootTemplate()) {
         $action->getLayout()->helper('page/layout')->applyHandle($page->getRootTemplate());
     }
     $action->loadLayoutUpdates();
     $action->getLayout()->getUpdate()->addUpdate($page->getLayoutUpdateXml());
     $action->generateLayoutXml()->generateLayoutBlocks();
     if ($page->getRootTemplate()) {
         $action->getLayout()->helper('page/layout')->applyTemplate($page->getRootTemplate());
     }
     if ($storage = Mage::getSingleton('catalog/session')) {
         $action->getLayout()->getMessagesBlock()->addMessages($storage->getMessages(true));
     }
     if ($storage = Mage::getSingleton('checkout/session')) {
         $action->getLayout()->getMessagesBlock()->addMessages($storage->getMessages(true));
     }
     $action->renderLayout();
     return true;
 }
开发者ID:jauderho,项目名称:magento-mirror,代码行数:47,代码来源:Page.php

示例14: getBreadcrumbs

 /**
  * Get Breadcrumbs for current controller action
  *
  * @param  Mage_Core_Controller_Front_Action $controller
  */
 public function getBreadcrumbs($controller)
 {
     $breadcrumbs = $controller->getLayout()->getBlock('breadcrumbs');
     $breadcrumbs->addCrumb('home', array('label' => Mage::helper('cms')->__('Home'), 'title' => Mage::helper('cms')->__('Go to Home Page'), 'link' => Mage::getBaseUrl()));
     $breadcrumbs->addCrumb('cms_page', array('label' => Mage::helper('sales')->__('Order Information'), 'title' => Mage::helper('sales')->__('Order Information')));
 }
开发者ID:NBSW,项目名称:mageplus,代码行数:11,代码来源:Guest.php

示例15: renderAllAttributesPage

 /**
  * Renders the attribute info page
  * Call from controller action
  *
  * @param Mage_Core_Controller_Front_Action $action
  */
 public function renderAllAttributesPage(Mage_Core_Controller_Front_Action $action)
 {
     $action->getLayout()->getUpdate()->addHandle('default')->addHandle('dc_catalog_attributeinfo_all');
     $action->addActionLayoutHandles();
     $action->loadLayoutUpdates();
     //$action->getLayout()->getUpdate()->addUpdate($attributeInfo->getLayoutUpdateXml());
     $action->generateLayoutXml()->generateLayoutBlocks();
     /*if (($attributeInfo->getRootTemplate()) && ('empty' != $attributeInfo->getRootTemplate())) {
           $action->getLayout()->helper('page/layout')
               ->applyTemplate($attributeInfo->getRootTemplate());
       }*/
     // show breadcrumbs
     if (Mage::getStoreConfig('web/default/show_cms_breadcrumbs') && ($breadcrumbs = $action->getLayout()->getBlock('breadcrumbs'))) {
         $breadcrumbs->addCrumb('home', array('label' => Mage::helper('dc_catalog')->__('Home'), 'title' => Mage::helper('dc_catalog')->__('Go to Home Page'), 'link' => Mage::getBaseUrl()));
         $attributeCode = Mage::registry('attribute_code');
         $attribute = Mage::getSingleton('eav/config')->getAttribute('catalog_product', $attributeCode);
         if (is_array($labels = $attribute->getStoreLabels()) && isset($labels[Mage::app()->getStore()->getId()])) {
             $label = $labels[Mage::app()->getStore()->getId()];
         } else {
             $label = $attribute->getFrontendLabel();
         }
         $breadcrumbs->addCrumb('allvalues', array('label' => Mage::helper('dc_catalog')->__($label . 's')));
     }
     if ($storage = Mage::getSingleton('catalog/session')) {
         $action->getLayout()->getMessagesBlock()->addMessages($storage->getMessages(true));
     }
     if ($storage = Mage::getSingleton('checkout/session')) {
         $action->getLayout()->getMessagesBlock()->addMessages($storage->getMessages(true));
     }
     $action->renderLayout();
     return true;
 }
开发者ID:arzzzen,项目名称:DC_Catalog,代码行数:38,代码来源:AttributeInfo.php


注:本文中的Mage_Core_Controller_Front_Action::getLayout方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。