},
{
"listeners" : {
- "click" : "function (_self, e)\n{\n var tree = _this.treepanel.tree;\n Roo.log(tree);\n var sn = tree.getSelectionModel().getSelectedNode();\n\n if (!sn) {\n Roo.MessageBox.alert(\"Error\", \"Select a node\");\n return;\n }\n \n \n var steps = [ \n 'scanProjectBJS',\n 'scanPmanBJS',\n 'scanPmanTemplates',\n 'scanTables',\n 'syncLanguage' \n ];\n \n \n var syncTemplate = function(){\n \n var step = steps.shift();\n Roo.MessageBox.updateProgress( (5.0 - steps.length) / 5.0, \"Running \" + step);\n \n new Pman.Request({\n url : baseURL + '/Admin/UpdateBjsTemplates/' + step,\n method : 'GET',\n //mask : 'Processing...',\n timeout : 9000000,\n success : function()\n {\n if (steps.length > 0 ) { \n syncTemplate();\n return;\n }\n Roo.MessageBox.hide();\n _this.treepanel.tree.getRootNode().reload();\n }\n });\n \n };\n \n \n var syncLanguage = function(){\n new Pman.Request({\n url : baseURL + '/Roo/Core_templatestr',\n method : 'POST',\n mask : 'Processing...',\n params : {\n _rescan : sn.attributes.id.split(':')[1]\n }, \n success : function()\n {\n _this.treepanel.tree.getRootNode().reload();\n }\n });\n };\n \n if(typeof(sn.isRoot) != 'undefined' && sn.isRoot){\n Roo.MessageBox.progress(\"Syncing templates\", \"Starting\");\n syncTemplate();\n return;\n }\n \n if(typeof(sn.attributes.language) != 'undefined' && sn.attributes.language){\n syncLanguage();\n return;\n }\n \n \n \n \n \n}"
+ "click" : "function (_self, e)\n{\n var tree = _this.treepanel.tree;\n Roo.log(tree);\n var sn = tree.getSelectionModel().getSelectedNode();\n\n if (!sn) {\n Roo.MessageBox.alert(\"Error\", \"Select a node\");\n return;\n }\n \n \n var steps = [ \n 'scanProjectBJS',\n 'scanPmanBJS',\n 'scanPmanTemplates',\n 'scanTables',\n 'syncLanguage' \n ];\n \n \n var syncTemplate = function(){\n \n var step = steps.shift();\n Roo.MessageBox.updateProgress( (5.0 - steps.length) / 5.0, \"Running \" + step);\n \n new Pman.Request({\n url : baseURL + '/Admin/UpdateBjsTemplates/' + step,\n method : 'GET',\n //mask : 'Processing...',\n timeout : 9000000,\n success : function()\n {\n if (steps.length > 0 ) { \n syncTemplate();\n return;\n }\n Roo.MessageBox.hide();\n _this.treepanel.tree.getRootNode().reload();\n }\n });\n \n };\n \n \n var syncLanguage = function(){\n new Pman.Request({\n url : baseURL + '/Roo/Core_templatestr',\n method : 'POST',\n mask : 'Processing...',\n params : {\n _rescan : sn.attributes.id.split(':')[1]\n }, \n success : function()\n {\n _this.treepanel.tree.getRootNode().reload();\n }\n });\n };\n \n var syncSingleTemplate = function(id){\n new Pman.Request({\n url : baseURL + '/Roo/Core_template',\n method : 'POST',\n mask : 'Processing...',\n params : {\n id : id,\n _rescan : 1\n }, \n success : function()\n {\n (function() {\n _this.grid.footer.onClick('first');\n }).defer(100);\n }\n });\n };\n \n \n if(typeof(sn.isRoot) != 'undefined' && sn.isRoot){\n Roo.MessageBox.progress(\"Syncing templates\", \"Starting\");\n syncTemplate();\n return;\n }\n \n if(typeof(sn.attributes.language) != 'undefined' && sn.attributes.language){\n syncLanguage();\n return;\n }\n \n if(typeof(sn.attributes.id) != 'undefined' && sn.attributes.id * 1> 0){\n syncSingleTemplate(sn.attributes.id);\n return;\n }\n \n \n \n \n}"
},
"text" : "Rescan",
"xtype" : "Button",