当前位置: 首页>>代码示例>>PHP>>正文


PHP Mage_Adminhtml_Block_Widget_Form::_afterToHtml方法代码示例

本文整理汇总了PHP中Mage_Adminhtml_Block_Widget_Form::_afterToHtml方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Adminhtml_Block_Widget_Form::_afterToHtml方法的具体用法?PHP Mage_Adminhtml_Block_Widget_Form::_afterToHtml怎么用?PHP Mage_Adminhtml_Block_Widget_Form::_afterToHtml使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mage_Adminhtml_Block_Widget_Form的用法示例。


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

示例1: _afterToHtml

    protected function _afterToHtml($html)
    {
        $html .= '
<script type="text/javascript">

    getElementsByClass = function(classList, node) {
        var node = node || document;
        if(node.getElementsByClassName) {
            return node.getElementsByClassName(classList);
        } else {
            var nodes = node.getElementsByTagName("*"),
            nodesLength = nodes.length,
            classes = classList.split(/\\s+/),
            classesLength = classes.length,
            result = [], i,j;
            for(i = 0; i < nodesLength; i++) {
                for(j = 0; j < classesLength; j++)  {
                    if(nodes[i].className.search("\\\\b" + classes[j] + "\\\\b") != -1) {
                        result.push(nodes[i]);
                        break;
                    }
                }
            }
            return result;
        }
    }

    var fieldsets = getElementsByClass("magicslideshowFieldset");
    var header = null;
    var buttons = null;
    var magicslideshowFieldsetId = "";
    for(var i = 0, l = fieldsets.length; i < l; i++) {
        header = fieldsets[i].previousSibling;
        while(header.nodeType!=1) {
            header = header.previousSibling;
        }
        header.style.cursor = "pointer";
        buttons = getElementsByClass("form-buttons", header);
        buttons[0].innerHTML = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
        buttons[0].className += " fieldsetOpen";
        header.onclick = function() {
            var buttons = getElementsByClass("form-buttons", this);
            var fieldset = this.nextSibling;
            while(fieldset.nodeType!=1) {
                fieldset = fieldset.nextSibling;
            }
            if(buttons[0].className.match(/\\bfieldsetOpen\\b/)) {
                buttons[0].className = buttons[0].className.replace(/\\bfieldsetOpen\\b/, "fieldsetClose");
                fieldset.style.display = "none";
                this.style.marginBottom = "5px";
            } else {
                buttons[0].className = buttons[0].className.replace(/\\bfieldsetClose\\b/, "fieldsetOpen");
                fieldset.style.display = "block";
                this.style.marginBottom = "0px";
            }
            return false;
        }
        var id = fieldsets[i].id.replace(/_group_fieldset_\\d+/g, "");
        if(magicslideshowFieldsetId != id) {
            magicslideshowFieldsetId = id;
        } else {
            header.click();
        }
    }


</script>
';
        return parent::_afterToHtml($html);
    }
开发者ID:CE-Webmaster,项目名称:CE-Hub,代码行数:70,代码来源:Form.php

示例2: _afterToHtml

 /**
  * Append dependence block at then end of form block
  *
  *
  */
 protected function _afterToHtml($html)
 {
     if ($this->_getDependence()) {
         $html .= $this->_getDependence()->toHtml();
     }
     $html = parent::_afterToHtml($html);
     return $html;
 }
开发者ID:monkviper,项目名称:magento-lite,代码行数:13,代码来源:Form.php

示例3: _afterToHtml

    protected function _afterToHtml($html)
    {
        $html .= '
<script type="text/javascript">

    getElementsByClass = function(classList, node) {
        var node = node || document;
        if(node.getElementsByClassName) {
            return node.getElementsByClassName(classList);
        } else {
            var nodes = node.getElementsByTagName("*"),
            nodesLength = nodes.length,
            classes = classList.split(/\\s+/),
            classesLength = classes.length,
            result = [], i,j;
            for(i = 0; i < nodesLength; i++) {
                for(j = 0; j < classesLength; j++)  {
                    if(nodes[i].className.search("\\\\b" + classes[j] + "\\\\b") != -1) {
                        result.push(nodes[i]);
                        break;
                    }
                }
            }
            return result;
        }
    }

    var fieldsets = getElementsByClass("magiczoomplusFieldset");
    var header = null;
    var buttons = null;
    var magiczoomplusFieldsetId = "";
    for(var i = 0, l = fieldsets.length; i < l; i++) {
        header = fieldsets[i].previousSibling;
        while(header.nodeType!=1) {
            header = header.previousSibling;
        }
        header.style.cursor = "pointer";
        buttons = getElementsByClass("form-buttons", header);
        buttons[0].innerHTML = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
        buttons[0].className += " fieldsetOpen";
        header.onclick = function() {
            var buttons = getElementsByClass("form-buttons", this);
            var fieldset = this.nextSibling;
            while(fieldset.nodeType!=1) {
                fieldset = fieldset.nextSibling;
            }
            if(buttons[0].className.match(/\\bfieldsetOpen\\b/)) {
                buttons[0].className = buttons[0].className.replace(/\\bfieldsetOpen\\b/, "fieldsetClose");
                fieldset.style.display = "none";
                this.style.marginBottom = "5px";
            } else {
                buttons[0].className = buttons[0].className.replace(/\\bfieldsetClose\\b/, "fieldsetOpen");
                fieldset.style.display = "block";
                this.style.marginBottom = "0px";
            }
            return false;
        }
        var id = fieldsets[i].id.replace(/_group_fieldset_\\d+/g, "");
        if(magiczoomplusFieldsetId != id) {
            magiczoomplusFieldsetId = id;
        } else {
            header.click();
        }
    }
    initOptionsValidation("magiczoomplus[product][template]", "magiczoomplus[product][magicscroll]");
    var magicscrollIcon = document.createElement("img");
    magicscrollIcon.id = "magicscroll_icon";
    magicscrollIcon.src = "' . $this->getSkinUrl("magiczoomplus/magicscroll.png") . '";
    document.getElementById("product-magicscrollYes").parentNode.insertBefore(magicscrollIcon, document.getElementById("product-magicscrollYes"));


</script>
';
        return parent::_afterToHtml($html);
    }
开发者ID:buttasg,项目名称:cowgirlk,代码行数:75,代码来源:Form.php

示例4: _afterToHtml

 protected function _afterToHtml($html)
 {
     $html .= '<script type="text/javascript">addForm = new varienForm(\'add_form\', \'\');</script>';
     return parent::_afterToHtml($html);
 }
开发者ID:buttasg,项目名称:cowgirlk,代码行数:5,代码来源:Form.php

示例5: _afterToHtml

 protected function _afterToHtml($html)
 {
     $html = str_replace('__*__', ' <span class="required">*</span>', $html);
     return parent::_afterToHtml($html);
 }
开发者ID:finelinePG,项目名称:finelink-dev,代码行数:5,代码来源:Additional.php


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