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


PHP Mage::helper方法代码示例

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


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

示例1: __construct

 /**
  * Block constructor
  */
 public function __construct()
 {
     $this->_controller = 'sitemap';
     $this->_headerText = Mage::helper('sitemap')->__('Google Sitemap');
     $this->_addButtonLabel = Mage::helper('sitemap')->__('Add Sitemap');
     parent::__construct();
 }
开发者ID:QiuLihua83,项目名称:magento-enterprise-1.13.1.0,代码行数:10,代码来源:Sitemap.php

示例2: serialize

 /**
  * (non-PHPdoc)
  * @see lib/Faett/Channel/Serializer/Interfaces/Faett_Channel_Serializer_Interfaces_Serializer#serialize()
  */
 public function serialize()
 {
     try {
         // initialize a new DOM document
         $doc = new DOMDocument('1.0', 'UTF-8');
         // create new namespaced root element
         $a = $doc->createElementNS($this->_namespace, 'a');
         // add the schema to the root element
         $a->setAttributeNS('http://www.w3.org/2001/XMLSchema-instance', 'xsi:schemaLocation', 'http://pear.php.net/dtd/rest.allcategories http://pear.php.net/dtd/rest.allcategories.xsd');
         // create an element for the channel's name
         $ch = $doc->createElement('ch');
         $ch->nodeValue = Mage::helper('channel')->getChannelName();
         // append the element with the channel's name to the root element
         $a->appendChild($ch);
         // load the product's attributes
         $attributes = $this->_category->getSelectOptions();
         // iterate over the channel's categories
         foreach ($attributes as $attribute) {
             $c = $doc->createElement('c');
             $c->setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', '/channel/index/c/' . $attribute . '/info.xml');
             $c->nodeValue = $attribute;
             // append the XLink to the root element
             $a->appendChild($c);
         }
         // append the root element to the DOM tree
         $doc->appendChild($a);
         // return the XML document
         return $doc->saveXML();
     } catch (Exception $e) {
         return $e->getMessage();
     }
 }
开发者ID:BGCX067,项目名称:faett-channel-svn-to-git,代码行数:36,代码来源:Categories.php

示例3: _prepareToRender

 /**
  * Prepare to render
  */
 protected function _prepareToRender()
 {
     $this->addColumn('customer_group_id', array('label' => Mage::helper('Mage_Customer_Helper_Data')->__('Customer Group'), 'renderer' => $this->_getGroupRenderer()));
     $this->addColumn('min_sale_qty', array('label' => Mage::helper('Mage_CatalogInventory_Helper_Data')->__('Minimum Qty'), 'style' => 'width:100px'));
     $this->_addAfter = false;
     $this->_addButtonLabel = Mage::helper('Mage_CatalogInventory_Helper_Data')->__('Add Minimum Qty');
 }
开发者ID:relue,项目名称:magento2,代码行数:10,代码来源:Minsaleqty.php

示例4: toGridOptionArray

 /**
  * Options getter
  *
  * @return array
  */
 public function toGridOptionArray()
 {
     return array(
         self::IMAGE => Mage::helper('adminhtml')->__('Image'),
         self::PRODUCT => Mage::helper('adminhtml')->__('Product')
     );
 }
开发者ID:amal-nibaya,项目名称:PB-BEERSHOP,代码行数:12,代码来源:Type.php

