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',
35 title : "Add / Edit Images",
42 activate : function() {
45 _this.grid.footer.onClick('first');
58 autoExpandColumn : 'title',
63 //_this.dialog = Pman.Dialog.FILL_IN
64 if (_this.panel.active) {
65 this.footer.onClick('first');
68 rowdblclick : function (_self, rowIndex, e)
71 var s = _self.getDataSource().getAt(rowIndex);
72 Pman.Dialog.PressReleaseImage.show(s.data, function() {
73 _this.grid.footer.onClick('first');
81 beforeload : function (_self, o)
83 //o.params.ontable = 'Companies';
85 // o.params.imgtype = 'PressRelease';
91 load : function (_self, records, options)
93 _this.panel.el.unmask();
97 sortInfo : { field: 'created' , direction: 'DESC' },
103 totalProperty : 'total',
138 'name': 'displayorder',
146 'name': 'parent_image_id',
152 'dateFormat' : 'Y-m-d H:i:s'
176 url : baseURL + '/Roo/Images.php'
180 xtype: 'PagingToolbar',
184 displayMsg : "Displaying Images {0} - {1} of {2}",
185 emptyMsg : "No Images found"
198 var sel = Pman.Tab.PressReleaseCompanies ? Pman.Tab.PressReleaseCompanies.grid.getSelectionModel().getSelected() : false
200 Pman.Dialog.Image.show( {
202 ontable: 'Companies',
204 imgtype : 'PressRelease'
207 if (!data) { return; }
208 Pman.Dialog.PressReleaseImage.show( data, function() {
209 _this.grid.footer.onClick('first');
216 cls : 'x-btn-text-icon',
218 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
226 var s = _this.grid.getSelectionModel().getSelections();
227 if (!s || s.length != 1) {
228 Roo.MessageBox.alert("Error", "Select a single image to edit");
231 var data = _this.grid.getDataSource().getById(s[0].data.id).data;
233 Pman.Dialog.PressReleaseImage.show(data, function() {
234 _this.grid.footer.onClick('first');
239 cls : 'x-btn-text-icon',
241 icon : Roo.rootURL + 'images/default/tree/leaf.gif'
249 Pman.genericDelete(_this, 'Images');
252 cls : 'x-btn-text-icon',
254 icon : rootURL + '/Pman/templates/images/trash.gif'
260 xtype: 'ColumnModel',
264 dataIndex : 'created',
265 renderer : function(v,x,r) {
266 return String.format('{0}<br/><i>{1}</i><br/>{2}<br/><i>{3}x{4}</i>',
267 v.format('d/M/Y'), r.data.mimetype, r.data.filename,
268 r.data.width, r.data.height
274 xtype: 'ColumnModel',
279 renderer : function(v,x,r) { return String.format('<img src="{0}/Images/Thumb/100/{1}/{2}" width="100">', baseURL, v, r.data.filename); }
282 xtype: 'ColumnModel',
287 renderer : function(v,x,r) {
288 var surl = r.json.url.replace(/\/release.php\/Images\//, '/i/').replace(/\/([0-9]+)\/.*$/, '/$1');;
289 var svurl = r.json.url_view.replace(/\/release.php\/Images\//, '/i/').replace(/\/([0-9]+)\/.*$/, '/$1');;
290 return String.format(
291 'Download Url : <a href="http://{0}{1}" target="_new">http://{0}{1}</a>' +
292 '<br/>View Url : <a href="http://{0}{2}" target="_new">http://{0}{2}</a>' +
293 '<br/><b>{3}</b><br/>{4}</i>',
294 window.location.host, surl, svurl,
304 xtype: 'LayoutRegion',
312 click : function (_self, e)
315 _this.callback(true);
324 click : function (_self, e)
327 _this.callback(true);