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',
54 actionfailed : function (_self, action)
56 _this.dialog.el.unmask();
57 Pman.standardActionFailed(_self, action);
59 actioncomplete : function (_self, action)
62 if (action.type =='submit') {
64 _this.dialog.el.unmask();
68 _this.callback.call(_this, _this.form.getValues());
73 if (action.type == 'setdata') {
76 // _this.dialog.getLayout().showPanel(0);
77 // _this.form.addForm(_this.form1);
79 _this.dialog.el.mask("Loading");
80 this.load({ method: 'GET', params: { '_id' : _this.data.id }});
83 //disable image upload!
84 _this.form.findField('publish_status').setValue(-1);
91 if (action.type == 'load') {
92 _this.dialog.el.unmask();
93 _this.grid.getDataSource().load();
97 rendered : function (_self)
103 style : 'margin: 5px',
104 url : baseURL + '/Roo/Page.php',
109 fieldLabel : 'Replaces',
110 name : 'replaces_id',
116 fieldLabel : 'Parent',
123 fieldLabel : 'Page link',
130 fieldLabel : 'Display in RSS',
138 displayField : 'title',
140 emptyText : "Select Category ",
141 fieldLabel : 'Category ',
142 forceSelection : true,
143 hiddenName : 'category_id',
145 loadingText : "Searching...",
147 name : 'category_id_title',
149 qtip : "Select Category ",
150 queryParam : 'query[title]',
151 selectOnFocus : true,
152 tpl : '<div class="x-grid-cell-text x-btn button"><b>{title}</b> </div>',
153 triggerAction : 'all',
160 reader : Pman.Readers.Category,
164 url : baseURL + '/Roo/Category.php',
172 fieldLabel : 'Title',
185 fieldLabel : 'Contents',
200 fieldLabel : 'Use Extended Contents?',
216 fieldLabel : 'Extended Contents',
231 fieldLabel : 'Visible',
238 fieldLabel : 'Has extended',
239 name : 'has_extended',
245 fieldLabel : 'Date to Publish',
259 tableName : 'Images',
262 activate : function() {
265 _this.grid.footer.onClick('first');
273 autoExpandColumn : 'filename',
276 render : function() {
278 //_this.dialog = Pman.Dialog.FILL_IN
279 if (_this.panel.active) {
280 //this.footer.onClick('first');
283 rowdblclick : function (_self, rowIndex, e)
285 var rd = _this.grid.getDataSource().getAt(rowIndex);
287 var url = String.format('{0}/Images/{1}/{2}', baseURL, rd.data.id, rd.data.filename);
288 _this.form.findField('contents').execCmd('insertimage', url);
295 reader : Pman.Readers.Images,
297 beforeload : function (_self, o)
299 if (!_this.data.id) {
302 o.params = o.params || {};
303 o.params.onid = _this.data.id;
304 o.params.ontable = 'Page';
311 url : baseURL + '/Roo/Images.php'
322 cls : 'x-btn-text-icon',
323 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
327 Pman.Dialog.Image.show( { id : 0, onid: _this.data.id, ontable: 'Page' }, function() {
328 _this.grid.getDataSource().load();
338 cls : 'x-btn-text-icon',
339 icon : rootURL + '/Pman/templates/images/trash.gif',
343 Pman.genericDelete(_this, _this.panel.tableName);
351 xtype: 'ColumnModel',
356 renderer : function(v,x,r) { return String.format('<img src="{0}/Images/Thumb/100/{1}/{2}">', baseURL, v, r.data.filename); },
360 xtype: 'ColumnModel',
364 dataIndex : 'filename',
365 renderer : function(v) { return String.format('{0}', v); }
372 xtype: 'LayoutRegion',
377 xtype: 'LayoutRegion',
405 _this.dialog.el.mask("Saving");
406 _this.form.findField('contents').syncValue();
407 _this.form.doAction("submit");