1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Pman.Dialog.CmsPage = {
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',
43 xtype: 'ContentPanel',
53 actionfailed : function (_self, action)
55 _this.dialog.el.unmask();
56 Pman.standardActionFailed(_self, action);
58 actioncomplete : function (_self, action)
61 if (action.type =='submit') {
63 _this.dialog.el.unmask();
67 _this.callback.call(_this, _this.form.getValues());
72 if (action.type == 'setdata') {
75 // _this.dialog.getLayout().showPanel(0);
76 // _this.form.addForm(_this.form1);
78 _this.dialog.el.mask("Loading");
79 this.load({ method: 'GET', params: { '_id' : _this.data.id }});
82 //disable image upload!
83 _this.form.findField('publish_status').setValue(-1);
90 if (action.type == 'load') {
91 _this.dialog.el.unmask();
92 _this.grid.getDataSource().load();
96 rendered : function (_self)
102 style : 'margin: 5px',
103 url : baseURL + '/Roo/Page.php',
108 fieldLabel : 'Page link',
116 displayField : 'page_link',
118 emptyText : "Select Parent",
119 fieldLabel : 'Parent page',
120 forceSelection : true,
121 hiddenName : 'parent_id',
123 loadingText : "Searching...",
125 name : 'parent_id_page_link',
127 qtip : "Select Category ",
128 selectOnFocus : true,
129 tpl : '<div class="x-grid-cell-text x-btn button"><b>{title}</b><br/><i>{page_link}</i> </div>',
130 triggerAction : 'all',
138 sortInfo : { field: 'page_link', direction: 'ASC' },
143 url : baseURL + '/Roo/Page.php'
150 totalProperty : 'total',
152 { name: 'id', type: 'int' },
166 fieldLabel : 'Date to Publish',
174 fieldLabel : 'Replaces',
175 name : 'replaces_id',
190 boxLabel : 'Visible',
197 boxLabel : 'Display in RSS',
204 boxLabel : 'Extended Vis.?',
206 name : 'has_extended',
214 fieldLabel : 'Title',
227 fieldLabel : 'Contents',
243 fieldLabel : 'Extended Contents',
265 tableName : 'Images',
268 activate : function() {
271 _this.grid.footer.onClick('first');
279 autoExpandColumn : 'filename',
282 render : function() {
284 //_this.dialog = Pman.Dialog.FILL_IN
285 if (_this.panel.active) {
286 //this.footer.onClick('first');
289 rowdblclick : function (_self, rowIndex, e)
291 var rd = _this.grid.getDataSource().getAt(rowIndex);
293 var url = String.format('{0}/Images/{1}/{2}', baseURL, rd.data.id, rd.data.filename);
294 _this.form.findField('contents').execCmd('insertimage', url);
302 beforeload : function (_self, o)
304 if (!_this.data.id) {
307 o.params = o.params || {};
308 o.params.onid = _this.data.id;
309 o.params.ontable = 'Page';
312 reader : Pman.Readers.Images,
317 url : baseURL + '/Roo/Images.php'
330 Pman.Dialog.Image.show( { id : 0, onid: _this.data.id, ontable: 'Page' }, function() {
331 _this.grid.getDataSource().load();
336 cls : 'x-btn-text-icon',
338 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
344 cls : 'x-btn-text-icon',
345 icon : rootURL + '/Pman/templates/images/trash.gif',
349 Pman.genericDelete(_this, _this.panel.tableName);
357 xtype: 'ColumnModel',
362 renderer : function(v,x,r) { return String.format('<img src="{0}/Images/Thumb/100/{1}/{2}">', baseURL, v, r.data.filename); },
366 xtype: 'ColumnModel',
370 dataIndex : 'filename',
371 renderer : function(v) { return String.format('{0}', v); }
378 xtype: 'LayoutRegion',
383 xtype: 'LayoutRegion',
411 _this.dialog.el.mask("Saving");
412 _this.form.findField('contents').syncValue();
413 _this.form.doAction("submit");