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


PHP Varien_Data_Form_Element_Abstract類代碼示例

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


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

示例1: _getElementHtml

 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $url_params = $this->getStoreId() ? array("store" => $this->getStoreId()) : array();
     $label_suffix = $this->getStoreId() ? " for This Store" : "";
     $this->addData(array("html_id" => $element->getHtmlId(), "button_label" => sprintf("Sync All Products%s", $label_suffix), "destination_url" => $this->getUrl("adminhtml/klevu_search/sync_all", $url_params)));
     return $this->_toHtml();
 }
開發者ID:shebin512,項目名稱:Magento_Zoff,代碼行數:7,代碼來源:Button.php

示例2: _getElementHtml

 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     if (!Mage::helper('catalog/category_flat')->isBuilt()) {
         $element->setDisabled(true)->setValue(0);
     }
     return parent::_getElementHtml($element);
 }
開發者ID:SalesOneGit,項目名稱:s1_magento,代碼行數:7,代碼來源:Flatcatalog.php

示例3: _getElementHtml

 /**
  * Ajax Create the addressbooks.
  *
  * @param Varien_Data_Form_Element_Abstract $element
  *
  * @return string
  */
 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $url = Mage::helper('adminhtml')->getUrl('*/connector/createnewaddressbook');
     $website = Mage::app()->getRequest()->getParam('website', 0);
     $element->setData('after_element_html', "<script>\n                function createAddressbook(form, element) {\n                    var name       = \$('connector_sync_settings_dynamic_addressbook_addressbook_name').value;\n                    var visibility = \$('connector_sync_settings_dynamic_addressbook_visibility').value;\n                    var reloadurl  = '{$url}';\n                    if(name && visibility){\n                        new Ajax.Request(reloadurl, {\n                            method: 'post',\n                            parameters: {'name' : name, 'visibility' : visibility, 'website': '{$website}'},\n                            onComplete: function(transport) {\n                                window.location.reload();\n                            }\n                        });\n                    }\n                    return false;\n                }\n            </script>");
     return parent::_getElementHtml($element);
 }
開發者ID:dotmailer,項目名稱:dotmailer-magento-extension,代碼行數:14,代碼來源:Addressbook.php

示例4: _getElementHtml

 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $el)
 {
     $data = $el->getOriginalData();
     if (isset($data['process'])) {
         $process = $data['process'];
     } else {
         return '<div>Action was not specified</div>';
     }
     if (isset($data['demo'])) {
         $demo = $data['demo'];
     } else {
         return '<div>Demo param was not specified</div>';
     }
     $buttonSuffix = '';
     if (isset($data['label'])) {
         $buttonSuffix = ' ' . $data['label'];
     }
     $url = $this->getUrl('adminhtml/porto_demo/' . $process) . 'demoversion/' . $demo;
     if (strlen($code = Mage::getSingleton('adminhtml/config_data')->getWebsite())) {
         $url .= "/website/" . $code;
     }
     if (strlen($code = Mage::getSingleton('adminhtml/config_data')->getStore())) {
         $url .= "/store/" . $code;
     }
     $html = $this->getLayout()->createBlock('adminhtml/widget_button')->setType('button')->setClass('import-cms')->setLabel('Import' . $buttonSuffix)->setOnClick("setLocation('{$url}')")->toHtml();
     return $html;
 }
開發者ID:ausger,項目名稱:myporto,代碼行數:27,代碼來源:Demo.php

示例5: _getElementHtml

 /**
  * Render Default Product Price field as disabled if user does not have enough permissions
  *
  * @param Varien_Data_Form_Element_Abstract $element
  * @return string
  */
 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     if (!Mage::helper('enterprise_pricepermissions')->getCanAdminEditProductPrice()) {
         $element->setReadonly(true, true);
     }
     return parent::_getElementHtml($element);
 }
開發者ID:QiuLihua83,項目名稱:magento-enterprise-1.13.1.0,代碼行數:13,代碼來源:Default.php

示例6: render

    public function render(Varien_Data_Form_Element_Abstract $element)
    {
        $useContainerId = $element->getData('use_container_id');
        return sprintf('<tr class="system-fieldset-sub-head" id="row_%s"><td colspan="5" class="ves-description">
					   <h3>	<a href="http://www.venustheme.com"><b>Magento - Venus Product Categories Block</b></a>  </h3>
								Show List Categories.<br>
							<br>
							
							<h4><b>Guide</b></h4>
							<ul>
								<li><a href="http://www.venustheme.com"> 1) Forum Support</a></li>
								<li><a href="http://www.venustheme.com"> 2) Submit A Request</a></li>
								<li><a href="http://www.venustheme.com"> 3) Submit A Ticket</a></li>
							</ul>
							<div>
								<h4>How to implement</h4>
								<ul>
									<li>&ltblock type="ves_productcategories/list" name="ves.list" /&gt</li>
									<li>{{block type="ves_productcategories/list" name="ves.list"}}</li>
								</ul>
								
							</div>
							<br>
							<div style="font-size:11px">@Copyright: <i><a href="http://www.venustheme.com" target="_blank">VenusTheme.Com</a></i></div>
					   </td></tr>', $element->getHtmlId(), $element->getHtmlId(), $element->getLabel());
    }
