本文整理汇总了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;
}
示例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;
}