示例5: changeColumnPosition

 /**
  * Change columns position
  *
  * @param string $table
  * @param string $column
  * @param boolean $after
  * @param boolean $first
  * @return Enterprise_SalesArchive_Model_Resource_Helper_Mysql4
  */
 public function changeColumnPosition($table, $column, $after = false, $first = false)
 {
     if ($after && $first) {
         if (is_string($after)) {
             $first = false;
         } else {
             $after = false;
         }
     } elseif (!$after && !$first) {
         // If no new position specified
         return $this;
     }
     if (!$this->_getWriteAdapter()->isTableExists($table)) {
         Mage::throwException(Mage::helper('enterprise_salesarchive')->__('Table not found'));
     }
     $columns = array();
     $adapter = $this->_getWriteAdapter();
     $description = $adapter->describeTable($table);
     foreach ($description as $columnDescription) {
         $columns[$columnDescription['COLUMN_NAME']] = $adapter->getColumnDefinitionFromDescribe($columnDescription);
     }
     if (!isset($columns[$column])) {
         Mage::throwException(Mage::helper('enterprise_salesarchive')->__('Column not found'));
     } elseif ($after && !isset($columns[$after])) {
         Mage::throwException(Mage::helper('enterprise_salesarchive')->__('Positioning column not found'));
     }
     if ($after) {
         $sql = sprintf('ALTER TABLE %s MODIFY COLUMN %s %s AFTER %s', $adapter->quoteIdentifier($table), $adapter->quoteIdentifier($column), $columns[$column], $adapter->quoteIdentifier($after));
     } else {
         $sql = sprintf('ALTER TABLE %s MODIFY COLUMN %s %s FIRST', $adapter->quoteIdentifier($table), $adapter->quoteIdentifier($column), $columns[$column]);
     }
     $adapter->query($sql);
     return $this;
 }
开发者ID:sagmahajan,项目名称:aswan_release,代码行数:43,代码来源:Mysql4.php

