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 : 'Replaces',
109 name : 'replaces_id',
115 fieldLabel : 'Page link',
123 displayField : 'link_path',
125 emptyText : "Select Parent",
126 fieldLabel : 'Parent page',
127 forceSelection : true,
128 hiddenName : 'parent_id',
130 loadingText : "Searching...",
132 name : 'parent_id_link_path',
134 qtip : "Select Category ",
135 selectOnFocus : true,
136 tpl : '<div class="x-grid-cell-text x-btn button"><b>{title}</b> </div>',
137 triggerAction : 'all',
148 url : baseURL + '/Roo/Page.php'
155 totalProperty : 'total',
157 { name: 'id', type: 'int' },
167 fieldLabel : 'Date to Publish',
181 boxLabel : 'Visible',
188 boxLabel : 'Display in RSS',
195 boxLabel : 'Extended Vis.?',
197 name : 'has_extended',
205 fieldLabel : 'Title',
218 fieldLabel : 'Contents',
234 fieldLabel : 'Extended Contents',
256 tableName : 'Images',
259 activate : function() {
262 _this.grid.footer.onClick('first');
270 autoExpandColumn : 'filename',
273 render : function() {
275 //_this.dialog = Pman.Dialog.FILL_IN
276 if (_this.panel.active) {
277 //this.footer.onClick('first');
280 rowdblclick : function (_self, rowIndex, e)
282 var rd = _this.grid.getDataSource().getAt(rowIndex);
284 var url = String.format('{0}/Images/{1}/{2}', baseURL, rd.data.id, rd.data.filename);
285 _this.form.findField('contents').execCmd('insertimage', url);
292 reader : Pman.Readers.Images,
294 beforeload : function (_self, o)
296 if (!_this.data.id) {
299 o.params = o.params || {};
300 o.params.onid = _this.data.id;
301 o.params.ontable = 'Page';
308 url : baseURL + '/Roo/Images.php'
319 cls : 'x-btn-text-icon',
320 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
324 Pman.Dialog.Image.show( { id : 0, onid: _this.data.id, ontable: 'Page' }, function() {
325 _this.grid.getDataSource().load();
335 cls : 'x-btn-text-icon',
336 icon : rootURL + '/Pman/templates/images/trash.gif',
340 Pman.genericDelete(_this, _this.panel.tableName);
348 xtype: 'ColumnModel',
353 renderer : function(v,x,r) { return String.format('<img src="{0}/Images/Thumb/100/{1}/{2}">', baseURL, v, r.data.filename); },
357 xtype: 'ColumnModel',
361 dataIndex : 'filename',
362 renderer : function(v) { return String.format('{0}', v); }
369 xtype: 'LayoutRegion',
374 xtype: 'LayoutRegion',
402 _this.dialog.el.mask("Saving");
403 _this.form.findField('contents').syncValue();
404 _this.form.doAction("submit");