PHP8
[Pman.BAdmin] / Pman.Dialog.BAdminImageManager.js
index 1f158e4..514d28d 100644 (file)
@@ -10,6 +10,7 @@ Roo.apply(Pman.Dialog.BAdminImageManager.prototype, {
  _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",
@@ -19,10 +20,11 @@ Roo.apply(Pman.Dialog.BAdminImageManager.prototype, {
   '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: ",
@@ -71,66 +73,7 @@ Roo.apply(Pman.Dialog.BAdminImageManager.prototype, {
     xtype : 'Modal',
     cls : 'modal-body-enable-overflow-y pman-badmin-image-manager',
     fitwindow : true,
-    haveProgress : false,
     title : _this._strings['d9787032e54a7facd5c7b1db2ae61c7b'] /* Image Manager */,
-    uploadComplete : false,
-    uploadProgress : function()
-    {
-        Roo.log('uploadProgress');
-        
-        var dlg = this;
-        if (!dlg.haveProgress) {
-            Roo.MessageBox.progress("Uploading", "Uploading");
-        }
-        
-        if (dlg.haveProgress == 2) {
-            // it's been closed elsewhere..
-            return;
-        }
-        if (dlg.uploadComplete) {
-            Roo.MessageBox.hide();
-            return;
-        }
-        
-        dlg.haveProgress = 1;
-        
-        var uid = _this.form_upload.findField('UPLOAD_IDENTIFIER').getValue();
-        
-        new Pman.Request({
-            url : baseURL + '/Core/UploadProgress.php',
-            params: {
-                id : uid
-                
-            },
-            method: 'GET',
-            success : function(res){
-                var data = res.data;
-                if (dlg.haveProgress == 2) {
-                    return;
-                }
-                
-                if (dlg.uploadComplete) {
-                    Roo.MessageBox.hide();
-                    return;
-                }
-                    
-                if (data){
-                    Roo.MessageBox.updateProgress(data.bytes_uploaded/data.bytes_total,
-                        Math.floor((data.bytes_total - data.bytes_uploaded)/1000) + 'k remaining'
-                    );
-                } else {
-                    Roo.MessageBox.updateProgress(1,
-                        "Upload Complete - processing"
-                    );
-                    return;
-                }
-                dlg.uploadProgress.defer(2000,dlg);
-            },
-            failure: function(data) {
-            }
-        })
-        
-    },
     listeners : {
      resize : function (_self)
       {
@@ -172,7 +115,13 @@ Roo.apply(Pman.Dialog.BAdminImageManager.prototype, {
       items  : [
        {
         xtype : 'Column',
-        sm : 8,
+        md : 12,
+        listeners : {
+         render : function (_self)
+          {
+              _this.masonryBlock = this;
+          }
+        },
         xns : Roo.bootstrap,
         '|xns' : 'Roo.bootstrap',
         items  : [
@@ -186,14 +135,10 @@ Roo.apply(Pman.Dialog.BAdminImageManager.prototype, {
           listeners : {
            actioncomplete : function(_self,action)
             {
-                _this.dialog.uploadComplete = true;
-                
-                _this.dialog.haveProgress = 2;
-                
-                Roo.MessageBox.hide();
-                 
                 if (action.type == 'setdata') { 
                     
+                    _this.showType = 'public';
+                    
                     this.url = _this.data._url ? baseURL + _this.data._url : baseURL + '/Roo/Images.php';
                     
                     this.el.dom.action = this.url;
@@ -220,17 +165,7 @@ Roo.apply(Pman.Dialog.BAdminImageManager.prototype, {
                 
                 
                 if (action.type == 'submit') { // only submitted here if we are 
-                    _this.detail_form.doAction('submit', {
-                        params: {
-                            ts : Math.random()
-                        }
-                    });
-                    Roo.log("Upload success");
-                    Roo.log(action);
-                    if (_this.callback) {
-                        _this.callback.call(this, action.result.data, action.result.extra);
-                    }
-                   
+                    
                     _this.masonry.load();
                     
                     return; 
@@ -241,10 +176,6 @@ Roo.apply(Pman.Dialog.BAdminImageManager.prototype, {
             },
            actionfailed : function (_self, action)
             {
-                _this.dialog.uploadComplete = true;
-                
-                 _this.dialog.haveProgress = 2;
-                 
                 if (action.type == 'submit') {
                     Roo.log("Upload error");
                     Roo.log(action);
@@ -264,7 +195,7 @@ Roo.apply(Pman.Dialog.BAdminImageManager.prototype, {
             },
            render : function (_self)
             {
-                _this.form_upload = this;
+                _this.form = this;
                 
             }
           },
@@ -283,20 +214,9 @@ Roo.apply(Pman.Dialog.BAdminImageManager.prototype, {
                   _this.uploadDL = this;
                   
                   _this.uploadDL.inputEl().on("change",function(){
-                  
-                      var id =  _this.current_obj_btn.isActive() ? _this.data.onid : "";
-                      _this.form_upload.doAction('submit', {
-                          params: {
-                              onid: id,
-                              ontable: 'core_email',
-                              ts : Math.random()
-                          }
-                      });
-                      Roo.log("Upload success");
-                      
                       
-                      //console.log(_this.current_obj_btn.getEl().dom.className);
-                      _this.dialog.uploadProgress.defer(1000, _this.dialog);
+                      _this.form.findField('onid').setValue((_this.showType == 'private') ? _this.data.onid : 0);
+                      _this.form.doAction('submit');
                   });
                   
                   
@@ -351,6 +271,7 @@ Roo.apply(Pman.Dialog.BAdminImageManager.prototype, {
          },
          {
           xtype : 'Container',
+          cls : 'col-md-12',
           listeners : {
            render : function (_self)
             {
@@ -375,33 +296,59 @@ Roo.apply(Pman.Dialog.BAdminImageManager.prototype, {
              {
               xtype : 'Column',
               md : 8,
+              sm : 12,
               xns : Roo.bootstrap,
               '|xns' : 'Roo.bootstrap',
               items  : [
                {
                 xtype : 'Button',
-                html : _this._strings['f48f7c7bccb5e29c83d87984c49ad8d4'] /* Show image for this email */,
-                pressed : false,
-                style : 'float:left;',
-                listeners : {
-                 render : function (_self)
+                html : _this._strings['53ab4599d0106e32d015649175a70d7b'] /* <i class="fa fa-filter"></i> Filter */,
+                xns : Roo.bootstrap,
+                '|xns' : 'Roo.bootstrap',
+                menu : {
+                 xtype : 'Menu',
+                 xns : Roo.bootstrap,
+                 '|xns' : 'Roo.bootstrap',
+                 items  : [
                   {
-                      _this.showTypeBtn = this;
+                   xtype : 'MenuItem',
+                   html : _this._strings['179d4ab94c43ccb7cd6d2b3d82c7fe1f'] /* Show images for this email */,
+                   isContainer : false,
+                   preventDefault : true,
+                   listeners : {
+                    click : function (_self, e)
+                     {
+                         _this.showType = 'private';
+                         
+                         _this.masonry.load();
+                     }
+                   },
+                   xns : Roo.bootstrap,
+                   '|xns' : 'Roo.bootstrap'
                   },
-                 toggle : function (b, e, pressed)
                   {
-                      _this.showTypeBtn.setText(!pressed ? 'Show all images' : 'Show image for this email');
-                      
-                      _this.masonry.load();
+                   xtype : 'MenuItem',
+                   html : _this._strings['2cd3a1900dd0060540b418b2a60f6eec'] /* Show all images */,
+                   isContainer : false,
+                   preventDefault : true,
+                   listeners : {
+                    click : function (_self, e)
+                     {
+                         _this.showType = 'public';
+                         
+                         _this.masonry.load();
+                     }
+                   },
+                   xns : Roo.bootstrap,
+                   '|xns' : 'Roo.bootstrap'
                   }
-                },
-                xns : Roo.bootstrap,
-                '|xns' : 'Roo.bootstrap'
+                 ]
+                }
                },
                {
                 xtype : 'Input',
                 placeholder : _this._strings['37c1097cf82226d511586ecd99ed97cf'] /* search for image */,
-                style : 'float:left; width: 300px; margin-left: 15px;',
+                style : 'width: 200px; margin-left: 15px;display: inline-block; margin-bottom: 0px; vertical-align: middle;',
                 listeners : {
                  render : function (_self)
                   {
@@ -441,12 +388,14 @@ Roo.apply(Pman.Dialog.BAdminImageManager.prototype, {
               xtype : 'Column',
               cls : 'text-right',
               md : 4,
+              sm : 12,
               xns : Roo.bootstrap,
               '|xns' : 'Roo.bootstrap',
               items  : [
                {
                 xtype : 'Button',
                 html : _this._strings['5350277f16d9998c57fa7e1d17be2a76'] /* <i class="fa fa-upload"></i> Upload Image */,
+                size : 'sm',
                 weight : 'primary',
                 listeners : {
                  click : function (_self, e)
@@ -467,20 +416,19 @@ Roo.apply(Pman.Dialog.BAdminImageManager.prototype, {
                {
                 xtype : 'Button',
                 html : _this._strings['ed807858fcb68abdd180481f1fcba5c5'] /* <i class="fa fa-trash"></i> Delete */,
+                size : 'sm',
                 style : 'margin-left: 15px;',
                 weight : 'default',
                 listeners : {
                  click : function (_self, e)
                   {
                       if (_this.masonry.getSelected().length > 1) {
-                          
                           Roo.bootstrap.MessageBox.alert('Cannot delete the images !','Please select one image only');
                           return;
                       }
                       
                       if (_this.masonry.getSelected().length < 1) {
-                          
-                          Roo.bootstrap.MessageBox.alert('Cannot delete any image !','Please select an image');
+                          Roo.bootstrap.MessageBox.alert('Cannot delete any image!', 'Please select an image');
                           return;
                       }
                       
@@ -493,14 +441,12 @@ Roo.apply(Pman.Dialog.BAdminImageManager.prototype, {
                               url : baseURL + '/Roo/Images.php',
                               method: 'POST',
                               params : {
-                                  _delete : Roo.bootstrap.MasonryBrick.get(_this.masonry.getSelected()[0]).image_id
+                                  _delete : Roo.bootstrap.MasonryBrick.get(_this.masonry.getSelected()[0]).imageObj.id
                               },
                               success : function()
                               {
-                                  _this.masonry.removeBrick(_this.masonry.getSelected()[0]);
-                                  _this.detail_form.reset();
-                                  _this.setting_form.reset();
-                                  _this.masonry.initial();
+                  //                _this.masonry.removeBrick(_this.masonry.getSelected()[0]);
+                                  _this.masonry.load();
                               }
                           });
                       });
@@ -555,14 +501,19 @@ Roo.apply(Pman.Dialog.BAdminImageManager.prototype, {
                     
                     _this.masonry.clearAll();
                     
+                    var params = {
+                        ontable : 'core_email',
+                        'search[filename]' : _this.searchBox.getValue()
+                    };
+                    
+                    if(_this.showType == 'private'){
+                        params.onid = _this.data.onid;
+                    }
+                    
                     new Pman.Request({
                         url: baseURL + '/Roo/Images',
                         method: 'GET',
-                        params: {
-                            ontable : 'core_email',
-                            onid : _this.showTypeBtn.isActive() ? _this.data.onid : 0,
-                            'search[filename]' : _this.searchBox.getValue()
-                        },
+                        params: params,
                         success: function(ret) {
                             
                             if(!ret.data.length){
@@ -578,7 +529,7 @@ Roo.apply(Pman.Dialog.BAdminImageManager.prototype, {
                                     active: false,
                                     activeClass: 'active',
                                     preventDefault: true,
-                                    bgimage : baseURL + '/Images/' + r.id + '/' + r.filename,
+                                    bgimage : baseURL + '/Images/' + r.id + '/' + r.filename.replace('%', '-'),
                                     imageObj: r,
                                     listeners : {
                                         click : function (_self)
@@ -588,36 +539,41 @@ Roo.apply(Pman.Dialog.BAdminImageManager.prototype, {
                                             
                                             _this.setting_form.hide();
                                             _this.detail_form.hide();
-                                                
-                                            if(this.isSelected()){
-                                                _this.setting_form.show();
-                                                _this.detail_form.show();
-                                                
-                                                _this.detail_form.setValues(_self.imageObj);
-                                                _this.setting_form.setValues(_self.imageObj);
-                                                
-                                                _this.setting_form.findField('align').setValue("left");
-                                                _this.tb.setSrc(baseURL + '/Images/' + res.data[0].id + '/' + res.data[0].filename);
+                                            
+                                            _this.deleteBtn.hide();
+                                            
+                                            _this.masonryBlock.el.removeClass(['col-md-12','col-md-8']).addClass('col-md-12');
+                                            
+                                            if(!this.isSelected()){
+                                                return;
                                             }
-                                            /*
+                                            
+                                            _this.masonryBlock.el.removeClass(['col-md-12','col-md-8']).addClass('col-md-8');
+                                            
+                                            if(_this.masonry.getSelected().length == 1){
+                                                _this.deleteBtn.show();
+                                            }
+                                            
                                             new Pman.Request({
                                                 url: baseURL + '/Roo/Images.php',
                                                 method : 'GET',
                                                 params : {
-                                                    id: this.image_id
+                                                    _id: _self.imageObj.id
                                                 }, 
-                                                success : function(res) {
-                                                    Roo.log(res.data[0]);
-                                                    _this.detail_form.setValues(res.data[0]);
-                                                    _this.setting_form.setValues(res.data[0]);
+                                                success : function(rr) {
+                                                    
+                                                    _this.setting_form.show();
+                                                    _this.detail_form.show();
+                                                    
+                                                    _this.detail_form.setValues(rr.data);
+                                                    _this.setting_form.setValues(rr.data);
+                                                    
                                                     _this.setting_form.findField('align').setValue("left");
-                                                    _this.setting_form.findField('alt').setValue(res.data[0].descript);
-                                                    //_this.align.getEl().setValue("left");
-                                                    _this.tb.setSrc(baseURL + '/Images/' + res.data[0].id + '/' + res.data[0].filename);
                                                     
+                                                    _self.imageObj = rr.data;
                                                 }
                                             });
-                                            */
+                                            
                                         }
                                      }
                                 })
@@ -626,58 +582,6 @@ Roo.apply(Pman.Dialog.BAdminImageManager.prototype, {
                             
                             _this.masonry.initial();
                             
-                            /*
-                             if(r.data) {
-                                 for (var i = 0; i<r.data.length; i++) {
-                                    
-                                    _this.masonry.addBrick({
-                                        image_filename: r.data[i].filename,
-                                        image_id: r.data[i].id,
-                                        size: 'md',
-                                        boxWidth: 150,
-                                        cls: 'coba-image-mgmt-masonry-brick',
-                                        active: false,
-                                        activeClass: 'active',
-                                        preventDefault: true,
-                                        bgimage : baseURL + '/Images/' + r.data[i].id + '/' + r.data[i].filename,
-                                        listeners : {
-                                            click : function (_self)
-                                            {
-                                                _this.setting_form.reset();
-                                                
-                                                if(this.isSelected()){
-                                                    _this.setting_form.show();
-                                                    _this.detail_form.show();
-                                                }
-                                                else{
-                                                    _this.setting_form.hide();
-                                                    _this.detail_form.hide();
-                                                }
-                                                
-                                                new Pman.Request({
-                                                    url: baseURL + '/Roo/Images.php',
-                                                    method : 'GET',
-                                                    params : {
-                                                        id: this.image_id
-                                                    }, 
-                                                    success : function(res) {
-                                                        Roo.log(res.data[0]);
-                                                        _this.detail_form.setValues(res.data[0]);
-                                                        _this.setting_form.setValues(res.data[0]);
-                                                        _this.setting_form.findField('align').setValue("left");
-                                                        _this.setting_form.findField('alt').setValue(res.data[0].descript);
-                                                        //_this.align.getEl().setValue("left");
-                                                        _this.tb.setSrc(baseURL + '/Images/' + res.data[0].id + '/' + res.data[0].filename);
-                                                        
-                                                    }
-                                                });
-                                            }
-                                         }
-                                    })
-                                 }
-                                 _this.masonry.initial();
-                             }
-                             */
                          },
                          
                          failure: function(res) {
@@ -705,7 +609,7 @@ Roo.apply(Pman.Dialog.BAdminImageManager.prototype, {
        },
        {
         xtype : 'Column',
-        sm : 4,
+        md : 4,
         xns : Roo.bootstrap,
         '|xns' : 'Roo.bootstrap',
         items  : [
@@ -742,73 +646,136 @@ Roo.apply(Pman.Dialog.BAdminImageManager.prototype, {
                 '|xns' : 'Roo.bootstrap',
                 items  : [
                  {
-                  xtype : 'Input',
-                  cls : 'row-style',
-                  fieldLabel : _this._strings['031fa343a28d221a25d2bcd942437174'] /* Alternate Text: */,
-                  labelWidth : 4,
-                  name : 'descript',
+                  xtype : 'Row',
                   xns : Roo.bootstrap,
-                  '|xns' : 'Roo.bootstrap'
+                  '|xns' : 'Roo.bootstrap',
+                  items  : [
+                   {
+                    xtype : 'Column',
+                    md : 12,
+                    xns : Roo.bootstrap,
+                    '|xns' : 'Roo.bootstrap',
+                    items  : [
+                     {
+                      xtype : 'Input',
+                      cls : 'row-style',
+                      fieldLabel : _this._strings['031fa343a28d221a25d2bcd942437174'] /* Alternate Text: */,
+                      labelWidth : 4,
+                      name : 'descript',
+                      xns : Roo.bootstrap,
+                      '|xns' : 'Roo.bootstrap'
+                     }
+                    ]
+                   }
+                  ]
                  },
                  {
-                  xtype : 'Input',
-                  cls : 'row-style',
-                  fieldLabel : _this._strings['e933dc24fb245d863a43b4fefe9b45f5'] /* Height: */,
-                  labelWidth : 4,
-                  name : 'height',
+                  xtype : 'Row',
                   xns : Roo.bootstrap,
-                  '|xns' : 'Roo.bootstrap'
+                  '|xns' : 'Roo.bootstrap',
+                  items  : [
+                   {
+                    xtype : 'Column',
+                    md : 12,
+                    style : 'margin-top:15px;',
+                    xns : Roo.bootstrap,
+                    '|xns' : 'Roo.bootstrap',
+                    items  : [
+                     {
+                      xtype : 'Input',
+                      cls : 'row-style',
+                      fieldLabel : _this._strings['e933dc24fb245d863a43b4fefe9b45f5'] /* Height: */,
+                      labelWidth : 4,
+                      name : 'height',
+                      xns : Roo.bootstrap,
+                      '|xns' : 'Roo.bootstrap'
+                     }
+                    ]
+                   }
+                  ]
                  },
                  {
-                  xtype : 'Input',
-                  cls : 'row-style',
-                  fieldLabel : _this._strings['48ccf48dcf2218a413ce473262f21a0c'] /* Width:  */,
-                  labelWidth : 4,
-                  name : 'width',
+                  xtype : 'Row',
                   xns : Roo.bootstrap,
-                  '|xns' : 'Roo.bootstrap'
+                  '|xns' : 'Roo.bootstrap',
+                  items  : [
+                   {
+                    xtype : 'Column',
+                    md : 12,
+                    style : 'margin-top:15px;',
+                    xns : Roo.bootstrap,
+                    '|xns' : 'Roo.bootstrap',
+                    items  : [
+                     {
+                      xtype : 'Input',
+                      cls : 'row-style',
+                      fieldLabel : _this._strings['48ccf48dcf2218a413ce473262f21a0c'] /* Width:  */,
+                      labelWidth : 4,
+                      name : 'width',
+                      xns : Roo.bootstrap,
+                      '|xns' : 'Roo.bootstrap'
+                     }
+                    ]
+                   }
+                  ]
                  },
                  {
-                  xtype : 'ComboBox',
-                  allowBlank : true,
-                  alwaysQuery : true,
-                  cls : 'row-style',
-                  displayField : 'value',
-                  editable : false,
-                  fieldLabel : _this._strings['361bacb1a72a350ee34e2f31a6a91dab'] /* Alignment: */,
-                  forceSelection : true,
-                  labelWidth : 4,
-                  mode : 'local',
-                  name : 'align',
-                  selectOnFocus : true,
-                  triggerAction : 'all',
-                  valueField : 'code',
+                  xtype : 'Row',
                   xns : Roo.bootstrap,
                   '|xns' : 'Roo.bootstrap',
-                  store : {
-                   xtype : 'SimpleStore',
-                   data : [
-                       ['left', 'left'],
-                       ['right', 'right'],
-                       ['middle', 'middle'],
-                       ['top', 'top'],
-                       ['bottom', 'bottom']
-                   ],
-                   fields : ['code', 'value'],
-                   xns : Roo.data,
-                   '|xns' : 'Roo.data'
-                  }
+                  items  : [
+                   {
+                    xtype : 'Column',
+                    md : 12,
+                    style : 'margin-top:15px;',
+                    xns : Roo.bootstrap,
+                    '|xns' : 'Roo.bootstrap',
+                    items  : [
+                     {
+                      xtype : 'ComboBox',
+                      allowBlank : true,
+                      alwaysQuery : true,
+                      cls : 'row-style',
+                      displayField : 'value',
+                      editable : false,
+                      fieldLabel : _this._strings['361bacb1a72a350ee34e2f31a6a91dab'] /* Alignment: */,
+                      forceSelection : true,
+                      labelWidth : 4,
+                      mode : 'local',
+                      name : 'align',
+                      selectOnFocus : true,
+                      triggerAction : 'all',
+                      valueField : 'code',
+                      xns : Roo.bootstrap,
+                      '|xns' : 'Roo.bootstrap',
+                      store : {
+                       xtype : 'SimpleStore',
+                       data : [
+                           ['left', 'left'],
+                           ['right', 'right'],
+                           ['middle', 'middle'],
+                           ['top', 'top'],
+                           ['bottom', 'bottom']
+                       ],
+                       fields : ['code', 'value'],
+                       xns : Roo.data,
+                       '|xns' : 'Roo.data'
+                      }
+                     }
+                    ]
+                   }
+                  ]
                  },
                  {
                   xtype : 'Row',
-                  cls : 'form-group-button_row',
                   xns : Roo.bootstrap,
                   '|xns' : 'Roo.bootstrap',
                   items  : [
                    {
                     xtype : 'Column',
+                    cls : 'text-center',
                     md : 12,
-                    style : 'text-align: center',
+                    style : 'margin-top:15px;',
                     xns : Roo.bootstrap,
                     '|xns' : 'Roo.bootstrap',
                     items  : [
@@ -820,8 +787,6 @@ Roo.apply(Pman.Dialog.BAdminImageManager.prototype, {
                       listeners : {
                        click : function (_self, e)
                         {
-                            Roo.log('adding into the email');
-                            
                             var b = _this.masonry.getSelected();
                             
                             if (b.length < 1) {
@@ -832,19 +797,21 @@ Roo.apply(Pman.Dialog.BAdminImageManager.prototype, {
                             
                             var brick = Roo.bootstrap.MasonryBrick.get(b[0]);
                             
-                            
-                            
                             _this.dialog.hide();
                         
                             if(_this.callback){
-                                _this.callback({
-                                    id : brick.image_id,
-                                    filename : brick.image_filename,
-                                    height : _this.setting_form.findField('height').getValue(),
+                                
+                                var data = {
+                                    id : brick.imageObj.id,
+                                    filename : brick.imageObj.filename,
                                     width : _this.setting_form.findField('width').getValue(),
-                                    alt : _this.setting_form.findField('alt').getValue(),
+                                    height : _this.setting_form.findField('height').getValue(),
+                                    descript : _this.setting_form.findField('descript').getValue(),
                                     align : _this.setting_form.findField('align').getValue()
-                                });
+                                };
+                                
+                                _this.callback.call(_this, data);
+                                
                             }
                         }
                       },
@@ -896,71 +863,133 @@ Roo.apply(Pman.Dialog.BAdminImageManager.prototype, {
                 '|xns' : 'Roo.bootstrap',
                 items  : [
                  {
-                  xtype : 'Img',
-                  alt : '*Please select an image in the media library',
-                  border : 'thumbnail',
-                  style : 'width: 100%; margin-bottom:15px; display: none;',
-                  listeners : {
-                   render : function (_self)
-                    {
-                        _this.thumb = this;
-                        
-                        //any default image?
-                        
-                    }
-                  },
-                  xns : Roo.bootstrap,
-                  '|xns' : 'Roo.bootstrap'
-                 },
-                 {
-                  xtype : 'Input',
-                  cls : 'row-style',
-                  disabled : true,
-                  fieldLabel : _this._strings['708ea0e601087e73c4764d5086e3ea3c'] /* File Name: */,
-                  labelWidth : 4,
-                  name : 'filename',
-                  style : 'padding: 0;',
+                  xtype : 'Row',
                   xns : Roo.bootstrap,
-                  '|xns' : 'Roo.bootstrap'
+                  '|xns' : 'Roo.bootstrap',
+                  items  : [
+                   {
+                    xtype : 'Column',
+                    md : 12,
+                    xns : Roo.bootstrap,
+                    '|xns' : 'Roo.bootstrap',
+                    items  : [
+                     {
+                      xtype : 'Input',
+                      cls : 'row-style',
+                      disabled : true,
+                      fieldLabel : _this._strings['708ea0e601087e73c4764d5086e3ea3c'] /* File Name: */,
+                      labelWidth : 4,
+                      name : 'filename',
+                      style : 'padding: 0;',
+                      xns : Roo.bootstrap,
+                      '|xns' : 'Roo.bootstrap'
+                     }
+                    ]
+                   }
+                  ]
                  },
                  {
-                  xtype : 'Input',
-                  cls : 'row-style',
-                  disabled : true,
-                  fieldLabel : _this._strings['e0a53da57dd79cca5d3b6a7c42e463ef'] /* File Type: */,
-                  labelWidth : 4,
-                  name : 'mimetype',
+                  xtype : 'Row',
                   xns : Roo.bootstrap,
-                  '|xns' : 'Roo.bootstrap'
+                  '|xns' : 'Roo.bootstrap',
+                  items  : [
+                   {
+                    xtype : 'Column',
+                    md : 12,
+                    style : 'margin-top:15px;',
+                    xns : Roo.bootstrap,
+                    '|xns' : 'Roo.bootstrap',
+                    items  : [
+                     {
+                      xtype : 'Input',
+                      cls : 'row-style',
+                      disabled : true,
+                      fieldLabel : _this._strings['e0a53da57dd79cca5d3b6a7c42e463ef'] /* File Type: */,
+                      labelWidth : 4,
+                      name : 'mimetype',
+                      xns : Roo.bootstrap,
+                      '|xns' : 'Roo.bootstrap'
+                     }
+                    ]
+                   }
+                  ]
                  },
                  {
-                  xtype : 'Input',
-                  cls : 'row-style',
-                  disabled : true,
-                  fieldLabel : _this._strings['3f986fa4066f6bded1376eb69de18da2'] /* File Size: */,
-                  labelWidth : 4,
-                  name : 'filesize',
+                  xtype : 'Row',
                   xns : Roo.bootstrap,
-                  '|xns' : 'Roo.bootstrap'
+                  '|xns' : 'Roo.bootstrap',
+                  items  : [
+                   {
+                    xtype : 'Column',
+                    md : 12,
+                    style : 'margin-top:15px;',
+                    xns : Roo.bootstrap,
+                    '|xns' : 'Roo.bootstrap',
+                    items  : [
+                     {
+                      xtype : 'Input',
+                      cls : 'row-style',
+                      disabled : true,
+                      fieldLabel : _this._strings['3f986fa4066f6bded1376eb69de18da2'] /* File Size: */,
+                      labelWidth : 4,
+                      name : 'filesize',
+                      xns : Roo.bootstrap,
+                      '|xns' : 'Roo.bootstrap'
+                     }
+                    ]
+                   }
+                  ]
                  },
                  {
-                  xtype : 'Input',
-                  cls : 'row-style',
-                  disabled : true,
-                  fieldLabel : _this._strings['14834a16229091f47cf1810177d07916'] /* Created Date: */,
-                  labelWidth : 4,
-                  name : 'created',
+                  xtype : 'Row',
                   xns : Roo.bootstrap,
-                  '|xns' : 'Roo.bootstrap'
+                  '|xns' : 'Roo.bootstrap',
+                  items  : [
+                   {
+                    xtype : 'Column',
+                    md : 12,
+                    style : 'margin-top:15px;',
+                    xns : Roo.bootstrap,
+                    '|xns' : 'Roo.bootstrap',
+                    items  : [
+                     {
+                      xtype : 'Input',
+                      cls : 'row-style',
+                      disabled : true,
+                      fieldLabel : _this._strings['14834a16229091f47cf1810177d07916'] /* Created Date: */,
+                      labelWidth : 4,
+                      name : 'created',
+                      xns : Roo.bootstrap,
+                      '|xns' : 'Roo.bootstrap'
+                     }
+                    ]
+                   }
+                  ]
                  },
                  {
-                  xtype : 'Input',
-                  cls : 'row-style',
-                  fieldLabel : _this._strings['d0042a700e9bdf79689d63ee6846dc0e'] /* Description: */,
-                  labelWidth : 4,
-                  name : 'descript',
+                  xtype : 'Row',
                   xns : Roo.bootstrap,
-                  '|xns' : 'Roo.bootstrap'
+                  '|xns' : 'Roo.bootstrap',
+                  items  : [
+                   {
+                    xtype : 'Column',
+                    md : 12,
+                    style : 'margin-top:15px;',
+                    xns : Roo.bootstrap,
+                    '|xns' : 'Roo.bootstrap',
+                    items  : [
+                     {
+                      xtype : 'Input',
+                      cls : 'row-style',
+                      fieldLabel : _this._strings['d0042a700e9bdf79689d63ee6846dc0e'] /* Description: */,
+                      labelWidth : 4,
+                      name : 'descript',
+                      xns : Roo.bootstrap,
+                      '|xns' : 'Roo.bootstrap'
+                     }
+                    ]
+                   }
+                  ]
                  },
                  {
                   xtype : 'Input',
@@ -971,14 +1000,14 @@ Roo.apply(Pman.Dialog.BAdminImageManager.prototype, {
                  },
                  {
                   xtype : 'Row',
-                  cls : 'form-group-button_row',
                   xns : Roo.bootstrap,
                   '|xns' : 'Roo.bootstrap',
                   items  : [
                    {
                     xtype : 'Column',
+                    cls : 'text-center',
                     md : 12,
-                    style : 'text-align: center',
+                    style : 'margin-top:15px;',
                     xns : Roo.bootstrap,
                     '|xns' : 'Roo.bootstrap',
                     items  : [