• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Mage_Adminhtml_Block_System_Config_Form_Field类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Mage_Adminhtml_Block_System_Config_Form_Field的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Adminhtml_Block_System_Config_Form_Field类的具体用法?PHP Mage_Adminhtml_Block_System_Config_Form_Field怎么用?PHP Mage_Adminhtml_Block_System_Config_Form_Field使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Mage_Adminhtml_Block_System_Config_Form_Field类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: _getElementHtml

 /**
  * Override for disabling support information until API token is set
  *
  * @param Varien_Data_Form_Element_Abstract $element
  *
  * @return string
  */
 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     if (!Mage::helper('bronto_verify/apitoken')->getStatus()) {
         $element->setDisabled('disabled');
     }
     return parent::_getElementHtml($element);
 }
开发者ID:xiaoguizhidao,项目名称:blingjewelry-prod,代码行数:14,代码来源:Support.php


示例2: _getElementHtml

    /**
     * Override field method to add js
     *
     * @param Varien_Data_Form_Element_Abstract $element
     * @return String
     */
    protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
    {
        // Get the default HTML for this option
        $html = parent::_getElementHtml($element);
        if (!Mage::registry('mColorPicker')) {
            $html .= '
                <script type="text/javascript">
					jQuery.fn.mColorPicker.init.replace = false;
					jQuery.fn.mColorPicker.init.enhancedSwatches = false;
					jQuery.fn.mColorPicker.init.allowTransparency = true;
					jQuery.fn.mColorPicker.init.showLogo = false;
					jQuery.fn.mColorPicker.defaults.imageFolder = "' . $this->getJsUrl('shopshark/mColorPicker/') . '";
                </script>
                ';
            Mage::register('mColorPicker', 1);
        }
        $html .= '
        <script type="text/javascript">
			jQuery(function($){
				$("#' . $element->getHtmlId() . '").width("200px").attr("data-hex", true).mColorPicker();
			});
        </script>
        ';
        return $html;
    }
开发者ID:xiaoguizhidao,项目名称:storebaby.it,代码行数:31,代码来源:Color.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: toggleDisabled

 public function toggleDisabled($element)
 {
     if (!$element->getValue() || $element->getValue() != 1) {
         $element->getForm()->getElement($this->_getSplitPaymentElementId($element))->setDisabled('disabled');
     }
     return parent::getHtml();
 }
开发者ID:hipay,项目名称:hipay-fullservice-sdk-magento1,代码行数:7,代码来源:Allowsplitpayment.php


示例5: __construct

 public function __construct()
 {
     parent::__construct();
     if (!$this->getTemplate()) {
         $this->setTemplate('udtiercom/system/form_field/category_rates_config.phtml');
     }
 }
开发者ID:xiaoguizhidao,项目名称:magento,代码行数:7,代码来源:Rates.php


示例6: _getElementHtml

 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $time = $element->getHtmlId();
     // Get the default HTML for this option
     $html = parent::_getElementHtml($element);
     return $html;
 }
开发者ID:sshegde123,项目名称:wmp8,代码行数:7,代码来源:Textarea.php


