sync
[Pman.Admin] / Pman.Dialog.AdminTranslateTemplates.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
4
5 Roo.namespace('Pman.Dialog');
6
7 Pman.Dialog.AdminTranslateTemplates = {
8
9  _strings : {
10   '0a52da7a03a6de3beefe54f8c03ad80d' :"Original",
11   'd41d8cd98f00b204e9800998ecf8427e' :"",
12   '6dd08874f83507e9c7b23f1a46b7fa7c' :"Translation",
13   'ea4788705e6873b424c65e91c2846b19' :"Cancel",
14   '305253475cc868103805068f45a90468' :"Edit Translation",
15   'e0aa021e21dddbd6d8cecec71e9cf564' :"OK"
16  },
17  _named_strings : {
18   'src_id_txt_fieldLabel' : '0a52da7a03a6de3beefe54f8c03ad80d' /* Original */ ,
19   'src_id_txt_value' : 'd41d8cd98f00b204e9800998ecf8427e' /*  */ ,
20   'txt_fieldLabel' : '6dd08874f83507e9c7b23f1a46b7fa7c' /* Translation */ 
21  },
22
23  dialog : false,
24  callback:  false,
25
26  show : function(data, cb)
27  {
28   if (!this.dialog) {
29    this.create();
30   }
31
32   this.callback = cb;
33   this.data = data;
34   this.dialog.show(this.data._el);
35   if (this.form) {
36    this.form.reset();
37    this.form.setValues(data);
38    this.form.fireEvent('actioncomplete', this.form,  { type: 'setdata', data: data });
39   }
40
41  },
42
43  create : function()
44  {
45    var _this = this;
46    this.dialog = Roo.factory({
47     xtype : 'LayoutDialog',
48     background : true,
49     closable : false,
50     collapsible : false,
51     height : 450,
52     modal : true,
53     resizable : true,
54     title : _this._strings['305253475cc868103805068f45a90468'] /* Edit Translation */,
55     width : 800,
56     xns : Roo,
57     '|xns' : 'Roo',
58     center : {
59      xtype : 'LayoutRegion',
60      title : "Note: If the original text contains template variables like  {TEMPLATE_VARIABLE} <br/>Be careful to retain them otherwise the translation may not work",
61      titlebar : true,
62      xns : Roo,
63      '|xns' : 'Roo'
64     },
65     buttons : [
66      {
67       xtype : 'Button',
68       text : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
69       listeners : {
70        click : function() {
71             _this.form.reset();
72             _this.dialog.hide();
73         }
74       },
75       xns : Roo,
76       '|xns' : 'Roo'
77      },
78      {
79       xtype : 'Button',
80       text : _this._strings['e0aa021e21dddbd6d8cecec71e9cf564'] /* OK */,
81       listeners : {
82        click : function() {
83             _this.dialog.el.mask("Saving");
84             //_this.form.doAction('submit');
85             _this.dialog.hide();
86             if (_this.callback) {
87                 _this.callback.call(_this, _this.form.getValues());
88             }
89             _this.dialog.el.unmask();
90             _this.form.reset();
91         }
92       },
93       xns : Roo,
94       '|xns' : 'Roo'
95      }
96     ],
97     items  : [
98      {
99       xtype : 'ContentPanel',
100       background : true,
101       fitToFrame : true,
102       region : 'center',
103       xns : Roo,
104       '|xns' : 'Roo',
105       items  : [
106        {
107         xtype : 'Form',
108         method : 'POST',
109         style : 'margin: 5px',
110         listeners : {
111          actioncomplete : function (_self, action)
112           {
113                 
114               if (action.type == 'setdata') {
115                  //_this.dialog.el.mask("Loading");
116                  
117                  Roo.log(_this.data);
118                  return;
119               }
120               if (action.type == 'load') {
121                    return;
122               }
123               if (action.type =='submit') {
124                   _this.dialog.hide();
125                   if (_this.callback) {
126                       _this.callback.call(_this, _this.form.getValues());
127                   }
128                   _this.form.reset();
129                   return;
130               }
131           },
132          actionfailed : function (_self, action)
133           {
134               _this.dialog.el.unmask();
135               Pman.standardActionFailed(_self, action);
136           },
137          rendered : function (form)
138           {
139              _this.form = form;
140           }
141         },
142         xns : Roo.form,
143         '|xns' : 'Roo.form',
144         items  : [
145          {
146           xtype : 'Row',
147           labelAlign : 'top',
148           xns : Roo.form,
149           '|xns' : 'Roo.form',
150           items  : [
151            {
152             xtype : 'TextArea',
153             fieldLabel : _this._strings['0a52da7a03a6de3beefe54f8c03ad80d'] /* Original */,
154             height : 150,
155             name : 'src_id_txt',
156             readOnly : true,
157             value : _this._strings['d41d8cd98f00b204e9800998ecf8427e'] /*  */,
158             width : 750,
159             xns : Roo.form,
160             '|xns' : 'Roo.form'
161            }
162           ]
163          },
164          {
165           xtype : 'Row',
166           labelAlign : 'top',
167           xns : Roo.form,
168           '|xns' : 'Roo.form',
169           items  : [
170            {
171             xtype : 'TextArea',
172             fieldLabel : _this._strings['6dd08874f83507e9c7b23f1a46b7fa7c'] /* Translation */,
173             height : 150,
174             name : 'txt',
175             width : 750,
176             xns : Roo.form,
177             '|xns' : 'Roo.form'
178            }
179           ]
180          }
181         ]
182        }
183       ]
184      }
185     ]
186    });
187  }
188 };