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


PHP Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract::render方法代码示例

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


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

示例1: render

 public function render(Varien_Data_Form_Element_Abstract $element)
 {
     $mappingModel = Mage::getModel('orderstatusimport/processor_mapping_fields');
     $mappingModel->setDataPath($this->DATA_PATH);
     $mappingFields = $mappingModel->getMappingFields();
     // Add the actual mapped fields
     $html = '<script>' . "\n";
     $html .= 'var ' . $this->MAPPING_ID . '_mapping_values = new Hash();' . "\n";
     foreach ($mappingModel->getMapping() as $field => $fieldData) {
         $html .= $this->MAPPING_ID . '_mapping_values[\'' . $fieldData['id'] . '\'] = \'' . $this->_escapeStringJs($field) . '\';' . "\n";
     }
     // Add the default values
     $html .= 'var ' . $this->MAPPING_ID . '_default_values = new Hash();' . "\n";
     foreach ($mappingModel->getMapping() as $field => $fieldData) {
         $html .= $this->MAPPING_ID . '_default_values[\'' . $fieldData['id'] . '\'] = \'' . $this->_escapeStringJs($fieldData['default_value']) . '\';' . "\n";
     }
     // Add the possible default values
     $html .= 'var ' . $this->MAPPING_ID . '_possible_default_values = $H({' . "\n";
     $loopLength = 0;
     foreach ($mappingFields as $field => $fieldData) {
         if (isset($fieldData['default_values']) && is_array($fieldData['default_values'])) {
             $loopLength++;
         }
     }
     $loopCounter = 0;
     foreach ($mappingFields as $field => $fieldData) {
         if (isset($fieldData['default_values']) && is_array($fieldData['default_values'])) {
             $loopCounter++;
             $loopLength2 = count($fieldData['default_values']);
             $loopCounter2 = 0;
             $html .= '\'' . $this->_escapeStringJs($field) . '\': {' . "\n";
             foreach ($fieldData['default_values'] as $code => $label) {
                 $loopCounter2++;
                 $html .= '\'' . $this->_escapeStringJs($code) . '\': \'' . $this->_escapeStringJs($label) . '\'';
                 if ($loopCounter2 !== $loopLength2) {
                     $html .= ',';
                 }
                 $html .= "\n";
             }
             $html .= '}';
             if ($loopCounter !== $loopLength) {
                 $html .= ',';
             }
         }
     }
     $html .= '});';
     $html .= '</script>' . "\n";
     $html .= parent::render($element);
     return $html;
 }
开发者ID:xiaoguizhidao,项目名称:devfashion,代码行数:50,代码来源:Abstract.php

示例2: render

 /**
  * Enter description here...
  *
  * @param Varien_Data_Form_Element_Abstract $element
  * @return string
  */
 public function render(Varien_Data_Form_Element_Abstract $element)
 {
     $hint = (array) $element->getFieldConfig()->hint;
     if (!count($hint)) {
         return parent::render($element);
     }
     // Generate Tooltip
     /** @var $tooltip Payone_Core_Block_Adminhtml_System_Config_Tooltip */
     $tooltip = $this->getLayout()->createBlock('payone_core/adminhtml_system_config_tooltip');
     $tooltip->initFormElement($element);
     $tooltipHtml = $tooltip->toHtml();
     $element->setHint('__tooltip_html__');
     $html = parent::render($element);
     $hintToReplace = '<div class="hint" ><div style="display: none;">__tooltip_html__</div></div>';
     $html = str_replace($hintToReplace, $tooltipHtml, $html);
     return $html;
 }
开发者ID:kirchbergerknorr,项目名称:payone-magento,代码行数:23,代码来源:Abstract.php


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