// Auto generated file - created by app.Builder.js- do not edit directly (at present!)
+Roo.namespace('Pman.Dialog');
+
Pman.Dialog.CmsPage = {
dialog : false,
{
var _this = this;
this.dialog = Roo.factory({
- xtype: 'LayoutDialog',
- xns: Roo,
+ center : {
+ '|xns' : 'Roo',
+ xtype : 'LayoutRegion',
+ xns : Roo,
+ titlebar : false
+ },
+ east : {
+ '|xns' : 'Roo',
+ fitToFrame : true,
+ xtype : 'LayoutRegion',
+ width : 200,
+ xns : Roo,
+ titlebar : false
+ },
+ '|xns' : 'Roo',
+ modal : true,
+ collapsible : false,
background : true,
+ title : "Edit Page",
+ xtype : 'LayoutDialog',
+ width : 850,
+ xns : Roo,
closable : false,
- collapsible : false,
- height : 600,
- modal : true,
resizable : false,
- title : "Edit Page",
- width : 800,
+ height : 600,
+ buttons : [
+ {
+ '|xns' : 'Roo',
+ text : "Cancel",
+ xtype : 'Button',
+ xns : Roo,
+ listeners : {
+ click : function() {
+
+ _this.form.reset();
+
+ _this.dialog.hide();
+
+ }
+ }
+ },
+{
+ '|xns' : 'Roo',
+ text : "OK",
+ xtype : 'Button',
+ xns : Roo,
+ listeners : {
+ click : function() {
+
+ _this.dialog.el.mask("Saving");
+ _this.form.findField('contents').syncValue();
+ _this.form.doAction("submit");
+
+ }
+ }
+ }
+ ],
items : [
- {
- xtype: 'ContentPanel',
- xns: Roo,
+ {
+ '|xns' : 'Roo',
autoScroll : true,
- fitToFrame : true,
region : 'center',
+ fitToFrame : true,
+ xtype : 'ContentPanel',
+ xns : Roo,
items : [
- {
- xtype: 'Form',
- xns: Roo.form,
- listeners : {
- actionfailed : function (_self, action)
- {
- _this.dialog.el.unmask();
- Pman.standardActionFailed(_self, action);
- },
- actioncomplete : function (_self, action)
- {
-
- if (action.type =='submit') {
-
- _this.dialog.el.unmask();
- _this.dialog.hide();
-
- if (_this.callback) {
- _this.callback.call(_this, _this.form.getValues());
- }
- _this.form.reset();
- return;
- }
- if (action.type == 'setdata') {
- _this.loaded = false;
-
- // _this.dialog.getLayout().showPanel(0);
- // _this.form.addForm(_this.form1);
- if ( _this.data.id) {
- _this.dialog.el.mask("Loading");
- this.load({ method: 'GET', params: { '_id' : _this.data.id }});
- } else {
- _this.loaded = true;
- //disable image upload!
- _this.form.findField('publish_status').setValue(-1);
- }
-
- return;
-
- }
-
- if (action.type == 'load') {
- _this.dialog.el.unmask();
- _this.grid.getDataSource().load();
- return;
- }
- },
- rendered : function (_self)
- {
- _this.form = _self;
- }
- },
+ {
+ '|xns' : 'Roo.form',
+ url : baseURL + '/Roo/Page.php',
+ xtype : 'Form',
method : 'POST',
style : 'margin: 5px',
- url : baseURL + '/Roo/Page.php',
+ xns : Roo.form,
+ listeners : {
+ actionfailed : function (_self, action)
+ {
+ _this.dialog.el.unmask();
+ Pman.standardActionFailed(_self, action);
+ },
+ actioncomplete : function (_self, action)
+ {
+
+ if (action.type =='submit') {
+
+ _this.dialog.el.unmask();
+ _this.dialog.hide();
+
+ if (_this.callback) {
+ _this.callback.call(_this, _this.form.getValues());
+ }
+ _this.form.reset();
+ return;
+ }
+ if (action.type == 'setdata') {
+ _this.loaded = false;
+
+ // _this.dialog.getLayout().showPanel(0);
+ // _this.form.addForm(_this.form1);
+ if ( _this.data.id) {
+ _this.dialog.el.mask("Loading");
+ this.load({ method: 'GET', params: { '_id' : _this.data.id }});
+ } else {
+ _this.loaded = true;
+ //disable image upload!
+ _this.form.findField('publish_status').setValue(-1);
+ }
+
+ return;
+
+ }
+
+ if (action.type == 'load') {
+ _this.dialog.el.unmask();
+ _this.grid.getDataSource().load();
+ return;
+ }
+ },
+ rendered : function (_self)
+ {
+ _this.form = _self;
+ }
+ },
items : [
- {
- xtype: 'TextField',
- xns: Roo.form,
- fieldLabel : 'Replaces',
- name : 'replaces_id',
- width : 75
+ {
+ '|xns' : 'Roo.form',
+ fieldLabel : 'Page link',
+ xtype : 'TextField',
+ width : 200,
+ xns : Roo.form,
+ name : 'page_link'
},
- {
- xtype: 'ComboBox',
- xns: Roo.form,
- allowBlank : true,
- displayField : 'link_path',
- editable : false,
- emptyText : "Select Parent",
- fieldLabel : 'Parent page',
- forceSelection : true,
- hiddenName : 'parent_id',
- listWidth : 400,
- loadingText : "Searching...",
- minChars : 2,
- name : 'parent_id_link_path',
- pageSize : 20,
- qtip : "Select Category ",
- selectOnFocus : true,
- tpl : '<div class="x-grid-cell-text x-btn button"><b>{title}</b> </div>',
- triggerAction : 'all',
- typeAhead : true,
- valueField : 'id',
- width : 400,
+ {
store : {
- xtype: 'Store',
- xns: Roo.data,
proxy : {
- xtype: 'HttpProxy',
- xns: Roo.data,
+ '|xns' : 'Roo.data',
+ url : baseURL + '/Roo/Page.php',
+ xtype : 'HttpProxy',
method : 'GET',
- url : baseURL + '/Roo/Page.php'
+ xns : Roo.data
},
reader : {
- xtype: 'JsonReader',
- xns: Roo.data,
+ '|xns' : 'Roo.data',
id : 'id',
root : 'data',
- totalProperty : 'total',
+ xtype : 'JsonReader',
fields : [
- { name: 'id', type: 'int' }
- ]
- }
- }
- },
- {
- xtype: 'TextField',
- xns: Roo.form,
- fieldLabel : 'Parent',
- name : 'parent_id',
- width : 75
- },
- {
- xtype: 'TextField',
- xns: Roo.form,
- fieldLabel : 'Page link',
- name : 'page_link',
- width : 200
+ { name: 'id', type: 'int' },
+ 'title',
+ 'page_link'
+ ],
+ xns : Roo.data,
+ totalProperty : 'total'
+ },
+ '|xns' : 'Roo.data',
+ xtype : 'Store',
+ remoteSort : true,
+ sortInfo : { field: 'page_link', direction: 'ASC' },
+ xns : Roo.data,
+ items : [
+
+ ]
+
+ },
+ '|xns' : 'Roo.form',
+ listWidth : 400,
+ triggerAction : 'all',
+ fieldLabel : 'Parent page',
+ forceSelection : true,
+ selectOnFocus : true,
+ pageSize : 20,
+ displayField : 'page_link',
+ emptyText : "Select Parent",
+ hiddenName : 'parent_id',
+ minChars : 2,
+ valueField : 'id',
+ xtype : 'ComboBox',
+ allowBlank : true,
+ typeAhead : true,
+ editable : false,
+ width : 400,
+ xns : Roo.form,
+ name : 'parent_id_page_link',
+ qtip : "Select Category ",
+ tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b><br/><i>{page_link}</i> </div>',
+ loadingText : "Searching...",
+ items : [
+
+ ]
+
},
- {
- xtype: 'DateField',
- xns: Roo.form,
- fieldLabel : 'Date to Publish',
- name : 'published',
- width : 200
+ {
+ '|xns' : 'Roo.form',
+ xtype : 'Row',
+ xns : Roo.form,
+ items : [
+ {
+ '|xns' : 'Roo.form',
+ fieldLabel : 'Date to Publish',
+ format : 'Y-m-d',
+ xtype : 'DateField',
+ width : 200,
+ xns : Roo.form,
+ name : 'published'
+ },
+ {
+ '|xns' : 'Roo.form',
+ fieldLabel : 'Replaces',
+ xtype : 'TextField',
+ width : 75,
+ xns : Roo.form,
+ name : 'replaces_id'
+ }
+ ]
+
},
- {
- xtype: 'Row',
- xns: Roo.form,
+ {
+ '|xns' : 'Roo.form',
hideLabels : true,
+ xtype : 'Row',
labelWidth : 0,
width : 520,
+ xns : Roo.form,
items : [
- {
- xtype: 'Checkbox',
- xns: Roo.form,
+ {
+ '|xns' : 'Roo.form',
+ xtype : 'Checkbox',
+ width : 100,
boxLabel : 'Visible',
- name : 'visible',
- width : 100
+ xns : Roo.form,
+ name : 'visible'
},
- {
- xtype: 'Checkbox',
- xns: Roo.form,
+ {
+ '|xns' : 'Roo.form',
+ xtype : 'Checkbox',
+ width : 150,
boxLabel : 'Display in RSS',
- name : 'in_rss',
- width : 150
+ xns : Roo.form,
+ name : 'in_rss'
},
- {
- xtype: 'Checkbox',
- xns: Roo.form,
- boxLabel : 'Extended Vis.?',
+ {
+ '|xns' : 'Roo.form',
inputValue : 1,
- name : 'has_extended',
- width : 140
+ xtype : 'Checkbox',
+ boxLabel : 'Extended Vis.?',
+ width : 140,
+ xns : Roo.form,
+ name : 'has_extended'
}
]
+
},
- {
- xtype: 'TextField',
- xns: Roo.form,
+ {
+ '|xns' : 'Roo.form',
fieldLabel : 'Title',
- name : 'title',
- width : 390
+ xtype : 'TextField',
+ width : 390,
+ xns : Roo.form,
+ name : 'title'
},
- {
- xtype: 'Column',
- xns: Roo.form,
- width : '570',
+ {
+ '|xns' : 'Roo.form',
labelAlign : 'top',
+ xtype : 'Column',
+ width : 570,
+ xns : Roo.form,
items : [
- {
- xtype: 'HtmlEditor',
- xns: Roo.form,
+ {
+ '|xns' : 'Roo.form',
fieldLabel : 'Contents',
- height : 240,
+ xtype : 'HtmlEditor',
+ width : 550,
+ xns : Roo.form,
+ resizable : 's',
name : 'contents',
- width : 550
+ height : 200
}
]
+
},
- {
- xtype: 'Column',
- xns: Roo.form,
- width : '570',
+ {
+ '|xns' : 'Roo.form',
labelAlign : 'top',
+ xtype : 'Column',
+ width : 570,
+ xns : Roo.form,
items : [
- {
- xtype: 'HtmlEditor',
- xns: Roo.form,
+ {
+ '|xns' : 'Roo.form',
fieldLabel : 'Extended Contents',
- height : 340,
+ xtype : 'HtmlEditor',
+ width : 550,
+ xns : Roo.form,
+ resizable : 's',
name : 'extended',
- width : 550
+ height : 200
}
]
+
},
- {
- xtype: 'Hidden',
- xns: Roo.form,
+ {
+ '|xns' : 'Roo.form',
+ xtype : 'Hidden',
+ xns : Roo.form,
name : 'id'
}
]
+
}
]
+
},
- {
- xtype: 'GridPanel',
- xns: Roo,
- title : "Images",
- fitToframe : true,
- fitContainer : true,
- tableName : 'Images',
- background : false,
- listeners : {
- activate : function() {
- _this.panel = this;
- if (_this.grid) {
- _this.grid.footer.onClick('first');
- }
- }
- },
- region : 'east',
+ {
grid : {
- xtype: 'Grid',
- xns: Roo.grid,
- autoExpandColumn : 'filename',
- loadMask : true,
- listeners : {
- render : function() {
- _this.grid = this;
- //_this.dialog = Pman.Dialog.FILL_IN
- if (_this.panel.active) {
- //this.footer.onClick('first');
- }
- },
- rowdblclick : function (_self, rowIndex, e)
- {
- var rd = _this.grid.getDataSource().getAt(rowIndex);
- var id = rd.data.id;
- var url = String.format('{0}/Images/{1}/{2}', baseURL, rd.data.id, rd.data.filename);
- _this.form.findField('contents').execCmd('insertimage', url);
-
- }
- },
dataSource : {
- xtype: 'Store',
- xns: Roo.data,
- reader : Pman.Readers.Images,
- listeners : {
- beforeload : function (_self, o)
- {
- if (!_this.data.id) {
- return false;
- }
- o.params = o.params || {};
- o.params.onid = _this.data.id;
- o.params.ontable = 'Page';
- }
+ reader : {
+ '|xns' : 'Roo.data',
+ id : 'id',
+ root : 'data',
+ xtype : 'JsonReader',
+ xns : Roo.data,
+ fields : [
+ {
+ 'name': 'id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'filename',
+ 'type': 'string'
+ },
+ {
+ 'name': 'ontable',
+ 'type': 'string'
+ },
+ {
+ 'name': 'onid',
+ 'type': 'int'
+ },
+ {
+ 'name': 'mimetype',
+ 'type': 'string'
+ },
+ {
+ 'name': 'width',
+ 'type': 'int'
+ },
+ {
+ 'name': 'height',
+ 'type': 'int'
+ },
+ {
+ 'name': 'filesize',
+ 'type': 'int'
+ },
+ {
+ 'name': 'displayorder',
+ 'type': 'int'
+ },
+ {
+ 'name': 'language',
+ 'type': 'string'
+ },
+ {
+ 'name': 'parent_image_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'created',
+ 'type': 'date',
+ 'dateFormat': 'Y-m-d'
+ },
+ {
+ 'name': 'imgtype',
+ 'type': 'string'
+ },
+ {
+ 'name': 'linkurl',
+ 'type': 'string'
+ },
+ {
+ 'name': 'descript',
+ 'type': 'string'
+ },
+ {
+ 'name': 'title',
+ 'type': 'string'
+ },
+ {
+ 'name': 'parent_image_id_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'parent_image_id_filename',
+ 'type': 'string'
+ },
+ {
+ 'name': 'parent_image_id_ontable',
+ 'type': 'string'
+ },
+ {
+ 'name': 'parent_image_id_onid',
+ 'type': 'int'
+ },
+ {
+ 'name': 'parent_image_id_mimetype',
+ 'type': 'string'
+ },
+ {
+ 'name': 'parent_image_id_width',
+ 'type': 'int'
+ },
+ {
+ 'name': 'parent_image_id_height',
+ 'type': 'int'
+ },
+ {
+ 'name': 'parent_image_id_filesize',
+ 'type': 'int'
+ },
+ {
+ 'name': 'parent_image_id_displayorder',
+ 'type': 'int'
+ },
+ {
+ 'name': 'parent_image_id_language',
+ 'type': 'string'
+ },
+ {
+ 'name': 'parent_image_id_parent_image_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'parent_image_id_created',
+ 'type': 'date'
+ },
+ {
+ 'name': 'parent_image_id_imgtype',
+ 'type': 'string'
+ },
+ {
+ 'name': 'parent_image_id_linkurl',
+ 'type': 'string'
+ },
+ {
+ 'name': 'parent_image_id_descript',
+ 'type': 'string'
+ },
+ {
+ 'name': 'parent_image_id_title',
+ 'type': 'string'
+ }
+ ],
+ totalProperty : 'total'
},
proxy : {
- xtype: 'HttpProxy',
- xns: Roo.data,
+ '|xns' : 'Roo.data',
+ url : baseURL + '/Roo/Images.php',
method : 'GET',
- url : baseURL + '/Roo/Images.php'
- }
+ xtype : 'HttpProxy',
+ xns : Roo.data
+ },
+ '|xns' : 'Roo.data',
+ xtype : 'Store',
+ xns : Roo.data,
+ listeners : {
+ beforeload : function (_self, o)
+ {
+ if (!_this.data.id) {
+ return false;
+ }
+ o.params = o.params || {};
+ o.params.onid = _this.data.id;
+ o.params.ontable = 'Page';
+ }
+ },
+ items : [
+
+ ]
+
},
toolbar : {
- xtype: 'Toolbar',
- xns: Roo,
+ '|xns' : 'Roo',
+ xtype : 'Toolbar',
+ xns : Roo,
items : [
- {
- xtype: 'Button',
- xns: Roo,
+ {
+ '|xns' : 'Roo',
text : "Add",
+ xtype : 'Button',
cls : 'x-btn-text-icon',
icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
+ xns : Roo,
listeners : {
- click : function()
- {
- Pman.Dialog.Image.show( { id : 0, onid: _this.data.id, ontable: 'Page' }, function() {
- _this.grid.getDataSource().load();
- });
-
- }
+ click : function()
+ {
+ Pman.Dialog.Image.show( { id : 0, onid: _this.data.id, ontable: 'Page' }, function() {
+ _this.grid.getDataSource().load();
+ });
+
+ }
}
},
- {
- xtype: 'Button',
- xns: Roo,
+ {
+ '|xns' : 'Roo',
text : "Delete",
+ xtype : 'Button',
cls : 'x-btn-text-icon',
icon : rootURL + '/Pman/templates/images/trash.gif',
+ xns : Roo,
listeners : {
- click : function()
- {
- Pman.genericDelete(_this, _this.panel.tableName);
- }
+ click : function()
+ {
+ Pman.genericDelete(_this, _this.panel.tableName);
+ }
}
}
]
+
},
+ '|xns' : 'Roo.grid',
+ autoExpandColumn : 'filename',
+ xtype : 'Grid',
+ loadMask : true,
+ xns : Roo.grid,
colModel : [
- {
- xtype: 'ColumnModel',
- xns: Roo.grid,
- header : '',
- width : 50,
- dataIndex : 'id',
- renderer : function(v,x,r) { return String.format('<img src="{0}/Images/Thumb/100/{1}/{2}">', baseURL, v, r.data.filename); },
- sortable : false
- },
- {
- xtype: 'ColumnModel',
- xns: Roo.grid,
- header : 'Filename',
- width : 100,
- dataIndex : 'filename',
- renderer : function(v) { return String.format('{0}', v); }
- }
+ {
+ '|xns' : 'Roo.grid',
+ xtype : 'ColumnModel',
+ sortable : false,
+ width : 50,
+ header : '',
+ renderer : function(v,x,r) { return String.format('<img src="{0}/Images/Thumb/100/{1}/{2}">', baseURL, v, r.data.filename); },
+ xns : Roo.grid,
+ dataIndex : 'id'
+ },
+{
+ '|xns' : 'Roo.grid',
+ xtype : 'ColumnModel',
+ width : 100,
+ header : 'Filename',
+ renderer : function(v) { return String.format('{0}', v); },
+ xns : Roo.grid,
+ dataIndex : 'filename'
+ }
+ ],
+ listeners : {
+ rowdblclick : function (_self, rowIndex, e)
+ {
+ var rd = _this.grid.getDataSource().getAt(rowIndex);
+ var id = rd.data.id;
+ var url = String.format('{0}/Images/{1}/{2}', baseURL, rd.data.id, rd.data.filename);
+ _this.form.findField('contents').execCmd('insertimage', url);
+
+ },
+ render : function() {
+ _this.grid = this;
+ //_this.dialog = Pman.Dialog.FILL_IN
+ if (_this.panel.active) {
+ //this.footer.onClick('first');
+ }
+ }
+ },
+ items : [
+
]
- }
- }
- ],
- center : {
- xtype: 'LayoutRegion',
- xns: Roo,
- titlebar : false
- },
- east : {
- xtype: 'LayoutRegion',
- xns: Roo,
- titlebar : false,
- fitToFrame : 'true',
- width : 200
- },
- buttons : [
- {
- xtype: 'Button',
- xns: Roo,
- text : "Cancel",
- listeners : {
- click : function() {
-
- _this.form.reset();
-
- _this.dialog.hide();
-
- }
- }
- },
- {
- xtype: 'Button',
- xns: Roo,
- text : "OK",
+
+ },
+ '|xns' : 'Roo',
+ fitToframe : true,
+ background : false,
+ region : 'east',
+ xtype : 'GridPanel',
+ title : "Images",
+ fitContainer : true,
+ xns : Roo,
+ tableName : 'Images',
listeners : {
- click : function() {
-
- _this.dialog.el.mask("Saving");
- _this.form.findField('contents').syncValue();
- _this.form.doAction("submit");
-
- }
- }
+ activate : function() {
+ _this.panel = this;
+ if (_this.grid) {
+ _this.grid.footer.onClick('first');
+ }
+ }
+ },
+ items : [
+
+ ]
+
}
]
+
});
}
};