示例7: _getElementHtml

 /**
  * Override method to output our custom HTML with JavaScript
  *
  * @param Varien_Data_Form_Element_Abstract $element
  *
  * @return String
  */
 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $_html = array();
     $element->setData('after_element_html', "\n            <span id=\"classpath-loadingmask\" style=\"display: none; width: 100px;\">\n                <span class=\"loader\" id=\"classpath-loading-mask-loader\" style=\"background: url(" . $this->getSkinUrl('bronto/images/ajax-loader-tr.gif') . ") no-repeat 0 50%; background-size: 20px; padding:3px 0 3px 25px;\">" . $this->__(' Searching For Class Path...') . "</span>\n                <span id=\"classpath-loading-mask\"></span>\n            </span>\n\n            <script>\n            //<![CDATA[\n                Event.observe(window, 'load', function() {\n                    var newTr = '<tr id=\"bronto_verify_advanced_classpath_results\"><td class=\"classpath_results\" colspan=\"4\"><div id=\"bronto-classpath-results\"></div></td></tr>';\n                    \$('" . $this->_getRowElementId($element) . "').insert({after: newTr});\n                });\n                function searchClasspath() {\n                    var reloadUrl  = '{$this->getUrl('*/advanced/ajaxclasspath')}';\n                    var statusText = \$('bronto-classpath-results');\n\n                    var searchText = \$('bronto_verify_advanced_classpath_search').value;\n                    var classType  = \$('classpath-type').value;\n\n                    statusText.innerHTML = \$('classpath-loadingmask').innerHTML;\n\n                    new Ajax.Request(reloadUrl, {\n                        method: 'post',\n                        parameters: {class: searchText, type: classType},\n                        onComplete: function(transport) {\n                            Element.hide('classpath-loadingmask');\n                            statusText.innerHTML = transport.responseText;\n                        }\n                    });\n\n                    return false;\n                }\n            //]]>\n            </script>\n        ");
     // Add Class Type Selector to Input
     $classTypeHtml = '<select id="classpath-type"><option value="model">Model (Default)</option><option value="helper">Helper</option><option value="block">Block</option><option value="controller">Controller</option></select>';
     // Add Search Button
     $button = $this->getLayout()->createBlock('bronto_verify/adminhtml_widget_button_classpath')->toHtml();
     $buttonHtml = "<p class=\"form-buttons\" id=\"events-button\" style=\"float:none;\">{$button}</p>";
     // Add Button to Html
     $_html[] = $buttonHtml;
     // Show everything Else
     if (!empty($_html)) {
         $elementHtml = $element->getElementHtml();
         $elementHtml .= $classTypeHtml;
         if ($element->getComment()) {
             $elementHtml .= '<p class="note"><span>' . $element->getComment() . '</span></p>';
             $element->setComment(null);
         }
         $elementHtml .= '<div style="margin-top:10px">';
         $elementHtml .= implode('<br />', $_html);
         $elementHtml .= '</div>';
         return $elementHtml;
     }
     return parent::_getElementHtml($element);
 }
开发者ID:Rodrifer,项目名称:candyclub,代码行数:33,代码来源:Classpath.php


示例8: _getElementHtml

 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $element->setData('onchange', "apiValidation(this.form, this);");
     $url = Mage::helper('adminhtml')->getUrl('*/connector/ajaxvalidation');
     $element->setData('after_element_html', "\n            <script>\n                document.observe('dom:loaded', function(){\n                    apiValidation();\n\n                 });\n                function apiValidation(form, element) {\n                    var api_user       = \$('connector_transactional_emails_credentials_api_username');\n                    var api_password   = \$('connector_transactional_emails_credentials_api_password');\n                    var reloadurl  = '{$url}';\n                    var encoded = btoa(api_password.value);\n                    new Ajax.Request(reloadurl, {\n                        method: 'post',\n                        parameters: {'api_username' : api_user.value, 'api_password' : encoded},\n                        onComplete: function(transport) {\n                            Element.hide('loadingmask');\n                            if(transport.responseText == '\"Credentials Valid.\"'){\n                                api_user.setStyle({\n                                    fontWeight: 'bold',\n                                    color:  'green' ,\n                                    background: 'transparent url(\"" . $this->getSkinUrl('images/success_msg_icon.gif') . "\") no-repeat right center'\n                                })\n                            }else{\n                                api_user.setStyle({\n                                    fontWeight: 'bold',\n                                    color:  'red',\n                                    background: 'transparent url(\"" . $this->getSkinUrl('images/error_msg_icon.gif') . "\") no-repeat right center'\n                                });\n\n                            }\n                        }\n                    });\n\n                    return false;\n                }\n\n            </script>\n        ");
     return parent::_getElementHtml($element);
 }
开发者ID:vdimitrovv,项目名称:dotmailer-magento-extension,代码行数:7,代码来源:Emailapivalidate.php


示例9: _getElementHtml

 /**
  * Override field method to add js
  *
  * @param Varien_Data_Form_Element_Abstract $element
  * @return String
  */
 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     // Get the default HTML for this option
     $html = parent::_getElementHtml($element);
     $html .= '<script>jQuery(function(){ jQuery("#' . $element->getHtmlId() . '").attr("style", "width: 200px !important").attr("data-hex", true).mColorPicker({ imageFolder: "' . $this->getJsUrl('olegnax/mColorPicker/') . '" }); });</script>';
     return $html;
 }
开发者ID:bigtailbear14,项目名称:rosstheme,代码行数:13,代码来源:Color.php


