Pman.Tab.CmsBlog.bjs
[Pman.Cms] / Pman.Dialog.CmsLanguagePick.bjs
1 {
2  "name" : "Pman.Dialog.CmsLanguagePick",
3  "parent" : "",
4  "title" : "",
5  "path" : "/home/alan/gitlive/Pman.Cms/Pman.Dialog.CmsLanguagePick.bjs",
6  "permname" : "",
7  "modOrder" : "001",
8  "strings" : {
9   "4994a8ffeba4ac3140beb89e8d41f174" : "Language",
10   "ea4788705e6873b424c65e91c2846b19" : "Cancel",
11   "052ca52fc8eb1bdff3e34de3fa735e35" : "Select a Language",
12   "e0aa021e21dddbd6d8cecec71e9cf564" : "OK"
13  },
14  "items" : [
15   {
16    "modal" : true,
17    "collapsible" : false,
18    "title" : "Select a Language",
19    "xtype" : "LayoutDialog",
20    "width" : 400,
21    "$ xns" : "Roo",
22    "closable" : false,
23    "resizable" : false,
24    "height" : 120,
25    "items" : [
26     {
27      "xtype" : "LayoutRegion",
28      "$ xns" : "Roo",
29      "* prop" : "center"
30     },
31     {
32      "region" : "center",
33      "xtype" : "ContentPanel",
34      "$ xns" : "Roo",
35      "items" : [
36       {
37        "listeners" : {
38         "|actioncomplete" : "function(_self,action)\n{\n    if (action.type == 'setdata') {\n       //_this.dialog.el.mask(\"Loading\");\n       //this.load({ method: 'GET', params: { '_id' : _this.data.id }});\n       return;\n    }\n    if (action.type == 'load') {\n        _this.dialog.el.unmask();\n        return;\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}\n",
39         "|rendered" : "function (form)\n{\n    _this.form= form;\n}\n"
40        },
41        "$ url" : "baseURL + '/Roo/INGORE.php'",
42        "method" : "GET",
43        "xtype" : "Form",
44        "style" : "margin:10px;",
45        "$ xns" : "Roo.form",
46        "items" : [
47         {
48          "alwaysQuery" : true,
49          "listWidth" : 200,
50          "triggerAction" : "all",
51          "fieldLabel" : "Language",
52          "displayField" : "title",
53          "hiddenName" : "lang",
54          "valueField" : "code",
55          "xtype" : "ComboBox",
56          "allowBlank" : false,
57          "editable" : false,
58          "width" : 200,
59          "$ xns" : "Roo.form",
60          "name" : "language_name",
61          "items" : [
62           {
63            "listeners" : {
64             "beforeload" : "function (_self, o)\n{\n    o.params['!code'] = 'en'; // exclude english from the list (it's the default?)\n}"
65            },
66            "xtype" : "Store",
67            "$ xns" : "Roo.data",
68            "* prop" : "store",
69            "items" : [
70             {
71              "$ url" : "baseURL + '/Core/I18n/Lang'",
72              "method" : "GET",
73              "xtype" : "HttpProxy",
74              "$ xns" : "Roo.data",
75              "* prop" : "proxy"
76             },
77             {
78              "id" : "code",
79              "root" : "data",
80              "xtype" : "JsonReader",
81              "$ fields" : "[\n    {\n        'name': 'code',\n        'type': 'string'\n    },\n    {\n        'name': 'title',\n        'type': 'string'\n    }\n]",
82              "$ xns" : "Roo.data",
83              "* prop" : "reader",
84              "totalProperty" : "total"
85             }
86            ]
87           }
88          ]
89         }
90        ]
91       }
92      ]
93     },
94     {
95      "listeners" : {
96       "click" : "function (_self, e)\n{\n    _this.dialog.hide();\n}"
97      },
98      "text" : "Cancel",
99      "xtype" : "Button",
100      "$ xns" : "Roo",
101      "* prop" : "buttons[]"
102     },
103     {
104      "listeners" : {
105       "click" : "function (_self, e)\n{\n    // do some checks?\n     \n    var data =  _this.form.getValues();\n \n    if (!data.lang.length) {\n    \n        Roo.MessageBox.alert(\"Error\", \"Select language\");\n        return;\n    \n    }\n    _this.dialog.hide();\n            \n    var callbackData = data.lang;\n   // Roo.log(_this.data);\n    if(_this.data._with_name == true){\n        callbackData = {'lang' : data.lang , 'lang_name' : _this.form.findField('lang').lastSelectionText};\n    }\n    \n    _this.callback(callbackData);\n    \n\n}"
106      },
107      "text" : "OK",
108      "xtype" : "Button",
109      "$ xns" : "Roo",
110      "* prop" : "buttons[]"
111     }
112    ]
113   }
114  ]
115 }