/** * Render element * * @param Varien_Data_Form_Element_Abstract $element * @see Varien_Data_Form_Element_Renderer_Interface::render() * @return string */ public function render(Varien_Data_Form_Element_Abstract $element) { $element->addClass('element-value-changer'); $valueName = $element->getValueName(); if ($element instanceof Varien_Data_Form_Element_Select && $valueName == '...') { $optionValues = $element->getValues(); foreach ($optionValues as $option) { if ($option['value'] === '') { $valueName = $option['label']; } } } if ($valueName === '') { $valueName = '...'; } if ($element->getShowAsText()) { $html = ' <input type="hidden" class="hidden" id="' . $element->getHtmlId() . '" name="' . $element->getName() . '" value="' . $element->getValue() . '"/> ' . htmlspecialchars($valueName) . ' '; } else { $html = ' <span class="rule-param"' . ($element->getParamId() ? ' id="' . $element->getParamId() . '"' : '') . '>' . '<a href="javascript:void(0)" class="label">'; $translate = Mage::getSingleton('core/translate_inline'); $html .= $translate->isAllowed() ? Mage::helper('core')->escapeHtml($valueName) : Mage::helper('core')->escapeHtml(Mage::helper('core/string')->truncate($valueName, 33, '...')); $html .= '</a><span class="element"> ' . $element->getElementHtml(); if ($element->getExplicitApply()) { $html .= ' <a href="javascript:void(0)" class="rule-param-apply"><img src="' . $this->getSkinUrl('M2ePro/images/rule_component_apply.gif') . '" class="v-middle" alt="' . Mage::helper('M2ePro')->__('Apply') . '" title="' . Mage::helper('M2ePro')->__('Apply') . '" /></a> '; } $html .= '</span></span> '; } return $html; }
public function render(Varien_Data_Form_Element_Abstract $element) { $element->addClass('element-value-changer'); $valueName = $element->getValueName(); if ($valueName === '') { $valueName = '...'; } $valueLabel = htmlspecialchars(Mage::helper('core/string')->truncate($valueName, 150, '...')); switch ($this->getFormat()) { case 'text': $html = $valueLabel; break; case 'html': $html = '<strong>' . $valueLabel . '</strong>'; break; default: if ($element->getIsMeta()) { $html = '<input type="hidden" class="hidden" id="' . $element->getHtmlId() . '" name="' . $element->getName() . '" value="' . $element->getValue() . '"/>'; $html .= htmlspecialchars($valueName); } else { $html = '<span class="rule-param"' . ($element->getParamId() ? ' id="' . $element->getParamId() . '"' : '') . '>'; $html .= '<a href="javascript:void(0)" class="label">' . $valueLabel . '</a>'; $html .= '<span class="element">'; $html .= $element->getElementHtml(); if ($element->getExplicitApply()) { $html .= '<a href="javascript:void(0)" class="rule-param-apply"><img src="' . $this->getSkinUrl('images/rule_component_apply.gif') . '" class="v-middle" alt="' . $this->__('Apply') . '" title="' . $this->__('Apply') . '" /></a>'; } $html .= '</span></span>'; } } return $html; }
public function render(Varien_Data_Form_Element_Abstract $element) { $html = ' <span class="rule-param rule-param-new-child"' . ($element->getParamId() ? ' id="' . $element->getParamId() . '"' : '') . '>'; $html .= '<a href="javascript:void(0)" class="label">'; $html .= $element->getValueName(); $html .= '</a><span class="element">'; $html .= $element->getElementHtml(); $html .= '</span></span> '; return $html; }
public function render(Varien_Data_Form_Element_Abstract $element) { $element->addClass('element-value-changer'); $valueName = $element->getValueName(); if ($valueName === '') { $valueName = '...'; } if ($element->getShowAsText()) { $html = ' <input type="hidden" class="hidden" id="' . $element->getHtmlId() . '" name="' . $element->getName() . '" value="' . $element->getValue() . '"/> '; $html .= htmlspecialchars($valueName) . ' '; } else { $html = ' <span class="rule-param"' . ($element->getParamId() ? ' id="' . $element->getParamId() . '"' : '') . '>'; $html .= '<a href="javascript:void(0)" class="label">'; $html .= htmlspecialchars(Mage::helper('core/string')->truncate($valueName, 33, '...')); $html .= '</a><span class="element"> '; $html .= $element->getElementHtml(); if ($element->getExplicitApply()) { $html .= ' <a href="javascript:void(0)" class="rule-param-apply"><img src="' . $this->getSkinUrl('images/rule_component_apply.gif') . '" class="v-middle" alt="' . $this->__('Apply') . '" title="' . $this->__('Apply') . '" /></a> '; } $html .= '</span></span> '; } return $html; }
/** * Render element * * @param Varien_Data_Form_Element_Abstract $element * @see Varien_Data_Form_Element_Renderer_Interface::render() * @return string */ public function render(Varien_Data_Form_Element_Abstract $element) { $element->addClass('element-value-changer'); $valueName = $element->getValueName(); if ($valueName === '') { $valueName = '...'; } $coreHelper = Mage::helper('Mage_Core_Helper_Data'); $stringHelper = Mage::helper('Mage_Core_Helper_String'); if ($element->getShowAsText()) { $html = ' <input type="hidden" class="hidden" id="' . $element->getHtmlId() . '" name="' . $element->getName() . '" value="' . $element->getValue() . '"/> ' . htmlspecialchars($valueName) . ' '; } else { $html = ' <span class="rule-param"' . ($element->getParamId() ? ' id="' . $element->getParamId() . '"' : '') . '>' . '<a href="javascript:void(0)" class="label">'; $translate = Mage::getSingleton('Mage_Core_Model_Translate_Inline'); $html .= $translate->isAllowed() ? $coreHelper->escapeHtml($valueName) : $coreHelper->escapeHtml($stringHelper->truncate($valueName, 33, '...')); $html .= '</a><span class="element"> ' . $element->getElementHtml(); if ($element->getExplicitApply()) { $html .= ' <a href="javascript:void(0)" class="rule-param-apply"><img src="' . $this->getViewFileUrl('images/rule_component_apply.gif') . '" class="v-middle" alt="' . $this->__('Apply') . '" title="' . $this->__('Apply') . '" /></a> '; } $html .= '</span></span> '; } return $html; }
public function render(Varien_Data_Form_Element_Abstract $element) { $valueName = $element->getValueName(); if ($valueName == '') { $valueName = '...'; } elseif (strlen($valueName) > 30) { $valueName = substr($valueName, 0, 30) . '...'; } if ($element->getShowAsText()) { $html = ' <input type="hidden" id="' . $element->getHtmlId() . '" name="' . $element->getName() . '" value="' . $element->getValue() . '"/> '; $html .= htmlspecialchars($valueName) . ' '; } else { $html = ' <span class="rule-param" id="' . $element->getParamId() . '">'; $html .= '<a href="javascript:void(0)" class="label">'; $html .= htmlspecialchars($valueName); $html .= '</a><span class="element"> '; $html .= $element->getElementHtml(); if ($element->getExplicitApply()) { $html .= ' <a href="javascript:void(0)" class="rule-param-apply"><img src="' . $this->getSkinUrl('images/rule_component_apply.gif') . '" class="v-middle" title="' . $this->__('Apply') . '"/></a> '; } $html .= '</span></span> '; } return $html; }