DataObjects/Cms_page.php
[Pman.Cms] / Pman.Tab.CmsAggregate.bjs
index 9a4e04a..81cb9ee 100644 (file)
 {
-    "id": "roo-file-272",
-    "name": "Pman.Tab.CmsAggregate",
-    "parent": "Pman.Tab.Cms",
-    "title": "Pman.Tab.CmsAggregate",
-    "path": "/home/alan/gitlive/Pman.Cms/Pman.Tab.CmsAggregate.bjs",
-    "items": [
+ "name" : "Pman.Tab.CmsAggregate",
+ "parent" : "Pman.Tab.Cms",
+ "title" : "Pman.Tab.CmsAggregate",
+ "path" : "/home/edward/gitlive/Pman.Cms/Pman.Tab.CmsAggregate.bjs",
+ "permname" : "",
+ "modOrder" : "850",
+ "strings" : {
+  "3b82002c77bd3f33f81e7be33deceb80" : "RSS Feed Aggregator",
+  "116af9a686a753275179db02cbb68f62" : "Displaying cms_rssaggr{0} - {1} of {2}",
+  "ec211f7c20af43e742bf2570c3cb84f9" : "Add",
+  "7dce122004969d56ae2e0245cb754d35" : "Edit",
+  "9b9d8a976b42e0bd66381797644943d5" : "Published",
+  "4c57e321aef3fb4261f9930dc39d9fb1" : "Update from Feed",
+  "86754577897acfb25deb69039d49d9a7" : "Displayed",
+  "b6f4933fc36f3dd21c402b0ab1e4e0c7" : "No cms_rssaggr found",
+  "f2a6c498fb90ee345d997f888fce3b18" : "Delete",
+  "c6568e77f61109390e82d035aaacaef0" : "Headline"
+ },
+ "items" : [
+  {
+   "region" : "center",
+   "xtype" : "NestedLayoutPanel",
+   "title" : "RSS Feed Aggregator",
+   "$ xns" : "Roo",
+   "items" : [
+    {
+     "xtype" : "BorderLayout",
+     "$ xns" : "Roo",
+     "* prop" : "layout",
+     "items" : [
+      {
+       "xtype" : "LayoutRegion",
+       "$ xns" : "Roo",
+       "* prop" : "center"
+      },
+      {
+       "xtype" : "LayoutRegion",
+       "$ xns" : "Roo",
+       "* prop" : "south",
+       "height" : 150
+      },
+      {
+       "listeners" : {
+        "|activate" : "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
+       },
+       "fitToframe" : true,
+       "background" : true,
+       "region" : "center",
+       "title" : "RSS Feed Aggregator",
+       "xtype" : "GridPanel",
+       "fitContainer" : true,
+       "$ xns" : "Roo",
+       "tableName" : "cms_rssaggr",
+       "items" : [
         {
-            "title": "RSS Feed Aggregator",
-            "xtype": "NestedLayoutPanel",
-            "|xns": "Roo",
-            "items": [
-                {
-                    "|xns": "Roo",
-                    "xtype": "BorderLayout",
-                    "*prop": "layout",
-                    "items": [
-                        {
-                            "|xns": "Roo",
-                            "xtype": "LayoutRegion",
-                            "*prop": "center"
-                        },
-                        {
-                            "|xns": "Roo",
-                            "xtype": "LayoutRegion",
-                            "*prop": "center"
-                        }
-                    ]
-                }
-            ]
+         "listeners" : {
+          "|render" : "function() \n{\n    _this.grid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}",
+          "cellclick" : "function (_self, rowIndex, colIndex, e)\n{\n\n    if (colIndex != 0) {\n        return;\n    }\n    var d = this.ds.getAt(rowIndex);\n    var s =    d.data.is_displayed ? 0 : 1;\n    d.set('is_displayed', s);\n    new Pman.Request({\n        url : baseURL + '/Roo/cms_rssaggr',\n        method : 'POST',\n        params : {\n            id : d.data.id,\n            is_displayed : s\n        },\n        success : function( ) {\n        \n        } \n        // should error on failure.\n    });\n     \n\n}",
+          "rowclick" : "function (_self, rowIndex, e)\n{\n    _this.cpanel.setContent(\n    \n        String.format('<div style=\"margin:10px\">{0}</div>',\n        _this.grid.ds.getAt(rowIndex).data.body)\n    );\n}"
+         },
+         "autoExpandColumn" : "headline",
+         "xtype" : "Grid",
+         "loadMask" : true,
+         "$ xns" : "Roo.grid",
+         "* prop" : "grid",
+         "items" : [
+          {
+           "xtype" : "Store",
+           "remoteSort" : true,
+           "$ sortInfo" : "{ field : 'published_dt', direction: 'DESC' }",
+           "$ xns" : "Roo.data",
+           "* prop" : "dataSource",
+           "items" : [
+            {
+             "$ url" : "baseURL + '/Roo/cms_rssaggr.php'",
+             "method" : "GET",
+             "xtype" : "HttpProxy",
+             "$ xns" : "Roo.data",
+             "* prop" : "proxy"
+            },
+            {
+             "id" : "id",
+             "root" : "data",
+             "xtype" : "JsonReader",
+             "$ xns" : "Roo.data",
+             "$ fields" : "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'extid',\n        'type': 'string'\n    },\n    {\n        'name': 'published_dt',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'headline',\n        'type': 'string'\n    },\n    {\n        'name': 'body',\n        'type': 'string'\n    },\n    {\n        'name': 'src_id',\n        'type': 'int'\n    }\n]",
+             "* prop" : "reader",
+             "totalProperty" : "total"
+            }
+           ]
+          },
+          {
+           "pageSize" : 25,
+           "xtype" : "PagingToolbar",
+           "emptyMsg" : "No cms_rssaggr found",
+           "$ xns" : "Roo",
+           "displayInfo" : true,
+           "displayMsg" : "Displaying cms_rssaggr{0} - {1} of {2}",
+           "* prop" : "footer"
+          },
+          {
+           "xtype" : "Toolbar",
+           "$ xns" : "Roo",
+           "* prop" : "toolbar",
+           "items" : [
+            {
+             "listeners" : {
+              "click" : "function (_self, e)\n{\n    Roo.MessageBox.alert(\"Downloading\", \n        \"Updating feed, wait till this message disapears, or press OK to let it carry on in the background\"\n    );\n    \n    \n    new Pman.Request({\n        url : baseURL + '/Roo/cms_rssaggr',\n        method : 'GET',\n        params : {\n            _pullfeed : 1\n        },\n        success : function() {\n            Roo.MessageBox.hide();\n            _this.grid.footer.onClick('first');\n        }\n    });\n}"
+             },
+             "text" : "Update from Feed",
+             "xtype" : "Button",
+             "$ xns" : "Roo.Toolbar"
+            },
+            {
+             "xtype" : "Fill",
+             "$ xns" : "Roo.Toolbar"
+            },
+            {
+             "listeners" : {
+              "|click" : "function()\n{\n    if (!_this.dialog) {\n        return;\n    }\n    _this.dialog.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
+             },
+             "text" : "Add",
+             "xtype" : "Button",
+             "cls" : "x-btn-text-icon",
+             "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
+             "$ xns" : "Roo.Toolbar"
+            },
+            {
+             "listeners" : {
+              "|click" : "function()\n{\n    var s = _this.grid.getSelectionModel().getSelections();\n    if (!s.length || (s.length > 1))  {\n        Roo.MessageBox.alert(\"Error\", s.length ? \"Select only one Row\" : \"Select a Row\");\n        return;\n    }\n    if (!_this.dialog) {\n        return;\n    }\n    \n    _this.dialog.show(s[0].data, function() {\n        _this.grid.footer.onClick('first');\n    }); \n    \n}\n"
+             },
+             "text" : "Edit",
+             "xtype" : "Button",
+             "cls" : "x-btn-text-icon",
+             "$ icon" : "Roo.rootURL + 'images/default/tree/leaf.gif'",
+             "$ xns" : "Roo.Toolbar"
+            },
+            {
+             "listeners" : {
+              "|click" : "function()\n{\n     Pman.genericDelete(_this, 'cms_rssaggr'); \n}\n        "
+             },
+             "text" : "Delete",
+             "xtype" : "Button",
+             "cls" : "x-btn-text-icon",
+             "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'",
+             "$ xns" : "Roo.Toolbar"
+            }
+           ]
+          },
+          {
+           "xtype" : "ColumnModel",
+           "header" : "Displayed",
+           "width" : 75,
+           "$ renderer" : "function(v) {  \n    var state = v> 0 ?  '-checked' : '';\n\n    return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';\n                \n }",
+           "$ xns" : "Roo.grid",
+           "* prop" : "colModel[]",
+           "dataIndex" : "is_displayed"
+          },
+          {
+           "xtype" : "ColumnModel",
+           "header" : "Published",
+           "width" : 75,
+           "$ renderer" : "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
+           "$ xns" : "Roo.grid",
+           "* prop" : "colModel[]",
+           "dataIndex" : "published_dt"
+          },
+          {
+           "xtype" : "ColumnModel",
+           "width" : 200,
+           "header" : "Headline",
+           "$ renderer" : "function(v) { return String.format('{0}', v); }",
+           "$ xns" : "Roo.grid",
+           "* prop" : "colModel[]",
+           "dataIndex" : "headline"
+          }
+         ]
         }
-    ],
-    "permname": "",
-    "modOrder": "850"
+       ]
+      },
+      {
+       "listeners" : {
+        "render" : "function (_self)\n{\n    _this.cpanel = _self;\n}"
+       },
+       "region" : "south",
+       "xtype" : "ContentPanel",
+       "$ xns" : "Roo"
+      }
+     ]
+    }
+   ]
+  }
+ ]
 }
\ No newline at end of file