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


PHP Varien_Data_Form_Element_Text::getElementHtml方法代碼示例

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


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

示例1: prepareElementHtml

    /**
     * @param Varien_Data_Form_Element_Abstract $element
     * @return Varien_Data_Form_Element_Abstract
     */
    public function prepareElementHtml(Varien_Data_Form_Element_Abstract $element)
    {
        $this->_init($element);
        $strTrFunctionJs = '';
        if (!$this->_isStrtrAdded) {
            $strTrFunctionJs = '
                <script type="text/javascript">//<![CDATA[
                var extendix_strtr = function (str, from, to) {
                    var out = "", i, m, p;
                        for (i = 0, m = str.length; i < m; i++) {
                            p = from.indexOf(str.charAt(i));
                            if (p >= 0) {
                            out = out + to.charAt(p);
                        } else {
                            out += str.charAt(i);
                        }
                    }
                    return out;
                };
                //]]></script>
            ';
            $this->_isStrtrAdded = true;
        }
        $extraJsHtml = $strTrFunctionJs . '
            <script type="text/javascript">//<![CDATA[

                new Form.Element.Observer(
                  \'' . $this->_dummyFieldInput->getHtmlId() . '\',
                  0.2,  // 200 milliseconds
                  function(el, value) {
                    var regex = new RegExp(\'/\\\\___directive\\/([^\\/]+)\\/\');
                    var imagePathBase64 = regex.exec(value)[1];
                    var dirtyImagePath = Base64.decode(extendix_strtr(imagePathBase64, "-_,", "+/="));
                    dirtyImagePath = dirtyImagePath.replace(\'{{media url="\',\'\');
                    var relativeImagePath = dirtyImagePath.replace(\'"}}\', \'\');

                    $(\'' . $this->_fieldInput->getHtmlId() . '\').value = relativeImagePath;

                    //Disable Insert Button
                    $(\'' . $this->_imageChooserButton->getHtmlId() . '\').writeAttribute(\'disabled\', true);
                    $(\'' . $this->_imageChooserButton->getHtmlId() . '\').addClassName(\'disabled\');

                    //Enable Remove Button
                    $(\'' . $this->_imageRemoveButton->getHtmlId() . '\').writeAttribute(\'disabled\', false);
                    $(\'' . $this->_imageRemoveButton->getHtmlId() . '\').removeClassName(\'disabled\');

                    //Display new image
                    $(\'' . $element->getHtmlId() . self::IMAGE_PREVIEW_SUFFIX . '\').parentNode.href = \'/media/\' + relativeImagePath;
                    $(\'' . $element->getHtmlId() . self::IMAGE_PREVIEW_SUFFIX . '\').src = \'/media/\' + relativeImagePath;
                    $(\'' . $element->getHtmlId() . self::IMAGE_PREVIEW_SUFFIX . '\').title = relativeImagePath;
                    $(\'' . $element->getHtmlId() . self::IMAGE_PREVIEW_SUFFIX . '\').alt = relativeImagePath;
                    $(\'' . $element->getHtmlId() . self::IMAGE_PREVIEW_SUFFIX . '\').parentNode.removeClassName(\'no-display\');
                  }
                );
            //]]></script>
        ';
        $element->setData('after_element_html', $this->_fieldInput->getElementHtml() . $this->_dummyFieldInput->getElementHtml() . $this->_getPreviewHtml($element) . $this->_imageChooserButton->toHtml() . $this->_imageRemoveButton->toHtml() . $extraJsHtml);
        return $element;
    }
開發者ID:Rizsti,項目名稱:Extendix_AdminFormChooserButton,代碼行數:63,代碼來源:ImageChooser.php

示例2: getElementHtml

 public function getElementHtml()
 {
     $html = '
         <div class="target-control">
             ' . parent::getElementHtml() . '
             ' . $this->getOptionsHtml() . '
         </div>
     ';
     return $html;
 }
開發者ID:beejhuff,項目名稱:rootd-link,代碼行數:10,代碼來源:Targetselector.php

示例3: _getElementHtml

 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $color = new Varien_Data_Form_Element_Text();
     $data = array('name' => $element->getName(), 'html_id' => $element->getId());
     $color->setData($data);
     $color->setValue($element->getValue(), $format);
     $color->setForm($element->getForm());
     $color->addClass('color ' . $element->getClass());
     return $color->getElementHtml();
 }
開發者ID:kanotest15,項目名稱:cbmagento,代碼行數:10,代碼來源:Jscolorblock.php

示例4: _getElementHtml

 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $helper = Mage::helper('netzarbeiter_groupscatalog2');
     if ($helper->getConfig('show_multiselect_field')) {
         $html = parent::_getElementHtml($element);
     } else {
         $label = new Varien_Data_Form_Element_Text();
         $label->setData($element->getData())->setType('text')->setExtType('textfield')->addClass('input-text')->setReadOnly(true)->setForm($element->getForm())->setId($element->getId());
         $value = explode(',', (string) $label->getValue());
         $groups = $helper->getGroupNamesAsString($value);
         $label->setValue($groups);
         $html = $label->getElementHtml();
     }
     return $html;
 }
開發者ID:gewaechshaus,項目名稱:groupscatalog2,代碼行數:15,代碼來源:Customergroup.php

示例5: prepareElementHtml

 public function prepareElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $config = $this->getConfig();
     $chooseButton = $this->getLayout()->createBlock('adminhtml/widget_button')->setType('button')->setClass('scalable btn-chooser')->setLabel($config['button']['open'])->setOnclick('MediabrowserUtility.openDialog(\'' . $this->getUrl('*/cms_wysiwyg_images/index', array('target_element_id' => $element->getName())) . '\')')->setDisabled($element->getReadonly());
     $text = new Varien_Data_Form_Element_Text();
     $text->setForm($element->getForm())->setId($element->getName())->setName($element->getName())->setClass('widget-option input-text');
     if ($element->getRequired()) {
         $text->addClass('required-entry');
     }
     if ($element->getValue()) {
         $text->setValue($element->getValue());
     }
     $element->setData('after_element_html', $text->getElementHtml() . $chooseButton->toHtml());
     return $element;
 }
開發者ID:jahvi,項目名稱:magento-study-group,代碼行數:15,代碼來源:Chooser.php

示例6: _getElementHtml

 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $days = new Varien_Data_Form_Element_Text();
     $data = array('name' => $element->getName(), 'html_id' => $element->getId());
     $days->setData($data);
     if (is_numeric($element->getValue())) {
         $days->setValue($element->getValue());
     } else {
         $days->setValue(30);
     }
     $days->setForm($element->getForm());
     $html = $days->getElementHtml();
     $javaScript = "\n            <script type=\"text/javascript\">\n                Event.observe(window, 'load', function() {\n                    days=\$('{$element->getHtmlId()}').value;\n                    if (isNaN(days)) {\n                        \$('{$element->getHtmlId()}').value = '';\n                    }\n                });\n                Event.observe('{$element->getHtmlId()}', 'change', function(){\n                    days=\$('{$element->getHtmlId()}').value;\n                    if (isNaN(days)) {\n                        \$('{$element->getHtmlId()}').value = '';\n                    }\n                });\n            </script>";
     $html .= $javaScript;
     return $html;
 }
開發者ID:sjonmx,項目名稱:conekta-magento,代碼行數:16,代碼來源:Days.php

示例7: getElementHtml

 /**
  * Retrieve element html
  *
  * @return string
  */
 public function getElementHtml()
 {
     $value = $this->getValue();
     if ($value == '') {
         $this->setValue($this->_getValueFromConfig());
     }
     $html = parent::getElementHtml();
     $htmlId = 'use_config_' . $this->getHtmlId();
     $checked = $value == '' ? ' checked="checked"' : '';
     $disabled = $this->getReadonly() ? ' disabled="disabled"' : '';
     $html .= '<input id="' . $htmlId . '" name="product[' . $htmlId . ']" ' . $disabled . ' value="1" ' . $checked;
     $html .= ' onclick="toggleValueElements(this, this.parentNode);" class="checkbox" type="checkbox" />';
     $html .= ' <label for="' . $htmlId . '">' . Mage::helper('adminhtml')->__('Use Config Settings') . '</label>';
     $html .= '<script type="text/javascript">toggleValueElements($(\'' . $htmlId . '\'), $(\'' . $htmlId . '\').parentNode);</script>';
     return $html;
 }
開發者ID:finelinePG,項目名稱:finelink-dev,代碼行數:21,代碼來源:Text.php

示例8: _getElementHtml

 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     if (!class_exists('Conekta')) {
         error_log("Plugin miss Conekta PHP lib dependency. Clone the repository using 'git clone --recursive git@github.com:conekta/conekta-magento.git'", 0);
         throw new Mage_Payment_Model_Info_Exception("Payment module unavailable. Please contact system administrator.");
     }
     Conekta::setApiKey(Mage::getStoreConfig('payment/webhook/privatekey'));
     Conekta::setApiVersion("1.0.0");
     Conekta::setLocale(Mage::app()->getLocale()->getLocaleCode());
     $url = new Varien_Data_Form_Element_Text();
     $data = array('name' => $element->getName(), 'html_id' => $element->getId());
     $url->setData($data);
     $webhook_url = Mage::getBaseUrl() . "index.php/webhook/ajax/listener";
     if (!empty($element->getValue())) {
         $url_string = $element->getValue();
     } else {
         $url_string = $webhook_url;
     }
     $url->setValue($url_string);
     $events = array("events" => array("charge.created", "charge.paid", "charge.under_fraud_review", "charge.fraudulent", "charge.refunded", "charge.created", "customer.created", "customer.updated", "customer.deleted", "webhook.created", "webhook.updated", "webhook.deleted", "charge.chargeback.created", "charge.chargeback.updated", "charge.chargeback.under_review", "charge.chargeback.lost", "charge.chargeback.won", "payout.created", "payout.retrying", "payout.paid_out", "payout.failed", "plan.created", "plan.updated", "plan.deleted", "subscription.created", "subscription.paused", "subscription.resumed", "subscription.canceled", "subscription.expired", "subscription.updated", "subscription.paid", "subscription.payment_failed", "payee.created", "payee.updated", "payee.deleted", "payee.payout_method.created", "payee.payout_method.updated", "payee.payout_method.deleted"));
     $error = false;
     $error_message = null;
     try {
         $different = true;
         $webhooks = Conekta_Webhook::where();
         foreach ($webhooks as $webhook) {
             if (strpos($webhook->webhook_url, $url_string) !== false) {
                 $different = false;
             }
         }
         if ($different) {
             $webhook = Conekta_Webhook::create(array_merge(array("url" => $url_string), $events));
         }
     } catch (Exception $e) {
         $error = true;
         $error_message = $e->getMessage();
     }
     $url->setForm($element->getForm());
     $html = $url->getElementHtml();
     $javaScript = "\n    <script type=\"text/javascript\">\n    Event.observe(window, 'load', function() {\n      alert('" . $error_message . "');\n    });\n    </script>";
     if ($error) {
         $html .= $javaScript;
     }
     return $html;
 }
開發者ID:intfrr,項目名稱:conekta-magento,代碼行數:45,代碼來源:Url.php

示例9: getElementHtml

 public function getElementHtml()
 {
     $elementAttributeHtml = '';
     if ($this->getReadonly()) {
         $elementAttributeHtml = $elementAttributeHtml . ' readonly="readonly"';
     }
     if ($this->getDisabled()) {
         $elementAttributeHtml = $elementAttributeHtml . ' disabled="disabled"';
     }
     $operator = array('' => '', '==' => Mage::helper('rule')->__('is'), '!=' => Mage::helper('rule')->__('is not'), '>=' => Mage::helper('rule')->__('equals or greater than'), '<=' => Mage::helper('rule')->__('equals or less than'), '>' => Mage::helper('rule')->__('greater than'), '<' => Mage::helper('rule')->__('less than'));
     $html = '<select name="' . $this->getData('dropdownName') . '" onchange="toggleQtyFilterVisibility(this)"' . $elementAttributeHtml . ' style="' . $this->getData('dropdownStyle') . '">';
     foreach ($operator as $key => $value) {
         $html .= '<option value="' . $key . '" ' . ($this->getData('dropdownValue') == $key ? 'selected' : '') . '>' . $value . '</option>';
     }
     $html .= '</select>&nbsp;&nbsp;';
     $html .= parent::getElementHtml();
     return $html;
 }
開發者ID:tschifftner,項目名稱:Magento-MEP,代碼行數:18,代碼來源:QtyFilter.php

示例10: getElementHtml

 /**
  * Retrieve Element HTML fragment
  *
  * @return string
  */
 public function getElementHtml()
 {
     $disabled = false;
     if (!$this->getValue()) {
         $this->setData('disabled', 'disabled');
         $disabled = true;
     }
     $html = parent::getElementHtml();
     $htmlId = 'use_config_' . $this->getHtmlId();
     $html .= '<br/><input id="' . $htmlId . '" name="use_config[]" value="' . $this->getId() . '"';
     $html .= $disabled ? ' checked="checked"' : '';
     if ($this->getReadonly()) {
         $html .= ' disabled="disabled"';
     }
     $html .= ' onclick="toggleValueElements(this, this.parentNode);" class="checkbox" type="checkbox" />';
     $html .= ' <label for="' . $htmlId . '" class="normal">' . Mage::helper('adminhtml')->__('Use Config Settings') . '</label>';
     $html .= '<script type="text/javascript">toggleValueElements($(\'' . $htmlId . '\'), $(\'' . $htmlId . '\').parentNode);</script>';
     return $html;
 }
開發者ID:votanlean,項目名稱:Magento-Pruebas,代碼行數:24,代碼來源:Pricestep.php

示例11: getElementHtml

 public function getElementHtml()
 {
     /** @var $helper MKleine_LanguageRoutes_Helper_Data */
     $helper = Mage::helper('mk_languageroutes');
     $html = '<select onchange="$(\'' . $this->getHtmlId() . '\').value = this.value;" id="' . $this->getHtmlId() . '-suggest" name="' . $this->getName() . '-suggest" ' . $this->serialize($this->getHtmlAttributes()) . ' style="margin-bottom: 10px;">' . "\n";
     // All routes
     $html .= '<optgroup label="' . $helper->__('Route') . '">';
     foreach ($helper->getAvailableRoutes() as $route) {
         $html .= '<option value="' . $route . '">' . $route . '</option>';
     }
     $html .= '</optgroup>' . "\n";
     // All controllers
     $html .= '<optgroup label="' . $helper->__('Controller') . '">';
     foreach ($helper->getAvailableControllers() as $controller) {
         $html .= '<option value="' . $controller . '">' . $controller . '</option>';
     }
     $html .= '</optgroup>' . "\n";
     $html .= '</select>' . "\n";
     $html .= parent::getElementHtml();
     return $html;
 }
開發者ID:ThomasNegeli,項目名稱:magento-language-routes,代碼行數:21,代碼來源:Languageroute.php

示例12: getElementHtml

 /**
  * Retrieve Element HTML fragment
  *
  * @return string
  */
 public function getElementHtml()
 {
     $elementDisabled = $this->getDisabled() == 'disabled';
     $disabled = false;
     if (!$this->getValue() || $elementDisabled) {
         $this->setData('disabled', 'disabled');
         $disabled = true;
     }
     parent::addClass('validate-number validate-number-range number-range-0.01-1000000000');
     $html = parent::getElementHtml();
     $htmlId = 'use_config_' . $this->getHtmlId();
     $html .= '<br/><input id="' . $htmlId . '" name="use_config[]" value="' . $this->getId() . '"';
     $html .= $disabled ? ' checked="checked"' : '';
     if ($this->getReadonly() || $elementDisabled) {
         $html .= ' disabled="disabled"';
     }
     $html .= ' onclick="toggleValueElements(this, this.parentNode);" class="checkbox" type="checkbox" />';
     $html .= ' <label for="' . $htmlId . '" class="normal">' . Mage::helper('Mage_Adminhtml_Helper_Data')->__('Use Config Settings') . '</label>';
     $html .= '<script type="text/javascript">' . 'toggleValueElements($(\'' . $htmlId . '\'), $(\'' . $htmlId . '\').parentNode);' . '</script>';
     return $html;
 }
開發者ID:natxetee,項目名稱:magento2,代碼行數:26,代碼來源:Pricestep.php

示例13: getElementHtml

 public function getElementHtml()
 {
     $this->_data['disabled'] = Mage::helper('advancedreports/setup')->isDefault($this->getId());
     return parent::getElementHtml() . $this->_getDefaultCheckbox();
 }
開發者ID:webmaster4world,項目名稱:manual-indexing,代碼行數:5,代碼來源:Text.php

示例14: getElementHtml

 /**
  * Join quantity and in stock elements' html
  *
  * @return string
  */
 public function getElementHtml()
 {
     $this->_disableFields();
     return $this->_qty->getElementHtml() . parent::getElementHtml() . $this->_getJs(self::QUANTITY_FIELD_HTML_ID, $this->getId());
 }
開發者ID:nickimproove,項目名稱:magento2,代碼行數:10,代碼來源:Stock.php

示例15: addParamsToForm

 /**
  * Add params to form
  * @param array $params
  * @param Varien_Object $_transport
  */
 public function addParamsToForm(array $params, Varien_Object &$_transport)
 {
     $_form = new Varien_Data_Form();
     foreach ($params as $name => $value) {
         $_element = new Varien_Data_Form_Element_Text();
         //init element
         $_element->setType("hidden");
         $_element->setForm($_form);
         //Add Element to empty form
         //Handle dynamic params
         $_element->addData(array("name" => $name, "value" => $value));
         $this->appendHtml($_transport, $_element->getElementHtml());
     }
 }
開發者ID:sereban,項目名稱:magento-marketo-integration,代碼行數:19,代碼來源:Data.php


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