1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Pman.Dialog.AdminEnumImages = {
10 show : function(data, cb)
18 this.dialog.show(this.data._el);
21 this.form.setValues(data);
22 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
30 this.dialog = Roo.factory({
31 xtype: 'LayoutDialog',
34 show : function (_self)
36 _this.grid.footer.onClick('first');
41 title : "Add / Edit Images",
48 activate : function() {
51 _this.grid.footer.onClick('first');
67 //_this.dialog = Pman.Dialog.FILL_IN
68 //if (_this.panel.active) {
69 // this.footer.onClick('first');
72 rowdblclick : function (_self, rowIndex, e)
75 var s = _self.getDataSource().getAt(rowIndex);
76 Pman.Dialog.PressReleaseImage.show(s.data, function() {
77 _this.grid.footer.onClick('first');
81 autoExpandColumn : 'title',
87 beforeload : function (_self, o)
89 //o.params.ontable = 'Companies';
91 // o.params.imgtype = 'PressRelease';
93 o.params = o.params || {};
94 o.params.onid = _this.data.onid;
95 o.params.ontable = 'core_enum';
99 load : function (_self, records, options)
101 _this.panel.el.unmask();
105 sortInfo : { field: 'created' , direction: 'DESC' },
111 totalProperty : 'total',
146 'name': 'displayorder',
154 'name': 'parent_image_id',
160 'dateFormat' : 'Y-m-d H:i:s'
184 url : baseURL + '/Roo/Images.php'
188 xtype: 'PagingToolbar',
192 displayMsg : "Displaying Images {0} - {1} of {2}",
193 emptyMsg : "No Images found"
206 //var sel = Pman.Tab.PressReleaseCompanies ? Pman.Tab.PressReleaseCompanies.grid.getSelectionModel().getSelected() : false
208 Pman.Dialog.Image.show({
210 ontable: 'core_enum',
211 onid: _this.data.onid,
214 if (!data) { return; }
215 _this.grid.footer.onClick('first');
220 cls : 'x-btn-text-icon',
222 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
230 var s = _this.grid.getSelectionModel().getSelections();
231 if (!s || s.length != 1) {
232 Roo.MessageBox.alert("Error", "Select a single image to edit");
235 var data = _this.grid.getDataSource().getById(s[0].data.id).data;
237 Pman.Dialog.PressReleaseImage.show(data, function() {
238 _this.grid.footer.onClick('first');
243 cls : 'x-btn-text-icon',
245 icon : Roo.rootURL + 'images/default/tree/leaf.gif'
253 Pman.genericDelete(_this, 'Images');
256 cls : 'x-btn-text-icon',
258 icon : rootURL + '/Pman/templates/images/trash.gif'
264 xtype: 'ColumnModel',
268 dataIndex : 'created',
269 renderer : function(v,x,r) {
270 return String.format('{0}<br/><i>{1}</i><br/>{2}<br/><i>{3}x{4}</i>',
271 v.format('d/M/Y'), r.data.mimetype, r.data.filename,
272 r.data.width, r.data.height
278 xtype: 'ColumnModel',
283 renderer : function(v,x,r) { return String.format('<img src="{0}/Images/Thumb/100/{1}/{2}" width="100">', baseURL, v, r.data.filename); }
286 xtype: 'ColumnModel',
291 renderer : function(v,x,r) {
292 // var surl = r.json.url.replace(/\/release.php\/Images\//, '/i/').replace(/\/([0-9]+)\/.*$/, '/$1');;
293 // var svurl = r.json.url_view.replace(/\/release.php\/Images\//, '/i/').replace(/\/([0-9]+)\/.*$/, '/$1');;
294 // return String.format(
295 // 'Download Url : <a href="http://{0}{1}" target="_new">http://{0}{1}</a>' +
296 // '<br/>View Url : <a href="http://{0}{2}" target="_new">http://{0}{2}</a>' +
297 //'<br/><b>{3}</b><br/>{4}</i>',
298 // window.location.host, surl, svurl,
299 // v, r.json.descript);
308 xtype: 'LayoutRegion',
316 click : function (_self, e)
319 _this.callback(true);