示例6: _prepareColumns

 protected function _prepareColumns()
 {
     $this->addColumn('period', array('header' => Mage::helper('sales')->__('Period'), 'index' => 'period', 'width' => 100, 'sortable' => false, 'period_type' => $this->getPeriodType(), 'renderer' => 'adminhtml/report_sales_grid_column_renderer_date', 'totals_label' => Mage::helper('sales')->__('Total'), 'html_decorators' => array('nobr')));
     $this->addColumn('orders_count', array('header' => Mage::helper('sales')->__('Orders'), 'index' => 'orders_count', 'type' => 'number', 'total' => 'sum', 'sortable' => false));
     $this->addColumn('total_qty_ordered', array('header' => Mage::helper('sales')->__('Sales Items'), 'index' => 'total_qty_ordered', 'type' => 'number', 'total' => 'sum', 'sortable' => false));
     $this->addColumn('total_qty_invoiced', array('header' => Mage::helper('sales')->__('Items'), 'index' => 'total_qty_invoiced', 'type' => 'number', 'total' => 'sum', 'sortable' => false, 'visibility_filter' => array('show_actual_columns')));
     if ($this->getFilterData()->getStoreIds()) {
         $this->setStoreIds(explode(',', $this->getFilterData()->getStoreIds()));
     }
     $currencyCode = $this->getCurrentCurrencyCode();
     $rate = $this->getRate($currencyCode);
     $this->addColumn('total_income_amount', array('header' => Mage::helper('sales')->__('Sales Total'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_income_amount', 'total' => 'sum', 'sortable' => false, 'rate' => $rate));
     $this->addColumn('total_revenue_amount', array('header' => Mage::helper('sales')->__('Revenue'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_revenue_amount', 'total' => 'sum', 'sortable' => false, 'visibility_filter' => array('show_actual_columns'), 'rate' => $rate));
     $this->addColumn('total_profit_amount', array('header' => Mage::helper('sales')->__('Profit'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_profit_amount', 'total' => 'sum', 'sortable' => false, 'visibility_filter' => array('show_actual_columns'), 'rate' => $rate));
     $this->addColumn('total_invoiced_amount', array('header' => Mage::helper('sales')->__('Invoiced'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_invoiced_amount', 'total' => 'sum', 'sortable' => false, 'rate' => $rate));
     $this->addColumn('total_paid_amount', array('header' => Mage::helper('sales')->__('Paid'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_paid_amount', 'total' => 'sum', 'sortable' => false, 'visibility_filter' => array('show_actual_columns'), 'rate' => $rate));
     $this->addColumn('total_refunded_amount', array('header' => Mage::helper('sales')->__('Refunded'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_refunded_amount', 'total' => 'sum', 'sortable' => false, 'rate' => $rate));
     $this->addColumn('total_tax_amount', array('header' => Mage::helper('sales')->__('Sales Tax'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_tax_amount', 'total' => 'sum', 'sortable' => false, 'rate' => $rate));
     $this->addColumn('total_tax_amount_actual', array('header' => Mage::helper('sales')->__('Tax'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_tax_amount_actual', 'total' => 'sum', 'sortable' => false, 'visibility_filter' => array('show_actual_columns'), 'rate' => $rate));
     $this->addColumn('total_shipping_amount', array('header' => Mage::helper('sales')->__('Sales Shipping'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_shipping_amount', 'total' => 'sum', 'sortable' => false, 'rate' => $rate));
     $this->addColumn('total_shipping_amount_actual', array('header' => Mage::helper('sales')->__('Shipping'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_shipping_amount_actual', 'total' => 'sum', 'sortable' => false, 'visibility_filter' => array('show_actual_columns'), 'rate' => $rate));
     $this->addColumn('total_discount_amount', array('header' => Mage::helper('sales')->__('Sales Discount'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_discount_amount', 'total' => 'sum', 'sortable' => false, 'rate' => $rate));
     $this->addColumn('total_discount_amount_actual', array('header' => Mage::helper('sales')->__('Discount'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_discount_amount_actual', 'total' => 'sum', 'sortable' => false, 'visibility_filter' => array('show_actual_columns'), 'rate' => $rate));
     $this->addColumn('total_canceled_amount', array('header' => Mage::helper('sales')->__('Canceled'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_canceled_amount', 'total' => 'sum', 'sortable' => false, 'rate' => $rate));
     $this->addExportType('*/*/exportSalesCsv', Mage::helper('adminhtml')->__('CSV'));
     $this->addExportType('*/*/exportSalesExcel', Mage::helper('adminhtml')->__('Excel XML'));
     return parent::_prepareColumns();
 }
开发者ID:xiaoguizhidao,项目名称:blingjewelry-prod,代码行数:28,代码来源:Grid.php

示例7: getAllOptions

 /**
  * Retrieve all options array
  *
  * @return array
  */
 public function getAllOptions()
 {
     if (is_null($this->_options)) {
         $this->_options = array(array('label' => Mage::helper('eav')->__('Selecteaza'), 'value' => '', 'selected' => 'selected'), array('label' => Mage::helper('eav')->__('Incluse in pret'), 'value' => 'incluse'), array('label' => Mage::helper('eav')->__('Decontate de client'), 'value' => 'decontate'));
     }
     return $this->_options;
 }
开发者ID:picode-eu,项目名称:nti_mage,代码行数:12,代码来源:Cheltuieli.php

示例8: _beforeToHtml

 protected function _beforeToHtml()
 {
     $this->moduleName = Mage::helper('M2ePro/Module')->getName();
     $this->moduleVersion = Mage::helper('M2ePro/Module')->getVersion();
     $this->moduleRevision = Mage::helper('M2ePro/Module')->getRevision();
     return parent::_beforeToHtml();
 }
开发者ID:newedge-media,项目名称:iwantmymeds,代码行数:7,代码来源:Module.php

示例9: getarchiveOptions

 function getarchiveOptions($order = 'DESC', $limit = '', $show_post_count = false, $showMonths = true)
 {
     $order = strtoupper($order);
     $collection = Mage::getModel('gallery/gallery')->getCollection()->addFieldToFilter('status', 3)->setOrder('created_time', $order);
     $collection->getSelect()->reset(Zend_Db_Select::COLUMNS)->columns('heading');
     if ($showMonths) {
         $collection->getSelect()->group(array('YEAR(created_time)', 'MONTH(created_time)'));
     } else {
         $collection->getSelect()->group(array('YEAR(created_time)'));
     }
     if ('' != $limit) {
         $collection->limit($limit);
     }
     //$collection->printLogQuery(true);die;
     $output = '';
     $route = Mage::helper('gallery')->getRoute('archive');
     foreach ($collection as $item) {
         $tm = mktime(0, 0, 0, $item->month, 1, $item->year);
         if ($showMonths) {
             $url = $route . "/y/" . $item->year . "/m/" . $item->month;
             $text = date('F Y', $tm);
         } else {
             $url = $route . "/y/" . $item->year;
             $text = date('Y', $tm);
         }
         $after = "";
         if ($show_post_count) {
             $after = ' (' . $item->posts . ')';
         }
         $output .= "<div class='nav_link'><a href='" . $url . "'>" . $text . " " . $after . "</a></div>";
     }
     return $output;
 }
开发者ID:sagmahajan,项目名称:aswan_release,代码行数:33,代码来源:Archive.php

示例10: __construct

 /**
  * Modify header & button labels
  *
  */
 public function __construct()
 {
     $this->_controller = 'customer_group';
     $this->_headerText = Mage::helper('customer')->__('Customer Groups');
     $this->_addButtonLabel = Mage::helper('customer')->__('Add New Customer Group');
     parent::__construct();
 }
开发者ID:hazaeluz,项目名称:magento_connect,代码行数:11,代码来源:Group.php

示例11: toOptionArray

 /**
  * Get product input types as option array
  *
  * @return array
  */
 public function toOptionArray()
 {
     $inputTypes = array(array('value' => 'price', 'label' => Mage::helper('catalog')->__('Price')), array('value' => 'media_image', 'label' => Mage::helper('catalog')->__('Media Image')));
     $response = new Varien_Object();
     $response->setTypes(array());
     Mage::dispatchEvent('adminhtml_product_attribute_types', array('response' => $response));
     $_disabledTypes = array();
     $_hiddenFields = array();
     foreach ($response->getTypes() as $type) {
         $inputTypes[] = $type;
         if (isset($type['hide_fields'])) {
             $_hiddenFields[$type['value']] = $type['hide_fields'];
         }
         if (isset($type['disabled_types'])) {
             $_disabledTypes[$type['value']] = $type['disabled_types'];
         }
     }
     if (Mage::registry('attribute_type_hidden_fields') === null) {
         Mage::register('attribute_type_hidden_fields', $_hiddenFields);
     }
     if (Mage::registry('attribute_type_disabled_types') === null) {
         Mage::register('attribute_type_disabled_types', $_disabledTypes);
     }
     return array_merge(parent::toOptionArray(), $inputTypes);
 }
开发者ID:cewolf2002,项目名称:magento,代码行数:30,代码来源:Inputtype.php

示例12: __construct

 /**
  * Initialize edit tabs
  *
  */
 public function __construct()
 {
     parent::__construct();
     $this->setId('customer_attribute_tabs');
     $this->setDestElementId('edit_form');
     $this->setTitle(Mage::helper('enterprise_customer')->__('Attribute Information'));
 }
开发者ID:QiuLihua83,项目名称:magento-enterprise-1.13.1.0,代码行数:11,代码来源:Tabs.php

示例13: __construct

 public function __construct()
 {
     $this->_controller = 'report_review_product';
     $this->_headerText = Mage::helper('reports')->__('Products Reviews');
     parent::__construct();
     $this->_removeButton('add');
 }
开发者ID:barneydesmond,项目名称:propitious-octo-tribble,代码行数:7,代码来源:Product.php

示例14: getAllOptions

 /**
  * Retrieve all attribute options
  *
  * @return array
  */
 public function getAllOptions()
 {
     if (!$this->_options) {
         $this->_options = array(array('label' => Mage::helper('giftmessage')->__('Yes'), 'value' => 1), array('label' => Mage::helper('giftmessage')->__('No'), 'value' => 0), array('label' => Mage::helper('giftmessage')->__('Use config'), 'value' => 2));
     }
     return $this->_options;
 }
开发者ID:hirentricore,项目名称:devmagento,代码行数:12,代码来源:Config.php

示例15: getAdditionalActionsButtonHtml

 public function getAdditionalActionsButtonHtml()
 {
     $data = array('target_css_class' => 'additional-actions-button-drop-down', 'items' => array(array('url' => $this->getUrl('*/adminhtml_development_tools_magento/clearMagentoCache'), 'target' => '_blank', 'label' => Mage::helper('M2ePro')->__('Flush Magento Cache'))));
     $dropDownBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_widget_button_dropDown');
     $dropDownBlock->setData($data);
     return $dropDownBlock->toHtml();
 }
开发者ID:ReeceCrossland,项目名称:essua-m2epro,代码行数:7,代码来源:Table.php


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