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,on_table,on_col,src_id_txt',",
253 " if (!sn || sn.id == 'transtree') {",
254 " Roo.MessageBox.alert(\"Error\", \"Select language, module or page\");",
257 " if (typeof(sn.id) == 'number') {",
258 " p.template_id = sn.id;",
263 " if (typeof(sn.id) == 'string' && sn.id.match(/^table:/)) {",
264 " var sns = sn.id.split(':');",
266 " p.on_table = sns[2];",
267 " p.csvCols = 'src_id_mdsum,on_table,on_id,on_col,src_id_txt,lang,txt';",
268 " p.csvTitles = 'Code,Table,Table id,Column,Original,Language,Translation';",
271 " if (typeof(sn.id) == 'string' && sn.id.match(/^view:/)) {",
272 " var sns = sn.id.split(':');",
274 " p.template_id_view_name = sns[2];",
277 " if (typeof(sn.id) == 'string' && sn.id.match(/^lang:/)) {",
278 " var sns = sn.id.split(':');",
283 " // view: {lang} : {view_name}",
286 " new Pman.Download({",
287 " url : baseURL + '/Roo/Core_templatestr',",
303 "$ xns" : "Roo.Toolbar",
304 "xtype" : "Separator"
307 "$ xns" : "Roo.Toolbar",
310 "function (_self, e)",
312 " _this.treepanel.tree.getRootNode().reload();",
324 "$ xns" : "Roo.tree",
326 "containerScroll" : false,
329 "$ baseParams" : "{ _tree : 1 }",
330 "$ dataUrl" : "baseURL + '/Roo/Core_templatestr'",
331 "$ xns" : "Roo.tree",
335 "function (This, node, callback)",
337 " // set some params.",
339 " this.baseParams._tree = 1;",
341 " //this.baseParams.category = node.attributes.category;",
345 "function (This, node, response)",
347 " Roo.MessageBox.alert(\"Error\", \"Problem loading tree\");",
351 "requestMethod" : "GET",
352 "xtype" : "TreeLoader"
355 "$ xns" : "Roo.tree",
358 "text" : "Translations (rescan this to update strings)",
359 "xtype" : "AsyncTreeNode"
362 "$ xns" : "Roo.tree",
363 "* prop" : "selModel",
365 "selectionchange" : [
366 "function (_self, node)",
370 " //if (node.id.split('/').length < 2) {",
374 " _this.grid.footer.onClick('first');",
380 "xtype" : "DefaultSelectionModel"
383 "rootVisible" : true,
384 "xtype" : "TreePanel"
391 " _this.treepanel = _self;",
396 "xtype" : "TreePanel"
400 "background" : false,
401 "fitContainer" : true,
405 "$ xns" : "Roo.grid",
407 "autoExpandColumn" : "txt",
412 "* prop" : "toolbar",
415 "$ xns" : "Roo.form",
416 "String emptyText" : "Search for",
421 " _this.searchBox = this;",
425 "function (_self, e)",
427 "_this.grid.footer.onClick('first');",
431 "xtype" : "TextField"
434 "$ icon" : "rootURL + '/Pman/templates/images/search.gif'",
435 "$ xns" : "Roo.Toolbar",
436 "cls" : "x-btn-icon",
439 "function (_self, e)",
441 "_this.grid.footer.onClick('first');",
448 "$ icon" : "rootURL + '/Pman/templates/images/edit-clear.gif'",
449 "$ xns" : "Roo.Toolbar",
450 "cls" : "x-btn-icon",
453 "function (_self, e)",
455 " _this.searchBox.setValue('');",
457 " _this.grid.footer.onClick('first');",
469 "displayInfo" : true,
470 "displayMsg" : "Displaying petition_entry{0} - {1} of {2}",
471 "emptyMsg" : "Not Found",
473 "xtype" : "PagingToolbar"
476 "$ sortInfo" : "{ field : 'src_id_txt', direction: 'ASC' }",
477 "$ xns" : "Roo.data",
478 "* prop" : "dataSource",
481 "$ url" : "baseURL + '/Roo/Core_templatestr.php'",
482 "$ xns" : "Roo.data",
485 "xtype" : "HttpProxy"
495 " 'name': 'shortname',",
501 "$ xns" : "Roo.data",
505 "totalProperty" : "total",
506 "xtype" : "JsonReader"
511 "function (_self, o)",
514 " var sn = _this.treepanel.tree.getSelectionModel().getSelectedNode();",
516 " if (!sn || typeof(sn.attributes) == 'undefined' || typeof(sn.attributes.leaf) == 'undefined' || !sn.attributes.leaf) { ",
517 " _this.grid.ds.removeAll();",
521 " o.params = o.params || {};",
522 " o.params.lang = sn.parentNode.attributes.id.split(':')[1];",
524 " o.params.active = 1;",
525 " o.params['!src_id'] = 0;",
527 " if (_this.searchBox && _this.searchBox.getValue().length) { ",
528 " o.params['_search_txt'] = _this.searchBox.getValue();",
532 " if(sn.attributes.on_table){",
533 " o.params.on_table = sn.attributes.on_table;",
535 " o.params.template_id = sn.attributes.id * 1;",
544 "function (_self, rec, operation)",
546 " Roo.log(operation);",
548 " if (operation != 'commit') {",
553 " _this.grid.getView().el.mask(\"Saving\");",
554 " new Pman.Request({",
555 " url : baseURL + '/Roo/Core_templatestr',",
558 " id : rec.get('id'),",
559 " txt : rec.get('txt')",
561 " success : function()",
563 " _this.grid.getView().el.unmask();",
564 " //g.getDataSource().reload();",
566 " failure : function()",
568 " _this.grid.getView().el.unmask();",
569 " Roo.MessageBox.alert(\"Error\", \"There was a problem saving the data - try reloading\");",
585 " if (r.data.updated < r.data.src_id_updated) {",
589 " return String.format('<div style=\"color:'+c+'\";>{0}</div>', v)",
593 "$ xns" : "Roo.grid",
595 "dataIndex" : "src_id_txt",
596 "header" : "Original",
598 "xtype" : "ColumnModel"
606 " if (r.data.updated < r.data.src_id_updated) {",
610 " return String.format('<div style=\"color:'+c+'\";>{0}</div>', v)",
614 "$ xns" : "Roo.grid",
617 "header" : "Translation",
620 "$ xns" : "Roo.grid",
624 "$ xns" : "Roo.form",
626 "allowBlank" : false,
627 "xtype" : "TextField"
630 "xtype" : "GridEditor"
634 "xtype" : "ColumnModel"
640 " return v ? v : '';",
644 "$ xns" : "Roo.grid",
646 "Boolean hidden" : true,
647 "dataIndex" : "src_id_mdsum",
650 "xtype" : "ColumnModel"
657 " e.record.commit();",
663 " /*if (e.record.data.src_id_txt.indexOf('<') > -1) {",
664 " // console.log(\"HTML EDITOR!!\");",
665 " Pman.Dialog.CmsTranslateEditor.show(e.record);",
669 " var str=e.record.data.src_id_txt;",
670 " var patt=/{(.*?)}/g;",
672 " Roo.log(str.length);",
675 " if(patt.test(str)){",
677 " Pman.Dialog.AdminTranslateTemplates.show(e.record.data, function(v){",
680 " e.record.set('txt', v.txt);",
681 " e.record.commit();",
684 " Roo.MessageBox.prompt('WARNING', 'This text is with {TEMPLATE VARIABLE}, PLEASE BE CAREFUL EDITING. What\\'s change? '+str, function(btn, text){",
685 " if (btn == 'ok'){",
687 " e.record.set('txt', text);",
688 " e.record.commit();",
694 " if(str.length > 150){",
696 " Pman.Dialog.AdminTranslateTemplates.show(e.record.data, function(v){",
698 " e.record.set('txt', v.txt);",
699 " e.record.commit();",
702 " Roo.MessageBox.prompt('WARNING', 'This text is with {TEMPLATE VARIABLE}, PLEASE BE CAREFUL EDITING. What\\'s change? '+str, function(btn, text){",
703 " if (btn == 'ok'){",
705 " e.record.set('txt', text);",
706 " e.record.commit();",
713 " if (e.record.data.txt.replace(/\\s+/, '').length) {",
717 " var tl = _this.treepanel.tree.getSelectionModel().getSelectedNode().parentNode.attributes.id;",
720 " tl = (tl == 'zh_HK') ? 'zh-TW' : tl;",
722 " if (tl == 'en' && !e.value.length) {",
724 " e.value = e.record.data.src_id_txt;",
725 " e.record.set('txt', e.record.data.src_id_txt);",
729 " Pman.GoogleTranslate(e.record.data.src_id_txt, \"en\", tl, function(result) {",
730 " // Roo.log(result);",
731 " _this.grid.activeEditor.setValue(result);",
732 " //console.log(result.translation);",
743 " _this.grid = this; ",
744 " //_this.dialog = Pman.Dialog.FILL_IN",
745 " if (_this.panel.active) {",
746 " this.footer.onClick('first');",
747 " // this.ds.onc.onClick('first');",
752 "function (_self, rowIndex, e)",
754 " if (!_this.dialog) {",
757 " _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {",
758 " _this.grid.footer.onClick('first');",
765 "xtype" : "EditorGrid"
771 " _this.panel = this;",
772 " if (_this.grid) {",
773 " _this.grid.footer.onClick('first');",
779 "tableName" : "Page",
781 "xtype" : "GridPanel"
784 "xtype" : "BorderLayout"
788 "title" : "Application Words",
789 "xtype" : "NestedLayoutPanel"
793 "name" : "Pman.Tab.AdminTranslations",
794 "parent" : "Pman.Tab.AdminTranslationsInt",
795 "path" : "/home/leon/gitlive/web.MediaOutreach/Pman/Admin/Pman.Tab.AdminTranslations.bjs",
796 "permname" : "Admin.Translations",
798 "03c2e7e41ffc181a4e84080b4710e81e" : "New",
799 "07a1d316d1065473f290c3c2b72a80f3" : "Application Words",
800 "0a52da7a03a6de3beefe54f8c03ad80d" : "Original",
801 "193cfc9be3b995831c6af2fea6650e60" : "Page",
802 "1bc29b36f623ba82aaf6724fd3b16718" : "md5",
803 "4d1c8263ba1036754f8db14a98f9f006" : "Reload",
804 "69fd71b6f79260924a32a45850a13ab7" : "Translations (rescan this to update strings)",
805 "6dd08874f83507e9c7b23f1a46b7fa7c" : "Translation",
806 "801ab24683a4a8c433c6eb40c48bcd9d" : "Download",
807 "91412465ea9169dfd901dd5e7c96dd99" : "Upload",
808 "9d1ead73e678fa2f51a70a933b0bf017" : "Not Found",
809 "cd6ae20e52d83f601c5fa12b66f0f6d0" : "Rescan",
810 "e2f9d206562d8f5ea421ad51100f7151" : "Displaying petition_entry{0} - {1} of {2}",
811 "e3d388b2c43e5ba0905702620ae2abc1" : "Search for",
812 "f2a6c498fb90ee345d997f888fce3b18" : "Delete"
814 "title" : "Admin - Translations"