{ "id": "roo-file-85", "name": "Pman.Dialog.CmsPage", "parent": "", "title": "Cms -Edit Page", "path": "/home/alan/gitlive/Pman.Cms/Pman.Dialog.CmsPage.bjs", "items": [ { "background": true, "closable": false, "collapsible": false, "height": 600, "modal": true, "resizable": false, "title": "Edit Page", "width": 850, "xtype": "LayoutDialog", "|xns": "Roo", "items": [ { "xtype": "LayoutRegion", "*prop": "center", "titlebar": false, "|xns": "Roo" }, { "xtype": "LayoutRegion", "*prop": "east", "titlebar": false, "fitToFrame": "true", "width": 200, "listeners": {}, "|xns": "Roo" }, { "autoScroll": true, "fitToFrame": true, "region": "center", "xtype": "ContentPanel", "|xns": "Roo", "listeners": {}, "items": [ { "listeners": { "|actionfailed": "function (_self, action)\n{\n _this.dialog.el.unmask();\n Pman.standardActionFailed(_self, action);\n}\n", "|actioncomplete": "function (_self, action)\n{\n\n if (action.type =='submit') {\n \n _this.dialog.el.unmask();\n _this.dialog.hide();\n \n if (_this.callback) {\n _this.callback.call(_this, _this.form.getValues());\n }\n _this.form.reset();\n return;\n }\n if (action.type == 'setdata') { \n _this.loaded = false;\n \n // _this.dialog.getLayout().showPanel(0);\n // _this.form.addForm(_this.form1);\n if ( _this.data.id) {\n _this.dialog.el.mask(\"Loading\");\n this.load({ method: 'GET', params: { '_id' : _this.data.id }});\n } else {\n _this.loaded = true;\n //disable image upload!\n _this.form.findField('publish_status').setValue(-1);\n }\n\n return;\n \n }\n \n if (action.type == 'load') {\n _this.dialog.el.unmask();\n _this.grid.getDataSource().load();\n return;\n }\n}\n", "|rendered": "function (_self)\n{\n _this.form = _self;\n}\n" }, "method": "POST", "style": "margin: 5px", "xtype": "Form", "|url": "baseURL + '/Roo/Page.php'", "|xns": "Roo.form", "items": [ { "fieldLabel": "Page link", "name": "page_link", "width": 200, "|xns": "Roo.form", "xtype": "TextField" }, { "allowBlank": true, "displayField": "page_link", "editable": false, "emptyText": "Select Parent", "fieldLabel": "Parent page", "forceSelection": true, "hiddenName": "parent_id", "listWidth": 400, "loadingText": "Searching...", "minChars": 2, "name": "parent_id_page_link", "pageSize": 20, "qtip": "Select Category ", "selectOnFocus": true, "tpl": "
{title}
{page_link}
", "triggerAction": "all", "typeAhead": true, "valueField": "id", "width": 400, "xtype": "ComboBox", "|xns": "Roo.form", "items": [ { "*prop": "store", "remoteSort": true, "xtype": "Store", "|sortInfo": "{ field: 'page_link', direction: 'ASC' }", "|xns": "Roo.data", "items": [ { "*prop": "proxy", "method": "GET", "xtype": "HttpProxy", "|url": "baseURL + '/Roo/Page.php'", "|xns": "Roo.data" }, { "*prop": "reader", "id": "id", "root": "data", "totalProperty": "total", "xtype": "JsonReader", "|fields": "[\n { name: 'id', type: 'int' },\n 'title',\n 'page_link' \n]", "|xns": "Roo.data" } ] } ] }, { "|xns": "Roo.form", "xtype": "Row", "items": [ { "fieldLabel": "Date to Publish", "format": "Y-m-d", "name": "published", "width": 200, "xtype": "DateField", "|xns": "Roo.form" }, { "fieldLabel": "Replaces", "name": "replaces_id", "width": 75, "|xns": "Roo.form", "xtype": "TextField" } ] }, { "hideLabels": true, "labelWidth": 0, "width": 520, "xtype": "Row", "|xns": "Roo.form", "items": [ { "boxLabel": "Visible", "name": "visible", "width": 100, "xtype": "Checkbox", "|xns": "Roo.form" }, { "boxLabel": "Display in RSS", "name": "in_rss", "width": 150, "xtype": "Checkbox", "|xns": "Roo.form" }, { "boxLabel": "Extended Vis.?", "inputValue": 1, "name": "has_extended", "width": 140, "xtype": "Checkbox", "|xns": "Roo.form" } ] }, { "fieldLabel": "Title", "name": "title", "width": 390, "xtype": "TextField", "|xns": "Roo.form" }, { "xtype": "Column", "width": "570", "listeners": {}, "labelAlign": "top", "|xns": "Roo.form", "items": [ { "fieldLabel": "Contents", "height": 240, "name": "contents", "width": 550, "xtype": "HtmlEditor", "|xns": "Roo.form" } ] }, { "xtype": "Column", "width": "570", "listeners": {}, "labelAlign": "top", "|xns": "Roo.form", "items": [ { "fieldLabel": "Extended Contents", "height": 340, "name": "extended", "width": 550, "xtype": "HtmlEditor", "|xns": "Roo.form" } ] }, { "name": "id", "xtype": "Hidden", "listeners": {}, "|xns": "Roo.form" } ] } ] }, { "xtype": "GridPanel", "title": "Images", "fitToframe": true, "fitContainer": true, "tableName": "Images", "background": false, "listeners": { "|activate": "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}" }, "region": "east", "|xns": "Roo", "items": [ { "*prop": "grid", "xtype": "Grid", "autoExpandColumn": "filename", "loadMask": true, "listeners": { "|render": "function() { \n _this.grid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.panel.active) {\n //this.footer.onClick('first');\n }\n}", "|rowdblclick": "function (_self, rowIndex, e)\n{\n var rd = _this.grid.getDataSource().getAt(rowIndex);\n var id = rd.data.id;\n var url = String.format('{0}/Images/{1}/{2}', baseURL, rd.data.id, rd.data.filename);\n _this.form.findField('contents').execCmd('insertimage', url);\n\n}" }, "|xns": "Roo.grid", "items": [ { "listeners": { "|beforeload": "function (_self, o)\n{\n if (!_this.data.id) {\n return false;\n } \n o.params = o.params || {}; \n o.params.onid = _this.data.id;\n o.params.ontable = 'Page';\n}" }, "*prop": "dataSource", "xtype": "Store", "|reader": "Pman.Readers.Images", "|xns": "Roo.data", "items": [ { "*prop": "proxy", "xtype": "HttpProxy", "method": "GET", "|url": "baseURL + '/Roo/Images.php'", "|xns": "Roo.data" } ] }, { "*prop": "toolbar", "xtype": "Toolbar", "listeners": {}, "|xns": "Roo", "items": [ { "listeners": { "|click": "function()\n{\n Pman.Dialog.Image.show( { id : 0, onid: _this.data.id, ontable: 'Page' }, function() {\n _this.grid.getDataSource().load();\n }); \n\n}\n " }, "cls": "x-btn-text-icon", "text": "Add", "xtype": "Button", "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'", "|xns": "Roo" }, { "text": "Delete", "cls": "x-btn-text-icon", "|icon": "rootURL + '/Pman/templates/images/trash.gif'", "xtype": "Button", "listeners": { "|click": "function()\n {\n Pman.genericDelete(_this, _this.panel.tableName); \n }\n " }, "|xns": "Roo" } ] }, { "xtype": "ColumnModel", "header": "", "width": 50, "dataIndex": "id", "|renderer": "function(v,x,r) { return String.format('', baseURL, v, r.data.filename); }", "listeners": {}, "sortable": false, "|xns": "Roo.grid", "*prop": "colModel[]" }, { "xtype": "ColumnModel", "header": "Filename", "width": 100, "dataIndex": "filename", "|renderer": "function(v) { return String.format('{0}', v); }", "listeners": {}, "|xns": "Roo.grid", "*prop": "colModel[]" } ] } ] }, { "text": "Cancel", "xtype": "Button", "|xns": "Roo", "listeners": { "|click": " function() {\n\n _this.form.reset();\n\n _this.dialog.hide();\n\n }\n" }, "*prop": "buttons[]" }, { "text": "OK", "xtype": "Button", "|xns": "Roo", "listeners": { "|click": " function() {\n\n _this.dialog.el.mask(\"Saving\");\n _this.form.findField('contents').syncValue();\n _this.form.doAction(\"submit\");\n\n }\n" }, "*prop": "buttons[]" } ] } ] }