1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Roo.namespace('Pman.Tab');
7 Pman.Tab.AdminTranslationsInt = new Roo.XComponent({
10 'deccbe4e9083c3b5f7cd2632722765bb' :"Translate",
11 '4994a8ffeba4ac3140beb89e8d41f174' :"Language",
12 'ae739a236065a45c64ad51aacb19498c' :"Active?",
13 'd41d8cd98f00b204e9800998ecf8427e' :"",
14 '6dd08874f83507e9c7b23f1a46b7fa7c' :"Translation",
15 '83dad8107f9459efe2b4fabcf5b63108' :"Select Language",
16 '78463a384a5aa4fad5fa73e2f506ecfc' :"English",
17 '552bcc4e00cd663f09cc4efbaca1cd45' :"Select Translation of",
18 'ca0dbad92a874b2f69b549293387925e' :"Code",
19 '0a9e8bd9e8b301dfb2c21c355e0b377d' :"Languages and Countries"
22 'language_title_value' : 'd41d8cd98f00b204e9800998ecf8427e' /* */ ,
23 'language_title_qtip' : '83dad8107f9459efe2b4fabcf5b63108' /* Select Language */ ,
24 'language_title_fieldLabel' : '4994a8ffeba4ac3140beb89e8d41f174' /* Language */
27 part : ["Admin", "TranslationInt" ],
28 order : '950-Pman.Tab.AdminTranslationsInt',
30 parent : 'Pman.Tab.Admin',
31 name : "Admin - AdminTranslationsInt",
33 permname : 'Admin.TranslationsInt',
34 _tree : function(_data)
39 xtype : 'NestedLayoutPanel',
41 title : _this._strings['deccbe4e9083c3b5f7cd2632722765bb'] /* Translate */,
45 xtype : 'BorderLayout',
49 xtype : 'LayoutRegion',
50 alwaysShowTabs : true,
63 title : _this._strings['0a9e8bd9e8b301dfb2c21c355e0b377d'] /* Languages and Countries */,
65 activate : function() {
66 _this.langpanel = this;
68 _this.langgrid.ds.load({});
76 autoExpandColumn : 'lval',
80 afteredit : function (e)
82 var saveRec = function(rec)
86 //g.getView().el.mask('Saving');
88 url : baseURL + '/Roo/I18n.php',
92 lval : rec.get('lval'),
93 ltype : rec.get('ltype')
97 //g.getView().el.unmask();
98 //g.getDataSource().reload();
102 Ext.Msg.alert("Error", "There was a problem saving the data - try reloading");
103 // g.getView().el.unmask();
109 saveRec.defer(1000, _this, [ e.record ]);
111 beforeedit : function(e) {
112 console.log('beforeedit');
113 //if (e.record.get('origtxt').indexOf('<') > -1) {
114 // console.log("HTML EDITOR!!");
118 if (e.record.get('lval').replace(/\s+/, '').length) {
123 var tl = _this.langgridCombo.getValue();
125 tl = (tl == 'zh_HK') ? 'zh-TW' : tl;
126 tl = tl.replace('_', '-');
131 Pman.gtranslate(e.record.get('lval_en'), 'en', tl, function(result) {
132 if (typeof(result) == 'object') { //error
136 if (_this.grid.activeEditor) {
137 _this.grid.activeEditor.setValue(result);
139 rec.set('lval',result);
140 //_this.saveRec(rec);
146 //console.log(result.translation);
153 cellclick : function (_self, rowIndex, columnIndex, e)
155 if(_this.langgrid.colModel.getDataIndex(columnIndex) !== 'is_active'){
159 var s = _this.langgrid.ds.getAt(rowIndex);
161 if(!s || s.data.id * 1 < 0){
165 s.set('is_active', s.data.is_active ? 0 : 1);
168 url : baseURL+'/Roo/I18n',
172 is_active : s.data.is_active
179 _this.langgrid = this;
180 //_this.dialog = Pman.Dialog.FILL_IN
181 if (_this.langpanel.active) {
195 displayField : 'lval',
197 emptyText : _this._strings['552bcc4e00cd663f09cc4efbaca1cd45'] /* Select Translation of */,
199 selectOnFocus : true,
200 triggerAction : 'all',
205 render : function (_self)
207 _this.langtypeCombo = _self;
209 select : function (combo, record, index)
211 _this.langgrid.getDataSource().reload();
217 xtype : 'SimpleStore',
219 [ 'l', 'Language Names' ],
220 [ 'c', 'Country Names' ],
221 [ 'm', 'Currency Names' ]
223 fields : ['lkey','lval'],
231 displayField : 'title',
233 fieldLabel : _this._strings['4994a8ffeba4ac3140beb89e8d41f174'] /* Language */,
234 hiddenName : 'language',
237 name : 'language_title',
239 qtip : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
240 queryParam : 'query[name_starts]',
241 selectOnFocus : true,
242 triggerAction : 'all',
244 value : _this._strings['d41d8cd98f00b204e9800998ecf8427e'] /* */,
248 render : function (_self)
250 _this.langgridCombo=_self;
252 select : function (combo, record, index)
254 _this.langgrid.getDataSource().reload();
261 sortInfo : { field : 'title', direction: 'ASC' },
263 beforeload : function (_self, options)
265 options =options || {};
266 options.params =options.params|| {};
267 options.params.ltype = 'l';
268 options.params.inlang = 'en';
270 options.params._as_code_and_title = 1;
279 url : baseURL + '/Roo/i18n.php',
284 xtype : 'JsonReader',
309 totalProperty : 'total',
320 sortInfo : { field : 'lkey', direction: 'ASC' },
322 beforeload : function (_self, options)
324 options =options || {};
325 options.params =options.params|| {};
326 options.params.ltype = _this.langtypeCombo.getValue();
327 options.params.inlang = _this.langgridCombo.getValue();
328 options.params['query[_with_en]'] = 1;
329 if (!options.params.ltype.length || !options.params.inlang.length) {
333 options.params.limit = 9999;
342 url : baseURL + '/Roo/i18n.php',
347 xtype : 'JsonReader',
372 totalProperty : 'total',
379 xtype : 'ColumnModel',
381 header : _this._strings['ca0dbad92a874b2f69b549293387925e'] /* Code */,
382 renderer : function(v) { return String.format('{0}', v); },
389 xtype : 'ColumnModel',
390 dataIndex : 'lval_en',
391 header : _this._strings['78463a384a5aa4fad5fa73e2f506ecfc'] /* English */,
392 renderer : function(v) { return String.format('{0}', v); },
399 xtype : 'ColumnModel',
401 header : _this._strings['6dd08874f83507e9c7b23f1a46b7fa7c'] /* Translation */,
402 renderer : function(v) { return String.format('{0}', v); },
408 xtype : 'GridEditor',
419 xtype : 'ColumnModel',
420 dataIndex : 'is_active',
421 header : _this._strings['ae739a236065a45c64ad51aacb19498c'] /* Active? */,
422 renderer : function(v,x,r) {
424 return '<img class="x-grid-check-icon' + (v*1 ? '-checked' : '') + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';