1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Roo.namespace('Pman.Dialog');
7 Pman.Dialog.BAdminImageManager= function() {}
8 Roo.apply(Pman.Dialog.BAdminImageManager.prototype, {
11 'ef797d5638c2e1c6b6225b2247541ea5' :"Upload Image or File:",
12 'd9787032e54a7facd5c7b1db2ae61c7b' :"Image Manager",
13 '53ab4599d0106e32d015649175a70d7b' :"<i class=\"fa fa-filter\"></i> Filter",
14 '37c1097cf82226d511586ecd99ed97cf' :"search for image",
15 'cdb6b6bab1fd18b9dbfe3fb84a5d34ae' :"<i class=\"fa fa-search\"></i>",
16 '5350277f16d9998c57fa7e1d17be2a76' :"<i class=\"fa fa-upload\"></i> Upload Image",
17 '14834a16229091f47cf1810177d07916' :"Created Date:",
18 '1a0ce561842e3caef9098f46ecaa1dcf' :"Add Images with Settings",
19 '78d0f5aac952e2ce840a381976a3b01e' :"Image Details",
20 '708ea0e601087e73c4764d5086e3ea3c' :"File Name:",
21 'e0a53da57dd79cca5d3b6a7c42e463ef' :"File Type:",
22 '3f986fa4066f6bded1376eb69de18da2' :"File Size:",
23 '179d4ab94c43ccb7cd6d2b3d82c7fe1f' :"Show images for this email",
24 'd3d2e617335f08df83599665eef8a418' :"Close",
25 '84378f54966381befd040dafbdc221d6' :"<i class=\"fa fa-plus\"></i> Add into the email",
26 '361bacb1a72a350ee34e2f31a6a91dab' :"Alignment:",
27 '2cd3a1900dd0060540b418b2a60f6eec' :"Show all images",
28 'ed807858fcb68abdd180481f1fcba5c5' :"<i class=\"fa fa-trash\"></i> Delete",
29 '031fa343a28d221a25d2bcd942437174' :"Alternate Text:",
30 '48ccf48dcf2218a413ce473262f21a0c' :"Width: ",
31 'd0042a700e9bdf79689d63ee6846dc0e' :"Description:",
32 'd6d93f0d6b7c6018d8949e73ed6efb6c' :"<i class=\"fa fa-save\"></i> Save Changes",
33 'e933dc24fb245d863a43b4fefe9b45f5' :"Height:"
36 'align_fieldLabel' : '361bacb1a72a350ee34e2f31a6a91dab' /* Alignment: */ ,
37 'filename_fieldLabel' : '708ea0e601087e73c4764d5086e3ea3c' /* File Name: */ ,
38 'add_html' : '84378f54966381befd040dafbdc221d6' /* <i class="fa fa-plus"></i> Add into the email */ ,
39 'created_fieldLabel' : '14834a16229091f47cf1810177d07916' /* Created Date: */ ,
40 'height_fieldLabel' : 'e933dc24fb245d863a43b4fefe9b45f5' /* Height: */ ,
41 'mimetype_fieldLabel' : 'e0a53da57dd79cca5d3b6a7c42e463ef' /* File Type: */ ,
42 'close_html' : 'd3d2e617335f08df83599665eef8a418' /* Close */ ,
43 'imageUpload_fieldLabel' : 'ef797d5638c2e1c6b6225b2247541ea5' /* Upload Image or File: */ ,
44 'width_fieldLabel' : '48ccf48dcf2218a413ce473262f21a0c' /* Width: */ ,
45 'filesize_fieldLabel' : '3f986fa4066f6bded1376eb69de18da2' /* File Size: */ ,
46 'descript_fieldLabel' : 'd0042a700e9bdf79689d63ee6846dc0e' /* Description: */
52 show : function(data, cb)
60 this.dialog.show(this.data._el);
63 this.form.setValues(data);
64 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
72 this.dialog = Roo.factory({
74 cls : 'modal-body-enable-overflow-y pman-badmin-image-manager',
76 title : _this._strings['d9787032e54a7facd5c7b1db2ae61c7b'] /* Image Manager */,
78 resize : function (_self)
80 if (_this.dialog && _this.container && _this.toolbar) {
82 _this.document_container.el.setHeight(
83 _this.dialog.bodyEl.getHeight() -
84 _this.dialog.headerEl.getHeight() -
85 _this.toolbar.el.dom.offsetHeight -
86 _this.dialog.footerEl.getHeight()
93 '|xns' : 'Roo.bootstrap',
97 html : _this._strings['d3d2e617335f08df83599665eef8a418'] /* Close */,
101 click : function (_self, e)
107 '|xns' : 'Roo.bootstrap'
114 '|xns' : 'Roo.bootstrap',
120 render : function (_self)
122 _this.masonryBlock = this;
126 '|xns' : 'Roo.bootstrap',
132 style : 'display: none;',
134 url : baseURL + '/Roo/Images.php',
136 actioncomplete : function(_self,action)
138 if (action.type == 'setdata') {
140 _this.showType = 'public';
142 this.url = _this.data._url ? baseURL + _this.data._url : baseURL + '/Roo/Images.php';
144 this.el.dom.action = this.url;
146 if (typeof(_this.data.timeout) != 'undefined') {
147 this.timeout = _this.data.timeout;
150 this.findField('UPLOAD_IDENTIFIER').setValue(
151 (new Date() * 1) + '' + Math.random());
153 _this.masonry.load();
159 if (action.type == 'load') {
161 _this.data = action.result.data;
167 if (action.type == 'submit') { // only submitted here if we are
169 _this.masonry.load();
177 actionfailed : function (_self, action)
179 if (action.type == 'submit') {
180 Roo.log("Upload error");
185 Roo.MessageBox.alert("Error", action.result.errorMsg.split(/\n/).join('<BR/>'));
189 Roo.MessageBox.alert("Error", "Saving failed = fix errors and try again");
194 Roo.MessageBox.alert("Error", "Error loading details");
196 render : function (_self)
203 '|xns' : 'Roo.bootstrap',
207 fieldLabel : _this._strings['ef797d5638c2e1c6b6225b2247541ea5'] /* Upload Image or File: */,
210 name : 'imageUpload',
212 render : function (_self)
214 _this.uploadDL = this;
216 _this.uploadDL.inputEl().on("change",function(){
218 _this.form.findField('onid').setValue((_this.showType == 'private') ? _this.data.onid : 0);
219 _this.form.doAction('submit');
226 '|xns' : 'Roo.bootstrap'
230 inputType : 'hidden',
231 name : 'UPLOAD_IDENTIFIER',
233 '|xns' : 'Roo.bootstrap'
237 inputType : 'hidden',
238 name : 'post_max_size',
240 '|xns' : 'Roo.bootstrap'
244 inputType : 'hidden',
245 name : 'upload_max_filesize',
247 '|xns' : 'Roo.bootstrap'
251 inputType : 'hidden',
254 '|xns' : 'Roo.bootstrap'
258 inputType : 'hidden',
261 '|xns' : 'Roo.bootstrap'
265 inputType : 'hidden',
268 '|xns' : 'Roo.bootstrap'
276 render : function (_self)
278 _this.container = this;
283 '|xns' : 'Roo.bootstrap',
288 render : function (_self)
290 _this.toolbar = this;
294 '|xns' : 'Roo.bootstrap',
301 '|xns' : 'Roo.bootstrap',
305 html : _this._strings['53ab4599d0106e32d015649175a70d7b'] /* <i class="fa fa-filter"></i> Filter */,
307 '|xns' : 'Roo.bootstrap',
311 '|xns' : 'Roo.bootstrap',
315 html : _this._strings['179d4ab94c43ccb7cd6d2b3d82c7fe1f'] /* Show images for this email */,
317 preventDefault : true,
319 click : function (_self, e)
321 _this.showType = 'private';
323 _this.masonry.load();
327 '|xns' : 'Roo.bootstrap'
331 html : _this._strings['2cd3a1900dd0060540b418b2a60f6eec'] /* Show all images */,
333 preventDefault : true,
335 click : function (_self, e)
337 _this.showType = 'public';
339 _this.masonry.load();
343 '|xns' : 'Roo.bootstrap'
350 placeholder : _this._strings['37c1097cf82226d511586ecd99ed97cf'] /* search for image */,
351 style : 'width: 200px; margin-left: 15px;display: inline-block; margin-bottom: 0px; vertical-align: middle;',
353 render : function (_self)
355 _this.searchBox = this;
357 specialkey : function (_self, e)
362 if(e.keyCode == e.ENTER) {
363 _this.masonry.clearAll();
364 _this.masonry.load();
370 '|xns' : 'Roo.bootstrap',
373 html : _this._strings['cdb6b6bab1fd18b9dbfe3fb84a5d34ae'] /* <i class="fa fa-search"></i> */,
375 click : function (_self, e)
377 _this.masonry.clearAll();
378 _this.masonry.load();
382 '|xns' : 'Roo.bootstrap'
393 '|xns' : 'Roo.bootstrap',
397 html : _this._strings['5350277f16d9998c57fa7e1d17be2a76'] /* <i class="fa fa-upload"></i> Upload Image */,
401 click : function (_self, e)
403 var id = _this.data.onid;
406 Roo.MessageBox.alert('Error', 'Please save the email template first');
410 _this.uploadDL.inputEl().dom.click();
414 '|xns' : 'Roo.bootstrap'
418 html : _this._strings['ed807858fcb68abdd180481f1fcba5c5'] /* <i class="fa fa-trash"></i> Delete */,
420 style : 'margin-left: 15px;',
423 click : function (_self, e)
425 if (_this.masonry.getSelected().length > 1) {
426 Roo.bootstrap.MessageBox.alert('Cannot delete the images !','Please select one image only');
430 if (_this.masonry.getSelected().length < 1) {
431 Roo.bootstrap.MessageBox.alert('Cannot delete any image!', 'Please select an image');
435 Roo.bootstrap.MessageBox.confirm("Confirm", "Are sure you want to delete this image?", function (v){
441 url : baseURL + '/Roo/Images.php',
444 _delete : Roo.bootstrap.MasonryBrick.get(_this.masonry.getSelected()[0]).imageObj.id
448 // _this.masonry.removeBrick(_this.masonry.getSelected()[0]);
449 _this.masonry.load();
454 render : function (_self)
456 _this.deleteBtn = this;
462 '|xns' : 'Roo.bootstrap'
470 style : 'margin-top: 15px;',
472 render : function (_self)
474 _this.document_container = this;
476 this.el.setStyle('overflow', 'auto');
480 '|xns' : 'Roo.bootstrap',
486 '|xns' : 'Roo.bootstrap',
489 xtype : 'LayoutMasonry',
490 activeClass : 'active',
492 isAutoInitial : false,
493 isLayoutInstant : false,
496 _this.setting_form.reset();
497 _this.detail_form.reset();
499 _this.setting_form.hide();
500 _this.detail_form.hide();
502 _this.masonry.clearAll();
505 ontable : 'core_email',
506 'search[filename]' : _this.searchBox.getValue()
509 if(_this.showType == 'private'){
510 params.onid = _this.data.onid;
514 url: baseURL + '/Roo/Images',
517 success: function(ret) {
519 if(!ret.data.length){
523 Roo.each(ret.data, function(r){
525 _this.masonry.addBrick({
528 cls: 'coba-image-mgmt-masonry-brick',
530 activeClass: 'active',
531 preventDefault: true,
532 bgimage : baseURL + '/Images/' + r.id + '/' + r.filename.replace('%', '-'),
535 click : function (_self)
537 _this.setting_form.reset();
538 _this.detail_form.reset();
540 _this.setting_form.hide();
541 _this.detail_form.hide();
543 _this.deleteBtn.hide();
545 _this.masonryBlock.el.removeClass(['col-md-12','col-md-8']).addClass('col-md-12');
547 if(!this.isSelected()){
551 _this.masonryBlock.el.removeClass(['col-md-12','col-md-8']).addClass('col-md-8');
553 if(_this.masonry.getSelected().length == 1){
554 _this.deleteBtn.show();
558 url: baseURL + '/Roo/Images.php',
561 _id: _self.imageObj.id
563 success : function(rr) {
565 _this.setting_form.show();
566 _this.detail_form.show();
568 _this.detail_form.setValues(rr.data);
569 _this.setting_form.setValues(rr.data);
571 _this.setting_form.findField('align').setValue("left");
573 _self.imageObj = rr.data;
583 _this.masonry.initial();
587 failure: function(res) {
588 Roo.log('cannot read Coba/Roo/Images');
593 render : function (_self)
595 _this.masonry = this;
600 '|xns' : 'Roo.bootstrap'
614 '|xns' : 'Roo.bootstrap',
619 '|xns' : 'Roo.bootstrap',
625 '|xns' : 'Roo.bootstrap',
630 url : baseURL + '/Roo/Images',
632 render : function (_self)
634 _this.setting_form = this;
638 '|xns' : 'Roo.bootstrap',
642 header : _this._strings['1a0ce561842e3caef9098f46ecaa1dcf'] /* Add Images with Settings */,
644 style : 'width: 100%;',
646 '|xns' : 'Roo.bootstrap',
651 '|xns' : 'Roo.bootstrap',
657 '|xns' : 'Roo.bootstrap',
662 fieldLabel : _this._strings['031fa343a28d221a25d2bcd942437174'] /* Alternate Text: */,
666 '|xns' : 'Roo.bootstrap'
675 '|xns' : 'Roo.bootstrap',
680 style : 'margin-top:15px;',
682 '|xns' : 'Roo.bootstrap',
687 fieldLabel : _this._strings['e933dc24fb245d863a43b4fefe9b45f5'] /* Height: */,
691 '|xns' : 'Roo.bootstrap'
700 '|xns' : 'Roo.bootstrap',
705 style : 'margin-top:15px;',
707 '|xns' : 'Roo.bootstrap',
712 fieldLabel : _this._strings['48ccf48dcf2218a413ce473262f21a0c'] /* Width: */,
716 '|xns' : 'Roo.bootstrap'
725 '|xns' : 'Roo.bootstrap',
730 style : 'margin-top:15px;',
732 '|xns' : 'Roo.bootstrap',
739 displayField : 'value',
741 fieldLabel : _this._strings['361bacb1a72a350ee34e2f31a6a91dab'] /* Alignment: */,
742 forceSelection : true,
746 selectOnFocus : true,
747 triggerAction : 'all',
750 '|xns' : 'Roo.bootstrap',
752 xtype : 'SimpleStore',
756 ['middle', 'middle'],
760 fields : ['code', 'value'],
772 '|xns' : 'Roo.bootstrap',
778 style : 'margin-top:15px;',
780 '|xns' : 'Roo.bootstrap',
784 html : _this._strings['84378f54966381befd040dafbdc221d6'] /* <i class="fa fa-plus"></i> Add into the email */,
788 click : function (_self, e)
790 var b = _this.masonry.getSelected();
794 Roo.bootstrap.MessageBox.alert('Cannot add any image', 'Please select an image');
798 var brick = Roo.bootstrap.MasonryBrick.get(b[0]);
805 id : brick.imageObj.id,
806 filename : brick.imageObj.filename,
807 width : _this.setting_form.findField('width').getValue(),
808 height : _this.setting_form.findField('height').getValue(),
809 descript : _this.setting_form.findField('descript').getValue(),
810 align : _this.setting_form.findField('align').getValue()
813 _this.callback.call(_this, data);
819 '|xns' : 'Roo.bootstrap'
836 '|xns' : 'Roo.bootstrap',
842 '|xns' : 'Roo.bootstrap',
847 url : baseURL + '/Roo/Images',
849 render : function (_self)
851 _this.detail_form = this;
855 '|xns' : 'Roo.bootstrap',
859 header : _this._strings['78d0f5aac952e2ce840a381976a3b01e'] /* Image Details */,
861 style : 'width: 100%; padding: 0',
863 '|xns' : 'Roo.bootstrap',
868 '|xns' : 'Roo.bootstrap',
874 '|xns' : 'Roo.bootstrap',
880 fieldLabel : _this._strings['708ea0e601087e73c4764d5086e3ea3c'] /* File Name: */,
883 style : 'padding: 0;',
885 '|xns' : 'Roo.bootstrap'
894 '|xns' : 'Roo.bootstrap',
899 style : 'margin-top:15px;',
901 '|xns' : 'Roo.bootstrap',
907 fieldLabel : _this._strings['e0a53da57dd79cca5d3b6a7c42e463ef'] /* File Type: */,
911 '|xns' : 'Roo.bootstrap'
920 '|xns' : 'Roo.bootstrap',
925 style : 'margin-top:15px;',
927 '|xns' : 'Roo.bootstrap',
933 fieldLabel : _this._strings['3f986fa4066f6bded1376eb69de18da2'] /* File Size: */,
937 '|xns' : 'Roo.bootstrap'
946 '|xns' : 'Roo.bootstrap',
951 style : 'margin-top:15px;',
953 '|xns' : 'Roo.bootstrap',
959 fieldLabel : _this._strings['14834a16229091f47cf1810177d07916'] /* Created Date: */,
963 '|xns' : 'Roo.bootstrap'
972 '|xns' : 'Roo.bootstrap',
977 style : 'margin-top:15px;',
979 '|xns' : 'Roo.bootstrap',
984 fieldLabel : _this._strings['d0042a700e9bdf79689d63ee6846dc0e'] /* Description: */,
988 '|xns' : 'Roo.bootstrap'
996 inputType : 'hidden',
999 '|xns' : 'Roo.bootstrap'
1003 xns : Roo.bootstrap,
1004 '|xns' : 'Roo.bootstrap',
1008 cls : 'text-center',
1010 style : 'margin-top:15px;',
1011 xns : Roo.bootstrap,
1012 '|xns' : 'Roo.bootstrap',
1016 html : _this._strings['d6d93f0d6b7c6018d8949e73ed6efb6c'] /* <i class="fa fa-save"></i> Save Changes */,
1019 click : function (_self, e)
1021 _this.detail_form.doAction('submit');
1024 xns : Roo.bootstrap,
1025 '|xns' : 'Roo.bootstrap'
1047 Roo.apply(Pman.Dialog.BAdminImageManager, Pman.Dialog.BAdminImageManager.prototype);