示例10: _getElementHtml

 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $extra = '';
     if ($current_store = Mage::app()->getRequest()->getParam('store')) {
         $store = Mage::getModel('core/store')->load($current_store);
         $url = parse_url($store->getBaseUrl());
         $host = $url['host'];
         //$ok = Mage::getStoreConfig('j2tonecheckout/'.base64_decode("bW9kdWxlX3NlcmlhbA==").'/ok', $store->getId());
         /*$ok = Mage::getStoreConfig('rewardpoints/verser/ok', $store->getId());
           if ($ok === null){
               $extra = '<div style="color:red;">'.Mage::helper('rewardpoints')->__('Please insert / verify your serial for "%s" domain', $host).'</div>';
           } else if ($ok === "0"){
               $extra = '<div style="color:red;">'.Mage::helper('rewardpoints')->__('Serial is not valid for "%s" domain', $host).'</div>';
           } else if ($ok == "1"){
               $extra = '<div style="color:green;">'.Mage::helper('rewardpoints')->__('Serial is valid for "%s" domain', $host).'</div>';
           }*/
         $extra = '<div>' . Mage::helper('rewardpoints')->__("Serial defined for store domain '%s'", $host) . '</div>';
     } else {
         $websites = Mage::app()->getWebsites();
         $code = Mage::app()->getWebsite(true)->getDefaultGroup()->getDefaultStore()->getCode();
         $store = Mage::getModel('core/store')->load($code);
         $url = parse_url($store->getBaseUrl());
         $host = $url['host'];
         $extra = '<div>' . Mage::helper('rewardpoints')->__("Serial defined for store domain '%s'", $host) . '</div>';
     }
     //$checkbox_name = $element->getName();
     //$checkbox_name = str_replace("key", "key_validation", $checkbox_name);
     $html = $extra;
     //.'<input type="checkbox" name="'.$checkbox_name.'" id="revalidate" value="1" /> <label for="revalidate">'.Mage::helper('rewardpoints')->__('First time validation / Re-validate').'</label>';
     return parent::_getElementHtml($element) . $html;
 }
开发者ID:xiaoguizhidao,项目名称:devfashion,代码行数:31,代码来源:Serialtext.php


示例11: render

 /**
  * @param Varien_Data_Form_Element_Abstract $element
  *
  * @return string
  */
 public function render(Varien_Data_Form_Element_Abstract $element)
 {
     if (!extension_loaded('soap') || !extension_loaded('openssl') || !Mage::helper('bronto_common')->getApiToken()) {
         return null;
     }
     return parent::render($element);
 }
开发者ID:bevello,项目名称:bevello,代码行数:12,代码来源:Hidden.php


示例12: _getElementHtml

 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     // Get the default HTML for this option
     $output = parent::_getElementHtml($element);
     // return $output;
     return $this->_getUrl();
 }
开发者ID:xiaoguizhidao,项目名称:autotech_design,代码行数:7,代码来源:Image.php


示例13: _getElementHtml

 /**
  * Loading background on save.
  * @param Varien_Data_Form_Element_Abstract $element
  *
  * @return string
  */
 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     // Get the default HTML for this option
     $html = parent::_getElementHtml($element);
     $html .= sprintf('<div id="loadingmask" style="position: fixed;">
         <div class="loader" id="loading-mask-loader">
         <img src="%sskin/adminhtml/default/default/images/ajax-loader-tr.gif" alt="%s"/>%s', preg_replace('/index.php\\//', '', $this->getBaseUrl()), $this->__('Loading...'), $this->__('Loading...')) . '<div id="loading-mask"></div></div>';
     $jQuery = '<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" ></script>';
     $jQuery .= '<script type="text/javascript">
         jQuery.noConflict();
         jQuery(document).ready(function() {
             //hide the load image field
             jQuery("#row_connector_api_credentials_api_credentials_validator").hide();
             jQuery("#row_connector_sync_settings_sync_customer_schedule_validator").hide();
             var loadingmask = jQuery("#loadingmask");
             loadingmask.hide();
             loadingmask.css({top : "50\\%", left: "50\\%"});
             //var thisButton = jQuery("button");
             //console.log(thisButton);
             //jQuery("button").click(function(){
             //    jQuery("body").css({"background-color": "black", "opacity": "0.4"});
             //    jQuery("#row_connector_api_settings_api_credentials_validator").show();
             //    jQuery("#row_connector_sync_settings_sync_customer_schedule_validator").show();
             //    loadingmask.show();
             //    loadingmask.css({"display": "block", "opacity" : "1"});
             //})
         });
         </script>';
     $html .= $jQuery;
     return $html;
 }
开发者ID:vdimitrovv,项目名称:dotmailer-magento-extension,代码行数:37,代码来源:Waitingfield.php


