當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Varien_Data_Form_Element_Abstract::addClass方法代碼示例

本文整理匯總了PHP中Varien_Data_Form_Element_Abstract::addClass方法的典型用法代碼示例。如果您正苦於以下問題:PHP Varien_Data_Form_Element_Abstract::addClass方法的具體用法?PHP Varien_Data_Form_Element_Abstract::addClass怎麽用?PHP Varien_Data_Form_Element_Abstract::addClass使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Varien_Data_Form_Element_Abstract的用法示例。


在下文中一共展示了Varien_Data_Form_Element_Abstract::addClass方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: render

 /**
  * 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) . '&nbsp;';
     } 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>&nbsp;';
     }
     return $html;
 }
開發者ID:ReeceCrossland,項目名稱:essua-m2epro,代碼行數:36,代碼來源:Editable.php

示例2: render

 public function render(Varien_Data_Form_Element_Abstract $element)
 {
     $element->addClass('element-value-changer');
     $valueName = $element->getLabel();
     if ($valueName === '' || $valueName === null) {
         $valueName = '...';
     }
     if ($element->getShowAsText()) {
         $html = ' <input type="hidden" class="hidden" id="' . $element->getHtmlId() . '" name="' . $element->getName() . '" value="' . $element->getValue() . '"/> ' . htmlspecialchars($valueName) . '&nbsp;';
     } else {
         $html = '&nbsp;<span class="rule-param">';
         /** @var Mage_Core_Model_Translate_Inline $translate */
         $translate = Mage::getSingleton('core/translate_inline');
         if ($translate->isAllowed()) {
             $valueName = Mage::helper('core/string')->truncate($valueName, 33, '...');
         }
         $html .= '<a href="javascript:void(0)" class="label">';
         $html .= Mage::helper('core')->escapeHtml($valueName);
         $html .= '</a>';
         $html .= '<span class="element"> ';
         $html .= $element->getElementHtml();
         if ($element->getExplicitApply()) {
             /** @var Aoe_FraudManager_Helper_Data $helper */
             $helper = Mage::helper('Aoe_FraudManager/Data');
             $url = $helper->getConditionApplyImageUrl();
             $label = $helper->getConditionApplyLabel();
             $html .= ' <a href="javascript:void(0)" class="rule-param-apply">';
             $html .= '<img src="' . $url . '" class="v-middle" alt="' . $label . '" title="' . $label . '" />';
             $html .= '</a> ';
         }
         $html .= '</span>';
         $html .= '</span>&nbsp;';
     }
     return $html;
 }
開發者ID:aoepeople,項目名稱:aoe_fraudmanager,代碼行數:35,代碼來源:Editable.php

示例3: render

 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;
 }
開發者ID:jsiefer,項目名稱:emarketing,代碼行數:32,代碼來源:Editable.php

示例4: _getElementHtml

 /**
  * @param Varien_Data_Form_Element_Abstract $element
  *
  * @return string
  */
 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $element->addClass('select');
     $hours = 0;
     $minutes = 0;
     if ($value = $element->getValue()) {
         $values = explode(',', $value);
         if (is_array($values) && count($values) == 2) {
             $hours = $values[0];
             $minutes = $values[1];
         }
     }
     $optionTemplate = '<option value="%s" %s>%s</option>';
     $html = sprintf('<input type="hidden" id="%s" />', $element->getHtmlId());
     $html .= sprintf('<select name="%s" %s style="width:60px">', $element->getName(), $element->serialize($element->getHtmlAttributes()));
     for ($i = 0; $i < 24; $i++) {
         $hour = str_pad($i, 2, '0', STR_PAD_LEFT);
         $html .= sprintf($optionTemplate, $hour, (int) $hours === $i ? 'selected="selected"' : '', $hour);
     }
     $html .= '</select>&nbsp;:&nbsp;';
     $html .= sprintf('<select name="%s" %s style="width:60px">', $element->getName(), $element->serialize($element->getHtmlAttributes()));
     for ($i = 0; $i < 60; $i++) {
         $minute = str_pad($i, 2, '0', STR_PAD_LEFT);
         $html .= sprintf($optionTemplate, $minute, (int) $minutes === $i ? 'selected="selected"' : '', $minute);
     }
     $html .= '</select>';
     $html .= $element->getAfterElementHtml();
     return $html;
 }
