PHP8
[Pman.BAdmin] / Pman.Dialog.BAdminImageManager.bjs
index 541239b..890ca82 100644 (file)
@@ -8,6 +8,7 @@
  "strings" : {
   "ef797d5638c2e1c6b6225b2247541ea5" : "Upload Image or File:",
   "d9787032e54a7facd5c7b1db2ae61c7b" : "Image Manager",
+  "53ab4599d0106e32d015649175a70d7b" : "<i class=\"fa fa-filter\"></i> Filter",
   "37c1097cf82226d511586ecd99ed97cf" : "search for image",
   "cdb6b6bab1fd18b9dbfe3fb84a5d34ae" : "<i class=\"fa fa-search\"></i>",
   "5350277f16d9998c57fa7e1d17be2a76" : "<i class=\"fa fa-upload\"></i> Upload Image",
   "708ea0e601087e73c4764d5086e3ea3c" : "File Name:",
   "e0a53da57dd79cca5d3b6a7c42e463ef" : "File Type:",
   "3f986fa4066f6bded1376eb69de18da2" : "File Size:",
+  "179d4ab94c43ccb7cd6d2b3d82c7fe1f" : "Show images for this email",
   "d3d2e617335f08df83599665eef8a418" : "Close",
   "84378f54966381befd040dafbdc221d6" : "<i class=\"fa fa-plus\"></i> Add into the email",
   "361bacb1a72a350ee34e2f31a6a91dab" : "Alignment:",
-  "f48f7c7bccb5e29c83d87984c49ad8d4" : "Show image for this email",
+  "2cd3a1900dd0060540b418b2a60f6eec" : "Show all images",
   "ed807858fcb68abdd180481f1fcba5c5" : "<i class=\"fa fa-trash\"></i> Delete",
   "031fa343a28d221a25d2bcd942437174" : "Alternate Text:",
   "48ccf48dcf2218a413ce473262f21a0c" : "Width: ",
     "resize" : "function (_self)\n{\n    if (_this.dialog && _this.container && _this.toolbar) {\n        \n        _this.document_container.el.setHeight(\n            _this.dialog.bodyEl.getHeight() -\n            _this.dialog.headerEl.getHeight() -\n            _this.toolbar.el.dom.offsetHeight -\n            _this.dialog.footerEl.getHeight()\n        );\n        \n    }\n}"
    },
    "String cls" : "modal-body-enable-overflow-y pman-badmin-image-manager",
-   "string haveProgress" : false,
-   "xtype" : "Modal",
    "Boolean fitwindow" : true,
