{
"name" : "Pman.Dialog.BAdminImageManager",
"parent" : "",
"title" : "Pman.Dialog.BAdminImageManager",
"path" : "/home/edward/gitlive/Pman.BAdmin/Pman.Dialog.BAdminImageManager.bjs",
"permname" : "",
"modOrder" : "001",
"strings" : {
"ef797d5638c2e1c6b6225b2247541ea5" : "Upload Image or File:",
"d9787032e54a7facd5c7b1db2ae61c7b" : "Image Manager",
"53ab4599d0106e32d015649175a70d7b" : " Filter",
"37c1097cf82226d511586ecd99ed97cf" : "search for image",
"cdb6b6bab1fd18b9dbfe3fb84a5d34ae" : "",
"5350277f16d9998c57fa7e1d17be2a76" : " Upload Image",
"14834a16229091f47cf1810177d07916" : "Created Date:",
"1a0ce561842e3caef9098f46ecaa1dcf" : "Add Images with Settings",
"78d0f5aac952e2ce840a381976a3b01e" : "Image Details",
"708ea0e601087e73c4764d5086e3ea3c" : "File Name:",
"e0a53da57dd79cca5d3b6a7c42e463ef" : "File Type:",
"3f986fa4066f6bded1376eb69de18da2" : "File Size:",
"179d4ab94c43ccb7cd6d2b3d82c7fe1f" : "Show images for this email",
"d3d2e617335f08df83599665eef8a418" : "Close",
"84378f54966381befd040dafbdc221d6" : " Add into the email",
"361bacb1a72a350ee34e2f31a6a91dab" : "Alignment:",
"2cd3a1900dd0060540b418b2a60f6eec" : "Show all images",
"ed807858fcb68abdd180481f1fcba5c5" : " Delete",
"031fa343a28d221a25d2bcd942437174" : "Alternate Text:",
"48ccf48dcf2218a413ce473262f21a0c" : "Width: ",
"d0042a700e9bdf79689d63ee6846dc0e" : "Description:",
"d6d93f0d6b7c6018d8949e73ed6efb6c" : " Save Changes",
"e933dc24fb245d863a43b4fefe9b45f5" : "Height:"
},
"named_strings" : {
"align_fieldLabel" : "361bacb1a72a350ee34e2f31a6a91dab",
"filename_fieldLabel" : "708ea0e601087e73c4764d5086e3ea3c",
"add_html" : "84378f54966381befd040dafbdc221d6",
"created_fieldLabel" : "14834a16229091f47cf1810177d07916",
"height_fieldLabel" : "e933dc24fb245d863a43b4fefe9b45f5",
"mimetype_fieldLabel" : "e0a53da57dd79cca5d3b6a7c42e463ef",
"close_html" : "d3d2e617335f08df83599665eef8a418",
"imageUpload_fieldLabel" : "ef797d5638c2e1c6b6225b2247541ea5",
"width_fieldLabel" : "48ccf48dcf2218a413ce473262f21a0c",
"filesize_fieldLabel" : "3f986fa4066f6bded1376eb69de18da2",
"descript_fieldLabel" : "d0042a700e9bdf79689d63ee6846dc0e"
},
"items" : [
{
"listeners" : {
"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",
"Boolean fitwindow" : true,
"xtype" : "Modal",
"$ xns" : "Roo.bootstrap",
"String title" : "Image Manager",
"items" : [
{
"listeners" : {
"click" : "function (_self, e)\n{\n _this.dialog.hide();\n}"
},
"xtype" : "Button",
"$ xns" : "Roo.bootstrap",
"String html" : "Close",
"string weight" : "default",
"* prop" : "buttons[]",
"string name" : "close"
},
{
"xtype" : "Row",
"$ xns" : "Roo.bootstrap",
"items" : [
{
"listeners" : {
"render" : "function (_self)\n{\n _this.masonryBlock = this;\n}"
},
"Number md" : 12,
"xtype" : "Column",
"$ xns" : "Roo.bootstrap",
"items" : [
{
"listeners" : {
"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('
'));\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,
"$ xns" : "Roo.bootstrap",
"Boolean fileUpload" : true,
"String method" : "POST",
"$ String url" : "baseURL + '/Roo/Images.php'",
"items" : [
{
"listeners" : {
"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",
"string fieldLabel" : "Upload Image or File:",
"String inputType" : "file",
"$ xns" : "Roo.bootstrap",
"Number labelWidth" : 4
},
{
"String name" : "UPLOAD_IDENTIFIER",
"xtype" : "Input",
"String inputType" : "hidden",
"$ xns" : "Roo.bootstrap"
},
{
"String name" : "post_max_size",
"xtype" : "Input",
"String inputType" : "hidden",
"$ xns" : "Roo.bootstrap"
},
{
"String name" : "upload_max_filesize",
"xtype" : "Input",
"String inputType" : "hidden",
"$ xns" : "Roo.bootstrap"
},
{
"String name" : "ontable",
"xtype" : "Input",
"String inputType" : "hidden",
"$ xns" : "Roo.bootstrap"
},
{
"String name" : "onid",
"xtype" : "Input",
"String inputType" : "hidden",
"$ xns" : "Roo.bootstrap"
},
{
"String name" : "id",
"xtype" : "Input",
"String inputType" : "hidden",
"$ xns" : "Roo.bootstrap"
}
]
},
{
"listeners" : {
"render" : "function (_self)\n{\n _this.container = this;\n \n}"
},
"String cls" : "col-md-12",
"xtype" : "Container",
"$ xns" : "Roo.bootstrap",
"items" : [
{
"listeners" : {
"render" : "function (_self)\n{\n _this.toolbar = this;\n}"
},
"xtype" : "Row",
"$ xns" : "Roo.bootstrap",
"items" : [
{
"Number md" : 8,
"xtype" : "Column",
"$ xns" : "Roo.bootstrap",
"Number sm" : 12,
"items" : [
{
"xtype" : "Button",
"$ xns" : "Roo.bootstrap",
"String html" : " 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" : {
"specialkey" : "function (_self, e)\n{ \n \n var image_name = \"\";\n \n if(e.keyCode == e.ENTER) {\n _this.masonry.clearAll();\n _this.masonry.load();\n \n }\n}",
"render" : "function (_self)\n{\n _this.searchBox = this;\n}"
},
"xtype" : "Input",
"string placeholder" : "search for image",
"$ xns" : "Roo.bootstrap",
"String style" : "width: 200px; margin-left: 15px;display: inline-block; margin-bottom: 0px; vertical-align: middle;",
"items" : [
{
"listeners" : {
"click" : "function (_self, e)\n{\n _this.masonry.clearAll();\n _this.masonry.load();\n}"
},
"xtype" : "Button",
"$ xns" : "Roo.bootstrap",
"String html" : "",
"* prop" : "after"
}
]
}
]
},
{
"Number md" : 4,
"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" : " Upload Image",
"string weight" : "primary"
},
{
"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 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",
"String html" : " Delete",
"String style" : "margin-left: 15px;"
}
]
}
]
},
{
"listeners" : {
"render" : "function (_self)\n{\n _this.document_container = this;\n \n this.el.setStyle('overflow', 'auto');\n}"
},
"xtype" : "Row",
"$ xns" : "Roo.bootstrap",
"String style" : "margin-top: 15px;",
"items" : [
{
"Number md" : 12,
"xtype" : "Column",
"$ xns" : "Roo.bootstrap",
"items" : [
{
"listeners" : {
"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 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",
"string activeClass" : "active",
"Boolean isAutoInitial" : false
}
]
}
]
}
]
}
]
},
{
"Number md" : 4,
"xtype" : "Column",
"$ xns" : "Roo.bootstrap",
"items" : [
{
"xtype" : "Row",
"$ xns" : "Roo.bootstrap",
"items" : [
{
"Number md" : 12,
"xtype" : "Column",
"$ xns" : "Roo.bootstrap",
"items" : [
{
"listeners" : {
"render" : "function (_self)\n{\n _this.setting_form = this;\n}"
},
"$ string url" : "baseURL + '/Roo/Images'\n",
"xtype" : "Form",
"$ xns" : "Roo.bootstrap",
"Boolean loadMask" : true,
"items" : [
{
"String header" : "Add Images with Settings",
"$ String panel" : "'default'",
"xtype" : "Container",
"$ xns" : "Roo.bootstrap",
"String style" : "width: 100%;",
"items" : [
{
"xtype" : "Row",
"$ xns" : "Roo.bootstrap",
"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
}
]
}
]
},
{
"xtype" : "Row",
"$ xns" : "Roo.bootstrap",
"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
}
]
}
]
},
{
"xtype" : "Row",
"$ xns" : "Roo.bootstrap",
"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
}
]
}
]
},
{
"xtype" : "Row",
"$ xns" : "Roo.bootstrap",
"items" : [
{
"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",
"$ xns" : "Roo.bootstrap",
"items" : [
{
"Number md" : 12,
"String cls" : "text-center",
"xtype" : "Column",
"$ xns" : "Roo.bootstrap",
"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 = {\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",
"$ xns" : "Roo.bootstrap",
"String html" : " Add into the email",
"name" : "add"
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"xtype" : "Row",
"$ xns" : "Roo.bootstrap",
"items" : [
{
"Number md" : 12,
"xtype" : "Column",
"$ xns" : "Roo.bootstrap",
"items" : [
{
"listeners" : {
"render" : "function (_self)\n{\n _this.detail_form = this;\n}"
},
"xtype" : "Form",
"$ xns" : "Roo.bootstrap",
"Boolean loadMask" : true,
"$ String url" : "baseURL + '/Roo/Images'",
"items" : [
{
"xtype" : "Container",
"string header" : "Image Details",
"$ xns" : "Roo.bootstrap",
"String style" : "width: 100%; padding: 0",
"$ string panel" : "'default'",
"items" : [
{
"xtype" : "Row",
"$ xns" : "Roo.bootstrap",
"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
}
]
}
]
},
{
"xtype" : "Row",
"$ xns" : "Roo.bootstrap",
"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
}
]
}
]
},
{
"xtype" : "Row",
"$ xns" : "Roo.bootstrap",
"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
}
]
}
]
},
{
"xtype" : "Row",
"$ xns" : "Roo.bootstrap",
"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
}
]
}
]
},
{
"xtype" : "Row",
"$ xns" : "Roo.bootstrap",
"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" : "Input",
"String inputType" : "hidden",
"$ xns" : "Roo.bootstrap"
},
{
"xtype" : "Row",
"$ xns" : "Roo.bootstrap",
"items" : [
{
"Number md" : 12,
"String cls" : "text-center",
"xtype" : "Column",
"$ xns" : "Roo.bootstrap",
"String style" : "margin-top:15px;",
"items" : [
{
"listeners" : {
"click" : "function (_self, e)\n{\n _this.detail_form.doAction('submit');\n}"
},
"String weight" : "default",
"xtype" : "Button",
"$ xns" : "Roo.bootstrap",
"String html" : " Save Changes"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}