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.CmsPage = {
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',
42 xtype : 'LayoutRegion',
52 xtype : 'LayoutDialog',
82 _this.dialog.el.mask("Saving");
83 _this.form.findField('contents').syncValue();
84 _this.form.doAction("submit");
96 xtype : 'ContentPanel',
101 url : baseURL + '/Roo/Page.php',
104 style : 'margin: 5px',
107 actionfailed : function (_self, action)
109 _this.dialog.el.unmask();
110 Pman.standardActionFailed(_self, action);
112 actioncomplete : function (_self, action)
115 if (action.type =='submit') {
117 _this.dialog.el.unmask();
120 if (_this.callback) {
121 _this.callback.call(_this, _this.form.getValues());
126 if (action.type == 'setdata') {
127 _this.loaded = false;
129 // _this.dialog.getLayout().showPanel(0);
130 // _this.form.addForm(_this.form1);
131 if ( _this.data.id) {
132 _this.dialog.el.mask("Loading");
133 this.load({ method: 'GET', params: { '_id' : _this.data.id }});
136 //disable image upload!
137 _this.form.findField('publish_status').setValue(-1);
144 if (action.type == 'load') {
145 _this.dialog.el.unmask();
146 _this.grid.getDataSource().load();
150 rendered : function (_self)
158 fieldLabel : 'Page link',
168 url : baseURL + '/Roo/Page.php',
177 xtype : 'JsonReader',
179 { name: 'id', type: 'int' },
184 totalProperty : 'total'
189 sortInfo : { field: 'page_link', direction: 'ASC' },
198 triggerAction : 'all',
199 fieldLabel : 'Parent page',
200 forceSelection : true,
201 selectOnFocus : true,
203 displayField : 'page_link',
204 emptyText : "Select Parent",
205 hiddenName : 'parent_id',
214 name : 'parent_id_page_link',
215 qtip : "Select Category ",
216 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b><br/><i>{page_link}</i> </div>',
217 loadingText : "Searching...",
230 fieldLabel : 'Date to Publish',
239 fieldLabel : 'Replaces',
260 boxLabel : 'Visible',
268 boxLabel : 'Display in RSS',
276 boxLabel : 'Extended Vis.?',
279 name : 'has_extended'
286 fieldLabel : 'Title',
301 fieldLabel : 'Contents',
302 xtype : 'HtmlEditor',
321 fieldLabel : 'Extended Contents',
322 xtype : 'HtmlEditor',
351 xtype : 'JsonReader',
387 'name': 'displayorder',
395 'name': 'parent_image_id',
401 'dateFormat': 'Y-m-d'
420 'name': 'parent_image_id_id',
424 'name': 'parent_image_id_filename',
428 'name': 'parent_image_id_ontable',
432 'name': 'parent_image_id_onid',
436 'name': 'parent_image_id_mimetype',
440 'name': 'parent_image_id_width',
444 'name': 'parent_image_id_height',
448 'name': 'parent_image_id_filesize',
452 'name': 'parent_image_id_displayorder',
456 'name': 'parent_image_id_language',
460 'name': 'parent_image_id_parent_image_id',
464 'name': 'parent_image_id_created',
468 'name': 'parent_image_id_imgtype',
472 'name': 'parent_image_id_linkurl',
476 'name': 'parent_image_id_descript',
480 'name': 'parent_image_id_title',
484 totalProperty : 'total'
488 url : baseURL + '/Roo/Images.php',
497 beforeload : function (_self, o)
499 if (!_this.data.id) {
502 o.params = o.params || {};
503 o.params.onid = _this.data.id;
504 o.params.ontable = 'Page';
521 cls : 'x-btn-text-icon',
522 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
527 Pman.Dialog.Image.show( { id : 0, onid: _this.data.id, ontable: 'Page' }, function() {
528 _this.grid.getDataSource().load();
538 cls : 'x-btn-text-icon',
539 icon : rootURL + '/Pman/templates/images/trash.gif',
544 Pman.genericDelete(_this, _this.panel.tableName);
552 autoExpandColumn : 'filename',
559 xtype : 'ColumnModel',
563 renderer : function(v,x,r) { return String.format('<img src="{0}/Images/Thumb/100/{1}/{2}">', baseURL, v, r.data.filename); },
569 xtype : 'ColumnModel',
572 renderer : function(v) { return String.format('{0}', v); },
574 dataIndex : 'filename'
578 rowdblclick : function (_self, rowIndex, e)
580 var rd = _this.grid.getDataSource().getAt(rowIndex);
582 var url = String.format('{0}/Images/{1}/{2}', baseURL, rd.data.id, rd.data.filename);
583 _this.form.findField('contents').execCmd('insertimage', url);
586 render : function() {
588 //_this.dialog = Pman.Dialog.FILL_IN
589 if (_this.panel.active) {
590 //this.footer.onClick('first');
607 tableName : 'Images',
609 activate : function() {
612 _this.grid.footer.onClick('first');