コード例 #1
0
 /**
  * Create renderer used for displaying the country select element
  *
  * @return Mage_Core_Block_Html_Select
  */
 protected function _getTemplateRenderer()
 {
     if (!$this->_templateRenderer) {
         $this->_templateRenderer = $this->getLayout()->createBlock('dhlonlineretoure/adminhtml_form_field_country_select', '', array('is_render_to_js_template' => true));
         /* @var $sourceModel Mage_Adminhtml_Model_System_Config_Source_Country */
         $sourceModel = Mage::getModel('adminhtml/system_config_source_country');
         $this->_templateRenderer->setOptions($sourceModel->toOptionArray());
     }
     return $this->_templateRenderer;
 }
コード例 #2
0
 /**
  * Render block HTML
  *
  * @return string
  */
 public function _toHtml()
 {
     $this->addOption('product_view', 'Product View');
     $this->addOption('product_list', 'Product List');
     $this->addOption('category_view', 'Category View');
     return parent::_toHtml();
 }
コード例 #3
0
ファイル: Chargetype.php プロジェクト: GaynorH/prestigedrinks
 /**
  * Render block HTML
  *
  * @return string
  */
 public function _toHtml()
 {
     if (!$this->getOptions()) {
         $this->addOption('fixed', $this->__('Fixed Amount'));
         $this->addOption('percentage', $this->__('Percent'));
     }
     return parent::_toHtml();
 }
コード例 #4
0
 public function _toHtml()
 {
     if (!$this->getOptions()) {
         foreach ($this->_getAttributes() as $id => $label) {
             $this->addOption($id, $label);
         }
     }
     return Mage_Core_Block_Html_Select::_toHtml();
 }
コード例 #5
0
 /**
  * Render block HTML
  *
  * @return string
  */
 public function _toHtml()
 {
     if (!$this->getOptions()) {
         foreach ($this->_getCarrierCodes() as $code => $label) {
             $this->addOption($code, addslashes($label));
         }
     }
     return parent::_toHtml();
 }
コード例 #6
0
ファイル: CmsPage.php プロジェクト: all-bear/magento.cg-cms
 public function _toHtml()
 {
     $options = Mage::getSingleton('adminhtml/system_config_source_cms_page')->toOptionArray();
     $this->addOption('', $this->_helper->__('--Use Default CMS Page--'));
     foreach ($options as $option) {
         $this->addOption($option['value'], $option['label']);
     }
     return parent::_toHtml();
 }
コード例 #7
0
 public function _toHtml()
 {
     if (!$this->getOptions()) {
         foreach ($this->_getOptions() as $groupId => $groupLabel) {
             $this->addOption($groupId, addslashes($groupLabel));
         }
     }
     return parent::_toHtml();
 }
コード例 #8
0
 /**
  * Render block HTML
  *
  * @return string
  */
 public function _toHtml()
 {
     if (!$this->getOptions()) {
         foreach ($this->_getAttributes() as $id => $label) {
             $htmlLabel = htmlspecialchars($label, ENT_QUOTES);
             $this->addOption($id, $htmlLabel);
         }
     }
     return parent::_toHtml();
 }
コード例 #9
0
 public function _toHtml()
 {
     if (!$this->getOptions() && $this->_getSourceModelName()) {
         $options = Mage::getModel($this->_getSourceModelName())->toOptionArray();
         foreach ($options as $option) {
             $this->addOption($option['value'], $option['label']);
         }
     }
     return parent::_toHtml();
 }
コード例 #10
0
 /**
  * Render block HTML
  *
  * @return string
  */
 public function _toHtml()
 {
     if (!$this->getOptions()) {
         foreach ($this->_getCountries() as $country) {
             if (isset($country['value']) && $country['value'] && isset($country['label']) && $country['label']) {
                 $this->addOption($country['value'], $country['label']);
             }
         }
     }
     return parent::_toHtml();
 }
コード例 #11
0
 /**
  * Render block HTML
  *
  * @return string
  */
 public function _toHtml()
 {
     if (!$this->getOptions()) {
         if ($this->_addGroupAllOption) {
             $this->addOption(Mage_Customer_Model_Group::CUST_GROUP_ALL, Mage::helper('customer')->__('ALL GROUPS'));
         }
         foreach ($this->_getCustomerGroups() as $groupId => $groupLabel) {
             $this->addOption($groupId, addslashes($groupLabel));
         }
     }
     return parent::_toHtml();
 }
コード例 #12
0
 /**
  * Render block HTML
  *
  * @return string
  */
 public function _toHtml()
 {
     if (!$this->getOptions()) {
         foreach ($this->_getCcTypes() as $country) {
             if (isset($country['value']) && $country['value'] && isset($country['label']) && $country['label']) {
                 $this->addOption($country['value'], $country['label']);
             }
         }
     }
     $this->setExtraParams('multiple="multiple" style="height:80px;"');
     return parent::_toHtml();
 }