-   "string uploadComplete" : false,
-   "$ string uploadProgress" : "function()\n{\n    Roo.log('uploadProgress');\n    \n    var dlg = this;\n    if (!dlg.haveProgress) {\n        Roo.MessageBox.progress(\"Uploading\", \"Uploading\");\n    }\n    \n    if (dlg.haveProgress == 2) {\n        // it's been closed elsewhere..\n        return;\n    }\n    if (dlg.uploadComplete) {\n        Roo.MessageBox.hide();\n        return;\n    }\n    \n    dlg.haveProgress = 1;\n    \n    var uid = _this.form_upload.findField('UPLOAD_IDENTIFIER').getValue();\n    \n    new Pman.Request({\n        url : baseURL + '/Core/UploadProgress.php',\n        params: {\n            id : uid\n            \n        },\n        method: 'GET',\n        success : function(res){\n            var data = res.data;\n            if (dlg.haveProgress == 2) {\n                return;\n            }\n            \n            if (dlg.uploadComplete) {\n                Roo.MessageBox.hide();\n                return;\n            }\n                \n            if (data){\n                Roo.MessageBox.updateProgress(data.bytes_uploaded/data.bytes_total,\n                    Math.floor((data.bytes_total - data.bytes_uploaded)/1000) + 'k remaining'\n                );\n            } else {\n                Roo.MessageBox.updateProgress(1,\n                    \"Upload Complete - processing\"\n                );\n                return;\n            }\n            dlg.uploadProgress.defer(2000,dlg);\n        },\n        failure: function(data) {\n        }\n    })\n    \n}\n",
+   "xtype" : "Modal",
    "$ xns" : "Roo.bootstrap",
    "String title" : "Image Manager",
    "items" : [
      "$ xns" : "Roo.bootstrap",
      "items" : [
       {
+       "listeners" : {
+        "render" : "function (_self)\n{\n    _this.masonryBlock = this;\n}"
+       },
+       "Number md" : 12,
        "xtype" : "Column",
        "$ xns" : "Roo.bootstrap",
-       "Number sm" : 8,
        "items" : [
         {
          "listeners" : {
-          "actionfailed" : "function (_self, action)\n{\n    _this.dialog.uploadComplete = true;\n    \n     _this.dialog.haveProgress = 2;\n     \n    if (action.type == 'submit') {\n        Roo.log(\"Upload error\");\n        Roo.log(action);\n        \n        try {\n            \n            Roo.MessageBox.alert(\"Error\", action.result.errorMsg.split(/\\n/).join('<BR/>'));\n            \n        } catch(e) {\n            \n            Roo.MessageBox.alert(\"Error\", \"Saving failed = fix errors and try again\");\n        }\n        return;\n    }\n    \n    Roo.MessageBox.alert(\"Error\", \"Error loading details\"); \n}",
-          "actioncomplete" : "function(_self,action)\n{\n    _this.dialog.uploadComplete = true;\n    \n    _this.dialog.haveProgress = 2;\n    \n    Roo.MessageBox.hide();\n     \n    if (action.type == 'setdata') { \n        \n        this.url = _this.data._url ? baseURL + _this.data._url : baseURL + '/Roo/Images.php';\n        \n        this.el.dom.action = this.url;\n        \n        if (typeof(_this.data.timeout) != 'undefined') {\n            this.timeout = _this.data.timeout;\n        }\n        \n        this.findField('UPLOAD_IDENTIFIER').setValue(\n            (new Date() * 1) + '' + Math.random());\n        \n        _this.masonry.load();\n        \n        return;\n    }\n     \n   \n    if (action.type == 'load') {\n        \n        _this.data = action.result.data;\n        \n        return;\n    }\n    \n    \n    if (action.type == 'submit') { // only submitted here if we are \n        _this.detail_form.doAction('submit', {\n            params: {\n                ts : Math.random()\n            }\n        });\n        Roo.log(\"Upload success\");\n        Roo.log(action);\n        if (_this.callback) {\n            _this.callback.call(this, action.result.data, action.result.extra);\n        }\n       \n        _this.masonry.load();\n        \n        return; \n    }\n \n\n    \n}\n",
-          "render" : "function (_self)\n{\n    _this.form_upload = this;\n    \n}"
+          "actionfailed" : "function (_self, action)\n{\n    if (action.type == 'submit') {\n        Roo.log(\"Upload error\");\n        Roo.log(action);\n        \n        try {\n            \n            Roo.MessageBox.alert(\"Error\", action.result.errorMsg.split(/\\n/).join('<BR/>'));\n            \n        } catch(e) {\n            \n            Roo.MessageBox.alert(\"Error\", \"Saving failed = fix errors and try again\");\n        }\n        return;\n    }\n    \n    Roo.MessageBox.alert(\"Error\", \"Error loading details\"); \n}",
+          "actioncomplete" : "function(_self,action)\n{\n    if (action.type == 'setdata') { \n        \n        _this.showType = 'public';\n        \n        this.url = _this.data._url ? baseURL + _this.data._url : baseURL + '/Roo/Images.php';\n        \n        this.el.dom.action = this.url;\n        \n        if (typeof(_this.data.timeout) != 'undefined') {\n            this.timeout = _this.data.timeout;\n        }\n        \n        this.findField('UPLOAD_IDENTIFIER').setValue(\n            (new Date() * 1) + '' + Math.random());\n        \n        _this.masonry.load();\n        \n        return;\n    }\n     \n   \n    if (action.type == 'load') {\n        \n        _this.data = action.result.data;\n        \n        return;\n    }\n    \n    \n    if (action.type == 'submit') { // only submitted here if we are \n        \n        _this.masonry.load();\n        \n        return; \n    }\n \n\n    \n}\n",
+          "render" : "function (_self)\n{\n    _this.form = this;\n    \n}"
          },
+         "style" : "display: none;",
          "xtype" : "Form",
          "Number timeout" : 300,
-         "style" : "display: none;",
          "$ xns" : "Roo.bootstrap",
          "Boolean fileUpload" : true,
          "String method" : "POST",
@@ -91,7 +93,7 @@
          "items" : [
           {
            "listeners" : {
-            "render" : "function (_self)\n{\n    _this.uploadDL = this;\n    \n    _this.uploadDL.inputEl().on(\"change\",function(){\n    \n        var id =  _this.current_obj_btn.isActive() ? _this.data.onid : \"\";\n        _this.form_upload.doAction('submit', {\n            params: {\n                onid: id,\n                ontable: 'core_email',\n                ts : Math.random()\n            }\n        });\n        Roo.log(\"Upload success\");\n        \n        \n        //console.log(_this.current_obj_btn.getEl().dom.className);\n        _this.dialog.uploadProgress.defer(1000, _this.dialog);\n    });\n    \n    \n}"
+            "render" : "function (_self)\n{\n    _this.uploadDL = this;\n    \n    _this.uploadDL.inputEl().on(\"change\",function(){\n        \n        _this.form.findField('onid').setValue((_this.showType == 'private') ? _this.data.onid : 0);\n        _this.form.doAction('submit');\n    });\n    \n    \n}"
            },
            "String name" : "imageUpload",
            "xtype" : "Input",
          "listeners" : {
           "render" : "function (_self)\n{\n    _this.container = this;\n    \n}"
          },
+         "String cls" : "col-md-12",
          "xtype" : "Container",
          "$ xns" : "Roo.bootstrap",
          "items" : [
              "Number md" : 8,
              "xtype" : "Column",
              "$ xns" : "Roo.bootstrap",
+             "Number sm" : 12,
              "items" : [
               {
-               "listeners" : {
-                "toggle" : "function (b, e, pressed)\n{\n    _this.showTypeBtn.setText(!pressed ? 'Show all images' : 'Show image for this email');\n    \n    _this.masonry.load();\n}",
-                "render" : "function (_self)\n{\n    _this.showTypeBtn = this;\n}"
-               },
-               "bool pressed" : false,
                "xtype" : "Button",
                "$ xns" : "Roo.bootstrap",
-               "String html" : "Show image for this email",
-               "String style" : "float:left;"
+               "String html" : "<i class=\"fa fa-filter\"></i> Filter",
+               "items" : [
+                {
+                 "xtype" : "Menu",
+                 "$ xns" : "Roo.bootstrap",
+                 "* prop" : "menu",
+                 "items" : [
+                  {
+                   "listeners" : {
+                    "click" : "function (_self, e)\n{\n    _this.showType = 'private';\n    \n    _this.masonry.load();\n}"
+                   },
+                   "Boolean preventDefault" : true,
+                   "xtype" : "MenuItem",
+                   "$ xns" : "Roo.bootstrap",
+                   "Boolean isContainer" : false,
+                   "String html" : "Show images for this email"
+                  },
+                  {
+                   "listeners" : {
+                    "click" : "function (_self, e)\n{\n    _this.showType = 'public';\n    \n    _this.masonry.load();\n}"
+                   },
+                   "Boolean preventDefault" : true,
+                   "xtype" : "MenuItem",
+                   "$ xns" : "Roo.bootstrap",
+                   "Boolean isContainer" : false,
+                   "String html" : "Show all images"
+                  }
+                 ]
+                }
+               ]
               },
               {
                "listeners" : {
                "xtype" : "Input",
                "string placeholder" : "search for image",
                "$ xns" : "Roo.bootstrap",
-               "String style" : "float:left; width: 300px; margin-left: 15px;",
+               "String style" : "width: 200px; margin-left: 15px;display: inline-block; margin-bottom: 0px; vertical-align: middle;",
                "items" : [
                 {
                  "listeners" : {
              "String cls" : "text-right",
              "xtype" : "Column",
              "$ xns" : "Roo.bootstrap",
+             "Number sm" : 12,
              "items" : [
               {
                "listeners" : {
                 "click" : "function (_self, e)\n{\n    var id = _this.data.onid;\n    \n    if(id*1 < 1){\n        Roo.MessageBox.alert('Error', 'Please save the email template first');\n        return;\n    }\n    \n    _this.uploadDL.inputEl().dom.click();\n}"
                },
+               "String size" : "sm",
                "xtype" : "Button",
                "$ xns" : "Roo.bootstrap",
                "String html" : "<i class=\"fa fa-upload\"></i> Upload Image",
               {
                "listeners" : {
                 "render" : "function (_self)\n{\n    _this.deleteBtn = this;\n    \n    this.hide();\n}",
-                "click" : "function (_self, e)\n{\n    if (_this.masonry.getSelected().length > 1) {\n        \n        Roo.bootstrap.MessageBox.alert('Cannot delete the images !','Please select one image only');\n        return;\n    }\n    \n    if (_this.masonry.getSelected().length < 1) {\n        \n        Roo.bootstrap.MessageBox.alert('Cannot delete any image !','Please select an image');\n        return;\n    }\n    \n    Roo.bootstrap.MessageBox.confirm(\"Confirm\", \"Are sure you want to delete this image?\", function (v){\n        if (v != 'yes') {\n            return;\n        }\n        \n        new Pman.Request({\n            url : baseURL + '/Roo/Images.php',\n            method: 'POST',\n            params : {\n                _delete : Roo.bootstrap.MasonryBrick.get(_this.masonry.getSelected()[0]).image_id\n            },\n            success : function()\n            {\n                _this.masonry.removeBrick(_this.masonry.getSelected()[0]);\n                _this.detail_form.reset();\n                _this.setting_form.reset();\n                _this.masonry.initial();\n            }\n        });\n    });\n}"
+                "click" : "function (_self, e)\n{\n    if (_this.masonry.getSelected().length > 1) {\n        Roo.bootstrap.MessageBox.alert('Cannot delete the images !','Please select one image only');\n        return;\n    }\n    \n    if (_this.masonry.getSelected().length < 1) {\n        Roo.bootstrap.MessageBox.alert('Cannot delete any image!', 'Please select an image');\n        return;\n    }\n    \n    Roo.bootstrap.MessageBox.confirm(\"Confirm\", \"Are sure you want to delete this image?\", function (v){\n        if (v != 'yes') {\n            return;\n        }\n        \n        new Pman.Request({\n            url : baseURL + '/Roo/Images.php',\n            method: 'POST',\n            params : {\n                _delete : Roo.bootstrap.MasonryBrick.get(_this.masonry.getSelected()[0]).imageObj.id\n            },\n            success : function()\n            {\n//                _this.masonry.removeBrick(_this.masonry.getSelected()[0]);\n                _this.masonry.load();\n            }\n        });\n    });\n}"
                },
+               "String size" : "sm",
                "String weight" : "default",
                "xtype" : "Button",
                "$ xns" : "Roo.bootstrap",
                 "render" : "function (_self)\n{\n    _this.masonry = this;\n    \n}"
                },
                "Boolean isLayoutInstant" : false,
-               "| function load" : "function() \n{\n    _this.setting_form.reset();\n    _this.detail_form.reset();\n    \n    _this.setting_form.hide();\n    _this.detail_form.hide();\n    \n    _this.masonry.clearAll();\n    \n    new Pman.Request({\n        url: baseURL + '/Roo/Images',\n        method: 'GET',\n        params: {\n            ontable : 'core_email',\n            onid : _this.showTypeBtn.isActive() ? _this.data.onid : 0,\n            'search[filename]' : _this.searchBox.getValue()\n        },\n        success: function(ret) {\n            \n            if(!ret.data.length){\n                return;\n            }\n            \n            Roo.each(ret.data, function(r){\n                \n                _this.masonry.addBrick({\n                    size: 'md',\n                    boxWidth: 150,\n                    cls: 'coba-image-mgmt-masonry-brick',\n                    active: false,\n                    activeClass: 'active',\n                    preventDefault: true,\n                    bgimage : baseURL + '/Images/' + r.id + '/' + r.filename,\n                    imageObj: r,\n                    listeners : {\n                        click : function (_self)\n                        {\n                            _this.setting_form.reset();\n                            _this.detail_form.reset();\n                            \n                            _this.setting_form.hide();\n                            _this.detail_form.hide();\n                                \n                            if(this.isSelected()){\n                                _this.setting_form.show();\n                                _this.detail_form.show();\n                                \n                                _this.detail_form.setValues(_self.imageObj);\n                                _this.setting_form.setValues(_self.imageObj);\n                                \n                                _this.setting_form.findField('align').setValue(\"left\");\n                                _this.thumb.setSrc(baseURL + '/Images/' + _self.imageObj.id + '/' + _self.imageObj.filename);\n                            }\n                            /*\n                            new Pman.Request({\n                                url: baseURL + '/Roo/Images.php',\n                                method : 'GET',\n                                params : {\n                                    id: this.image_id\n                                }, \n                                success : function(res) {\n                                    Roo.log(res.data[0]);\n                                    _this.detail_form.setValues(res.data[0]);\n                                    _this.setting_form.setValues(res.data[0]);\n                                    _this.setting_form.findField('align').setValue(\"left\");\n                                    _this.setting_form.findField('alt').setValue(res.data[0].descript);\n                                    //_this.align.getEl().setValue(\"left\");\n                                    _this.tb.setSrc(baseURL + '/Images/' + res.data[0].id + '/' + res.data[0].filename);\n                                    \n                                }\n                            });\n                            */\n                        }\n                     }\n                })\n                \n            });\n            \n            _this.masonry.initial();\n            \n            /*\n             if(r.data) {\n                 for (var i = 0; i<r.data.length; i++) {\n                    \n                    _this.masonry.addBrick({\n                        image_filename: r.data[i].filename,\n                        image_id: r.data[i].id,\n                        size: 'md',\n                        boxWidth: 150,\n                        cls: 'coba-image-mgmt-masonry-brick',\n                        active: false,\n                        activeClass: 'active',\n                        preventDefault: true,\n                        bgimage : baseURL + '/Images/' + r.data[i].id + '/' + r.data[i].filename,\n                        listeners : {\n                            click : function (_self)\n                            {\n                                _this.setting_form.reset();\n                                \n                                if(this.isSelected()){\n                                    _this.setting_form.show();\n                                    _this.detail_form.show();\n                                }\n                                else{\n                                    _this.setting_form.hide();\n                                    _this.detail_form.hide();\n                                }\n                                \n                                new Pman.Request({\n                                    url: baseURL + '/Roo/Images.php',\n                                    method : 'GET',\n                                    params : {\n                                        id: this.image_id\n                                    }, \n                                    success : function(res) {\n                                        Roo.log(res.data[0]);\n                                        _this.detail_form.setValues(res.data[0]);\n                                        _this.setting_form.setValues(res.data[0]);\n                                        _this.setting_form.findField('align').setValue(\"left\");\n                                        _this.setting_form.findField('alt').setValue(res.data[0].descript);\n                                        //_this.align.getEl().setValue(\"left\");\n                                        _this.tb.setSrc(baseURL + '/Images/' + res.data[0].id + '/' + res.data[0].filename);\n                                        \n                                    }\n                                });\n                            }\n                         }\n                    })\n                 }\n                 _this.masonry.initial();\n             }\n             */\n         },\n         \n         failure: function(res) {\n             Roo.log('cannot read Coba/Roo/Images');\n         }\n     });\n}",
+               "| function load" : "function() \n{\n    _this.setting_form.reset();\n    _this.detail_form.reset();\n    \n    _this.setting_form.hide();\n    _this.detail_form.hide();\n    \n    _this.masonry.clearAll();\n    \n    var params = {\n        ontable : 'core_email',\n        'search[filename]' : _this.searchBox.getValue()\n    };\n    \n    if(_this.showType == 'private'){\n        params.onid = _this.data.onid;\n    }\n    \n    new Pman.Request({\n        url: baseURL + '/Roo/Images',\n        method: 'GET',\n        params: params,\n        success: function(ret) {\n            \n            if(!ret.data.length){\n                return;\n            }\n            \n            Roo.each(ret.data, function(r){\n                \n                _this.masonry.addBrick({\n                    size: 'md',\n                    boxWidth: 150,\n                    cls: 'coba-image-mgmt-masonry-brick',\n                    active: false,\n                    activeClass: 'active',\n                    preventDefault: true,\n                    bgimage : baseURL + '/Images/' + r.id + '/' + r.filename.replace('%', '-'),\n                    imageObj: r,\n                    listeners : {\n                        click : function (_self)\n                        {\n                            _this.setting_form.reset();\n                            _this.detail_form.reset();\n                            \n                            _this.setting_form.hide();\n                            _this.detail_form.hide();\n                            \n                            _this.deleteBtn.hide();\n                            \n                            _this.masonryBlock.el.removeClass(['col-md-12','col-md-8']).addClass('col-md-12');\n                            \n                            if(!this.isSelected()){\n                                return;\n                            }\n                            \n                            _this.masonryBlock.el.removeClass(['col-md-12','col-md-8']).addClass('col-md-8');\n                            \n                            if(_this.masonry.getSelected().length == 1){\n                                _this.deleteBtn.show();\n                            }\n                            \n                            new Pman.Request({\n                                url: baseURL + '/Roo/Images.php',\n                                method : 'GET',\n                                params : {\n                                    _id: _self.imageObj.id\n                                }, \n                                success : function(rr) {\n                                    \n                                    _this.setting_form.show();\n                                    _this.detail_form.show();\n                                    \n                                    _this.detail_form.setValues(rr.data);\n                                    _this.setting_form.setValues(rr.data);\n                                    \n                                    _this.setting_form.findField('align').setValue(\"left\");\n                                    \n                                    _self.imageObj = rr.data;\n                                }\n                            });\n                            \n                        }\n                     }\n                })\n                \n            });\n            \n            _this.masonry.initial();\n            \n         },\n         \n         failure: function(res) {\n             Roo.log('cannot read Coba/Roo/Images');\n         }\n     });\n}",
                "Number boxWidth" : 250,
                "xtype" : "LayoutMasonry",
                "$ xns" : "Roo.bootstrap",
        ]
       },
       {
+       "Number md" : 4,
        "xtype" : "Column",
        "$ xns" : "Roo.bootstrap",
-       "Number sm" : 4,
        "items" : [
         {
          "xtype" : "Row",
                "String style" : "width: 100%;",
                "items" : [
                 {
-                 "String name" : "descript",
-                 "xtype" : "Input",
-                 "string fieldLabel" : "Alternate Text:",
-                 "cls" : "row-style",
+                 "xtype" : "Row",
                  "$ xns" : "Roo.bootstrap",
-                 "Number labelWidth" : 4
+                 "items" : [
+                  {
+                   "Number md" : 12,
+                   "xtype" : "Column",
+                   "$ xns" : "Roo.bootstrap",
+                   "items" : [
+                    {
+                     "String name" : "descript",
+                     "xtype" : "Input",
+                     "string fieldLabel" : "Alternate Text:",
+                     "cls" : "row-style",
+                     "$ xns" : "Roo.bootstrap",
+                     "Number labelWidth" : 4
+                    }
+                   ]
+                  }
+                 ]
                 },
                 {
-                 "String name" : "height",
-                 "xtype" : "Input",
-                 "string fieldLabel" : "Height:",
-                 "cls" : "row-style",
+                 "xtype" : "Row",
                  "$ xns" : "Roo.bootstrap",
-                 "Number labelWidth" : 4
+                 "items" : [
+                  {
+                   "Number md" : 12,
+                   "xtype" : "Column",
+                   "$ xns" : "Roo.bootstrap",
+                   "String style" : "margin-top:15px;",
+                   "items" : [
+                    {
+                     "String name" : "height",
+                     "xtype" : "Input",
+                     "string fieldLabel" : "Height:",
+                     "cls" : "row-style",
+                     "$ xns" : "Roo.bootstrap",
+                     "Number labelWidth" : 4
+                    }
+                   ]
+                  }
+                 ]
                 },
                 {
-                 "String name" : "width",
-                 "xtype" : "Input",
-                 "string fieldLabel" : "Width: ",
-                 "cls" : "row-style",
+                 "xtype" : "Row",
                  "$ xns" : "Roo.bootstrap",
-                 "Number labelWidth" : 4
+                 "items" : [
+                  {
+                   "Number md" : 12,
+                   "xtype" : "Column",
+                   "$ xns" : "Roo.bootstrap",
+                   "String style" : "margin-top:15px;",
+                   "items" : [
+                    {
+                     "String name" : "width",
+                     "xtype" : "Input",
+                     "string fieldLabel" : "Width: ",
+                     "cls" : "row-style",
+                     "$ xns" : "Roo.bootstrap",
+                     "Number labelWidth" : 4
+                    }
+                   ]
+                  }
+                 ]
                 },
                 {
-                 "Boolean allowBlank" : true,
-                 "Boolean selectOnFocus" : true,
-                 "String name" : "align",
-                 "String mode" : "local",
-                 "String valueField" : "code",
-                 "xtype" : "ComboBox",
-                 "Boolean editable" : false,
-                 "String triggerAction" : "all",
-                 "string fieldLabel" : "Alignment:",
-                 "Boolean alwaysQuery" : true,
-                 "cls" : "row-style",
+                 "xtype" : "Row",
                  "$ xns" : "Roo.bootstrap",
-                 "Number labelWidth" : 4,
-                 "String displayField" : "value",
-                 "Boolean forceSelection" : true,
                  "items" : [
                   {
-                   "$ Array fields" : "['code', 'value']",
-                   "xtype" : "SimpleStore",
-                   "$ xns" : "Roo.data",
-                   "* prop" : "store",
-                   "| Array data" : "[\n    ['left', 'left'],\n    ['right', 'right'],\n    ['middle', 'middle'],\n    ['top', 'top'],\n    ['bottom', 'bottom']\n]"
+                   "Number md" : 12,
+                   "xtype" : "Column",
+                   "$ xns" : "Roo.bootstrap",
+                   "String style" : "margin-top:15px;",
+                   "items" : [
+                    {
+                     "Boolean allowBlank" : true,
+                     "Boolean selectOnFocus" : true,
+                     "String name" : "align",
+                     "String mode" : "local",
+                     "String valueField" : "code",
+                     "xtype" : "ComboBox",
+                     "Boolean editable" : false,
+                     "String triggerAction" : "all",
+                     "string fieldLabel" : "Alignment:",
+                     "Boolean alwaysQuery" : true,
+                     "cls" : "row-style",
+                     "$ xns" : "Roo.bootstrap",
+                     "Number labelWidth" : 4,
+                     "String displayField" : "value",
+                     "Boolean forceSelection" : true,
+                     "items" : [
+                      {
+                       "$ Array fields" : "['code', 'value']",
+                       "xtype" : "SimpleStore",
+                       "$ xns" : "Roo.data",
+                       "* prop" : "store",
+                       "| Array data" : "[\n    ['left', 'left'],\n    ['right', 'right'],\n    ['middle', 'middle'],\n    ['top', 'top'],\n    ['bottom', 'bottom']\n]"
+                      }
+                     ]
+                    }
+                   ]
                   }
                  ]
                 },
                 {
                  "xtype" : "Row",
-                 "cls" : "form-group-button_row",
                  "$ xns" : "Roo.bootstrap",
                  "items" : [
                   {
                    "Number md" : 12,
+                   "String cls" : "text-center",
                    "xtype" : "Column",
                    "$ xns" : "Roo.bootstrap",
-                   "String style" : "text-align: center",
+                   "String style" : "margin-top:15px;",
                    "items" : [
                     {
                      "listeners" : {
-                      "click" : "function (_self, e)\n{\n    var b = _this.masonry.getSelected();\n    \n    if (b.length < 1) {\n        \n        Roo.bootstrap.MessageBox.alert('Cannot add any image', 'Please select an image');\n        return;\n    }\n    \n    var brick = Roo.bootstrap.MasonryBrick.get(b[0]);\n    \n    _this.dialog.hide();\n\n    if(_this.callback){\n        \n        var data = Roo.apply(b[0].imageObj, {\n            align : _this.setting_form.findField('align').getValue()\n        });\n        \n        _this.callback.call(_this, data);\n        \n        /*\n        _this.callback({\n            id : brick.image_id,\n            filename : brick.image_filename,\n            height : _this.setting_form.findField('height').getValue(),\n            width : _this.setting_form.findField('width').getValue(),\n            alt : _this.setting_form.findField('alt').getValue(),\n            align : _this.setting_form.findField('align').getValue()\n        });\n        */\n    }\n}"
+                      "click" : "function (_self, e)\n{\n    var b = _this.masonry.getSelected();\n    \n    if (b.length < 1) {\n        \n        Roo.bootstrap.MessageBox.alert('Cannot add any image', 'Please select an image');\n        return;\n    }\n    \n    var brick = Roo.bootstrap.MasonryBrick.get(b[0]);\n    \n    _this.dialog.hide();\n\n    if(_this.callback){\n        \n        var data = {\n            id : brick.imageObj.id,\n            filename : brick.imageObj.filename,\n            width : _this.setting_form.findField('width').getValue(),\n            height : _this.setting_form.findField('height').getValue(),\n            descript : _this.setting_form.findField('descript').getValue(),\n            align : _this.setting_form.findField('align').getValue()\n        };\n        \n        _this.callback.call(_this, data);\n        \n    }\n}"
                      },
                      "String weight" : "default",
                      "xtype" : "Button",
                "$ string panel" : "'default'",
                "items" : [
                 {
-                 "listeners" : {
-                  "render" : "function (_self)\n{\n    _this.thumb = this;\n    \n    //any default image?\n    \n}"
-                 },
-                 "String border" : "thumbnail",
-                 "String alt" : "*Please select an image in the media library",
-                 "xtype" : "Img",
-                 "$ xns" : "Roo.bootstrap",
-                 "String style" : "width: 100%; margin-bottom:15px; display: none;"
-                },
-                {
-                 "String name" : "filename",
-                 "style" : "padding: 0;",
-                 "xtype" : "Input",
-                 "string fieldLabel" : "File Name:",
-                 "cls" : "row-style",
-                 "Boolean disabled" : true,
+                 "xtype" : "Row",
                  "$ xns" : "Roo.bootstrap",
-                 "Number labelWidth" : 4
+                 "items" : [
+                  {
+                   "Number md" : 12,
+                   "xtype" : "Column",
+                   "$ xns" : "Roo.bootstrap",
+                   "items" : [
+                    {
+                     "String name" : "filename",
+                     "style" : "padding: 0;",
+                     "xtype" : "Input",
+                     "string fieldLabel" : "File Name:",
+                     "cls" : "row-style",
+                     "Boolean disabled" : true,
+                     "$ xns" : "Roo.bootstrap",
+                     "Number labelWidth" : 4
+                    }
+                   ]
+                  }
+                 ]
                 },
                 {
-                 "String name" : "mimetype",
-                 "xtype" : "Input",
-                 "string fieldLabel" : "File Type:",
-                 "cls" : "row-style",
-                 "Boolean disabled" : true,
+                 "xtype" : "Row",
                  "$ xns" : "Roo.bootstrap",
-                 "Number labelWidth" : 4
+                 "items" : [
+                  {
+                   "Number md" : 12,
+                   "xtype" : "Column",
+                   "$ xns" : "Roo.bootstrap",
+                   "String style" : "margin-top:15px;",
+                   "items" : [
+                    {
+                     "String name" : "mimetype",
+                     "xtype" : "Input",
+                     "string fieldLabel" : "File Type:",
+                     "cls" : "row-style",
+                     "Boolean disabled" : true,
+                     "$ xns" : "Roo.bootstrap",
+                     "Number labelWidth" : 4
+                    }
+                   ]
+                  }
+                 ]
                 },
                 {
-                 "String name" : "filesize",
-                 "xtype" : "Input",
-                 "string fieldLabel" : "File Size:",
-                 "cls" : "row-style",
-                 "Boolean disabled" : true,
+                 "xtype" : "Row",
                  "$ xns" : "Roo.bootstrap",
-                 "Number labelWidth" : 4
+                 "items" : [
+                  {
+                   "Number md" : 12,
+                   "xtype" : "Column",
+                   "$ xns" : "Roo.bootstrap",
+                   "String style" : "margin-top:15px;",
+                   "items" : [
+                    {
+                     "String name" : "filesize",
+                     "xtype" : "Input",
+                     "string fieldLabel" : "File Size:",
+                     "cls" : "row-style",
+                     "Boolean disabled" : true,
+                     "$ xns" : "Roo.bootstrap",
+                     "Number labelWidth" : 4
+                    }
+                   ]
+                  }
+                 ]
                 },
                 {
-                 "String name" : "created",
-                 "xtype" : "Input",
-                 "string fieldLabel" : "Created Date:",
-                 "cls" : "row-style",
-                 "Boolean disabled" : true,
+                 "xtype" : "Row",
                  "$ xns" : "Roo.bootstrap",
-                 "Number labelWidth" : 4
+                 "items" : [
+                  {
+                   "Number md" : 12,
+                   "xtype" : "Column",
+                   "$ xns" : "Roo.bootstrap",
+                   "String style" : "margin-top:15px;",
+                   "items" : [
+                    {
+                     "String name" : "created",
+                     "xtype" : "Input",
+                     "string fieldLabel" : "Created Date:",
+                     "cls" : "row-style",
+                     "Boolean disabled" : true,
+                     "$ xns" : "Roo.bootstrap",
+                     "Number labelWidth" : 4
+                    }
+                   ]
+                  }
+                 ]
                 },
                 {
-                 "String name" : "descript",
-                 "xtype" : "Input",
-                 "string fieldLabel" : "Description:",
-                 "cls" : "row-style",
+                 "xtype" : "Row",
                  "$ xns" : "Roo.bootstrap",
-                 "Number labelWidth" : 4
+                 "items" : [
+                  {
+                   "Number md" : 12,
+                   "xtype" : "Column",
+                   "$ xns" : "Roo.bootstrap",
+                   "String style" : "margin-top:15px;",
+                   "items" : [
+                    {
+                     "String name" : "descript",
+                     "xtype" : "Input",
+                     "string fieldLabel" : "Description:",
+                     "cls" : "row-style",
+                     "$ xns" : "Roo.bootstrap",
+                     "Number labelWidth" : 4
+                    }
+                   ]
+                  }
+                 ]
                 },
                 {
                  "String name" : "id",
                 },
                 {
                  "xtype" : "Row",
-                 "cls" : "form-group-button_row",
                  "$ xns" : "Roo.bootstrap",
                  "items" : [
                   {
                    "Number md" : 12,
+                   "String cls" : "text-center",
                    "xtype" : "Column",
                    "$ xns" : "Roo.bootstrap",
-                   "String style" : "text-align: center",
+                   "String style" : "margin-top:15px;",
                    "items" : [
                     {
                      "listeners" : {