示例14: render

 public function render(Varien_Data_Form_Element_Abstract $element)
 {
     $this->setData('scope', $element->getScope());
     // Remove the inheritance checkbox
     $element->unsCanUseWebsiteValue()->unsCanUseDefaultValue();
     return parent::render($element);
 }
开发者ID:mSupply,项目名称:runnable_test_repo,代码行数:7,代码来源:Label.php


示例15: _getElementHtml

    /**
     * Override method to output our custom image
     *
     * @param Varien_Data_Form_Element_Abstract $element
     * @return String
     */
    protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
    {
        // Get the default HTML for this option
        $html = parent::_getElementHtml($element);
        $html = '<div class="title"><h2>Click on element to remove it from the widget</h2></div><div class="title-2"><h2>Click on element to add it to widget</h2></div><div class="widget-holder"><div class="widget-content">';
        $value = $element->getValue();
        if ($values = $element->getValues()) {
            foreach ($values as $option) {
                $html .= $this->_optionToHtml($element, $option, $value);
            }
        }
        $html .= $element->getAfterElementHtml();
        $html .= '</div><div class="items-container">
			<div class="product_name-holder"><div class="product_name-sub"></div></div>
			<div class="rating_stars-holder"><div class="rating_stars-sub"></div></div>
			<div class="reviews">
				<div class="rating_cust_link-holder"><div class="rating_cust_link-sub"></div></div>
				<div class="rating_add_review_link-holder"><div class="rating_add_review_link-sub"></div></div>
			</div>
			<div class="add_to_cart-holder"><div class="add_to_cart-sub"></div></div>
			<div class="price"><div class="price-holder"><div class="price-sub"></div></div></div>
			<div class="wishlist-holder"><div class="wishlist-sub"></div></div>
			<div class="compare-holder"><div class="compare-sub"></div></div>
		</div></div>';
        return $html;
    }
开发者ID:victorkho,项目名称:telor,代码行数:32,代码来源:Widgetcontent.php


示例16: _prepareLayout

 protected function _prepareLayout()
 {
     parent::_prepareLayout();
     if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {
         $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
     }
 }
开发者ID:axovel,项目名称:exqzt,代码行数:7,代码来源:Confirmation.php


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


示例18: render

 public function render(Varien_Data_Form_Element_Abstract $element)
 {
     $element->setFormat(Varien_Date::DATE_INTERNAL_FORMAT);
     //or other format
     $element->setImage($this->getSkinUrl('images/grid-cal.gif'));
     return parent::render($element);
 }
开发者ID:rcclaudrey,项目名称:dev,代码行数:7,代码来源:Date.php


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


示例20: _getElementHtml

 /**
  * Override method to output our custom HTML with JavaScript
  *
  * @param Varien_Data_Form_Element_Abstract $element
  *
  * @return String
  */
 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     if (!extension_loaded('soap') || !extension_loaded('openssl')) {
         $element->setDisabled('disabled')->setValue(0);
     } else {
         // Get Config Link
         $configLink = Mage::helper('bronto_common')->getScopeUrl('/system_config/edit/section/bronto');
         if (!Mage::helper('bronto_verify/apitoken')->getStatus()) {
             if (trim($element->getLabel()) === 'Enable Module') {
                 $element->setDisabled('disabled')->setValue(0);
                 $link = '<a href="' . $configLink . '">Fix it Here</a>';
                 $element->setComment('<span style="color:red;font-weight: bold">A valid Bronto API key is required. ' . $link . '</span>');
             }
         } else {
             if (!Mage::helper('bronto_common')->isEnabled()) {
                 if (trim($element->getLabel()) === 'Enable Module') {
                     $element->setDisabled('disabled')->setValue(0);
                     $link = '<a href="' . $configLink . '">Enable It Here</a>';
                     $element->setComment('<span style="color:red;font-weight: bold">The Bronto Extension for Magento is not enabled. ' . $link . '</span>');
                 }
             } else {
                 if (!Mage::helper('bronto_common/support')->isRegistered()) {
                     if (trim($element->getLabel()) !== 'Enable Module' || !$element->getValue()) {
                         $link = '<a href="' . $configLink . '#bronto_support-head">Register Here</a>';
                         $element->setDisabled('disabled');
                         $element->setComment('<span style="color:red;font-weight:bold">Extension registration is required. ' . $link . '</span>');
                     }
                 }
             }
         }
     }
     return parent::_getElementHtml($element);
 }
开发者ID:bevello,项目名称:bevello,代码行数:40,代码来源:Field.php



注:本文中的Mage_Adminhtml_Block_System_Config_Form_Field类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap