DataObjects/Cms_page.php
[Pman.Cms] / Pman.Tab.CmsAggregate.bjs
1 {
2  "name" : "Pman.Tab.CmsAggregate",
3  "parent" : "Pman.Tab.Cms",
4  "title" : "Pman.Tab.CmsAggregate",
5  "path" : "/home/edward/gitlive/Pman.Cms/Pman.Tab.CmsAggregate.bjs",
6  "permname" : "",
7  "modOrder" : "850",
8  "strings" : {
9   "3b82002c77bd3f33f81e7be33deceb80" : "RSS Feed Aggregator",
10   "116af9a686a753275179db02cbb68f62" : "Displaying cms_rssaggr{0} - {1} of {2}",
11   "ec211f7c20af43e742bf2570c3cb84f9" : "Add",
12   "7dce122004969d56ae2e0245cb754d35" : "Edit",
13   "9b9d8a976b42e0bd66381797644943d5" : "Published",
14   "4c57e321aef3fb4261f9930dc39d9fb1" : "Update from Feed",
15   "86754577897acfb25deb69039d49d9a7" : "Displayed",
16   "b6f4933fc36f3dd21c402b0ab1e4e0c7" : "No cms_rssaggr found",
17   "f2a6c498fb90ee345d997f888fce3b18" : "Delete",
18   "c6568e77f61109390e82d035aaacaef0" : "Headline"
19  },
20  "items" : [
21   {
22    "region" : "center",
23    "xtype" : "NestedLayoutPanel",
24    "title" : "RSS Feed Aggregator",
25    "$ xns" : "Roo",
26    "items" : [
27     {
28      "xtype" : "BorderLayout",
29      "$ xns" : "Roo",
30      "* prop" : "layout",
31      "items" : [
32       {
33        "xtype" : "LayoutRegion",
34        "$ xns" : "Roo",
35        "* prop" : "center"
36       },
37       {
38        "xtype" : "LayoutRegion",
39        "$ xns" : "Roo",
40        "* prop" : "south",
41        "height" : 150
42       },
43       {
44        "listeners" : {
45         "|activate" : "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
46        },
47        "fitToframe" : true,
48        "background" : true,
49        "region" : "center",
50        "title" : "RSS Feed Aggregator",
51        "xtype" : "GridPanel",
52        "fitContainer" : true,
53        "$ xns" : "Roo",
54        "tableName" : "cms_rssaggr",
55        "items" : [
56         {
57          "listeners" : {
58           "|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}",
59           "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}",
60           "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}"
61          },
62          "autoExpandColumn" : "headline",
63          "xtype" : "Grid",
64          "loadMask" : true,
65          "$ xns" : "Roo.grid",
66          "* prop" : "grid",
67          "items" : [
68           {
69            "xtype" : "Store",
70            "remoteSort" : true,
71            "$ sortInfo" : "{ field : 'published_dt', direction: 'DESC' }",
72            "$ xns" : "Roo.data",
73            "* prop" : "dataSource",
74            "items" : [
75             {
76              "$ url" : "baseURL + '/Roo/cms_rssaggr.php'",
77              "method" : "GET",
78              "xtype" : "HttpProxy",
79              "$ xns" : "Roo.data",
80              "* prop" : "proxy"
81             },
82             {
83              "id" : "id",
84              "root" : "data",
85              "xtype" : "JsonReader",
86              "$ xns" : "Roo.data",
87              "$ 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]",
88              "* prop" : "reader",
89              "totalProperty" : "total"
90             }
91            ]
92           },
93           {
94            "pageSize" : 25,
95            "xtype" : "PagingToolbar",
96            "emptyMsg" : "No cms_rssaggr found",
97            "$ xns" : "Roo",
98            "displayInfo" : true,
99            "displayMsg" : "Displaying cms_rssaggr{0} - {1} of {2}",
100            "* prop" : "footer"
101           },
102           {
103            "xtype" : "Toolbar",
104            "$ xns" : "Roo",
105            "* prop" : "toolbar",
106            "items" : [
107             {
108              "listeners" : {
109               "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}"
110              },
111              "text" : "Update from Feed",
112              "xtype" : "Button",
113              "$ xns" : "Roo.Toolbar"
114             },
115             {
116              "xtype" : "Fill",
117              "$ xns" : "Roo.Toolbar"
118             },
119             {
120              "listeners" : {
121               "|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"
122              },
123              "text" : "Add",
124              "xtype" : "Button",
125              "cls" : "x-btn-text-icon",
126              "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
127              "$ xns" : "Roo.Toolbar"
128             },
129             {
130              "listeners" : {
131               "|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"
132              },
133              "text" : "Edit",
134              "xtype" : "Button",
135              "cls" : "x-btn-text-icon",
136              "$ icon" : "Roo.rootURL + 'images/default/tree/leaf.gif'",
137              "$ xns" : "Roo.Toolbar"
138             },
139             {
140              "listeners" : {
141               "|click" : "function()\n{\n     Pman.genericDelete(_this, 'cms_rssaggr'); \n}\n        "
142              },
143              "text" : "Delete",
144              "xtype" : "Button",
145              "cls" : "x-btn-text-icon",
146              "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'",
147              "$ xns" : "Roo.Toolbar"
148             }
149            ]
150           },
151           {
152            "xtype" : "ColumnModel",
153            "header" : "Displayed",
154            "width" : 75,
155            "$ 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 }",
156            "$ xns" : "Roo.grid",
157            "* prop" : "colModel[]",
158            "dataIndex" : "is_displayed"
159           },
160           {
161            "xtype" : "ColumnModel",
162            "header" : "Published",
163            "width" : 75,
164            "$ renderer" : "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
165            "$ xns" : "Roo.grid",
166            "* prop" : "colModel[]",
167            "dataIndex" : "published_dt"
168           },
169           {
170            "xtype" : "ColumnModel",
171            "width" : 200,
172            "header" : "Headline",
173            "$ renderer" : "function(v) { return String.format('{0}', v); }",
174            "$ xns" : "Roo.grid",
175            "* prop" : "colModel[]",
176            "dataIndex" : "headline"
177           }
178          ]
179         }
180        ]
181       },
182       {
183        "listeners" : {
184         "render" : "function (_self)\n{\n    _this.cpanel = _self;\n}"
185        },
186        "region" : "south",
187        "xtype" : "ContentPanel",
188        "$ xns" : "Roo"
189       }
190      ]
191     }
192    ]
193   }
194  ]
195 }