Pman.Dialog.CmsTranslateTemplates.bjs
[Pman.Cms] / Pman.Dialog.CmsTranslateTemplates.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
4
5 Pman.Dialog.CmsTranslateTemplates = {
6
7     dialog : false,
8     callback:  false,
9
10     show : function(data, cb)
11     {
12         if (!this.dialog) {
13             this.create();
14         }
15
16         this.callback = cb;
17         this.data = data;
18         this.dialog.show(this.data._el);
19         if (this.form) {
20            this.form.reset();
21            this.form.setValues(data);
22            this.form.fireEvent('actioncomplete', this.form,  { type: 'setdata', data: data });
23         }
24
25     },
26
27     create : function()
28     {
29         var _this = this;
30         this.dialog = Roo.factory({
31             xtype: 'LayoutDialog',
32             xns: Roo,
33             background : true,
34             closable : false,
35             collapsible : false,
36             height : 300,
37             modal : true,
38             resizable : true,
39             title : "WARNING",
40             width : 400,
41             items : [
42                 {
43                     xtype: 'ContentPanel',
44                     xns: Roo,
45                     background : true,
46                     fitToFrame : true,
47                     region : 'center',
48                     items : [
49                         {
50                             xtype: 'Form',
51                             xns: Roo.form,
52                             listeners : {
53                                 actionfailed : function (_self, action)
54                                 {
55                                     _this.dialog.el.unmask();
56                                     Pman.standardActionFailed(_self, action);
57                                 },
58                                 actioncomplete : function (_self, action)
59                                 {
60                                       
61                                     if (action.type == 'setdata') {
62                                        //_this.dialog.el.mask("Loading");
63                                        if (_this.data.id) {
64                                            this.load({ method: 'GET', params: { '_id' : _this.data.id }});
65                                        }
66                                        return;
67                                     }
68                                     if (action.type == 'load') {
69                                          return;
70                                     }
71                                     if (action.type =='submit') {
72                                         _this.dialog.hide();
73                                         if (_this.callback) {
74                                             _this.callback.call(_this, _this.form.getValues());
75                                         }
76                                         _this.form.reset();
77                                         return;
78                                     }
79                                 },
80                                 rendered : function (form)
81                                 {
82                                    _this.form = form;
83                                 }
84                             },
85                             method : 'POST',
86                             style : 'margin: 5px',
87                             url : baseURL + '/Roo/Ris_location.php',
88                             items : [
89                                 {
90                                     xtype: 'Row',
91                                     xns: Roo.form,
92                                     height : 30,
93                                     hideLabels : true,
94                                     labelWidth : 100,
95                                     items : [
96                                         {
97                                             xtype: 'DisplayField',
98                                             xns: Roo.form,
99                                             vtype : 'url',
100                                             fieldLabel : 'test',
101                                             name : 'wrin_text',
102                                             value : "",
103                                             width : 200
104                                         }
105                                     ]
106                                 },
107                                 {
108                                     xtype: 'Row',
109                                     xns: Roo.form,
110                                     labelAlign : 'top',
111                                     items : [
112                                         {
113                                             xtype: 'TextArea',
114                                             xns: Roo.form,
115                                             disabled : true,
116                                             fieldLabel : 'Original',
117                                             name : 'src_id_txt',
118                                             value : "teststsetetsetsete"
119                                         }
120                                     ]
121                                 },
122                                 {
123                                     xtype: 'Row',
124                                     xns: Roo.form,
125                                     labelAlign : 'top',
126                                     items : [
127                                         {
128                                             xtype: 'TextArea',
129                                             xns: Roo.form,
130                                             fieldLabel : 'Translation',
131                                             name : 'txt'
132                                         }
133                                     ]
134                                 }
135                             ]
136                         }
137                     ]
138                 }
139             ],
140             center : {
141                 xtype: 'LayoutRegion',
142                 xns: Roo,
143                 title : "This text is with {TEMPLATE VARIABLE}, <br />PLEASE BE CAREFUL EDITING. What\\'s change?",
144                 titlebar : true
145             },
146             buttons : [
147                 {
148                     xtype: 'Button',
149                     xns: Roo,
150                     text : "Cancel",
151                     listeners : {
152                         click : function() {
153                             _this.form.reset();
154                             _this.dialog.hide();
155                         }
156                     }
157                 },
158                 {
159                     xtype: 'Button',
160                     xns: Roo,
161                     listeners : {
162                         click : function() {
163                             _this.dialog.el.mask("Saving");
164                             _this.form.doAction('submit');
165                             
166                         }
167                     },
168                     text : "OK"
169                 }
170             ]
171         });
172     }
173 };