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


PHP Varien_Data_Form_Element_Text::setForm方法代碼示例

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


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

示例1: getCmsMappingsHtml

 /**
  * Return the list of stores that can be selected to be configured (i.e. haven't
  * been configured already), organised by website name and group name.
  *
  * @return array
  */
 protected function getCmsMappingsHtml()
 {
     $element = new Varien_Data_Form_Element_Text(array("name" => "excludedpages", "label" => $this->__("Exclude CMS pages from search"), "tooltip" => "", "hint" => "", "value" => Mage::helper("content")->getCmsPageMap($this->getStore()), "inherit" => false, "class" => "", "can_use_default_value" => false, "can_use_website_value" => false));
     $element->setForm(new Varien_Data_Form());
     /** @var Klevu_Search_Block_Adminhtml_Form_Field_Attribute_Mappings $renderer */
     $renderer = Mage::getBlockSingleton("content/adminhtml_form_cmspages");
     $renderer->setTemplate("klevu/search/wizard/form/field/array.phtml");
     return $renderer->render($element);
 }
開發者ID:klevu,項目名稱:klevu-smart-search-M1,代碼行數:15,代碼來源:Store.php

示例2: getAttributeMappingsHtml

 protected function getAttributeMappingsHtml()
 {
     $element = new Varien_Data_Form_Element_Text(array("name" => "attributes", "label" => $this->__("Additional Attributes"), "comment" => $this->__('Here you can set optional product attributes sent to Klevu by mapping them to your Magento attributes. If you specify multiple mappings for the same Klevu attribute, only the first mapping found on the product sent will be used, except for the "Other" attribute where all existing mappings are used.'), "tooltip" => "", "hint" => "", "value" => Mage::helper("klevu_search/config")->getAdditionalAttributesMap($this->getStore()), "inherit" => false, "class" => "", "can_use_default_value" => false, "can_use_website_value" => false));
     $element->setForm(new Varien_Data_Form());
     /** @var Klevu_Search_Block_Adminhtml_Form_Field_Attribute_Mappings $renderer */
     $renderer = Mage::getBlockSingleton("klevu_search/adminhtml_form_field_attribute_mappings");
     $renderer->setTemplate("klevu/search/wizard/form/field/array.phtml");
     return $renderer->render($element);
 }
開發者ID:mSupply,項目名稱:runnable_test_repo,代碼行數:9,代碼來源:Attributes.php

示例3: _getElementHtml

 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $html = '<script type="text/javascript" src="' . Mage::getBaseUrl('js') . 'chartmap/systemcolorpicker/procolor-1.0/procolor.compressed.js' . '"></script>';
     $input = new Varien_Data_Form_Element_Text();
     $input->setForm($element->getForm())->setElement($element)->setValue($element->getValue())->setHtmlId($element->getHtmlId())->setName($element->getName())->setStyle('width: 100px')->addClass('validate-hex');
     $html .= $input->getHtml();
     $html .= $this->_getProcolorJs($element->getHtmlId());
     $html .= $this->_addHexValidator();
     return $html;
 }
開發者ID:vijays91,項目名稱:Magento-Chart-Map,代碼行數:10,代碼來源:Colorpicker.php

示例4: renderWithoutFormElement

 /**
  * Render Media Chooser HTML without form element as parameter
  * Can be useful for dynamic fields integration like it is done in Mage_Poll module for example
  *
  * @param $id
  * @param null $value
  *
  * @return string
  */
 public function renderWithoutFormElement($id, $value = null)
 {
     $dummyForm = new Varien_Data_Form();
     $dummyElement = new Varien_Data_Form_Element_Text();
     $dummyElement->setHtmlId($id);
     $dummyElement->setValue($value);
     $dummyElement->setForm($dummyForm);
     $html = $this->render($dummyElement);
     return $html->getAfterElementHtml();
 }
開發者ID:christinecardoso,項目名稱:AntoineK_MediaChooserField,代碼行數:19,代碼來源:Data.php

示例5: _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

示例6: 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

示例7: _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

示例8: _getElementHtml

 /**
  * Generate HTML code for color picker
  *
  * @param Varien_Data_Form_Element_Abstract $element
  * @return string
  */
 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     // Include Procolor library JS file which is in [magento_base_dir]/js/herve/systemcolorpicker/procolor-1.0/procolor.compressed.js
     $html = '<script type="text/javascript" src="' . Mage::getBaseUrl('js') . 'herve/systemcolorpicker/procolor-1.0/procolor.compressed.js' . '"></script>';
     // Use Varien text element as a basis
     $input = new Varien_Data_Form_Element_Text();
     // Set data from config element on Varien text element
     $input->setForm($element->getForm())->setElement($element)->setValue($element->getValue())->setHtmlId($element->getHtmlId())->setName($element->getName())->setStyle('width: 60px')->addClass('validate-hex');
     // Add some Prototype validation to make sure color code is correct
     // Inject uddated Varien text element HTML in our current HTML
     $html .= $input->getHtml();
     // Inject Procolor JS code to display color picker
     $html .= $this->_getProcolorJs($element->getHtmlId());
     // Inject Prototype validation
     $html .= $this->_addHexValidator();
     return $html;
 }
開發者ID:simkea,項目名稱:Herve_SystemColorpicker,代碼行數:23,代碼來源:Colorpicker.php

示例9: _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

示例10: setForm

 /**
  * Set form to quantity element in addition to current element
  *
  * @param $form
  * @return Varien_Data_Form
  */
 public function setForm($form)
 {
     $this->_qty->setForm($form);
     return parent::setForm($form);
 }
開發者ID:nickimproove,項目名稱:magento2,代碼行數:11,代碼來源:Stock.php

示例11: _getFieldInput

 /**
  * @param Varien_Data_Form_Element_Abstract $element
  * @return Varien_Data_Form_Element_Text
  */
 protected function _getFieldInput(Varien_Data_Form_Element_Abstract $element)
 {
     $fieldInput = new Varien_Data_Form_Element_Text();
     $fieldInput->setForm($element->getForm())->setId($element->getId())->setName($element->getName())->setClass('widget-option input-text');
     if ($element->getRequired()) {
         $fieldInput->addClass('required-entry');
     }
     if ($element->getValue()) {
         $fieldInput->setValue($element->getValue());
     }
     return $fieldInput;
 }
開發者ID:Rizsti,項目名稱:Extendix_AdminFormChooserButton,代碼行數:16,代碼來源:ImageChooser.php

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