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


PHP FormBuilder::AdminIcon方法代码示例

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


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

示例1: imageFormFields

 public function imageFormFields($opts = NULL)
 {
     if (is_array($opts)) {
         extract($opts);
     }
     $this->accelJS()->requireFile('jqueryConfirm');
     $this->accelJS()->requireFile('jquery.imgareaselect');
     //$this->accelJS()->requireFile('jquery-ui-1.7.1.custom.min');
     $this->accelJS()->requireFile('jquery.ui.all.js');
     // $this->accelJS()->requireFile('jquery-ui-sortable');
     $this->accelJS()->requireFile('jeditable');
     $imageLimit = $this->obj->imageCount() ? $this->obj->imageCount() : $this->obj->displayMaxImages();
     $jQueryReadyCode .= "\n                \$('.deleteImage').click(function(){\n\n                    \$(this).html('" . str_replace('\'', '\\\'', FormBuilder::AdminIcon('activeToggleLoader')) . "');\n\n                    var imageFileName = \$(this).attr('title');\n                    \$.ajax({\n                        url: '?ajax=true&adminLayout=empty&ado=imagemgrDeleteImage&fileName=' + imageFileName,\n                        success: function(data){\n                            if(\$('#' + 'image_edit_info_' + data).css('visible')){\n                                custom_field_next_index_gallery--;\n                            }\n                            \$('#' + 'image_edit_info_' + data).remove();\n                            \$('#' + 'cropperDiv_' + data).remove();\n                            \$('#img_' + data.replace(new RegExp('_', 'g'), '" . self::WEB_SAFE_DELIM . "')).hide('slow').remove();\n                        }\n                    });\n                });\n                \$('.deleteImage').confirm();\n\n                \$('.image-edit-link').click(function(){\n                    var myID = \$(this).attr('id').replace('edit_image_', '');\n                    var me = \$(this);\n\n                    var infoForm =\$('#image_edit_info_' + myID);\n                    if(infoForm.is(':visible')){\n                        infoForm.hide('fast', function(){ \$(this).html(''); });\n                    } else {\n                        \$(this).html('" . str_replace('\'', '\\\'', FormBuilder::AdminIcon('activeToggleLoader')) . "');\n                        infoForm.load('?ado=imagemgrEditForm&ajax=true&adminLayout=empty&imageID=' + myID, function(){\n                            \$(this).show();\n                            me.html('" . str_replace('\'', '\\\'', FormBuilder::AdminIcon('file_edit')) . "');\n                        });\n                    }\n\n                });\n\n\n                var cropperVisible = false;\n\n                \$('.photoCropperLink').click(function(){\n\n                    \$(this).html('" . str_replace('\'', '\\\'', FormBuilder::AdminIcon('activeToggleLoader')) . "');\n\n                    \$('#thumbnail').imgAreaSelect({ hide: true});\n\n                    var fileName = \$(this).attr('title');\n                    var fileID = \$(this).attr('id').replace('cropperLink_', '');\n\n                    // close all\n                    if(cropperVisible) {\n                        \$('.cropperDivs').hide('slow').html('');\n                        \$('#thumbnail').imgAreaSelect({ hide: true});\n                    }\n\n                    var me = \$(this);\n\n                    if(cropperVisible == fileID) {\n                        cropperVisible = false;\n                        me.html('" . str_replace('\'', '\\\'', FormBuilder::AdminIcon('crop')) . "');\n\n                    } else {\n                        \$('#cropperDiv_' + fileID).load('?ado=imagemgrCropperForm&ajax=true&adminLayout=empty&cropperForm=' + fileName, function(){\n                            me.html('" . str_replace('\'', '\\\'', FormBuilder::AdminIcon('crop')) . "');\n                        }).show('slow');\n                        cropperVisible = fileID;\n                    }\n                });\n\n                \$('#images_ul').sortable({\n                        update : function(){\n                                    \$.get('?ado=imagemgrReorderImage&ajax=true&adminLayout=empty&' + \$('#images_ul').sortable('serialize', {}));\n                                    var i = 0;\n                                    \$('.image-i').each(function(){\n                                        var h = (i == 0) ? '0' : i;\n                                        \$(this).html(h);\n                                        i++;\n                                    });\n                            }\n                        });\n\n                \$('li.sortable-image').hover(function(){\n                    \$(this).addClass('image-hover');\n                }, function(){\n                    \$(this).removeClass('image-hover');\n                });\n\n                \$('.image-caption').editable('?ado=imagemgrChangeCaption&adminLayout=empty&ajax=true', {\n                        type      : 'text',\n                        cancel    : 'Cancel',\n                        submit    : 'OK',\n                        indicator : 'Updating. . .',\n                        tooltip   : 'Double click to edit...',\n                        cssclass  : 'image-caption-popup',\n                        event      : 'dblclick'\n                });";
     $this->accelJS()->ready($jQueryReadyCode);
     // images
     if ($maxImages = $this->obj->maxImages()) {
         $form .= "<h3>Images</h3>";
         if ($instructions) {
             $form .= $instructions;
         }
         $i = 0;
         $alreadyHasImage = $this->obj->getImage();
         if ($alreadyHasImage) {
             $form .= "<ul id='images_ul'>";
         }
         for ($i; $i < $maxImages && $i < $imageLimit; $i++) {
             $image = $this->obj->getImage($i);
             if (!$image) {
                 $image = new Image();
             }
             // smart front end/ back end
             $imageFormMethod = $this->contentID ? 'frontForm' : 'form';
             if ($alreadyHasImage) {
                 $form .= "<li id='img_" . str_replace("_", self::WEB_SAFE_DELIM, $image->getID()) . "' class='sortable-image'>";
             }
             $form .= $image->{$imageFormMethod}();
             if ($alreadyHasImage) {
                 $form .= "</li>";
             }
         }
         if ($alreadyHasImage) {
             $form .= "</ul>";
         }
         $form .= "<div class='clear'></div>";
         if ($i < $maxImages) {
             $form .= $this->addAJAXLink(0, $maxImages - 1, 'image');
         }
     }
     return $form;
 }
开发者ID:netacceleration,项目名称:accelpress,代码行数:50,代码来源:FormBuilder.php


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