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.AdminEnumImages = {
12 show : function(data, cb)
20 this.dialog.show(this.data._el);
23 this.form.setValues(data);
24 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
32 this.dialog = Roo.factory({
35 xtype : 'LayoutRegion',
40 title : "Add / Edit Images",
41 xtype : 'LayoutDialog',
52 click : function (_self, e)
61 show : function (_self)
63 _this.grid.footer.onClick('first');
109 'name': 'displayorder',
117 'name': 'parent_image_id',
123 'dateFormat' : 'Y-m-d H:i:s'
143 totalProperty : 'total'
147 url : baseURL + '/Roo/Images.php',
155 sortInfo : { field: 'created' , direction: 'DESC' },
158 beforeload : function (_self, o)
160 //o.params.ontable = 'Companies';
162 // o.params.imgtype = 'PressRelease';
164 o.params = o.params || {};
165 o.params.onid = _this.data.onid;
166 o.params.ontable = 'core_enum';
170 load : function (_self, records, options)
172 _this.panel.el.unmask();
183 xtype : 'PagingToolbar',
184 emptyMsg : "No Images found",
187 displayMsg : "Displaying Images {0} - {1} of {2}"
195 '|xns' : 'Roo.Toolbar',
198 cls : 'x-btn-text-icon',
199 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
205 //var sel = Pman.Tab.PressReleaseCompanies ? Pman.Tab.PressReleaseCompanies.grid.getSelectionModel().getSelected() : false
207 Pman.Dialog.Image.show({
209 ontable: 'core_enum',
210 onid: _this.data.onid,
213 if (!data) { return; }
214 _this.grid.footer.onClick('first');
224 cls : 'x-btn-text-icon',
225 icon : Roo.rootURL + 'images/default/tree/leaf.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');
245 '|xns' : 'Roo.Toolbar',
248 cls : 'x-btn-text-icon',
249 icon : rootURL + '/Pman/templates/images/trash.gif',
254 Pman.genericDelete(_this, 'Images');
262 autoExpandColumn : 'title',
269 xtype : 'ColumnModel',
273 renderer : function(v,x,r) {
274 return String.format('{0}<br/><i>{1}</i><br/>{2}<br/><i>{3}x{4}</i>',
275 v.format('d/M/Y'), r.data.mimetype, r.data.filename,
276 r.data.width, r.data.height
280 dataIndex : 'created'
284 xtype : 'ColumnModel',
287 renderer : function(v,x,r) { return String.format('<img src="{0}/Images/Thumb/100/{1}/{2}" width="100">', baseURL, v, r.data.filename); },
293 xtype : 'ColumnModel',
296 renderer : function(v,x,r) {
297 // var surl = r.json.url.replace(/\/release.php\/Images\//, '/i/').replace(/\/([0-9]+)\/.*$/, '/$1');;
298 // var svurl = r.json.url_view.replace(/\/release.php\/Images\//, '/i/').replace(/\/([0-9]+)\/.*$/, '/$1');;
299 // return String.format(
300 // 'Download Url : <a href="http://{0}{1}" target="_new">http://{0}{1}</a>' +
301 // '<br/>View Url : <a href="http://{0}{2}" target="_new">http://{0}{2}</a>' +
302 //'<br/><b>{3}</b><br/>{4}</i>',
303 // window.location.host, surl, svurl,
304 // v, r.json.descript);
312 rowdblclick : function (_self, rowIndex, e)
315 var s = _self.getDataSource().getAt(rowIndex);
316 Pman.Dialog.PressReleaseImage.show(s.data, function() {
317 _this.grid.footer.onClick('first');
320 render : function() {
322 //_this.dialog = Pman.Dialog.FILL_IN
323 //if (_this.panel.active) {
324 // this.footer.onClick('first');
341 tableName : 'Images',
343 activate : function() {
346 _this.grid.footer.onClick('first');