コード例 #13
0
ファイル: Creditcard.php プロジェクト: GaynorH/prestigedrinks
 /**
  * Render block HTML
  *
  * @return string
  */
 public function _toHtml()
 {
     if (!$this->getOptions()) {
         if ($this->_addCcAllOption) {
             $this->addOption('ALL', $this->__('ALL Credit Cards'));
         }
         foreach ($this->_getCreditCards() as $code => $label) {
             $this->addOption($code, $label);
         }
     }
     return parent::_toHtml();
 }
コード例 #14
0
 /**
  * Render block HTML
  * @return string
  */
 public function _toHtml()
 {
     $this->_grids = array('products' => 'Mage_Adminhtml_Block_Catalog_Product_Grid');
     $productAttributes = array(array('label' => Mage::helper('adminhtml')->__('Category'), 'value' => $this->_getGridAndColumnValue('products', 'category')), array('label' => Mage::helper('adminhtml')->__('Short Description'), 'value' => $this->_getGridAndColumnValue('products', 'short_description')), array('label' => Mage::helper('adminhtml')->__('Weight'), 'value' => $this->_getGridAndColumnValue('products', 'weight')), array('label' => Mage::helper('adminhtml')->__('Special Price'), 'value' => $this->_getGridAndColumnValue('products', 'special_price')), array('label' => Mage::helper('adminhtml')->__('Tax Class Id'), 'value' => $this->_getGridAndColumnValue('products', 'tax_class_id')));
     $systemProductAttributes = array('name', 'sku', 'status', 'visibility', 'category_ids', 'required_options', 'has_options', 'media_gallery', 'gallery', 'options_container');
     $attributes = Mage::getModel('catalog/product')->getAttributes();
     foreach ($attributes as $attribute) {
         if ($attribute->getAttributeId() && !in_array($attribute->getAttributeCode(), $systemProductAttributes)) {
             $productAttributes[] = array('label' => ucwords(str_replace('_', ' ', $attribute->getAttributeCode())), 'value' => $this->_getGridAndColumnValue('products', $attribute->getAttributeCode()));
         }
     }
     usort($productAttributes, function ($a, $b) {
         return strcmp($a['label'], $b['label']);
     });
     $this->setOptions(array(array('label' => Mage::helper('adminhtml')->__('Products'), 'value' => $productAttributes)));
     return parent::_toHtml();
 }
コード例 #15
0
ファイル: Layout.php プロジェクト: nemphys/magento2
 /**
  * Add necessary options
  *
  * @return Mage_Core_Block_Abstract
  */
 protected function _beforeToHtml()
 {
     if (!$this->getOptions()) {
         $this->addOption('', Mage::helper('Mage_Widget_Helper_Data')->__('-- Please Select --'));
         $layoutUpdateParams = array('area' => $this->getArea(), 'package' => $this->getPackage(), 'theme' => $this->getTheme());
         $pageTypes = array();
         $pageTypesAll = $this->_getLayoutUpdate($layoutUpdateParams)->getPageHandlesHierarchy();
         foreach ($pageTypesAll as $pageTypeName => $pageTypeInfo) {
             $layoutUpdate = $this->_getLayoutUpdate($layoutUpdateParams);
             $layoutUpdate->addPageHandles(array($pageTypeName));
             $layoutUpdate->load();
             if (!$layoutUpdate->getContainers()) {
                 continue;
             }
             $pageTypes[$pageTypeName] = $pageTypeInfo;
         }
         $this->_addPageTypeOptions($pageTypes);
     }
     return parent::_beforeToHtml();
 }
コード例 #16
0
ファイル: Container.php プロジェクト: nemphys/magento2
 /**
  * Add necessary options
  *
  * @return Mage_Core_Block_Abstract
  */
 protected function _beforeToHtml()
 {
     if (!$this->getOptions()) {
         $layoutUpdateParams = array('area' => $this->getArea(), 'package' => $this->getPackage(), 'theme' => $this->getTheme());
         /** @var $layoutUpdate Mage_Core_Model_Layout_Update */
         $layoutUpdate = Mage::getModel('Mage_Core_Model_Layout_Update', $layoutUpdateParams);
         $layoutUpdate->addPageHandles(array($this->getLayoutHandle()));
         $layoutUpdate->load();
         $containers = $layoutUpdate->getContainers();
         if ($this->getAllowedContainers()) {
             foreach (array_keys($containers) as $containerName) {
                 if (!in_array($containerName, $this->getAllowedContainers())) {
                     unset($containers[$containerName]);
                 }
             }
         }
         asort($containers, SORT_STRING);
         $this->addOption('', Mage::helper('Mage_Widget_Helper_Data')->__('-- Please Select --'));
         foreach ($containers as $containerName => $containerLabel) {
             $this->addOption($containerName, $containerLabel);
         }
     }
     return parent::_beforeToHtml();
 }
