本文整理汇总了PHP中Mage_Core_Controller_Front_Action::getFullActionName方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Controller_Front_Action::getFullActionName方法的具体用法?PHP Mage_Core_Controller_Front_Action::getFullActionName怎么用?PHP Mage_Core_Controller_Front_Action::getFullActionName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Controller_Front_Action
的用法示例。
在下文中一共展示了Mage_Core_Controller_Front_Action::getFullActionName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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('AJC_PRODUCT_TYPE_' . $product->getTypeId());
$update->addHandle('PRODUCT_' . $product->getId());
$controller->loadLayoutUpdates();
$update->addUpdate($product->getCustomLayoutUpdate());
$update->merge(strtolower($controller->getFullActionName()) . '_FINAL');
// 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;
}
示例2: 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;
}
示例3: _trackControllerAction
/**
* Method to track the controller-action
*
* @access public
* @param Mage_Core_Controller_Front_Action $action
* @return $this
*/
protected function _trackControllerAction($action)
{
if (!$this->_getHelper()->isTrackController()) {
return $this;
}
$actionName = $action->getFullActionName('/');
if (function_exists('newrelic_name_transaction')) {
newrelic_name_transaction($actionName);
}
return $this;
}
示例4: 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;
}