2 "name" : "Pman.Dialog.BAdminImageManager",
4 "title" : "Pman.Dialog.BAdminImageManager",
5 "path" : "/home/edward/gitlive/Pman.BAdmin/Pman.Dialog.BAdminImageManager.bjs",
9 "ef797d5638c2e1c6b6225b2247541ea5" : "Upload Image or File:",
10 "d9787032e54a7facd5c7b1db2ae61c7b" : "Image Manager",
11 "53ab4599d0106e32d015649175a70d7b" : "<i class=\"fa fa-filter\"></i> Filter",
12 "37c1097cf82226d511586ecd99ed97cf" : "search for image",
13 "cdb6b6bab1fd18b9dbfe3fb84a5d34ae" : "<i class=\"fa fa-search\"></i>",
14 "5350277f16d9998c57fa7e1d17be2a76" : "<i class=\"fa fa-upload\"></i> Upload Image",
15 "14834a16229091f47cf1810177d07916" : "Created Date:",
16 "1a0ce561842e3caef9098f46ecaa1dcf" : "Add Images with Settings",
17 "78d0f5aac952e2ce840a381976a3b01e" : "Image Details",
18 "708ea0e601087e73c4764d5086e3ea3c" : "File Name:",
19 "e0a53da57dd79cca5d3b6a7c42e463ef" : "File Type:",
20 "3f986fa4066f6bded1376eb69de18da2" : "File Size:",
21 "179d4ab94c43ccb7cd6d2b3d82c7fe1f" : "Show images for this email",
22 "d3d2e617335f08df83599665eef8a418" : "Close",
23 "84378f54966381befd040dafbdc221d6" : "<i class=\"fa fa-plus\"></i> Add into the email",
24 "361bacb1a72a350ee34e2f31a6a91dab" : "Alignment:",
25 "2cd3a1900dd0060540b418b2a60f6eec" : "Show all images",
26 "ed807858fcb68abdd180481f1fcba5c5" : "<i class=\"fa fa-trash\"></i> Delete",
27 "031fa343a28d221a25d2bcd942437174" : "Alternate Text:",
28 "48ccf48dcf2218a413ce473262f21a0c" : "Width: ",
29 "d0042a700e9bdf79689d63ee6846dc0e" : "Description:",
30 "d6d93f0d6b7c6018d8949e73ed6efb6c" : "<i class=\"fa fa-save\"></i> Save Changes",
31 "e933dc24fb245d863a43b4fefe9b45f5" : "Height:"
34 "align_fieldLabel" : "361bacb1a72a350ee34e2f31a6a91dab",
35 "filename_fieldLabel" : "708ea0e601087e73c4764d5086e3ea3c",
36 "add_html" : "84378f54966381befd040dafbdc221d6",
37 "created_fieldLabel" : "14834a16229091f47cf1810177d07916",
38 "height_fieldLabel" : "e933dc24fb245d863a43b4fefe9b45f5",
39 "mimetype_fieldLabel" : "e0a53da57dd79cca5d3b6a7c42e463ef",
40 "close_html" : "d3d2e617335f08df83599665eef8a418",
41 "imageUpload_fieldLabel" : "ef797d5638c2e1c6b6225b2247541ea5",
42 "width_fieldLabel" : "48ccf48dcf2218a413ce473262f21a0c",
43 "filesize_fieldLabel" : "3f986fa4066f6bded1376eb69de18da2",
44 "descript_fieldLabel" : "d0042a700e9bdf79689d63ee6846dc0e"
49 "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}"
51 "String cls" : "modal-body-enable-overflow-y pman-badmin-image-manager",
52 "Boolean fitwindow" : true,
54 "$ xns" : "Roo.bootstrap",
55 "String title" : "Image Manager",
59 "click" : "function (_self, e)\n{\n _this.dialog.hide();\n}"
62 "$ xns" : "Roo.bootstrap",
63 "String html" : "Close",
64 "string weight" : "default",
65 "* prop" : "buttons[]",
66 "string name" : "close"
70 "$ xns" : "Roo.bootstrap",
74 "$ xns" : "Roo.bootstrap",
79 "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}",
80 "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",
81 "render" : "function (_self)\n{\n _this.form = this;\n \n}"
83 "style" : "display: none;",
85 "Number timeout" : 300,
86 "$ xns" : "Roo.bootstrap",
87 "Boolean fileUpload" : true,
88 "String method" : "POST",
89 "$ String url" : "baseURL + '/Roo/Images.php'",
93 "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 //_this.dialog.uploadProgress.defer(1000, _this.dialog);\n });\n \n \n}"
95 "String name" : "imageUpload",
97 "string fieldLabel" : "Upload Image or File:",
98 "String inputType" : "file",
99 "$ xns" : "Roo.bootstrap",
100 "Number labelWidth" : 4
103 "String name" : "UPLOAD_IDENTIFIER",
105 "String inputType" : "hidden",
106 "$ xns" : "Roo.bootstrap"
109 "String name" : "post_max_size",
111 "String inputType" : "hidden",
112 "$ xns" : "Roo.bootstrap"
115 "String name" : "upload_max_filesize",
117 "String inputType" : "hidden",
118 "$ xns" : "Roo.bootstrap"
121 "String name" : "ontable",
123 "String inputType" : "hidden",
124 "$ xns" : "Roo.bootstrap"
127 "String name" : "onid",
129 "String inputType" : "hidden",
130 "$ xns" : "Roo.bootstrap"
133 "String name" : "id",
135 "String inputType" : "hidden",
136 "$ xns" : "Roo.bootstrap"
142 "render" : "function (_self)\n{\n _this.container = this;\n \n}"
144 "String cls" : "col-md-12",
145 "xtype" : "Container",
146 "$ xns" : "Roo.bootstrap",
150 "render" : "function (_self)\n{\n _this.toolbar = this;\n}"
153 "$ xns" : "Roo.bootstrap",
158 "$ xns" : "Roo.bootstrap",
162 "$ xns" : "Roo.bootstrap",
163 "String html" : "<i class=\"fa fa-filter\"></i> Filter",
164 "String style" : "float:left;",
168 "$ xns" : "Roo.bootstrap",
173 "click" : "function (_self, e)\n{\n _this.showType = 'private';\n \n _this.masonry.load();\n}"
175 "Boolean preventDefault" : true,
176 "xtype" : "MenuItem",
177 "$ xns" : "Roo.bootstrap",
178 "Boolean isContainer" : false,
179 "String html" : "Show images for this email"
183 "click" : "function (_self, e)\n{\n _this.showType = 'public';\n \n _this.masonry.load();\n}"
185 "Boolean preventDefault" : true,
186 "xtype" : "MenuItem",
187 "$ xns" : "Roo.bootstrap",
188 "Boolean isContainer" : false,
189 "String html" : "Show all images"
197 "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}",
198 "render" : "function (_self)\n{\n _this.searchBox = this;\n}"
201 "string placeholder" : "search for image",
202 "$ xns" : "Roo.bootstrap",
203 "String style" : "float:left; width: 300px; margin-left: 15px;",
207 "click" : "function (_self, e)\n{\n _this.masonry.clearAll();\n _this.masonry.load();\n}"
210 "$ xns" : "Roo.bootstrap",
211 "String html" : "<i class=\"fa fa-search\"></i>",
218 "render" : "function (_self)\n{\n _this.deleteBtn = this;\n \n this.hide();\n}",
219 "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}"
221 "String weight" : "default",
223 "$ xns" : "Roo.bootstrap",
224 "String html" : "<i class=\"fa fa-trash\"></i> Delete",
225 "String style" : "margin-left: 15px; float:right;"
229 "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}"
232 "$ xns" : "Roo.bootstrap",
233 "String html" : "<i class=\"fa fa-upload\"></i> Upload Image",
234 "string weight" : "primary",
235 "String style" : "float:right;"
242 "$ xns" : "Roo.bootstrap",
246 "$ xns" : "Roo.bootstrap",
247 "String html" : "<i class=\"fa fa-filter\"></i> Filter",
248 "String style" : "float:left;",
252 "$ xns" : "Roo.bootstrap",
257 "click" : "function (_self, e)\n{\n _this.showType = 'private';\n \n _this.masonry.load();\n}"
259 "Boolean preventDefault" : true,
260 "xtype" : "MenuItem",
261 "$ xns" : "Roo.bootstrap",
262 "Boolean isContainer" : false,
263 "String html" : "Show images for this email"
267 "click" : "function (_self, e)\n{\n _this.showType = 'public';\n \n _this.masonry.load();\n}"
269 "Boolean preventDefault" : true,
270 "xtype" : "MenuItem",
271 "$ xns" : "Roo.bootstrap",
272 "Boolean isContainer" : false,
273 "String html" : "Show all images"
281 "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}",
282 "render" : "function (_self)\n{\n _this.searchBox = this;\n}"
285 "string placeholder" : "search for image",
286 "$ xns" : "Roo.bootstrap",
287 "String style" : "float:left; width: 300px; margin-left: 15px;",
291 "click" : "function (_self, e)\n{\n _this.masonry.clearAll();\n _this.masonry.load();\n}"
294 "$ xns" : "Roo.bootstrap",
295 "String html" : "<i class=\"fa fa-search\"></i>",
302 "render" : "function (_self)\n{\n _this.deleteBtn = this;\n \n this.hide();\n}",
303 "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}"
305 "String weight" : "default",
307 "$ xns" : "Roo.bootstrap",
308 "String html" : "<i class=\"fa fa-trash\"></i> Delete",
309 "String style" : "margin-left: 15px; float:right;"
313 "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}"
316 "$ xns" : "Roo.bootstrap",
317 "String html" : "<i class=\"fa fa-upload\"></i> Upload Image",
318 "string weight" : "primary",
319 "String style" : "float:right;"
327 "render" : "function (_self)\n{\n _this.document_container = this;\n \n this.el.setStyle('overflow', 'auto');\n}"
330 "$ xns" : "Roo.bootstrap",
331 "String style" : "margin-top: 15px;",
336 "$ xns" : "Roo.bootstrap",
340 "render" : "function (_self)\n{\n _this.masonry = this;\n \n}"
342 "Boolean isLayoutInstant" : false,
343 "| 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.showType == 'private') ? _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.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 if(!this.isSelected()){\n return;\n }\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}",
344 "Number boxWidth" : 250,
345 "xtype" : "LayoutMasonry",
346 "$ xns" : "Roo.bootstrap",
347 "string activeClass" : "active",
348 "Boolean isAutoInitial" : false
360 "$ xns" : "Roo.bootstrap",
365 "$ xns" : "Roo.bootstrap",
370 "$ xns" : "Roo.bootstrap",
374 "render" : "function (_self)\n{\n _this.setting_form = this;\n}"
376 "$ string url" : "baseURL + '/Roo/Images'\n",
378 "$ xns" : "Roo.bootstrap",
379 "Boolean loadMask" : true,
382 "String header" : "Add Images with Settings",
383 "$ String panel" : "'default'",
384 "xtype" : "Container",
385 "$ xns" : "Roo.bootstrap",
386 "String style" : "width: 100%;",
390 "$ xns" : "Roo.bootstrap",
395 "$ xns" : "Roo.bootstrap",
398 "String name" : "descript",
400 "string fieldLabel" : "Alternate Text:",
402 "$ xns" : "Roo.bootstrap",
403 "Number labelWidth" : 4
411 "$ xns" : "Roo.bootstrap",
416 "$ xns" : "Roo.bootstrap",
417 "String style" : "margin-top:15px;",
420 "String name" : "height",
422 "string fieldLabel" : "Height:",
424 "$ xns" : "Roo.bootstrap",
425 "Number labelWidth" : 4
433 "$ xns" : "Roo.bootstrap",
438 "$ xns" : "Roo.bootstrap",
439 "String style" : "margin-top:15px;",
442 "String name" : "width",
444 "string fieldLabel" : "Width: ",
446 "$ xns" : "Roo.bootstrap",
447 "Number labelWidth" : 4
455 "$ xns" : "Roo.bootstrap",
460 "$ xns" : "Roo.bootstrap",
461 "String style" : "margin-top:15px;",
464 "Boolean allowBlank" : true,
465 "Boolean selectOnFocus" : true,
466 "String name" : "align",
467 "String mode" : "local",
468 "String valueField" : "code",
469 "xtype" : "ComboBox",
470 "Boolean editable" : false,
471 "String triggerAction" : "all",
472 "string fieldLabel" : "Alignment:",
473 "Boolean alwaysQuery" : true,
475 "$ xns" : "Roo.bootstrap",
476 "Number labelWidth" : 4,
477 "String displayField" : "value",
478 "Boolean forceSelection" : true,
481 "$ Array fields" : "['code', 'value']",
482 "xtype" : "SimpleStore",
483 "$ xns" : "Roo.data",
485 "| Array data" : "[\n ['left', 'left'],\n ['right', 'right'],\n ['middle', 'middle'],\n ['top', 'top'],\n ['bottom', 'bottom']\n]"
495 "$ xns" : "Roo.bootstrap",
499 "String cls" : "text-center",
501 "$ xns" : "Roo.bootstrap",
502 "String style" : "margin-top:15px;",
506 "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}"
508 "String weight" : "default",
510 "$ xns" : "Roo.bootstrap",
511 "String html" : "<i class=\"fa fa-plus\"></i> Add into the email",
528 "$ xns" : "Roo.bootstrap",
533 "$ xns" : "Roo.bootstrap",
537 "render" : "function (_self)\n{\n _this.detail_form = this;\n}"
540 "$ xns" : "Roo.bootstrap",
541 "Boolean loadMask" : true,
542 "$ String url" : "baseURL + '/Roo/Images'",
545 "xtype" : "Container",
546 "string header" : "Image Details",
547 "$ xns" : "Roo.bootstrap",
548 "String style" : "width: 100%; padding: 0",
549 "$ string panel" : "'default'",
553 "$ xns" : "Roo.bootstrap",
558 "$ xns" : "Roo.bootstrap",
561 "String name" : "filename",
562 "style" : "padding: 0;",
564 "string fieldLabel" : "File Name:",
566 "Boolean disabled" : true,
567 "$ xns" : "Roo.bootstrap",
568 "Number labelWidth" : 4
576 "$ xns" : "Roo.bootstrap",
581 "$ xns" : "Roo.bootstrap",
582 "String style" : "margin-top:15px;",
585 "String name" : "mimetype",
587 "string fieldLabel" : "File Type:",
589 "Boolean disabled" : true,
590 "$ xns" : "Roo.bootstrap",
591 "Number labelWidth" : 4
599 "$ xns" : "Roo.bootstrap",
604 "$ xns" : "Roo.bootstrap",
605 "String style" : "margin-top:15px;",
608 "String name" : "filesize",
610 "string fieldLabel" : "File Size:",
612 "Boolean disabled" : true,
613 "$ xns" : "Roo.bootstrap",
614 "Number labelWidth" : 4
622 "$ xns" : "Roo.bootstrap",
627 "$ xns" : "Roo.bootstrap",
628 "String style" : "margin-top:15px;",
631 "String name" : "created",
633 "string fieldLabel" : "Created Date:",
635 "Boolean disabled" : true,
636 "$ xns" : "Roo.bootstrap",
637 "Number labelWidth" : 4
645 "$ xns" : "Roo.bootstrap",
650 "$ xns" : "Roo.bootstrap",
651 "String style" : "margin-top:15px;",
654 "String name" : "descript",
656 "string fieldLabel" : "Description:",
658 "$ xns" : "Roo.bootstrap",
659 "Number labelWidth" : 4
666 "String name" : "id",
668 "String inputType" : "hidden",
669 "$ xns" : "Roo.bootstrap"
673 "$ xns" : "Roo.bootstrap",
677 "String cls" : "text-center",
679 "$ xns" : "Roo.bootstrap",
680 "String style" : "margin-top:15px;",
684 "click" : "function (_self, e)\n{\n _this.detail_form.doAction('submit');\n}"
686 "String weight" : "default",
688 "$ xns" : "Roo.bootstrap",
689 "String html" : "<i class=\"fa fa-save\"></i> Save Changes"