コード例 #17
0
ファイル: Type.php プロジェクト: finelinePG/finelink-dev
 /**
  * Add options to this select box.
  */
 protected function _construct()
 {
     parent::_construct();
     $this->setOptions(Mage::getModel('mageparts_base/system_config_source_urltable_type')->toOptionArray());
 }
コード例 #18
0
ファイル: Select.php プロジェクト: natxetee/magento2
 /**
  * @param Mage_Core_Controller_Request_Http $request
  * @param Mage_Core_Model_Layout $layout
  * @param Mage_Core_Model_Event_Manager $eventManager
  * @param Mage_Backend_Model_Url $urlBuilder
  * @param Mage_Core_Model_Translate $translator
  * @param Mage_Core_Model_Cache $cache
  * @param Mage_Core_Model_Design_Package $designPackage
  * @param Mage_Core_Model_Session $session
  * @param Mage_Core_Model_Store_Config $storeConfig
  * @param Mage_Core_Controller_Varien_Front $frontController
  * @param Mage_Core_Model_Factory_Helper $helperFactory
  * @param array $data
  *
  * @SuppressWarnings(PHPMD.ExcessiveParameterList)
  */
 public function __construct(Mage_Core_Controller_Request_Http $request, Mage_Core_Model_Layout $layout, Mage_Core_Model_Event_Manager $eventManager, Mage_Backend_Model_Url $urlBuilder, Mage_Core_Model_Translate $translator, Mage_Core_Model_Cache $cache, Mage_Core_Model_Design_Package $designPackage, Mage_Core_Model_Session $session, Mage_Core_Model_Store_Config $storeConfig, Mage_Core_Controller_Varien_Front $frontController, Mage_Core_Model_Factory_Helper $helperFactory, array $data = array())
 {
     parent::__construct($request, $layout, $eventManager, $urlBuilder, $translator, $cache, $designPackage, $session, $storeConfig, $frontController, $helperFactory, $data);
 }
コード例 #19
0
ファイル: Rule.php プロジェクト: TusharKDonda/maruti
 /**
  * Render block HTML
  *
  * @return string
  */
 public function _toHtml()
 {
     //Mage::log($this->getData('column'));
     return parent::_toHtml();
 }
コード例 #20
0
 public function _toHtml()
 {
     return trim(preg_replace('/\\s+/', ' ', parent::_toHtml()));
 }
コード例 #21
0
ファイル: Selectmaior.php プロジェクト: adrianomelo5/magento
 protected function _toHtml()
 {
     $this->addOption('gteq', $this->__('Maior ou igual que'));
     $this->addOption('gt', $this->__('Maior que'));
     return parent::_toHtml();
 }
コード例 #22
0
 /**
  * Add options to this select box.
  */
 protected function _construct()
 {
     parent::_construct();
     $this->setOptions(Mage::getModel('ddq/system_config_source_columntype')->toOptionArray());
 }
コード例 #23
0
ファイル: Filter.php プロジェクト: hirentricore/devmagento
 /**
  * Select field filter HTML with selected value.
  *
  * @param Mage_Eav_Model_Entity_Attribute $attribute
  * @param mixed $value
  * @return string
  */
 protected function _getSelectHtmlWithValue(Mage_Eav_Model_Entity_Attribute $attribute, $value)
 {
     if ($attribute->getFilterOptions()) {
         $options = array();
         foreach ($attribute->getFilterOptions() as $value => $label) {
             $options[] = array('value' => $value, 'label' => $label);
         }
     } else {
         $options = $attribute->getSource()->getAllOptions(false);
     }
     if ($size = count($options)) {
         // add empty vaue option
         $firstOption = reset($options);
         if ('' === $firstOption['value']) {
             $options[key($options)]['label'] = '';
         } else {
             array_unshift($options, array('value' => '', 'label' => ''));
         }
         $selectBlock = new Mage_Core_Block_Html_Select(array('name' => $this->getFilterElementName($attribute->getAttributeCode()), 'id' => $this->getFilterElementId($attribute->getAttributeCode()), 'class' => 'select', 'extra_params' => 'style="width:280px"'));
         return $selectBlock->setOptions($options)->setValue($value)->getHtml();
     } else {
         return $this->_helper->__('Attribute does not has options, so filtering is impossible');
     }
 }
コード例 #24
0
 /**
  * Calculate CRC32 hash for option value
  *
  * @param string $attributeValue -> Value of main option; $objectValue ->
  * @return string
  */
 public function calcOptionHashWithObject($attributeValue, $objectValue)
 {
     if (empty($objectValue)) {
         return parent::calcOptionHash($attributeValue);
     } else {
         return sprintf('%u', crc32($this->getName() . $this->getId() . $attributeValue . $objectValue));
     }
 }