開發者ID:quanghuynt93,項目名稱:VesSmartshop,代碼行數:26,代碼來源:Information.php

示例7: _getElementHtml

 /**
  *
  * @param Varien_Data_Form_Element_Abstract $element
  * @return string
  */
 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $javaScript = "\n            <script type=\"text/javascript\">\n                Event.observe('{$element->getId()}', 'change', function(){\n                    split_payment=\$('{$element->getId()}').value;\n                    \$('{$this->_getSplitPaymentElementId($element)}').disabled = (!split_payment || split_payment!=1);\n                });\n            </script>";
     $element->setData('after_element_html', $javaScript . $element->getAfterElementHtml());
     $this->toggleDisabled($element);
     return parent::_getElementHtml($element);
 }
開發者ID:hipay,項目名稱:hipay-fullservice-sdk-magento1,代碼行數:12,代碼來源:Allowsplitpayment.php

示例8: render

 public function render(Varien_Data_Form_Element_Abstract $element)
 {
     $editor = new TM_Core_Block_Adminhtml_Widget_Form_Element_Wysiwyg($element->getData());
     $editor->setId($element->getId());
     $editor->setForm($element->getForm());
     return parent::render($editor);
 }
開發者ID:santhosh400,項目名稱:ecart,代碼行數:7,代碼來源:Wysiwyg.php

示例9: _getElementHtml

 /**
  * Retrieve Element HTML
  *
  * @param Varien_Data_Form_Element_Abstract $element
  * @return string
  */
 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     if (!$this->helper('Mage_Catalog_Helper_Product_Flat')->isBuilt()) {
         $element->setDisabled(true)->setValue(0);
     }
     return parent::_getElementHtml($element);
 }
開發者ID:,項目名稱:,代碼行數:13,代碼來源:

示例10: prepareElementHtml

 public function prepareElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $targetId = $this->getFieldsetId() . '_' . $this->getConfig('target');
     $block = $this->getLayout()->createBlock('mtwidget/adminhtml_widget_renderer_depend', '', array('target' => $targetId, 'url' => $this->getUrl('mtwidget/adminhtml_widget_attribute/option'), 'me' => $element->getHtmlId(), 'value' => implode(',', (array) $element->getValue())));
     $element->setData('after_element_html', $block->toHtml());
     return $element;
 }
開發者ID:igorvasiliev4,項目名稱:magento_code,代碼行數:7,代碼來源:Option.php

示例11: render

 public function render(Varien_Data_Form_Element_Abstract $element)
 {
     if ($country = $element->getForm()->getElement('country_id')) {
         $countryId = $country->getValue();
     } else {
         return $element->getDefaultHtml();
     }
     $regionId = $element->getForm()->getElement('region_id')->getValue();
     $html = '<tr>';
     $element->setClass('input-text');
     $html .= '<td class="label">' . $element->getLabelHtml() . '</td><td class="value">';
     $html .= $element->getElementHtml();
     $selectName = str_replace('region', 'region_id', $element->getName());
     $selectId = $element->getHtmlId() . '_id';
     $html .= '<select id="' . $selectId . '" name="' . $selectName . '" class="select required-entry" style="display:none">';
     $html .= '<option value="">' . AO::helper('customer')->__('Please select') . '</option>';
     $html .= '</select>';
     $html .= '<script type="text/javascript">
     if ($("' . $country->getHtmlId() . '") != undefined) {
         new regionUpdater("' . $country->getHtmlId() . '", "' . $element->getHtmlId() . '", "' . $selectId . '", ' . $this->helper('directory')->getRegionJson() . ');
     }
     </script>';
     $html .= '</td></tr>' . "\n";
     return $html;
 }
開發者ID:ronseigel,項目名稱:agent-ohm,代碼行數:25,代碼來源:Customer_Edit_Renderer_Region.php

示例12: _getElementHtml

 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     if (!Mage::helper('Mage_Catalog_Helper_Category_Flat')->isRebuilt()) {
         $element->setDisabled('disabled')->setValue(0);
     }
     return parent::_getElementHtml($element);
 }
開發者ID:natxetee,項目名稱:magento2,代碼行數:7,代碼來源:Flatcatalog.php

