2 "gen_extended" : false,
9 " if (!dlg.haveProgress) {",
10 " Roo.MessageBox.progress(\"Uploading\", \"Uploading\");",
13 " if (dlg.haveProgress == 2) {",
14 " // it's been closed elsewhere..",
17 " if (dlg.uploadComplete) {",
18 " Roo.MessageBox.hide();",
22 " dlg.haveProgress = 1;",
24 " var uid = _this.form.findField('UPLOAD_IDENTIFIER').getValue();",
25 " new Pman.Request({",
26 " url : baseURL + '/Core/UploadProgress.php',",
31 " success : function(res){",
32 " //console.log(data);",
33 " var data = res.data;",
34 " if (dlg.haveProgress == 2) {",
35 " // it's been closed elsewhere..",
39 " if (dlg.uploadComplete) {",
40 " Roo.MessageBox.hide();",
45 " Roo.MessageBox.updateProgress(data.bytes_uploaded/data.bytes_total,",
46 " Math.floor((data.bytes_total - data.bytes_uploaded)/1000) + 'k remaining'",
49 " Roo.MessageBox.updateProgress(1,",
50 " \"Upload Complete - processing\"",
54 " dlg.uploadProgress.defer(2000,dlg);",
56 " failure: function(data) {",
57 " // console.log('fail');",
58 " // console.log(data);",
67 "collapsible" : false,
68 "haveProgress" : false,
74 "xtype" : "LayoutRegion"
78 "Boolean fitContainer" : true,
82 "$ url" : "baseURL + '/Roo/Images.php'",
88 "name" : "UPLOAD_IDENTIFIER",
93 "name" : "post_max_size",
99 "name" : "upload_max_filesize",
104 "$ xns" : "Roo.form",
105 "Boolean allowBlank" : false,
106 "fieldLabel" : "Upload Image or File",
107 "inputType" : "file",
108 "name" : "imageUpload",
110 "xtype" : "TextField"
113 "$ xns" : "Roo.form",
114 "String actionMode" : "fieldEl",
116 "alwaysQuery" : true,
117 "displayField" : "display_name",
118 "emptyText" : "Select image type",
119 "fieldLabel" : "Image Type",
120 "forceSelection" : true,
121 "hiddenName" : "imgtype",
124 "$ sortInfo" : "{ direction : 'ASC', field: 'name' }",
125 "$ xns" : "Roo.data",
129 "$ url" : "baseURL + '/Roo/Core_enum'",
130 "$ xns" : "Roo.data",
133 "xtype" : "HttpProxy"
136 "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]",
137 "$ xns" : "Roo.data",
141 "totalProperty" : "total",
142 "xtype" : "JsonReader"
147 "function (_self, o){",
148 " o.params = o.params || {};",
150 " o.params.etype = 'ImageType';",
152 " o.params.active = 1;",
162 "loadingText" : "Searching...",
164 "name" : "imgtype_name",
166 "qtip" : "Select image type",
167 "queryParam" : "query[search]",
168 "selectOnFocus" : true,
169 "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> {name}</div>",
170 "triggerAction" : "all",
172 "valueField" : "name",
177 "$ xns" : "Roo.form",
182 "$ xns" : "Roo.form",
187 "$ xns" : "Roo.form",
195 "function (_self, act)",
199 " _this.dialog.uploadComplete = true;",
200 " // _this.dialog.el.unmask();",
202 " _this.dialog.haveProgress = 2; ",
203 " if (act.type == 'submit') {",
204 " Roo.log(\"Upload error\");",
208 " Roo.MessageBox.alert(\"Error\", act.result.errorMsg.split(/\\n/).join('<BR/>'));",
211 " Roo.MessageBox.alert(\"Error\", \"Saving failed = fix errors and try again\"); ",
216 " // what about load failing..",
217 " Roo.MessageBox.alert(\"Error\", \"Error loading details\"); ",
220 "|actioncomplete" : [
221 "function(_self,act)",
223 " _this.dialog.uploadComplete = true;",
224 " _this.dialog.haveProgress = 2; ",
225 " Roo.MessageBox.hide(); // force hiding",
226 " //_this.dialog.el.unmask();",
228 " if (act.type == 'setdata') { ",
230 " _this.form.findField('imgtype').hide();",
232 " _this.dialog.resizeTo(500, 140);",
234 " if(_this.data._show_image_type){",
235 " _this.form.findField('imgtype').show();",
236 " _this.dialog.resizeTo(500, 170);",
239 " this.url = _this.data._url ? _this.data._url : baseURL + '/Roo/Images.php';",
240 " this.el.dom.action = this.url;",
241 " if (typeof(_this.data.timeout) != 'undefined') {",
242 " this.timeout = _this.data.timeout;",
245 " this.findField('UPLOAD_IDENTIFIER').setValue(",
246 " (new Date() * 1) + '' + Math.random());",
252 " if (act.type == 'load') {",
253 " // should this happen? ",
254 " _this.data = act.result.data;",
255 " // _this.loaded();",
260 " if (act.type == 'submit') { // only submitted here if we are ",
261 " _this.dialog.hide();",
262 " Roo.log(\"Upload success\");",
264 " //console.log(act);",
265 " if (_this.callback) {",
266 " _this.callback.call(this, act.result.data, act.result.extra);",
279 " _this.form= form;",
285 "style" : "margin:10px;",
291 "xtype" : "ContentPanel"
295 "* prop" : "buttons[]",
298 "function (_self, e)",
300 " _this.dialog.hide();",
309 "* prop" : "buttons[]",
312 "function (_self, e)",
314 " // do some checks?",
316 " //_this.dialog.el.mask(\"Sending\");",
317 " _this.dialog.uploadComplete = false;",
318 " _this.form.doAction('submit', {",
320 " ts : Math.random()",
323 " _this.dialog.haveProgress = 0; // set to show..",
324 " _this.dialog.uploadProgress.defer(1000, _this.dialog);",
338 " // this does not really work - escape on the borders works..",
339 " // resize to fit.. if we have styled stuff...",
346 " var pad = d.el.getSize().height - (d.header.getSize().height +",
347 " d.footer.getSize().height + ",
348 " d.layout.getRegion('center').getPanel(0).el.getSize().height",
353 " d.header.getSize().height +",
354 " d.footer.getSize().height + ",
355 " d.layout.getRegion('center').getPanel(0).el.child('div').getSize().height",
357 " this.resizeTo(d.el.getSize().width, height);",
359 " if (this.keylistener) {",
362 " this.keylistener = this.addKeyListener(27, this.hide, this);",
370 "title" : "Upload an Image or File",
371 "uploadComplete" : false,
373 "xtype" : "LayoutDialog"
377 "name" : "Pman.Dialog.Image",
379 "imageUpload_fieldLabel" : "ea72bacd2fdfa818907bb9559e6905a1",
380 "imgtype_name_emptyText" : "dff0c70e4c11953e4e3ee1cf268fb96d",
381 "imgtype_name_fieldLabel" : "8e16a71b3d8217eb80b39b7d8dec4296",
382 "imgtype_name_loadingText" : "1243daf593fa297e07ab03bf06d925af",
383 "imgtype_name_qtip" : "dff0c70e4c11953e4e3ee1cf268fb96d",
384 "post_max_size_value" : "eb5d45750c7ab13aa8e6bacc80315a30",
385 "upload_max_filesize_value" : "eb5d45750c7ab13aa8e6bacc80315a30"
390 "1243daf593fa297e07ab03bf06d925af" : "Searching...",
391 "2859a4ae58ae4e25abdfc530f814e42f" : "Upload an Image or File",
392 "8e16a71b3d8217eb80b39b7d8dec4296" : "Image Type",
393 "91412465ea9169dfd901dd5e7c96dd99" : "Upload",
394 "dff0c70e4c11953e4e3ee1cf268fb96d" : "Select image type",
395 "ea4788705e6873b424c65e91c2846b19" : "Cancel",
396 "ea72bacd2fdfa818907bb9559e6905a1" : "Upload Image or File",
397 "eb5d45750c7ab13aa8e6bacc80315a30" : "32M"