開發者ID:WeareJH,項目名稱:esendex-magento-extension,代碼行數:34,代碼來源:CronTime.php

示例5: _addEpicEditorHtml

 /**
  * @return $this
  */
 protected function _addEpicEditorHtml()
 {
     if (!$this->_helper->isEpicEditorEnabled()) {
         return $this;
     }
     $id = $this->_currentElement->getHtmlId();
     $this->_currentElement->addClass('initEpicEditor');
     $this->_afterElementHtml[100] = ' <div id="epiceditor_EE_' . $id . '"' . $this->_getEpicEditorHtmlConfig() . '></div>';
     return $this;
 }
開發者ID:ho-nl-fork,項目名稱:magento1-SchumacherFM_Markdown,代碼行數:13,代碼來源:Block.php

示例6: render

 public function render(Varien_Data_Form_Element_Abstract $element)
 {
     $element->addClass('element-value-changer');
     $html = '&nbsp;<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>&nbsp;';
     return $html;
 }
開發者ID:barneydesmond,項目名稱:propitious-octo-tribble,代碼行數:11,代碼來源:Newchild.php

示例7: _getElementHtml

 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $element->addClass('link');
     $id = $element->getHtmlId();
     // If there's an inherited checkbox; hide it. This is a read-only property, and the checkbox is superfluous
     $inheritedCheckbox = $id . '_inherit';
     $hideCheckboxJs = 'if ($("' . $inheritedCheckbox . '") != undefined ){$("' . $inheritedCheckbox . '").hide();}';
     $html = sprintf('<a id="%s" name="%s" onClick="return false;" href="#">%s</a>', $id, $element->getName(), $element->getEscapedValue());
     $html .= Mage::helper('core/js')->getScript('document.observe("dom:loaded", function() {' . $hideCheckboxJs . '});');
     return $html;
 }
開發者ID:xiaoguizhidao,項目名稱:magento,代碼行數:11,代碼來源:Feedurl.php

示例8: render

 public function render(Varien_Data_Form_Element_Abstract $element)
 {
     $element->addClass('element-value-changer');
     $html = '&nbsp;<span class="rule-param rule-param-new-child">';
     $html .= '<a href="javascript:void(0)" class="label">';
     $src = Mage::getDesign()->getSkinUrl('images/rule_component_add.gif');
     $html .= '<img src="' . $src . '" class="rule-param-add v-middle" alt="" title="' . $element->getLabel() . '"/>';
     $html .= '</a>';
     $html .= '<span class="element">';
     $html .= $element->getElementHtml();
     $html .= '</span>';
     $html .= '</span>&nbsp;';
     return $html;
 }
開發者ID:aoepeople,項目名稱:aoe_fraudmanager,代碼行數:14,代碼來源:Newchild.php

示例9: render

 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) . '&nbsp;';
     } 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>&nbsp;';
     }
     return $html;
 }
開發者ID:par-orillonsoft,項目名稱:magento_work,代碼行數:23,代碼來源:Editable.php