示例13: prepareElementHtml

 public function prepareElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $html = '<script type="text/javascript">' . 'function showHideColumn(){ if(jQuery("select[name=\'parameters[widget_type]\']").val() == \'block\' && jQuery("select[name=\'parameters[scroll]\']").val() == 0) jQuery("input[name=\'parameters[column]\']").closest( "tr").hide(); else jQuery("input[name=\'parameters[column]\']").closest( "tr").show();}</script>';
     $element->setOnchange('showHideColumn();');
     $element->setData('after_element_html', $html);
     return $element;
 }
開發者ID:igorvasiliev4,項目名稱:magento_code,代碼行數:7,代碼來源:Column.php

示例14: _getElementHtml

 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $websites = Mage::helper('auspost')->getAllWebsites();
     if (!empty($websites)) {
         $website_id = $this->getRequest()->getParam('website');
         $website = Mage::getModel('core/website')->load($website_id, 'code');
         if ($website && in_array($website->getWebsiteId(), $websites)) {
             $html = $element->getElementHtml();
         } elseif (!$website_id) {
             $html = $element->getElementHtml();
         } else {
             $html = '<strong class="required">' . $this->__('Please buy additional domains') . '</strong>';
         }
     } else {
         $websitecode = Mage::app()->getRequest()->getParam('website');
         $websiteId = Mage::getModel('core/store')->load($websitecode)->getWebsiteId;
         $isenabled = Mage::app()->getWebsite($websiteId)->getConfig('auspost/activation/key');
         if ($isenabled != null || $isenabled != '') {
             $html = '<strong class="required">' . $this->__(' Please select a website') . '</strong>';
             $modulestatus = new Mage_Core_Model_Config();
             $modulestatus->saveConfig('carriers/auspost/active', 0);
         } else {
             $html = '<strong class="required">' . $this->__('Please enter a valid key') . '</strong>';
         }
     }
     return $html;
 }
開發者ID:bogdy2p,項目名稱:apstufgnto,代碼行數:27,代碼來源:Enabledisable.php

示例15: render

 /**
  * Enter description here...
  *
  * @param Varien_Data_Form_Element_Abstract $element
  * @return string
  */
 public function render(Varien_Data_Form_Element_Abstract $element)
 {
     $fieldConfig = $element->getFieldConfig();
     $clonePath = (string) $fieldConfig->clone_path;
     $clonePaths = explode('/', $clonePath);
     // Prepare value for cloned element
     $name = 'groups[' . $clonePaths[1] . '][fields][' . $clonePaths[2] . '][value]';
     if (isset($this->_affiliateConfigData[$clonePath])) {
         $data = $this->_affiliateConfigData[$clonePath];
         $inherit = false;
     } else {
         $data = $this->_affiliateConfigRoot->descend($clonePath);
         $inherit = true;
     }
     if ($fieldConfig->backend_model) {
         $model = Mage::getModel((string) $fieldConfig->backend_model);
         if (!$model instanceof Mage_Core_Model_Config_Data) {
             Mage::throwException('Invalid config field backend model: ' . (string) $fieldConfig->backend_model);
         }
         $model->setPath($clonePath)->setValue($data)->afterLoad();
         $data = $model->getValue();
     }
     $element->setName($name)->setValue($data)->setInherit($inherit);
     // Render Element to HTML
     $html = parent::render($element);
     // Prepare Javascript for cloned element
     $cloneId = $element->getHtmlId();
     $origId = implode('_', $clonePaths);
     $html .= "<script type='text/javascript'>\r\nEvent.observe(window, 'load', function() {\r\n    \$('{$cloneId}').observe('change', function(){\r\n        Form.Element.setValue(\$('{$origId}'), Form.Element.getValue(\$('{$cloneId}')));\r\n    });\r\n    \$('{$origId}').observe('change', function(){\r\n        Form.Element.setValue(\$('{$cloneId}'), Form.Element.getValue(\$('{$origId}')));\r\n    });";
     if ($element->getCanUseWebsiteValue() || $element->getCanUseDefaultValue()) {
         $html .= "\r\n    \$('{$cloneId}_inherit').observe('click', function(){\r\n        var el = \$('{$origId}_inherit');\r\n        el.checked = \$('{$cloneId}_inherit').checked;\r\n        toggleValueElements(el, Element.previous(el.parentNode));\r\n    });\r\n    \$('{$origId}_inherit').observe('click', function(){\r\n        var el = \$('{$cloneId}_inherit');\r\n        el.checked = \$('{$origId}_inherit').checked;\r\n        toggleValueElements(el, Element.previous(el.parentNode));\r\n    });";
     }
     $html .= "\r\n});\r\n</script>";
     return $html;
 }
開發者ID:billadams,項目名稱:forever-frame,代碼行數:41,代碼來源:Clone.php


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