15 "xtype" : "LayoutRegion"
20 "xtype" : "LayoutRegion"
30 "$ xns" : "Roo.Toolbar",
33 "function (_self, e)",
35 " Pman.Dialog.AdminLanguagePick.show( { }, function(lang) {",
37 " new Pman.Request({",
38 " url : baseURL + '/Roo/core_templatestr',",
43 " success : function()",
45 " _this.treepanel.tree.getRootNode().reload();",
58 "$ xns" : "Roo.Toolbar",
62 "$ xns" : "Roo.Toolbar",
65 "function (_self, e)",
67 " var tree = _this.treepanel.tree;",
68 " var sn = tree.getSelectionModel().getSelectedNode();",
70 " if (!sn || typeof(sn.attributes.language) == 'undefined' || !sn.attributes.language) {",
71 " Roo.MessageBox.alert(\"Error\", \"Select a language\");",
75 " Roo.MessageBox.confirm(\"Confirm\", \"Are sure you want to delete the language\", function (v){",
79 " Roo.MessageBox.alert(\"Not yet\", \"not done yet\");",
93 "$ xns" : "Roo.Toolbar",
97 "$ xns" : "Roo.Toolbar",
100 "function (_self, e)",
102 " var tree = _this.treepanel.tree;",
104 " var sn = tree.getSelectionModel().getSelectedNode();",
107 " Roo.MessageBox.alert(\"Error\", \"Select a node\");",
113 " 'scanProjectBJS',",
115 " 'scanPmanTemplates',",
121 " var syncTemplate = function(){",
123 " var step = steps.shift();",
124 " Roo.MessageBox.updateProgress( (5.0 - steps.length) / 5.0, \"Running \" + step);",
126 " new Pman.Request({",
127 " url : baseURL + '/Admin/UpdateBjsTemplates/' + step,",
129 " //mask : 'Processing...',",
130 " timeout : 9000000,",
131 " success : function()",
133 " if (steps.length > 0 ) { ",
137 " Roo.MessageBox.hide();",
138 " _this.treepanel.tree.getRootNode().reload();",
145 " var syncLanguage = function(){",
146 " new Pman.Request({",
147 " url : baseURL + '/Roo/Core_templatestr',",
149 " mask : 'Processing...',",
151 " _rescan : sn.attributes.id.split(':')[1]",
153 " success : function()",
155 " _this.treepanel.tree.getRootNode().reload();",
160 " var syncSingleTemplate = function(id){",
161 " new Pman.Request({",
162 " url : baseURL + '/Roo/Core_template',",
164 " mask : 'Processing...',",
169 " success : function()",
172 " _this.grid.footer.onClick('first');",
179 " if(typeof(sn.isRoot) != 'undefined' && sn.isRoot){",
180 " Roo.MessageBox.progress(\"Syncing templates\", \"Starting\");",
185 " if(typeof(sn.attributes.language) != 'undefined' && sn.attributes.language){",
190 " if(typeof(sn.attributes.id) != 'undefined' && sn.attributes.id * 1> 0){",
191 " syncSingleTemplate(sn.attributes.id);",
205 "$ xns" : "Roo.Toolbar",
209 "$ xns" : "Roo.Toolbar",
212 "function (_self, e)",
216 " Pman.Dialog.Image.show({",
217 " _url : baseURL + '/Admin/Import/Core_templatestr' ",
220 " _this.treepanel.tree.getRootNode().reload();",
232 "$ xns" : "Roo.Toolbar",
236 "$ xns" : "Roo.Toolbar",
239 "function (_self, e)",
241 " var tree = _this.treepanel.tree;",
243 " var sn = tree.getSelectionModel().getSelectedNode();",
246 " csvCols : 'src_id_mdsum,template_id_view_name,template_id_template,src_id_txt,lang,txt',",
247 " csvTitles : 'Code,Module,Template,Original,Language,Translation',",
249 " sort: 'template_id_view_name,template_id_template,src_id_txt',",
252 " if (!sn || sn.id == 'transtree') {",
253 " Roo.MessageBox.alert(\"Error\", \"Select language, module or page\");",
256 " if (typeof(sn.id) == 'number') {",
257 " p.template_id = sn.id;",
262 " if (typeof(sn.id) == 'string' && sn.id.match(/^table:/)) {",
263 " var sns = sn.id.split(':');",
265 " p.on_table = sns[2];",
266 " p.csvCols = 'src_id_mdsum,on_table,on_id,on_col,src_id_txt,lang,txt';",
267 " p.csvTitles = 'Code,Table,Table id,Column,Language,Translation';",
270 " if (typeof(sn.id) == 'string' && sn.id.match(/^view:/)) {",
271 " var sns = sn.id.split(':');",
273 " p.template_id_view_name = sns[2];",
276 " if (typeof(sn.id) == 'string' && sn.id.match(/^lang:/)) {",
277 " var sns = sn.id.split(':');",
282 " // view: {lang} : {view_name}",
285 " new Pman.Download({",
286 " url : baseURL + '/Roo/Core_templatestr',",
302 "$ xns" : "Roo.Toolbar",
303 "xtype" : "Separator"
306 "$ xns" : "Roo.Toolbar",
309 "function (_self, e)",
311 " _this.treepanel.tree.getRootNode().reload();",
323 "$ xns" : "Roo.tree",
325 "containerScroll" : false,
328 "$ baseParams" : "{ _tree : 1 }",
329 "$ dataUrl" : "baseURL + '/Roo/Core_templatestr'",
330 "$ xns" : "Roo.tree",
334 "function (This, node, callback)",
336 " // set some params.",
338 " this.baseParams._tree = 1;",
340 " //this.baseParams.category = node.attributes.category;",
344 "function (This, node, response)",
346 " Roo.MessageBox.alert(\"Error\", \"Problem loading tree\");",
350 "requestMethod" : "GET",
351 "xtype" : "TreeLoader"
354 "$ xns" : "Roo.tree",
357 "text" : "Translations (rescan this to update strings)",
358 "xtype" : "AsyncTreeNode"
361 "$ xns" : "Roo.tree",
362 "* prop" : "selModel",
364 "selectionchange" : [
365 "function (_self, node)",
369 " //if (node.id.split('/').length < 2) {",
373 " _this.grid.footer.onClick('first');",
379 "xtype" : "DefaultSelectionModel"
382 "rootVisible" : true,
383 "xtype" : "TreePanel"
390 " _this.treepanel = _self;",
395 "xtype" : "TreePanel"
399 "background" : false,
400 "fitContainer" : true,
404 "$ xns" : "Roo.grid",
406 "autoExpandColumn" : "txt",
411 "* prop" : "toolbar",
414 "$ xns" : "Roo.form",
415 "String emptyText" : "Search for",
420 " _this.searchBox = this;",
424 "function (_self, e)",
426 "_this.grid.footer.onClick('first');",
430 "xtype" : "TextField"
433 "$ icon" : "rootURL + '/Pman/templates/images/search.gif'",
434 "$ xns" : "Roo.Toolbar",
435 "cls" : "x-btn-icon",
438 "function (_self, e)",
440 "_this.grid.footer.onClick('first');",
447 "$ icon" : "rootURL + '/Pman/templates/images/edit-clear.gif'",
448 "$ xns" : "Roo.Toolbar",
449 "cls" : "x-btn-icon",
452 "function (_self, e)",
454 " _this.searchBox.setValue('');",
456 " _this.grid.footer.onClick('first');",
468 "displayInfo" : true,
469 "displayMsg" : "Displaying petition_entry{0} - {1} of {2}",
470 "emptyMsg" : "Not Found",
472 "xtype" : "PagingToolbar"
475 "$ sortInfo" : "{ field : 'src_id_txt', direction: 'ASC' }",
476 "$ xns" : "Roo.data",
477 "* prop" : "dataSource",
480 "$ url" : "baseURL + '/Roo/Core_templatestr.php'",
481 "$ xns" : "Roo.data",
484 "xtype" : "HttpProxy"
494 " 'name': 'shortname',",
500 "$ xns" : "Roo.data",
504 "totalProperty" : "total",
505 "xtype" : "JsonReader"
510 "function (_self, o)",
513 " var sn = _this.treepanel.tree.getSelectionModel().getSelectedNode();",
515 " if (!sn || typeof(sn.attributes) == 'undefined' || typeof(sn.attributes.leaf) == 'undefined' || !sn.attributes.leaf) { ",
516 " _this.grid.ds.removeAll();",
520 " o.params = o.params || {};",
521 " o.params.lang = sn.parentNode.attributes.id.split(':')[1];",
523 " o.params.active = 1;",
524 " o.params['!src_id'] = 0;",
526 " if (_this.searchBox && _this.searchBox.getValue().length) { ",
527 " o.params['_search_txt'] = _this.searchBox.getValue();",
531 " if(sn.attributes.on_table){",
532 " o.params.on_table = sn.attributes.on_table;",
534 " o.params.template_id = sn.attributes.id * 1;",
543 "function (_self, rec, operation)",
545 " Roo.log(operation);",
547 " if (operation != 'commit') {",
552 " _this.grid.getView().el.mask(\"Saving\");",
553 " new Pman.Request({",
554 " url : baseURL + '/Roo/Core_templatestr',",
557 " id : rec.get('id'),",
558 " txt : rec.get('txt')",
560 " success : function()",
562 " _this.grid.getView().el.unmask();",
563 " //g.getDataSource().reload();",
565 " failure : function()",
567 " _this.grid.getView().el.unmask();",
568 " Roo.MessageBox.alert(\"Error\", \"There was a problem saving the data - try reloading\");",
584 " if (r.data.updated < r.data.src_id_updated) {",
588 " return String.format('<div style=\"color:'+c+'\";>{0}</div>', v)",
592 "$ xns" : "Roo.grid",
594 "dataIndex" : "src_id_txt",
595 "header" : "Original",
597 "xtype" : "ColumnModel"
605 " if (r.data.updated < r.data.src_id_updated) {",
609 " return String.format('<div style=\"color:'+c+'\";>{0}</div>', v)",
613 "$ xns" : "Roo.grid",
616 "header" : "Translation",
619 "$ xns" : "Roo.grid",
623 "$ xns" : "Roo.form",
625 "allowBlank" : false,
626 "xtype" : "TextField"
629 "xtype" : "GridEditor"
633 "xtype" : "ColumnModel"
639 " return v ? v : '';",
643 "$ xns" : "Roo.grid",
645 "Boolean hidden" : true,
646 "dataIndex" : "src_id_mdsum",
649 "xtype" : "ColumnModel"
656 " e.record.commit();",
662 " /*if (e.record.data.src_id_txt.indexOf('<') > -1) {",
663 " // console.log(\"HTML EDITOR!!\");",
664 " Pman.Dialog.CmsTranslateEditor.show(e.record);",
668 " var str=e.record.data.src_id_txt;",
669 " var patt=/{(.*?)}/g;",
671 " Roo.log(str.length);",
674 " if(patt.test(str)){",
676 " Pman.Dialog.AdminTranslateTemplates.show(e.record.data, function(v){",
679 " e.record.set('txt', v.txt);",
680 " e.record.commit();",
683 " Roo.MessageBox.prompt('WARNING', 'This text is with {TEMPLATE VARIABLE}, PLEASE BE CAREFUL EDITING. What\\'s change? '+str, function(btn, text){",
684 " if (btn == 'ok'){",
686 " e.record.set('txt', text);",
687 " e.record.commit();",
693 " if(str.length > 150){",
695 " Pman.Dialog.AdminTranslateTemplates.show(e.record.data, function(v){",
697 " e.record.set('txt', v.txt);",
698 " e.record.commit();",
701 " Roo.MessageBox.prompt('WARNING', 'This text is with {TEMPLATE VARIABLE}, PLEASE BE CAREFUL EDITING. What\\'s change? '+str, function(btn, text){",
702 " if (btn == 'ok'){",
704 " e.record.set('txt', text);",
705 " e.record.commit();",
712 " if (e.record.data.txt.replace(/\\s+/, '').length) {",
716 " var tl = _this.treepanel.tree.getSelectionModel().getSelectedNode().parentNode.attributes.id;",
719 " tl = (tl == 'zh_HK') ? 'zh-TW' : tl;",
721 " if (tl == 'en' && !e.value.length) {",
723 " e.value = e.record.data.src_id_txt;",
724 " e.record.set('txt', e.record.data.src_id_txt);",
728 " Pman.GoogleTranslate(e.record.data.src_id_txt, \"en\", tl, function(result) {",
729 " // Roo.log(result);",
730 " _this.grid.activeEditor.setValue(result);",
731 " //console.log(result.translation);",
742 " _this.grid = this; ",
743 " //_this.dialog = Pman.Dialog.FILL_IN",
744 " if (_this.panel.active) {",
745 " this.footer.onClick('first');",
746 " // this.ds.onc.onClick('first');",
751 "function (_self, rowIndex, e)",
753 " if (!_this.dialog) {",
756 " _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {",
757 " _this.grid.footer.onClick('first');",
764 "xtype" : "EditorGrid"
770 " _this.panel = this;",
771 " if (_this.grid) {",
772 " _this.grid.footer.onClick('first');",
778 "tableName" : "Page",
780 "xtype" : "GridPanel"
783 "xtype" : "BorderLayout"
787 "title" : "Application Words",
788 "xtype" : "NestedLayoutPanel"
792 "name" : "Pman.Tab.AdminTranslations",
793 "parent" : "Pman.Tab.AdminTranslationsInt",
794 "path" : "/home/alan/gitlive/Pman.Admin/Pman.Tab.AdminTranslations.bjs",
795 "permname" : "Admin.Translations",
797 "03c2e7e41ffc181a4e84080b4710e81e" : "New",
798 "07a1d316d1065473f290c3c2b72a80f3" : "Application Words",
799 "0a52da7a03a6de3beefe54f8c03ad80d" : "Original",
800 "193cfc9be3b995831c6af2fea6650e60" : "Page",
801 "1bc29b36f623ba82aaf6724fd3b16718" : "md5",
802 "4d1c8263ba1036754f8db14a98f9f006" : "Reload",
803 "69fd71b6f79260924a32a45850a13ab7" : "Translations (rescan this to update strings)",
804 "6dd08874f83507e9c7b23f1a46b7fa7c" : "Translation",
805 "801ab24683a4a8c433c6eb40c48bcd9d" : "Download",
806 "91412465ea9169dfd901dd5e7c96dd99" : "Upload",
807 "9d1ead73e678fa2f51a70a933b0bf017" : "Not Found",
808 "cd6ae20e52d83f601c5fa12b66f0f6d0" : "Rescan",
809 "e2f9d206562d8f5ea421ad51100f7151" : "Displaying petition_entry{0} - {1} of {2}",
810 "e3d388b2c43e5ba0905702620ae2abc1" : "Search for",
811 "f2a6c498fb90ee345d997f888fce3b18" : "Delete"
813 "title" : "Admin - Translations"