示例10: render

 /**
  * 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) . '&nbsp;';
     } 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>&nbsp;';
     }
     return $html;
 }
開發者ID:natxetee,項目名稱:magento2,代碼行數:30,代碼來源:Editable.php

示例11: _getElementHtml

 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $element->addClass('select');
     $value_hrs = 0;
     $value_min = 0;
     $value_sec = 0;
     if ($value = $element->getValue()) {
         $values = explode(',', $value);
         if (is_array($values) && count($values) == 3) {
             $value_hrs = $values[0];
             $value_min = $values[1];
             $value_sec = $values[2];
         }
     }
     $html = '<input type="hidden" id="' . $element->getHtmlId() . '" />';
     $html .= '<select name="' . $element->getName() . '" ' . $element->serialize($element->getHtmlAttributes()) . ' style="width:50px">' . "\n";
     for ($i = 0; $i < 24; $i++) {
         $hour = str_pad($i, 2, '0', STR_PAD_LEFT);
         $html .= '<option value="' . $hour . '" ' . ($value_hrs == $i ? 'selected="selected"' : '') . '>' . $hour . '</option>';
     }
     $html .= '</select>' . "\n";
     $html .= '&nbsp;:&nbsp;<select name="' . $element->getName() . '" ' . $element->serialize($element->getHtmlAttributes()) . ' style="width:50px">' . "\n";
     for ($i = 0; $i < 60; $i++) {
         $hour = str_pad($i, 2, '0', STR_PAD_LEFT);
         $html .= '<option value="' . $hour . '" ' . ($value_min == $i ? 'selected="selected"' : '') . '>' . $hour . '</option>';
     }
     $html .= '</select>' . "\n";
     $html .= '<select name="' . $element->getName() . '" ' . $element->serialize($element->getHtmlAttributes()) . ' style="width:50px;display:none;">' . "\n";
     for ($i = 0; $i < 60; $i++) {
         $hour = str_pad($i, 2, '0', STR_PAD_LEFT);
         $html .= '<option value="' . $hour . '" ' . ($value_sec == $i ? 'selected="selected"' : '') . '>' . $hour . '</option>';
     }
     $html .= '</select>' . "\n";
     $html .= $element->getAfterElementHtml();
     return $html;
 }
開發者ID:portchris,項目名稱:NaturalRemedyCompany,代碼行數:36,代碼來源:Time.php

示例12: _getElementHtml

 /**
  * 
  */
 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $element->addClass('rel__htmlColorEditbox');
     return parent::_getElementHtml($element);
 }
開發者ID:ashfaqphplhr,項目名稱:artificiallawnsforturf,代碼行數:8,代碼來源:AdminhtmlSystemConfigFieldEditboxColor.php

示例13: _getElementHtml

 /**
  * Get the feed URL contents which include information about the last time a feed was generate, lock file information and scripts contents
  * @param Varien_Data_Form_Element_Abstract $element
  * @return string
  */
 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $element->addClass('link');
     $lock = Mage::getModel('eems_display/file_lock');
     $this->addData(array('name' => $element->getName(), 'escaped_value' => $element->getEscapedValue(), 'is_lock_file_exist' => $lock->isLockFileExist(), 'lock_file_exist_text' => $this->_helper->__($lock->getLockFileExistText()), 'fail_to_remove_lock_file_text' => $this->_helper->__($lock->getFailRemoveLockFileText()), 'escaped_button_label' => $this->_helper->__($this->escapeHtml($lock->getRemoveLockButonText())), 'html_id' => $element->getHtmlId(), 'ajax_url' => $this->getUrl(static::REMOVE_LOCK_FILE_CONTROLLER, array('_current' => true))));
     return $this->_toHtml();
 }
開發者ID:adamhobson,項目名稱:magento-eems-display,代碼行數:12,代碼來源:Feedurl.php

示例14: render

 public function render(Varien_Data_Form_Element_Abstract $element)
 {
     $element->addClass('color');
     $html = '<tr>' . '<td class="label"><label for="' . $element->getId() . '">Color</label></td>' . '<td class="value">' . $element->getElementHtml() . '<script type="text/javascript">' . 'jscolor.init();' . '</script>' . '</td>' . '</tr>';
     return $html;
 }
開發者ID:jahvi,項目名稱:magento-study-group,代碼行數:6,代碼來源:Picker.php

示例15: render

 public function render(Varien_Data_Form_Element_Abstract $element)
 {
     $this->_element = $element;
     $element->addClass('udvalidate-' . $element->getId());
     return $this->toHtml();
 }
開發者ID:xiaoguizhidao,項目名稱:magento,代碼行數:6,代碼來源:FieldsetElement.php


注:本文中的Varien_Data_Form_Element_Abstract::addClass方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。