cvs: doc-editor /js login.js main.js main_min.js /php class.php controler.php
| From: | Mehdi Achour | Date: | Sun, 29 Mar 2009 02:44:06 +0000 |
| Subject: | cvs: doc-editor /js login.js main.js main_min.js /php class.php controler.php | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-3544@lists.php.net to get a copy of this message | ||
didou Sun Mar 29 02:44:06 2009 UTC
Modified files:
/doc-editor/js login.js main.js main_min.js
/doc-editor/php class.php controler.php
Log:
Clean up class.php:
* Declare unknown variables
* Use single quotes when it possibles (solves pcre compilations issues)
* Factorize some of the code
* Some minor fixes
Rename controler.php to controller.php
http://cvs.php.net/viewvc.cgi/doc-editor/js/login.js?r1=1.1&r2=1.2&diff_format=u Index: doc-editor/js/login.js diff -u doc-editor/js/login.js:1.1 doc-editor/js/login.js:1.2 --- doc-editor/js/login.js:1.1 Sat Mar 28 20:55:35 2009 +++ doc-editor/js/login.js Sun Mar 29 02:44:06 2009 @@ -97,7 +97,7 @@ xtype : 'form', region : 'south', id : 'login-form', - url : '../php/controler.php', + url : '../php/controller.php', bodyStyle : 'padding:5px 5px 0', border : false, height : 100, @@ -249,4 +249,4 @@ }(); -Ext.EventManager.onDocumentReady(loginPage.init, loginPage, true); \ No newline at end of file +Ext.EventManager.onDocumentReady(loginPage.init, loginPage, true); http://cvs.php.net/viewvc.cgi/doc-editor/js/main.js?r1=1.1&r2=1.2&diff_format=u Index: doc-editor/js/main.js diff -u doc-editor/js/main.js:1.1 doc-editor/js/main.js:1.2 --- doc-editor/js/main.js:1.1 Sat Mar 28 20:55:35 2009 +++ doc-editor/js/main.js Sun Mar 29 02:44:06 2009 @@ -54,7 +54,7 @@ // We load the configuration for this user Ext.Ajax.request({ scope: this, - url: './php/controler.php', + url: './php/controller.php', params: { task: 'get-conf' }, @@ -235,7 +235,7 @@ this.storeCommitLogMessage = new Ext.data.Store({ //autoLoad: true, proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'get-commit-log-message' @@ -257,7 +257,7 @@ this.storeFilesError = new Ext.data.GroupingStore({ autoLoad: ( this.userLang === 'en' ) ? false : true, proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'GetFilesError' @@ -307,7 +307,7 @@ this.storeFilesNeedUpdate = new Ext.data.GroupingStore({ autoLoad: ( this.userLang === 'en' ) ? false : true, proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'GetFilesNeedUpdate' @@ -357,7 +357,7 @@ this.storeFilesNeedReviewed = new Ext.data.GroupingStore({ autoLoad: (this.userLang === 'en' ) ? false : true, proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'GetFilesNeedReviewed' @@ -402,7 +402,7 @@ this.storePendingCommit = new Ext.data.GroupingStore({ autoLoad: true, proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'GetFilesPendingCommit' @@ -446,7 +446,7 @@ this.storePendingPatch = new Ext.data.GroupingStore({ autoLoad: true, proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'GetFilesPendingPatch' @@ -493,7 +493,7 @@ this.storeMailing = new Ext.data.Store({ //autoLoad: true, proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'get-mailing-info' @@ -526,7 +526,7 @@ // Store : All open bugs for documentation this.storeBugs = new Ext.data.Store({ proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'get-open-bugs' @@ -553,7 +553,7 @@ // Store : Translator with Informations like Revcheck first table this.storeTranslators = new Ext.data.Store({ proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'get-translator-info' @@ -600,7 +600,7 @@ // Store : storeSummary with Informations like Revcheck second table this.storeSummary = new Ext.data.Store({ proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'get-summary-info' @@ -639,7 +639,7 @@ // The store ds = new Ext.data.Store({ proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'get-check-doc-data' @@ -795,7 +795,7 @@ Ext.Ajax.request({ scope: this, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'get-check-doc-files', path: path, @@ -1004,7 +1004,7 @@ Ext.Ajax.request({ scope: scope, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'after-patch-reject', PatchUniqID: FileUniqID @@ -1057,7 +1057,7 @@ // We save LANG File Ext.Ajax.request({ scope: scope, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'save-file', filePath: FilePath, @@ -1081,7 +1081,7 @@ // We need to send an accept patch email, delete .patch file, and remove this patch from dataBase Ext.Ajax.request({ scope: scope, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'after-patch-accept', PatchUniqID: FileUniqID @@ -1126,7 +1126,7 @@ // We save LANG File Ext.Ajax.request({ scope: scope, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'save-file', filePath: FilePath, @@ -1246,7 +1246,7 @@ // We save this patch Ext.Ajax.request({ scope: scope, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'save-file', filePath: FilePath, @@ -1308,7 +1308,7 @@ // We save LANG File Ext.Ajax.request({ scope: this, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'save-file', filePath: FilePath, @@ -1370,7 +1370,7 @@ // We check for error Ext.Ajax.request({ scope: this, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'check-file-error', FilePath: FilePath, @@ -1415,7 +1415,7 @@ // Now, We save LANG File Ext.Ajax.request({ scope: this, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'save-file', filePath: FilePath, @@ -1483,7 +1483,7 @@ // We load the File Ext.Ajax.request({ scope: this, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'get-file', FilePath: FilePath, @@ -1646,7 +1646,7 @@ // Load diff data Ext.Ajax.request({ - url: './php/controler.php', + url: './php/controller.php', params: { task: 'get-diff2', FilePath: FilePath, @@ -1845,7 +1845,7 @@ // Ext.Ajax.request({ scope: this, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'save-LogMessage', messID: messID, @@ -1902,7 +1902,7 @@ // Ext.Ajax.request({ scope: this, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'delete-LogMessage', messID: this.storeCommitLogMessage.getAt(rowIndex).data.id @@ -2123,7 +2123,7 @@ Ext.getCmp('winCvsCommit').close(); Ext.Ajax.request({ - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'cvs-commit', nodes: Ext.util.JSON.encode(nodes), @@ -2159,7 +2159,7 @@ // Apply modification Ext.Ajax.request({ - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'on-succes-commit', nodes: Ext.util.JSON.encode(nodes), @@ -2209,7 +2209,7 @@ Ext.get('wizard-step-1.1').replaceClass('wizard-wait', 'wizard-show'); Ext.Ajax.request({ scope: scope, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'update-repo' }, @@ -2232,7 +2232,7 @@ function checkLockFile(){ Ext.Ajax.request({ scope: scope, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'check-lock-file', lockFile: 'lock_update_repository' @@ -2273,7 +2273,7 @@ Ext.get('wizard-step-2').replaceClass('wizard-step-before', 'wizard-step-working'); Ext.Ajax.request({ scope: scope, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'apply-tools' }, @@ -2292,7 +2292,7 @@ function checkLockFile2(){ Ext.Ajax.request({ scope: scope, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'check-lock-file', lockFile: 'lock_apply_tools' @@ -2404,7 +2404,7 @@ Ext.Ajax.request({ scope: scope, - url: './php/controler.php', + url: './php/controller.php', params: { task: 'get-logfile', file: 'log_check_build' @@ -2471,7 +2471,7 @@ Ext.Ajax.request({ scope: this, - url: './php/controler.php', + url: './php/controller.php', params: { task: 'check-build', xmlDetails: choice @@ -2494,7 +2494,7 @@ function checkLockFile(){ Ext.Ajax.request({ - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'check-lock-file', lockFile: 'lock_check_build' @@ -2839,7 +2839,7 @@ // Apply modification in DB Ext.Ajax.request({ scope: this, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'conf-update', item: item, @@ -2970,7 +2970,7 @@ var v = form.getForm().getValues(); Ext.Ajax.request({ - url: './php/controler.php', + url: './php/controller.php', params: { task: 'send-email', to: v.to, @@ -3010,7 +3010,7 @@ this.TaskPing = new Ext.util.DelayedTask(function(){ Ext.Ajax.request({ - url: './php/controler.php', + url: './php/controller.php', params: { task: 'ping' }, @@ -3099,7 +3099,7 @@ storeLogLang = new Ext.data.Store({ autoLoad: true, proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'get-log', @@ -3134,7 +3134,7 @@ storeLogEn = new Ext.data.Store({ autoLoad: true, proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'get-log', @@ -3646,7 +3646,7 @@ // Load diff data Ext.Ajax.request({ scope: this, - url: './php/controler.php', + url: './php/controller.php', params: { task: 'get-diff', FilePath: this.userLang + FilePath, @@ -3782,7 +3782,7 @@ // Load diff data Ext.Ajax.request({ - url: './php/controler.php', + url: './php/controller.php', params: { task: 'get-diff', FilePath: this.userLang + FilePath, @@ -3841,7 +3841,7 @@ storeLogLang = new Ext.data.Store({ autoLoad: true, proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'get-log', @@ -3876,7 +3876,7 @@ storeLogEn = new Ext.data.Store({ autoLoad: true, proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'get-log', @@ -4119,7 +4119,7 @@ // Load diff data Ext.Ajax.request({ - url: './php/controler.php', + url: './php/controller.php', params: { task: 'get-diff2', FilePath: 'en' + FilePath, @@ -4483,7 +4483,7 @@ storeLog = new Ext.data.Store({ autoLoad: true, proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'get-log', @@ -4630,7 +4630,7 @@ // Load diff data Ext.Ajax.request({ scope: this, - url: './php/controler.php', + url: './php/controller.php', params: { task: 'get-diff', FilePath: FilePath, @@ -4900,7 +4900,7 @@ // Load diff data Ext.Ajax.request({ - url: './php/controler.php', + url: './php/controller.php', params: { task: 'get-diff', FilePath: FilePath, @@ -4953,7 +4953,7 @@ // Ext.Ajax.request({ scope: this, - url: './php/controler.php', + url: './php/controller.php', params: { task: 'clear-local-change', FilePath: FilePath, @@ -5111,7 +5111,7 @@ // Load diff data Ext.Ajax.request({ scope: this, - url: './php/controler.php', + url: './php/controller.php', params: { task: 'get-diff', FilePath: this.userLang + FilePath, @@ -5150,7 +5150,7 @@ Ext.Ajax.request({ scope: this, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'all-files-about-extension', ExtName: group[2] @@ -5213,7 +5213,7 @@ storeLogLang = new Ext.data.Store({ autoLoad: true, proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'get-log', @@ -5248,7 +5248,7 @@ storeLogEn = new Ext.data.Store({ autoLoad: true, proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'get-log', @@ -6087,7 +6087,7 @@ autoScroll: true, useArrows: true, loader: new Ext.tree.TreeLoader({ - dataUrl: './php/controler.php', + dataUrl: './php/controller.php', baseParams: { task: 'getAllFiles' } @@ -6138,7 +6138,7 @@ storeLog = new Ext.data.Store({ autoLoad: true, proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'get-log', @@ -6365,7 +6365,7 @@ // We save LANG File Ext.Ajax.request({ scope: this, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'save-file', filePath: FilePath, @@ -6516,7 +6516,7 @@ // Ext.Ajax.request({ scope: this, - url: './php/controler.php', + url: './php/controller.php', params: { task: 'erase-personal-data' }, http://cvs.php.net/viewvc.cgi/doc-editor/js/main_min.js?r1=1.1&r2=1.2&diff_format=u Index: doc-editor/js/main_min.js diff -u doc-editor/js/main_min.js:1.1 doc-editor/js/main_min.js:1.2 --- doc-editor/js/main_min.js:1.1 Sat Mar 28 20:55:35 2009 +++ doc-editor/js/main_min.js Sun Mar 29 02:44:06 2009 @@ -1 +1 @@ -var phpDoc=function(){Ext.QuickTips.init();Ext.BLANK_IMAGE_URL="/extjs/resources/images/default/s.gif";return{TaskPing:"",storeCommitLogMessage:"",storeFilesError:"",storeFilesNeedUpdate:"",storeFilesNeedReviewed:"",storePendingCommit:"",storePendingPatch:"",storeMailing:"",storeBugs:"",storeTranslators:"",storeSummary:"",userLoggin:"",userLang:"",appName:"PhpDocumentation Online Editor",appVer:"0.2",userConf:{conf_needupdate_diff:"using-exec",conf_needupdate_scrollbars:true,conf_error_skipnbliteraltag:true,conf_error_scrollbars:true,conf_reviewed_scrollbars:true,conf_patch_scrollbars:true,conf_theme:"xtheme-default.css"},treeAllFiles:"",treeSort:"",treeAllFilesRoot:"",filePendingOpen:"",init:function(){Ext.getBody().on("contextmenu",function(a){a.stopEvent()},this);Ext.Ajax.request({scope:this,url:"./php/controler.php",params:{task:"get-conf"},success:function(a){var b=Ext.util.JSON.decode(a.responseText);if(b.success){this.userLoggin=b.mess.userLoggin;this.userLang=b.mess! .userLang;this.userConf.conf_needupdate_diff=b.mess.userConf.conf_needupdate_diff;this.userConf.conf_needupdate_scrollbars=b.mess.userConf.conf_needupdate_scrollbars;this.userConf.conf_error_skipnbliteraltag=b.mess.userConf.conf_error_skipnbliteraltag;this.userConf.conf_error_scrollbars=b.mess.userConf.conf_error_scrollbars;this.userConf.conf_reviewed_scrollbars=b.mess.userConf.conf_reviewed_scrollbars;this.userConf.conf_theme=b.mess.userConf.conf_theme;Ext.util.CSS.swapStyleSheet("appTheme",this.userConf.conf_theme);this.loadDataStore();this.drawInterface()}}})},loadDataStore:function(){this.storeCommitLogMessage=new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:"/php/controler.php"}),baseParams:{task:"get-commit-log-message"},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"text",mapping:"text"}])});this.storeFilesError=new Ext.data.GroupingStore({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/contro! ler.php"}),baseParams:{task:"GetFilesError"},reader:new Ext.data.JsonR eader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"path",mapping:"path"},{name:"name",mapping:"name"},{name:"maintainer",mapping:"maintainer"},{name:"type",mapping:"type"},{name:"value_en",mapping:"value_en"},{name:"value_lang",mapping:"value_lang"},{name:"needcommit",mapping:"needcommit"}]),sortInfo:{field:"path",direction:"ASC"},groupField:"path",listeners:{datachanged:function(a){Ext.getDom("acc-error-nb").innerHTML=a.getCount()}}});this.storeFilesNeedUpdate=new Ext.data.GroupingStore({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controler.php"}),baseParams:{task:"GetFilesNeedUpdate"},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"path",mapping:"path"},{name:"name",mapping:"name"},{name:"revision",mapping:"revision"},{name:"en_revision",mapping:"en_revision"},{name:"maintainer",mapping:"maintainer"},{name:"needcommit",mapping:"needcommit"},{name:"isCritical",mapping! :"isCritical"}]),sortInfo:{field:"path",direction:"ASC"},groupField:"path",listeners:{datachanged:function(a){Ext.getDom("acc-need-update-nb").innerHTML=a.getCount()}}});this.storePendingCommit=new Ext.data.GroupingStore({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controler.php"}),baseParams:{task:"GetFilesPendingCommit"},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"path",mapping:"path"},{name:"name",mapping:"name"},{name:"by",mapping:"by"},{name:"date",mapping:"date"}]),sortInfo:{field:"path",direction:"ASC"},groupField:"path",listeners:{datachanged:function(a){Ext.getDom("acc-pendingCommit-nb").innerHTML=a.getCount()},add:function(a){Ext.getDom("acc-pendingCommit-nb").innerHTML=a.getCount()}}});this.storePendingPatch=new Ext.data.GroupingStore({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controler.php"}),baseParams:{task:"GetFilesPendingPatch"},reader:new Ext.data.JsonReader({root:"Item! s",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"p ath",mapping:"path"},{name:"name",mapping:"name"},{name:"by",mapping:"by"},{name:"uniqID",mapping:"uniqID"},{name:"date",mapping:"date"}]),sortInfo:{field:"path",direction:"ASC"},groupField:"path",listeners:{datachanged:function(a){Ext.getDom("acc-pendingPatch-nb").innerHTML=a.getCount()},add:function(a){Ext.getDom("acc-pendingPatch-nb").innerHTML=a.getCount()}}});this.storeFilesNeedReviewed=new Ext.data.GroupingStore({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controler.php"}),baseParams:{task:"GetFilesNeedReviewed"},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"path",mapping:"path"},{name:"name",mapping:"name"},{name:"reviewed",mapping:"reviewed"},{name:"maintainer",mapping:"maintainer"},{name:"needcommit",mapping:"needcommit"}]),sortInfo:{field:"path",direction:"ASC"},groupField:"path",listeners:{datachanged:function(a){Ext.getDom("acc-need-reviewed-nb").innerHTML=a.getCount()}}});this.storeMailin! g=new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:"/php/controler.php"}),baseParams:{task:"get-mailing-info"},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"title",mapping:"title"},{name:"link",mapping:"link"},{name:"description",mapping:"description"},{name:"pubDate",mapping:"pubDate",type:"date",dateFormat:"Y/m/d H:i:s"}])});this.storeMailing.setDefaultSort("pubDate","desc");this.storeBugs=new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:"/php/controler.php"}),baseParams:{task:"get-open-bugs"},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"title",mapping:"title"},{name:"link",mapping:"link"},{name:"description",mapping:"description"}])});this.storeTranslators=new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:"/php/controler.php"}),baseParams:{task:"get-translator-info"},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nb! Items",id:"id"},[{name:"id",mapping:"id"},{name:"name",mapping:"name"} ,{name:"email",mapping:"mail"},{name:"nick",mapping:"nick"},{name:"cvs",mapping:"cvs"},{name:"uptodate",mapping:"uptodate",type:"int"},{name:"old",mapping:"old",type:"int"},{name:"critical",mapping:"critical",type:"int"},{name:"sum",mapping:"sum",type:"int"}])});this.storeTranslators.setDefaultSort("nick","asc");this.storeSummary=new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:"/php/controler.php"}),baseParams:{task:"get-summary-info"},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"libel",mapping:"libel"},{name:"nbFiles",mapping:"nbFiles"},{name:"percentFiles",mapping:"percentFiles"},{name:"sizeFiles",mapping:"sizeFiles"},{name:"percentSize",mapping:"percentSize"}])})},openFile:function(d,a){Ext.getCmp("acc-all-files").expand();var c=d.split("/");function b(f,e){f.expand(false,true,function(h){var g;h.ensureVisible();if(c[0]&&c[0]!==""){for(g=0;g<h.childNodes.length;g=g+1){if(h.childNodes[g].text===c[0]){c! .shift();b(h.childNodes[g],e)}}}else{for(g=0;g<h.childNodes.length;g=g+1){if(h.childNodes[g].text===a){h.childNodes[g].ensureVisible();h.childNodes[g].ui.highlight();e.treeAllFiles.fireEvent("dblclick",h.childNodes[g])}}}})}b(this.treeAllFilesRoot,this)},rejectPatch:function(f,d,a,e,g,c){function b(h){if(h==="yes"){var i=Ext.MessageBox.wait("Please, wait...");Ext.Ajax.request({scope:c,url:"../php/controler.php",params:{task:"after-patch-reject",PatchUniqID:e},success:function(){this.storePendingPatch.remove(this.storePendingPatch.getAt(g));this.storePendingPatch.fireEvent("add",this.storePendingPatch);Ext.getCmp("main-panel").remove("PP-"+f);i.hide()}})}}Ext.MessageBox.confirm("Confirm","This action will <b>reject</b> this patch, send an email to his author and close this tab.",b,c)},saveFileViaPatch:function(e,c,a,d,g,b){function f(h){if(h==="yes"){Ext.getCmp("PP-PATCH-PANEL-btn-save-"+e).disable();Ext.getCmp("PP-PATCH-"+e).isModified=false;Ext.getCmp("PP-PATCH-PANEL-"+e).! setTitle(Ext.getCmp("PP-PATCH-PANEL-"+e).originTitle);Ext.getCmp("PP-" +e).setTitle(Ext.getCmp("PP-"+e).originTitle);var i=Ext.MessageBox.wait("Saving data...");Ext.Ajax.request({scope:b,url:"../php/controler.php",params:{task:"save-file",filePath:c,fileName:a,fileLang:"all",fileContent:Ext.getCmp("PP-PATCH-"+e).getCode()},success:function(k,j){var l=Ext.util.JSON.decode(k.responseText);if(l.success){this.addToPendingCommit(c,a);this.storePendingPatch.remove(this.storePendingPatch.getAt(g));this.storePendingPatch.fireEvent("add",this.storePendingPatch);Ext.Ajax.request({scope:b,url:"../php/controler.php",params:{task:"after-patch-accept",PatchUniqID:d}});i.hide();Ext.getCmp("main-panel").remove("PP-"+e)}}})}}Ext.MessageBox.confirm("Confirm","This action will accept this patch, send an email to his author, save the file and close this tab.",f,b)},saveEnFile:function(e,c,a,d,g,b){Ext.getCmp(d+"-EN-PANEL-btn-save-"+e).disable();Ext.getCmp(d+"-"+e).isModifiedEn=false;Ext.getCmp(d+"-EN-PANEL-"+e).setTitle(Ext.getCmp(d+"-EN-PANEL-"+e).originTitle);if! (!Ext.getCmp(d+"-"+e).isModifiedEn&&!Ext.getCmp(d+"-"+e).isModifiedLang){Ext.getCmp(d+"-"+e).setTitle(Ext.getCmp(d+"-"+e).originTitle)}var f=Ext.MessageBox.wait("Saving data...");Ext.Ajax.request({scope:b,url:"../php/controler.php",params:{task:"save-file",filePath:c,fileName:a,fileLang:"en",fileContent:Ext.getCmp(d+"-EN-"+e).getCode()},success:function(i,h){var j=Ext.util.JSON.decode(i.responseText);if(j.success){if(d==="FNU"){this.storeFilesNeedUpdate.getAt(g).set("en_revision","1."+j.en_revision);this.storeFilesNeedUpdate.getAt(g).set("needcommit",true)}if(d==="FE"){this.storeFilesError.getAt(g).set("needcommit",true)}if(d==="FNR"){this.storeFilesNeedReviewed.getAt(g).set("needcommit",true)}this.addToPendingCommit("en"+c,a);f.hide()}}})},savePatch:function(d,g,a,c,h,i){var b,f,e;if(d==="en"){b="-EN"}else{if(d==="all"){b=""}else{b="-LANG"}}if(i.userLoggin!=="cvsread"){f=i.userLoggin+"@php.net"}e=new Ext.Window({title:"Do you want to be alerted ?",iconCls:"patchAlert",widt! h:350,height:150,resizable:false,modal:true,autoScroll:true,bodyStyle: "padding: 5px;",layout:"form",labelWidth:50,items:[{xtype:"panel",baseCls:"x-plain",bodyStyle:"padding-bottom: 10px;",html:"If you want to be notified when your patch will be dealt with, thank you to leave an email address below."},{xtype:"textfield",fieldLabel:"Email",name:"patch-email-alert",anchor:"100%",value:f}],buttons:[{text:"Save",handler:function(){var j,k;j=this.ownerCt.items.items[1].getValue();k=Ext.MessageBox.wait("Saving data as a patch...");e.close();if(d!=="all"){Ext.getCmp(h+b+"-PANEL-btn-saveas-"+g).disable();Ext.getCmp(h+b+"-"+g).isModifiedLang=false;Ext.getCmp(h+b+"-PANEL-"+g).setTitle(Ext.getCmp(h+b+"-PANEL-"+g).originTitle);Ext.getCmp(h+"-"+g).setTitle(Ext.getCmp(h+"-"+g).originTitle)}else{Ext.getCmp("AF-PANEL-btn-saveas-"+g).disable();Ext.getCmp("AF-FILE-"+g).isModified=false;Ext.getCmp("AF-PANEL-"+g).setTitle(Ext.getCmp("AF-PANEL-"+g).originTitle);Ext.getCmp("AF-"+g).setTitle(Ext.getCmp("AF-"+g).originTitle)}Ext.Ajax.request({scope:i,url:"../php/contr! oler.php",params:{task:"save-file",filePath:a,fileName:c,fileLang:d,fileContent:(d!=="all")?Ext.getCmp(h+b+"-"+g).getCode():Ext.getCmp("AF-FILE-"+g).getCode(),type:"patch",emailAlert:j},success:function(m,l){var n=Ext.util.JSON.decode(m.responseText);if(n.success){if(d!=="all"){this.addToPendingPatch(d+a,c,n.uniqID)}else{this.addToPendingPatch(a,c,n.uniqID)}k.hide()}}})}},{text:"Cancel",handler:function(){e.close()}}]});e.show()},saveLangFile:function(f,d,b,e,g,c){function a(h){if(h==="no"){Ext.getCmp(e+"-LANG-PANEL-btn-save-"+f).disable();Ext.getCmp(e+"-"+f).isModifiedLang=false;Ext.getCmp(e+"-LANG-PANEL-"+f).setTitle(Ext.getCmp(e+"-LANG-PANEL-"+f).originTitle);if(!Ext.getCmp(e+"-"+f).isModifiedEn&&!Ext.getCmp(e+"-"+f).isModifiedLang){Ext.getCmp(e+"-"+f).setTitle(Ext.getCmp(e+"-"+f).originTitle)}var i=Ext.MessageBox.wait("Saving data...");Ext.Ajax.request({scope:this,url:"../php/controler.php",params:{task:"save-file",filePath:d,fileName:b,fileLang:this.userLang,fileConten! t:Ext.getCmp(e+"-LANG-"+f).getCode()},success:function(k,j){var l=Ext. util.JSON.decode(k.responseText);if(l.success){if(e==="FE"){this.storeFilesError.getAt(g).set("needcommit",true);this.storeFilesError.getAt(g).set("maintainer",l.maintainer)}if(e==="FNU"){this.storeFilesNeedUpdate.getAt(g).set("revision","1."+l.new_revision);this.storeFilesNeedUpdate.getAt(g).set("needcommit",true);this.storeFilesNeedUpdate.getAt(g).set("maintainer",l.maintainer)}if(e==="FNR"){this.storeFilesNeedReviewed.getAt(g).set("needcommit",true);this.storeFilesNeedReviewed.getAt(g).set("maintainer",l.maintainer);this.storeFilesNeedReviewed.getAt(g).set("reviewed",l.reviewed)}this.addToPendingCommit(this.userLang+d,b);i.hide()}}})}else{if(h==="yes"){Ext.getBody().mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Checking for error. Please, wait...');Ext.getCmp(e+"-LANG-PANEL-btn-save-"+f).disable();Ext.getCmp(e+"-"+f).isModifiedLang=false;Ext.getCmp(e+"-LANG-PANEL-"+f).setTitle(Ext.getCmp(e+"-LANG-PANEL-"+f).originTitle);if(!Ext.getCmp(e+"-"+f).isMod! ifiedEn&&!Ext.getCmp(e+"-"+f).isModifiedLang){Ext.getCmp(e+"-"+f).setTitle(Ext.getCmp(e+"-"+f).originTitle)}Ext.Ajax.request({scope:this,url:"../php/controler.php",params:{task:"check-file-error",FilePath:d,FileName:b,FileLang:this.userLang,FileContent:Ext.getCmp(e+"-LANG-"+f).getCode()},success:function(k,j){Ext.getBody().unmask();var l=Ext.util.JSON.decode(k.responseText);if(l.success){if(l.error&&l.error_first!=="-No error-"){Ext.getCmp("main-panel").add({closable:true,title:"Error in "+b,iconCls:"FilesError",id:"FE-help-"+f,autoScroll:true,autoLoad:"/error_type.php?dir="+d+"&file="+b});Ext.getCmp("main-panel").setActiveTab("FE-help-"+f);this.storeFilesError.reload()}else{Ext.MessageBox.show({title:"Check for errors",msg:"There is no error.",buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.INFO})}Ext.Ajax.request({scope:this,url:"../php/controler.php",params:{task:"save-file",filePath:d,fileName:b,fileLang:this.userLang,fileContent:Ext.getCmp(e+"-LANG-"+f).getCode()},succes! s:function(n,m){var p=Ext.util.JSON.decode(n.responseText);if(p.succes s){if(e==="FE"){this.storeFilesError.getAt(g).set("needcommit",true);this.storeFilesError.getAt(g).set("maintainer",p.maintainer)}if(e==="FNU"){this.storeFilesNeedUpdate.getAt(g).set("revision","1."+p.new_revision);this.storeFilesNeedUpdate.getAt(g).set("needcommit",true);this.storeFilesNeedUpdate.getAt(g).set("maintainer",p.maintainer)}if(e==="FNR"){this.storeFilesNeedReviewed.getAt(g).set("needcommit",true);this.storeFilesNeedReviewed.getAt(g).set("maintainer",p.maintainer);this.storeFilesNeedReviewed.getAt(g).set("reviewed",p.reviewed)}this.addToPendingCommit(this.userLang+d,b)}}});if(e==="FE"){Ext.getCmp(e+"-error-type-"+f).setSrc("/error_type.php?dir="+d+"&file="+b+"&nocache="+new Date().getTime())}}}})}}}Ext.MessageBox.show({scope:c,title:"Confirm",msg:"Do you want to check for error before saving ?",icon:Ext.MessageBox.INFO,buttons:Ext.MessageBox.YESNOCANCEL,fn:a})},getFile:function(e,d,a,c,b){Ext.get(c+e).mask('<img src="/img/loading.gif" style="vertical-align: middl! e;" /> Loading...');Ext.Ajax.request({scope:this,url:"../php/controler.php",params:{task:"get-file",FilePath:d,FileName:a},success:function(h,g){var i,f;i=Ext.util.JSON.decode(h.responseText);if(i.success){Ext.getCmp(b+e).setCode(i.content);Ext.get(c+e).unmask();if(c==="FE-LANG-PANEL-"||c==="FNR-LANG-PANEL-"||c==="FNR-EN-PANEL-"||c==="AF-PANEL-"){f=Ext.getCmp(c+e).getSize();f.height=f.height+1;Ext.getCmp(c+e).setSize(f);Ext.getCmp(c+e).fireEvent("resize")}}},callback:function(){if(this.filePendingOpen[0]){this.filePendingOpen.shift();if(this.filePendingOpen[0]){if(this.filePendingOpen[0][0]){this.openFile(this.filePendingOpen[0][0],this.filePendingOpen[0][1])}}}}})},addToPendingPatch:function(b,a,e){var d,c;d=new Date();c=new this.storePendingPatch.recordType({id:Ext.id("",""),path:b,name:a,by:this.userLoggin,uniqID:e,date:d.format("Y-m-d H:i:s")});this.storePendingPatch.insert(0,c)},addToPendingCommit:function(d,a){var c,e,b;c=false;this.storePendingCommit.each(function(f)! {if(f.data.path===d&&f.data.name===a){c=true}});if(!c){e=new Date();b= new this.storePendingCommit.recordType({id:Ext.id("",""),path:d,name:a,by:this.userLoggin,date:e.format("Y-m-d H:i:s")});this.storePendingCommit.insert(0,b)}},rendererNumUptodate:function(a){if(a==="0"){return}else{return'<span style="color:green; font-weight: bold;">'+a+"</span>"}},rendererNumCritical:function(a){if(a==="0"){return}else{return'<span style="color:red; font-weight: bold;">'+a+"</span>"}},rendererTotalTranslator:function(a,c,b){return a?((a===0||a>1)?"("+a+" Translators)":"(1 Translator)"):""},rendererSum:function(a){return(a==="0")?"":a},NewTabBugs:function(a,b,c){Ext.getCmp("main-panel").add({xtype:"iframepanel",id:"mifp_bugs_"+a,title:"Loading...",tabTip:c,iconCls:"iconBugs",loadMask:true,defaultSrc:b,listeners:{documentloaded:function(d){d.ownerCt.setTitle(Ext.util.Format.substr(c,0,20)+"...")}}});Ext.getCmp("main-panel").setActiveTab("mifp_bugs_"+a)},NewTabMailing:function(a,c,b){Ext.getCmp("main-panel").add({xtype:"iframepanel",id:"mifp_"+a,title:"Loadin! g...",tabTip:b,iconCls:"home-mailing-title",loadMask:true,defaultSrc:c,listeners:{documentloaded:function(d){d.ownerCt.setTitle(Ext.util.Format.substr(b,0,20)+"...")}}});Ext.getCmp("main-panel").setActiveTab("mifp_"+a)},winDiff:function(d,b,c,a){Ext.getBody().mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Finding the diff. Please, wait...');Ext.Ajax.request({url:"./php/controler.php",params:{task:"get-diff2",FilePath:d,FileName:b,Rev1:c,Rev2:a},success:function(f){var g,e;g=Ext.util.JSON.decode(f.responseText);if(g.success){Ext.getBody().unmask();e=new Ext.Window({title:"Diff between "+c+" & "+a,width:650,height:350,resizable:false,modal:true,autoScroll:true,bodyStyle:"background-color: white; padding: 5px;",html:'<div class="diff-content">'+g.content+"</div>",buttons:[{text:"Close",handler:function(){e.close()}}]});e.show()}},failure:function(){}})},removeTabEvent:function(d,e){var b,c,f,a;a=e.id.split("-");if((a[0]==="FE"||a[0]==="FNU"||a[0]==="FNR"|! |a[0]==="PP")&&a[1]!=="help"){if(a[0]==="FE"){b=Ext.getCmp("FE-"+a[1]) ..isModifiedLang}if(a[0]==="FNU"){b=Ext.getCmp("FNU-"+a[1]).isModifiedLang}if(a[0]==="FNR"){b=Ext.getCmp("FNR-"+a[1]).isModifiedLang}if(a[0]==="FE"){c=Ext.getCmp("FE-"+a[1]).isModifiedEn}if(a[0]==="FNU"){c=Ext.getCmp("FNU-"+a[1]).isModifiedEn}if(a[0]==="FNR"){c=Ext.getCmp("FNR-"+a[1]).isModifiedEn}if(a[0]==="PP"){f=Ext.getCmp("PP-PATCH-"+a[1]).isModified}if(c||b||f){Ext.Msg.show({scope:this,title:"Confirm",msg:"This file has been modified without being saved.<br/>Do you really want to close?",buttons:Ext.Msg.YESNO,icon:Ext.Msg.QUESTION,fn:function(g,h){if(g==="yes"){d.un("beforeremove",this.removeTabEvent,this);d.remove(e);d.addListener("beforeremove",this.removeTabEvent,this)}}})}else{return true}return false}else{return true}},WinCommit:function(i,h,e){var f,c,g,a,b,d;c=Ext.get("acc-need-update");if(!f){f=new Ext.Window({scope:this,id:"winCvsCommit",title:"CVS commit",closable:false,layout:"form",width:400,height:480,resizable:false,modal:true,bodyStyle:"padding:5px 5px 0",! labelAlign:"top",items:[{xtype:"checktreepanel",id:"tree-panel",anchor:"100%",height:180,autoScroll:true,rootVisible:false,root:{text:"root",expanded:true,children:[]}},{scope:this,xtype:"combo",fieldLabel:"Older messages",editable:false,name:"first2",anchor:"100%",store:this.storeCommitLogMessage,triggerAction:"all",tpl:'<tpl for="."><div class="x-combo-list-item">{[values.text.split("\n").join("<br/>")]}</div></tpl>',valueField:"id",displayField:"text",listeners:{scope:this,render:function(){this.storeCommitLogMessage.load()},select:function(l,j,k){Ext.getCmp("form-commit-message-log").setValue(j.data.text)}}},{xtype:"textarea",id:"form-commit-message-log",fieldLabel:"Log message",name:"first3",anchor:"100%",height:150,value:""}],tools:[{scope:this,id:"gear",qtip:"Configure this tools",handler:function(){var m,k,l;function j(n){return n.split("\n").join("<br/>")}m=new Ext.form.TextArea({grow:true,growMin:120});k=new Ext.grid.ColumnModel([new Ext.grid.RowNumberer(),{id:"Gr! idManageLog",header:"Log Message",dataIndex:"text",renderer:j,editor:n ew Ext.Editor(m,{shadow:false,autoSize:true,listeners:{scope:this,complete:function(p,q,o){var n=p.record.data.id;Ext.Ajax.request({scope:this,url:"../php/controler.php",params:{task:"save-LogMessage",messID:n,mess:q},success:function(s,r){var t=Ext.util.JSON.decode(s.responseText);if(t.success){this.storeCommitLogMessage.getById(n).commit()}}})}}})}]);l=new Ext.Window({title:"Manage Log Message",iconCls:"winManageLog",width:650,height:350,layout:"fit",resizable:false,modal:true,autoScroll:true,html:'<div class="diff-content"></div>',items:[{xtype:"editorgrid",store:this.storeCommitLogMessage,loadMask:true,cm:k,sm:new Ext.grid.RowSelectionModel({singleSelect:true}),autoExpandColumn:"GridManageLog",listeners:{scope:this,rowcontextmenu:function(n,q,o){o.stopEvent();n.getSelectionModel().selectRow(q);var p=new Ext.menu.Menu({items:[{text:"Delete this Log Message",iconCls:"iconDelete",scope:this,handler:function(){Ext.Ajax.request({scope:this,url:"../php/controler.php",params:{t! ask:"delete-LogMessage",messID:this.storeCommitLogMessage.getAt(q).data.id},success:function(s,r){var t=Ext.util.JSON.decode(s.responseText);if(t.success){this.storeCommitLogMessage.remove(this.storeCommitLogMessage.getAt(q))}}})}}]});p.showAt(o.getXY())}}}],buttons:[{text:"Close",handler:function(){l.close()}}],listeners:{scope:this,close:function(){this.storeCommitLogMessage.reload()}}});l.show()}}],buttons:[{scope:this,text:"Submit",id:"win-commit-btn-submit",handler:function(){var j,n,q,s,k,l,o=[],r,p="",m;if(this.userLoggin==="cvsread"){f.close();Ext.MessageBox.show({title:"Cvsread restriction",msg:"You are logging in with Cvsread account.<br><br>You can't commit anything with this account.",icon:Ext.MessageBox.INFO,buttons:Ext.MessageBox.OK});return}j=Ext.getCmp("tree-panel").getValue();n=[];for(m=0;m<j.length;m=m+1){q=Ext.getCmp("tree-panel").getNodeById(j[m]).attributes;s="FE-"+Ext.util.md5("FE-"+q.FilePath+q.FileName);k="FNU-"+Ext.util.md5("FNU-"+q.FilePath+q.FileN! ame);l="FNR-"+Ext.util.md5("FNR-"+q.FilePath+q.FileName);if(Ext.getCmp ("main-panel").findById(s)||Ext.getCmp("main-panel").findById(k)||Ext.getCmp("main-panel").findById(l)){if(Ext.getCmp("main-panel").findById(s)){r=s}if(Ext.getCmp("main-panel").findById(k)){r=k}if(Ext.getCmp("main-panel").findById(l)){r=l}o[0]=r;o[1]=q.FileName;n.push(o)}}if(n.length>0){for(m=0;m<n.length;m=m+1){p+=n[m][1]+"<br>"}Ext.MessageBox.show({scope:this,title:"Warning",msg:"There is "+n.length+" file"+((n.length>1)?"s":"")+" to close before commit.<br><br>"+p+"<br><br>Would you like I close it for you ?",icon:Ext.MessageBox.INFO,buttons:Ext.MessageBox.YESNOCANCEL,fn:function(t){if(t==="yes"){for(m=0;m<n.length;m=m+1){Ext.getCmp("main-panel").remove(n[m][0])}this.WinCommitLastStep(j,this)}else{return}}})}else{this.WinCommitLastStep(j,this)}return}},{text:"Close",id:"win-commit-btn-close",handler:function(){f.close()}}]})}f.show(c);if(i){a=this.storePendingCommit.getAt(h).data.path;b=this.storePendingCommit.getAt(h).data.name;g=Ext.util.md5(a+b);d=new Ext.tree.TreeNode! ({id:"need-commit-"+g,text:a+b,FilePath:a,FileName:b,leaf:true,checked:true,uiProvider:Ext.ux.tree.CheckTreeNodeUI});Ext.getCmp("tree-panel").getRootNode().appendChild(d)}else{this.storePendingCommit.each(function(j){if(e&&e==="by me"&&j.data.by!==this.userLoggin){}else{a=j.data.path;b=j.data.name;g=Ext.util.md5(a+b);d=new Ext.tree.TreeNode({id:"need-commit-"+g,text:a+b,FilePath:a,FileName:b,leaf:true,checked:true,uiProvider:Ext.ux.tree.CheckTreeNodeUI});Ext.getCmp("tree-panel").getRootNode().appendChild(d)}},this)}},WinCommitLastStep:function(g,d){Ext.getBody().mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Please, wait until commit...');var a=[],f,c,e,b;for(b=0;b<g.length;b=b+1){f=Ext.getCmp("tree-panel").getNodeById(g[b]);c=[];c[0]=f.attributes.FilePath;c[1]=f.attributes.FileName;a.push(c)}e=Ext.getCmp("form-commit-message-log").getValue();Ext.getCmp("winCvsCommit").close();Ext.Ajax.request({url:"../php/controler.php",params:{task:"cvs-commit",nodes! :Ext.util.JSON.encode(a),logMessage:e},success:function(i){var j,h;j=E xt.util.JSON.decode(i.responseText);if(j.success){Ext.getBody().unmask();h=new Ext.Window({title:"Status",width:450,height:350,resizable:false,modal:true,autoScroll:true,bodyStyle:"background-color: white; padding: 5px;",html:j.mess.join("<br>"),buttons:[{text:"Close",handler:function(){h.close()}}]});h.show();Ext.Ajax.request({url:"../php/controler.php",params:{task:"on-succes-commit",nodes:Ext.util.JSON.encode(a),logMessage:e},success:function(k){d.storeFilesError.reload();d.storeFilesNeedReviewed.reload();d.storeFilesNeedUpdate.reload();d.storePendingCommit.reload();d.storeTranslators.reload();d.storeSummary.reload()}})}else{}}})},WinUpdate:function(){var e,d;function c(f){f.TaskPing.cancel();Ext.get("wizard-step-1").replaceClass("wizard-step-before","wizard-step-working");Ext.get("wizard-step-1.1").replaceClass("wizard-wait","wizard-show");Ext.Ajax.request({scope:f,url:"../php/controler.php",params:{task:"update-repo"},success:function(g){var h=Ext.util.JSON.decode(g.res! ponseText);if(h.success){Ext.get("wizard-step-1").replaceClass("wizard-step-working","wizard-step-done");Ext.get("wizard-step-1.1").replaceClass("wizard-show","wizard-wait");b(f)}},failure:function(){function h(){Ext.Ajax.request({scope:f,url:"../php/controler.php",params:{task:"check-lock-file",lockFile:"lock_update_repository"},success:function(i){var j=Ext.util.JSON.decode(i.responseText);if(!j.success){Ext.get("wizard-step-1").replaceClass("wizard-step-working","wizard-step-done");Ext.get("wizard-step-1.1").replaceClass("wizard-show","wizard-wait");b(this)}else{g.delay(5000)}},failure:function(){g.delay(5000)}})}var g=new Ext.util.DelayedTask(function(){h()});g.delay(5000)}})}function b(f){Ext.get("wizard-step-2").replaceClass("wizard-step-before","wizard-step-working");Ext.Ajax.request({scope:f,url:"../php/controler.php",params:{task:"apply-tools"},success:function(g){var h=Ext.util.JSON.decode(g.responseText);if(h.success){Ext.get("wizard-step-2").replaceClass("wizard! -step-working","wizard-step-done");a(this)}},failure:function(){functi on h(){Ext.Ajax.request({scope:f,url:"../php/controler.php",params:{task:"check-lock-file",lockFile:"lock_apply_tools"},success:function(i){var j=Ext.util.JSON.decode(i.responseText);if(!j.success){Ext.get("wizard-step-2").replaceClass("wizard-step-working","wizard-step-done");a(this)}else{g.delay(5000)}},failure:function(){g.delay(5000)}})}var g=new Ext.util.DelayedTask(function(){h()});g.delay(5000)}})}function a(f){Ext.get("wizard-step-3").replaceClass("wizard-step-before","wizard-step-working");f.storeFilesNeedUpdate.reload();f.storeTranslators.reload();f.storeFilesError.reload();Ext.get("wizard-step-3").replaceClass("wizard-step-working","wizard-step-done");Ext.getCmp("btn-start-refresh").setIconClass("finishRefresh");Ext.getCmp("btn-start-refresh").setText("Finish !");Ext.getCmp("btn-start-refresh").setHandler(function(){e.close()});Ext.getCmp("btn-start-refresh").enable();f.TaskPing.delay(30000);e.tools.close.setVisible(true)}d=Ext.get("acc-need-update");if(!e){e=new ! Ext.Window({title:"Refresh all data",layout:"form",width:300,height:200,resizable:false,modal:true,bodyStyle:"padding:15px 15px 0",iconCls:"refresh",html:'<div id="wizard-step-1" class="wizard-step-before">Update all files from Cvs</div><div id="wizard-step-1.1" class="wizard-wait">This may take time. Thank you for your patience...</div><div id="wizard-step-2" class="wizard-step-before">Apply all tools</div><div id="wizard-step-3" class="wizard-step-before">Reload data</div>',buttons:[{scope:this,text:"Start",id:"btn-start-refresh",iconCls:"startRefresh",handler:function(){Ext.getCmp("btn-start-refresh").disable();e.tools.close.setVisible(false);c(this)}}]})}e.show(d)},WinCheckBuild:function(){var c,a;a=Ext.get("acc-need-update");function b(d){Ext.Ajax.request({scope:d,url:"./php/controler.php",params:{task:"get-logfile",file:"log_check_build"},success:function(f){var g,e;g=Ext.util.JSON.decode(f.responseText);if(g.success){this.TaskPing.delay(30000);e=new Ext.Window({title! :"Status",width:450,height:350,resizable:false,modal:true,autoScroll:t rue,bodyStyle:"background-color: white; padding: 5px;",html:g.mess,buttons:[{text:"Close",handler:function(){e.close()}}]});e.show()}}})}if(!c){c=new Ext.Window({title:"Check Build",iconCls:"checkBuild",layout:"form",width:350,height:200,resizable:false,modal:true,bodyStyle:"padding:5px 5px 0",labelAlign:"top",buttons:[{scope:this,text:"Go !",id:"win-check-build-btn-submit",handler:function(){var d=Ext.getCmp("option-xml-details").checked;c.close();Ext.getBody().mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Please, wait until the build is checked...');this.TaskPing.cancel();Ext.Ajax.request({scope:this,url:"./php/controler.php",params:{task:"check-build",xmlDetails:d},success:function(e){var f=Ext.util.JSON.decode(e.responseText);if(f.success){Ext.getBody().unmask();b(this)}},failure:function(g){function e(){Ext.Ajax.request({url:"../php/controler.php",params:{task:"check-lock-file",lockFile:"lock_check_build"},success:function(h){var i=Ext.util.JSON.d! ecode(h.responseText);if(!i.success){Ext.getBody().unmask();b()}else{f.delay(5000)}},failure:function(){f.delay(5000)}})}var f=new Ext.util.DelayedTask(function(){e()});f.delay(5000)}})}}],items:[{xtype:"panel",baseCls:"x-plain",bodyStyle:"padding:5px 5px 0",html:"You're about to check the build via this command :<br/><br/>/usr/bin/php configure.php --with-lang="+this.userLang+"<br><br>",modal:false},{xtype:"checkbox",hideLabel:true,checked:false,boxLabel:"Enable detailed XML error messages",name:"option-xml-details",id:"option-xml-details"}]})}c.show(a)},WinConf:function(){var a,c,e,d,b;if(!a){b=new Ext.XTemplate('<tpl for=".">','<div class="thumb-wrap" id="tplMenu-{id}">','<div class="thumb"><img src="/img/{img}" title=""></div>',"<span>{label}</span></div>","</tpl>");b.compile();d=[["1","go-home.png","Main"],["2","edit-redo.png",'Module "Files Need Update"'],["3","dialog-cancel.png",'Module "Files with Error"'],["4","document-properties.png",'Module "Files need Reviewed"! '],["5","view-media-playlist.png",'Module "Pending Patch"']];e=new Ext ..data.SimpleStore({id:0,fields:[{name:"id"},{name:"img"},{name:"label"}]});e.loadData(d);c=new Ext.DataView({tpl:b,singleSelect:true,overClass:"x-view-over",itemSelector:"div.thumb-wrap",store:e,listeners:{selectionchange:function(f,g){var h=f.getSelectedRecords();Ext.getCmp("confCard").layout.setActiveItem("conf-card-"+h[0].data.id)}}});a=new Ext.Window({scope:this,layout:"border",width:550,height:400,iconCls:"iconConf",modal:true,title:"Configuration",plain:true,closeAction:"hide",listeners:{show:function(){c.select(c.getNode(0))}},items:[{scope:this,region:"west",width:190,id:"confMenu",autoScroll:true,items:c},{scope:this,layout:"slide",region:"center",id:"confCard",width:375,frame:true,activeItem:0,bbar:new Ext.StatusBar({defaultText:"All changes take effect immediately",defaultIconCls:"confStatusBar"}),items:[{scope:this,id:"conf-card-1",xtype:"form",bodyStyle:"padding: 10px;",items:[{xtype:"fieldset",title:"Themes",autoHeight:true,defaults:{hideLabel:true},items:[{xty! pe:"combo",store:new Ext.data.SimpleStore({fields:["themeFile",{name:"themeName",type:"string"}],data:[["/themes/black/css/xtheme-black.css","Black"],["xtheme-default.css","Default"],["/themes/darkgray/css/xtheme-darkgray.css","DarkGray"],["/extjs/resources/css/xtheme-gray.css","Gray"],["/themes/gray-extend/css/xtheme-gray-extend.css","Gray Extend"],["/themes/indigo/css/xtheme-indigo.css","Indigo"],["/themes/midnight/css/xtheme-midnight.css","Midnight"],["/themes/olive/css/xtheme-olive.css","Olive"],["/themes/purple/css/xtheme-purple.css","Purple"],["/extjs/resources/css/xtheme-slate.css","Slate"],["/themes/silverCherry/css/xtheme-silverCherry.css","SilverCherry"]]}),valueField:"themeFile",displayField:"themeName",triggerAction:"all",mode:"local",forceSelection:true,editable:false,fieldLabel:"fieldlabel",value:this.userConf.conf_theme,listeners:{scope:this,select:function(h,f,g){Ext.util.CSS.swapStyleSheet("appTheme",h.getValue());this.confUpdate("conf_theme",h.getValue())}! }}]}]},{scope:this,id:"conf-card-2",xtype:"form",bodyStyle:"padding: 1 0px;",items:[{xtype:"fieldset",title:"Diff view",autoHeight:true,defaults:{hideLabel:true},defaultType:"radio",items:[{scope:this,checked:(this.userConf.conf_needupdate_diff==="using-viewvc")?true:false,boxLabel:"Using ViewVc from php web site",name:"conf_needupdate_diff",inputValue:"using-viewvc",listeners:{scope:this,check:function(g){if(g.checked){this.confUpdate("conf_needupdate_diff",g.getRawValue())}}}},{checked:(this.userConf.conf_needupdate_diff==="using-exec")?true:false,boxLabel:"Using diff -kk -u command line",name:"conf_needupdate_diff",inputValue:"using-exec",listeners:{scope:this,check:function(g){if(g.checked){this.confUpdate("conf_needupdate_diff",g.getRawValue())}}}}]},{xtype:"fieldset",title:"Editor",autoHeight:true,defaults:{hideLabel:true},defaultType:"checkbox",items:[{scope:this,checked:(this.userConf.conf_needupdate_scrollbars==="true")?true:false,boxLabel:"Synchronize scroll bars",name:"conf_needupdate_scrollbars",listeners:{scope:this,check:function(! g){this.confUpdate("conf_needupdate_scrollbars",g.getValue())}}}]}]},{id:"conf-card-3",xtype:"form",bodyStyle:"padding: 10px;",items:[{xtype:"fieldset",title:"Error type",autoHeight:true,defaults:{hideLabel:true},defaultType:"checkbox",items:[{scope:this,checked:(this.userConf.conf_error_skipnbliteraltag==="true")?true:false,boxLabel:"Skip nbLiteralTag error",name:"conf_error_skipnbliteraltag",listeners:{scope:this,check:function(g){this.confUpdate("conf_error_skipnbliteraltag",g.getValue())}}}]},{xtype:"fieldset",title:"Editor",autoHeight:true,defaults:{hideLabel:true},defaultType:"checkbox",items:[{scope:this,checked:(this.userConf.conf_error_scrollbars==="true")?true:false,boxLabel:"Synchronize scroll bars",name:"conf_error_scrollbars",listeners:{scope:this,check:function(g){this.confUpdate("conf_error_scrollbars",g.getValue())}}}]}]},{id:"conf-card-4",xtype:"form",bodyStyle:"padding: 10px;",items:[{xtype:"fieldset",title:"Editor",autoHeight:true,defaults:{hideLabel:true! },defaultType:"checkbox",items:[{scope:this,checked:(this.userConf.con f_reviewed_scrollbars==="true")?true:false,boxLabel:"Synchronize scroll bars",name:"conf_reviewed_scrollbars",listeners:{scope:this,check:function(g){this.confUpdate("conf_reviewed_scrollbars",g.getValue())}}}]}]},{id:"conf-card-5",xtype:"form",bodyStyle:"padding: 10px;",items:[{xtype:"fieldset",title:"Editor",autoHeight:true,defaults:{hideLabel:true},defaultType:"checkbox",items:[{scope:this,checked:(this.userConf.conf_patch_scrollbars==="true")?true:false,boxLabel:"Synchronize scroll bars",name:"conf_patch_scrollbars",listeners:{scope:this,check:function(g){this.confUpdate("conf_patch_scrollbars",g.getValue())}}}]}]}]}],buttons:[{text:"Close",handler:function(){a.hide()}}]})}a.show(Ext.get("winconf-btn"))},confUpdate:function(b,a){Ext.Ajax.request({scope:this,url:"../php/controler.php",params:{task:"conf-update",item:b,value:a},success:function(c){if(b==="conf_needupdate_diff"){this.userConf.conf_needupdate_diff=a}if(b==="conf_needupdate_scrollbars"){this.userConf.conf_nee! dupdate_scrollbars=""+a+""}if(b==="conf_error_skipnbliteraltag"){this.userConf.conf_error_skipnbliteraltag=""+a+"";this.storeFilesError.reload()}if(b==="conf_error_scrollbars"){this.userConf.conf_error_scrollbars=""+a+""}if(b==="conf_reviewed_scrollbars"){this.userConf.conf_reviewed_scrollbars=""+a+""}if(b==="conf_patch_scrollbars"){this.userConf.conf_patch_scrollbars=""+a+""}}})},WinAbout:function(){var a;if(!a){a=new Ext.Window({layout:"fit",width:515,height:320,iconCls:"iconHelp",modal:true,title:"About "+this.appName,closeAction:"hide",plain:true,bodyStyle:"color:#000",items:new Ext.TabPanel({autoTabs:true,activeTab:0,border:false,defaults:{autoScroll:true},items:[{title:"About",html:'<div id="phd-oe-about"><img src="/img/logo.png" alt="'+this.appName+'" /></div><div id="phd-oe-about-info">'+this.appName+" ver "+this.appVer+' (c) 2008-2009, Yannick Torrèss - <a href="mailto:yannick@php.net">yannick@php.net</a></div>'},{title:"Credits",bodyStyle:"padding:15px",htm! l:'<div id="phd-oe-credit"><ul><li><a href="http://extjs.com" target=" _blank">ExtJs Team</a><div class="phd-oe-credit-info">Javascript FrameWork</div></li><li><a href="http://marijn.haverbeke.nl/codemirror/" target="_blank">CodeMirror</a><div class="phd-oe-credit-info">Code editor</div></li><li><a href="http://famfamfam.com" target="_blank">famfamfam.com</a><div class="phd-oe-credit-info">Icon pack</div></li></ul></div>'},{title:"License",autoLoad:{url:"/license_LGPL_v2.txt"}}]}),buttons:[{text:"Close",handler:function(){a.hide()}}]})}a.show(Ext.get("winabout-btn"))},sendEmail:function(b,a){var c,d;c=new Ext.form.FormPanel({baseCls:"x-plain",labelWidth:55,url:"save-form.php",defaultType:"textfield",items:[{fieldLabel:"Send To",name:"to",readOnly:true,anchor:"100%",value:'"'+b+'" <'+a+">"},{fieldLabel:"Subject",name:"subject",anchor:"100%"},{xtype:"textarea",hideLabel:true,name:"msg",anchor:"100% -53"}]});d=new Ext.Window({title:"Send an email",width:500,height:300,minWidth:300,minHeight:200,layout:"fit",plain:true,bodyStyle:"padding:5px;",butt! onAlign:"center",items:c,iconCls:"iconSendEmail",buttons:[{text:"Send",handler:function(){var e=c.getForm().getValues();Ext.Ajax.request({url:"./php/controler.php",params:{task:"send-email",to:e.to,subject:e.subject,msg:e.msg},success:function(f){var g=Ext.util.JSON.decode(f.responseText);if(g.success){d.close();Ext.MessageBox.alert("Status","Email sent to "+b+" with success!")}},failure:function(){}})}},{text:"Cancel",handler:function(){d.close()}}]});d.show()},drawInterface:function(){var j,l,a,c,h,g,f,i,e,k,b,d;this.TaskPing=new Ext.util.DelayedTask(function(){Ext.Ajax.request({url:"./php/controler.php",params:{task:"ping"},success:function(m){if(m.responseText!=="pong"){window.location.href="/login.php"}},failure:function(){window.location.href="/login.php"}});this.TaskPing.delay(30000)},this);this.TaskPing.delay(30000);j=new Ext.grid.GridPanel({store:this.storeFilesError,loadMask:true,columns:[{id:"name",header:"Files",sortable:true,dataIndex:"name"},{header:"Maintaine! r",width:45,sortable:true,dataIndex:"maintainer"},{header:"Type",width :45,sortable:true,dataIndex:"type"},{header:"Path",dataIndex:"path",hidden:true}],view:new Ext.grid.GroupingView({emptyText:'<div style="text-align: center;">No files</div>',forceFit:true,groupTextTpl:'{[values.rs[0].data["path"]]} ({[values.rs.length]} {[values.rs.length > 1 ? "Files" : "File"]})',getRowClass:function(m,p,o,n){if(m.data.needcommit){return"file-need-commit"}}}),autoExpandColumn:"name",bodyBorder:false,listeners:{scope:this,render:function(m){j.view.refresh()},rowdblclick:function(o,y,u){var n,p,v,t,w,m,s,r,q,z,x;n=this.storeFilesError.getAt(y).data.path;p=this.storeFilesError.getAt(y).data.name;v=Ext.util.md5("FE-"+this.userLang+n+p);t=this.storeFilesError.getAt(y).data.needcommit;if(!Ext.getCmp("main-panel").findById("FE-"+v)){w=[];this.storeFilesError.each(function(A){if(A.data.path===n&&A.data.name===p){if(!w[A.data.type]){w.push(A.data.type)}}});m=new Ext.data.Store({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controler.php"}),baseParams:{task:! "get-log",Path:this.userLang+n,File:p},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"revision",mapping:"revision"},{name:"date",mapping:"date",type:"date",dateFormat:"Y/m/d H:i:s"},{name:"author",mapping:"author"},{name:"content",mapping:"content"}])});m.setDefaultSort("date","desc");s=new Ext.data.Store({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controler.php"}),baseParams:{task:"get-log",Path:"en"+n,File:p},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"revision",mapping:"revision"},{name:"date",mapping:"date",type:"date",dateFormat:"Y/m/d H:i:s"},{name:"author",mapping:"author"},{name:"content",mapping:"content"}])});s.setDefaultSort("date","desc");r=new Ext.grid.CheckboxSelectionModel({singleSelect:false,width:22,header:"",listeners:{beforerowselect:function(B){var A=B.getCount();if(A===2){return false}},rowselect:function(B){var A! =B.getCount();if(A===2){Ext.getCmp("FE-PANEL-btn-logLang-"+v).enable() ;Ext.get("FE-PANEL-btn-logLang-"+v).frame("3F8538")}else{Ext.getCmp("FE-PANEL-btn-logLang-"+v).disable()}},rowdeselect:function(B){var A=B.getCount();if(A===2){Ext.getCmp("FE-PANEL-btn-logLang-"+v).enable();Ext.get("FE-PANEL-btn-logLang-"+v).frame("3F8538")}else{Ext.getCmp("FE-PANEL-btn-logLang-"+v).disable()}}}});q=new Ext.grid.GridPanel({store:m,loadMask:true,columns:[r,{id:"id",header:"Rev.",width:40,sortable:false,dataIndex:"revision"},{header:"Content",width:130,sortable:true,dataIndex:"content"},{header:"By",width:50,sortable:true,dataIndex:"author"},{header:"Date",width:85,sortable:true,dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y/m/d, H:i")}],autoHeight:true,autoExpandColumn:"content",bodyBorder:false,sm:r,view:new Ext.grid.GridView({forceFit:true}),tbar:[{scope:this,tooltip:"<b>View</b> the diff",iconCls:"iconViewDiff",id:"FE-PANEL-btn-logLang-"+v,disabled:true,handler:function(){var C,B,A;C=r.getSelections();B=C[0].data.revision;A=C[1].data.revision;th! is.winDiff(this.userLang+n,p,B,A)}}]});z=new Ext.grid.CheckboxSelectionModel({singleSelect:false,width:22,header:"",listeners:{beforerowselect:function(B){var A=B.getCount();if(A===2){return false}},rowselect:function(B){var A=B.getCount();if(A===2){Ext.getCmp("FE-PANEL-btn-logEn-"+v).enable();Ext.get("FE-PANEL-btn-logEn-"+v).frame("3F8538")}else{Ext.getCmp("FE-PANEL-btn-logEn-"+v).disable()}},rowdeselect:function(B){var A=B.getCount();if(A===2){Ext.getCmp("FE-PANEL-btn-logEn-"+v).enable();Ext.get("FE-PANEL-btn-logEn-"+v).frame("3F8538")}else{Ext.getCmp("FE-PANEL-btn-logEn-"+v).disable()}}}});x=new Ext.grid.GridPanel({store:s,loadMask:true,columns:[z,{id:"id",header:"Rev.",width:40,sortable:false,dataIndex:"revision"},{header:"Content",width:130,sortable:true,dataIndex:"content"},{header:"By",width:50,sortable:true,dataIndex:"author"},{header:"Date",width:85,sortable:true,dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y/m/d, H:i")}],autoHeight:true,autoExpandColumn! :"content",bodyBorder:false,sm:z,view:new Ext.grid.GridView({forceFit: true}),tbar:[{scope:this,tooltip:"<b>View</b> the diff",iconCls:"iconViewDiff",id:"FE-PANEL-btn-logEn-"+v,disabled:true,handler:function(){var C,B,A;C=z.getSelections();B=C[0].data.revision;A=C[1].data.revision;this.winDiff("en"+n,p,B,A)}}]});Ext.getCmp("main-panel").add({closable:true,title:p,originTitle:p,tabTip:"File with error : in "+n,iconCls:"iconTabError",id:"FE-"+v,isModifiedLang:false,isModifiedEn:false,layout:"border",defaults:{collapsible:true,split:true},items:[{xtype:"panel",layout:"fit",region:"north",title:"Error description",id:"FE-error-desc-"+v,height:150,collapsed:true,items:{xtype:"iframepanel",id:"FE-error-type-"+v,loadMask:true,defaultSrc:"/error_type.php?dir="+n+"&file="+p}},{region:"west",xtype:"panel",layout:"fit",bodyBorder:false,title:"CvsLog",collapsed:true,width:375,items:{xtype:"tabpanel",activeTab:0,tabPosition:"bottom",defaults:{autoScroll:true},items:[{layout:"fit",title:this.userLang,items:[q]},{layout:"fit",title:"En",items:[x]}]}},{title:t! his.userLang+" File: "+n+p,originTitle:this.userLang+" File: "+n+p,collapsible:false,id:"FE-LANG-PANEL-"+v,region:"center",xtype:"form",height:"auto",width:"auto",items:[{xtype:"codemirror",id:"FE-LANG-"+v,listeners:{scope:this,initialize:function(A){this.getFile(v,this.userLang+n,p,"FE-LANG-PANEL-","FE-LANG-")},cmcursormove:function(){var A=Ext.util.JSON.decode(Ext.getCmp("FE-LANG-"+v).getCursorPosition());Ext.get("FE-LANG-status-line-"+v).dom.innerHTML=A.line;Ext.get("FE-LANG-status-col-"+v).dom.innerHTML=A.caracter},cmchange:function(D,B,C){var A=Ext.util.JSON.decode(Ext.getCmp("FE-LANG-"+v).getCursorPosition());Ext.get("FE-LANG-status-line-"+v).dom.innerHTML=A.line;Ext.get("FE-LANG-status-col-"+v).dom.innerHTML=A.caracter;if(D!==27&&D!==33&&D!==34&&D!==37&&D!==38&&D!==39&&D!==40&&D!==17&&D!==16&&D!==67){if(!Ext.getCmp("FE-"+v).isModifiedLang){Ext.getCmp("FE-LANG-PANEL-"+v).setTitle(Ext.getCmp("FE-LANG-PANEL-"+v).originTitle+' <span style="color:#ff0000; font-weight: bol! d;">[modified]</span>');Ext.getCmp("FE-"+v).setTitle(Ext.getCmp("FE-"+ v).originTitle+' <t style="color:#ff0000; font-weight: bold;">*</t>');Ext.getCmp("FE-LANG-PANEL-btn-save-"+v).enable();Ext.get("FE-LANG-PANEL-btn-save-"+v).frame("3F8538");Ext.getCmp("FE-LANG-PANEL-btn-saveas-"+v).enable();Ext.get("FE-LANG-PANEL-btn-saveas-"+v).frame("3F8538");Ext.getCmp("FE-"+v).isModifiedLang=true}}},cmscroll:function(A){if(this.userConf.conf_error_scrollbars==="true"){Ext.getCmp("FE-EN-"+v).scrollTo(A)}}}}],bbar:[{scope:this,xtype:"checkbox",hideLabel:true,checked:(this.userConf.conf_error_scrollbars==="true")?true:false,boxLabel:"Synchronize scroll bars",name:"conf_error_scrollbars",listeners:{scope:this,check:function(A){this.confUpdate("conf_error_scrollbars",A.getValue())},render:function(A){Ext.DomHelper.insertHtml("beforeBegin",A.el.dom,'<div style="display: inline;" class="x-statusbar"><span class="x-status-text-panel">Line: <span id="FE-LANG-status-line-'+v+'">-</span></span> <span class="x-status-text-panel">Col: <span id="FE-LANG-stat! us-col-'+v+'">-</span></span></div> ')}}}],tbar:[{scope:this,tooltip:"<b>Save</b> this file",iconCls:"saveFile",id:"FE-LANG-PANEL-btn-save-"+v,disabled:true,handler:function(){this.saveLangFile(v,n,p,"FE",y,this)}},{scope:this,tooltip:"<b>Save as</b> a patch",iconCls:"saveAsFile",id:"FE-LANG-PANEL-btn-saveas-"+v,disabled:true,handler:function(){this.savePatch(this.userLang,v,n,p,"FE",this)}},"->",{tooltip:"<b>Re-indent</b> all this file",iconCls:"iconIndent",handler:function(){Ext.getCmp("FE-LANG-"+v).reIndentAll()}}]},{title:"En File: "+n+p,originTitle:"En File: "+n+p,collapsible:false,id:"FE-EN-PANEL-"+v,region:"east",xtype:"form",height:"auto",width:575,items:[{xtype:"codemirror",id:"FE-EN-"+v,listeners:{scope:this,initialize:function(A){this.getFile(v,"en"+n,p,"FE-EN-PANEL-","FE-EN-")},cmchange:function(D,B,C){var A=Ext.util.JSON.decode(Ext.getCmp("FE-EN-"+v).getCursorPosition());Ext.get("FE-EN-status-line-"+v).dom.innerHTML=A.line;Ext.get("FE-EN-status-col-"! +v).dom.innerHTML=A.caracter;if(D!==27&&D!==33&&D!==34&&D!==37&&D!==38 &&D!==39&&D!==40&&D!==17&&D!==16&&D!==67){if(!Ext.getCmp("FE-"+v).isModifiedEn){Ext.getCmp("FE-EN-PANEL-"+v).setTitle(Ext.getCmp("FE-EN-PANEL-"+v).originTitle+' <span style="color:#ff0000; font-weight: bold;">[modified]</span>');Ext.getCmp("FE-"+v).setTitle(Ext.getCmp("FE-"+v).originTitle+' <t style="color:#ff0000; font-weight: bold;">*</t>');Ext.getCmp("FE-EN-PANEL-btn-save-"+v).enable();Ext.get("FE-EN-PANEL-btn-save-"+v).frame("3F8538");Ext.getCmp("FE-EN-PANEL-btn-saveas-"+v).enable();Ext.get("FE-EN-PANEL-btn-saveas-"+v).frame("3F8538");Ext.getCmp("FE-"+v).isModifiedEn=true}}},cmscroll:function(A){if(this.userConf.conf_error_scrollbars==="true"){Ext.getCmp("FE-LANG-"+v).scrollTo(A)}},cmcursormove:function(B){var A=Ext.util.JSON.decode(Ext.getCmp("FE-EN-"+v).getCursorPosition());Ext.get("FE-EN-status-line-"+v).dom.innerHTML=A.line;Ext.get("FE-EN-status-col-"+v).dom.innerHTML=A.caracter}}}],bbar:[{scope:this,xtype:"panel",height:21,baseCls:"",bodyStyle:"padding-top:5px;",htm! l:'<div style="display: inline;" class="x-statusbar"><span class="x-status-text-panel">Line: <span id="FE-EN-status-line-'+v+'">-</span></span> <span class="x-status-text-panel">Col: <span id="FE-EN-status-col-'+v+'">-</span></span></div> '}],tbar:[{scope:this,tooltip:"<b>Save</b> this file",iconCls:"saveFile",id:"FE-EN-PANEL-btn-save-"+v,disabled:true,handler:function(){this.saveEnFile(v,n,p,"FE",y,this)}},{scope:this,tooltip:"<b>Save as</b> a patch",iconCls:"saveAsFile",id:"FE-EN-PANEL-btn-saveas-"+v,disabled:true,handler:function(){this.savePatch("en",v,n,p,"FE",this)}},"->",{tooltip:"<b>Re-indent</b> all this file",iconCls:"iconIndent",handler:function(){Ext.getCmp("FE-EN-"+v).reIndentAll()}}]}]});Ext.getCmp("main-panel").setActiveTab("FE-"+v);if(Ext.getCmp("FE-"+v).getLayout().north.collapsedEl){Ext.getCmp("FE-"+v).getLayout().north.collapsedEl.addClass("x-layout-collapsed-east-error-desc")}}else{Ext.getCmp("main-panel").setActiveTab("FE-"+v)}},ro! wcontextmenu:function(o,t,r){var p,m,q,n="",s;o.getSelectionModel().se lectRow(t);p=this.storeFilesError.getAt(t).data.path;m=this.storeFilesError.getAt(t).data.name;q=Ext.util.md5("FE-"+p+m);if(this.storeFilesError.getAt(t).data.needcommit){n={text:"View Diff",iconCls:"iconViewDiff",scope:this,handler:function(){Ext.getCmp("main-panel").add({xtype:"panel",id:"diff_panel_"+t,title:"Diff",tabTip:"Diff",closable:true,autoScroll:true,iconCls:"iconTabLink",html:'<div id="diff_content_'+t+'" class="diff-content"></div>'});Ext.getCmp("main-panel").setActiveTab("diff_panel_"+t);Ext.get("diff_panel_"+t).mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Please, Wait...');Ext.Ajax.request({scope:this,url:"./php/controler.php",params:{task:"get-diff",FilePath:this.userLang+p,FileName:m},success:function(u){var v=Ext.util.JSON.decode(u.responseText);if(v.success){Ext.get("diff_content_"+t).dom.innerHTML=v.content;Ext.get("diff_panel_"+t).unmask()}},failure:function(){}})}}}s=new Ext.menu.Menu({items:[{text:"<b>Edit in a new Tab</b>",icon! Cls:"FilesError",scope:this,handler:function(){j.fireEvent("rowdblclick",o,t,r)}},n,"-",{text:"About error type",iconCls:"iconHelp",scope:this,handler:function(){Ext.getCmp("main-panel").add({closable:true,title:"About error type",iconCls:"iconHelp",id:"FE-help-"+q,autoScroll:true,autoLoad:"/error_type.php"});Ext.getCmp("main-panel").setActiveTab("FE-help-"+q)}}]});s.showAt(r.getXY())}}});l=new Ext.grid.GridPanel({store:this.storeFilesNeedUpdate,loadMask:true,columns:[{id:"name",header:"Files",sortable:true,dataIndex:"name"},{header:"EN revision",width:45,sortable:true,dataIndex:"en_revision"},{header:Ext.util.Format.uppercase(this.userLang)+" revision",width:45,sortable:true,dataIndex:"revision"},{header:"Maintainer",width:45,sortable:true,dataIndex:"maintainer"},{header:"Path",dataIndex:"path",hidden:true}],view:new Ext.grid.GroupingView({forceFit:true,groupTextTpl:'{[values.rs[0].data["path"]]} ({[values.rs.length]} {[values.rs.length > 1 ? "Files" : "File"]})',getRowCla! ss:function(m,p,o,n){if(m.data.needcommit){return"file-need-commit"}if (m.data.isCritical){return"file-critical"}},emptyText:'<div style="text-align: center;">No Files</div>'}),autoExpandColumn:"name",bodyBorder:false,listeners:{scope:this,rowcontextmenu:function(o,s,q){var p,m,n="",r;p=this.storeFilesNeedUpdate.getAt(s).data.path;m=this.storeFilesNeedUpdate.getAt(s).data.name;o.getSelectionModel().selectRow(s);if(this.storeFilesNeedUpdate.getAt(s).data.needcommit){n={text:"View Diff",iconCls:"iconViewDiff",scope:this,handler:function(){Ext.getCmp("main-panel").add({xtype:"panel",id:"diff_panel_"+s,title:"Diff",tabTip:"Diff",closable:true,autoScroll:true,iconCls:"iconTabLink",html:'<div id="diff_content_'+s+'" class="diff-content"></div>'});Ext.getCmp("main-panel").setActiveTab("diff_panel_"+s);Ext.get("diff_panel_"+s).mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Please, Wait...');Ext.Ajax.request({url:"./php/controler.php",params:{task:"get-diff",FilePath:this.userLang+p,FileName:m},success:function(t){var u=Ext.util.JS! ON.decode(t.responseText);if(u.success){Ext.get("diff_content_"+s).dom.innerHTML=u.content;Ext.get("diff_panel_"+s).unmask()}},failure:function(){}})}}}r=new Ext.menu.Menu({items:[{text:"<b>Edit in a new Tab</b>",iconCls:"iconTabNeedUpdate",scope:this,handler:function(){l.fireEvent("rowdblclick",o,s,q)}},n]});q.stopEvent();r.showAt(q.getXY())},rowdblclick:function(o,x,v){var n,p,z,y,t,u,m,s,r,q,B,w,A;n=this.storeFilesNeedUpdate.getAt(x).data.path;p=this.storeFilesNeedUpdate.getAt(x).data.name;z=this.storeFilesNeedUpdate.getAt(x).data.en_revision;y=this.storeFilesNeedUpdate.getAt(x).data.revision;t=this.storeFilesNeedUpdate.getAt(x).data.needcommit;u=Ext.util.md5("FNU-"+this.userLang+n+p);if(!Ext.getCmp("main-panel").findById("FNU-"+u)){m=new Ext.data.Store({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controler.php"}),baseParams:{task:"get-log",Path:this.userLang+n,File:p},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",map! ping:"id"},{name:"revision",mapping:"revision"},{name:"date",mapping:" date",type:"date",dateFormat:"Y/m/d H:i:s"},{name:"author",mapping:"author"},{name:"content",mapping:"content"}])});m.setDefaultSort("date","desc");s=new Ext.data.Store({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controler.php"}),baseParams:{task:"get-log",Path:"en"+n,File:p},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"revision",mapping:"revision"},{name:"date",mapping:"date",type:"date",dateFormat:"Y/m/d H:i:s"},{name:"author",mapping:"author"},{name:"content",mapping:"content"}])});s.setDefaultSort("date","desc");r=new Ext.grid.CheckboxSelectionModel({singleSelect:false,width:22,header:"",listeners:{beforerowselect:function(D){var C=D.getCount();if(C===2){return false}},rowselect:function(D){var C=D.getCount();if(C===2){Ext.getCmp("FNU-PANEL-btn-logLang-"+u).enable();Ext.get("FNU-PANEL-btn-logLang-"+u).frame("3F8538")}else{Ext.getCmp("FNU-PANEL-btn-logLang-"+u).disable()}},rowdeselect:function(D)! {var C=D.getCount();if(C===2){Ext.getCmp("FNU-PANEL-btn-logLang-"+u).enable();Ext.get("FNU-PANEL-btn-logLang-"+u).frame("3F8538")}else{Ext.getCmp("FNU-PANEL-btn-logLang-"+u).disable()}}}});q=new Ext.grid.GridPanel({store:m,loadMask:true,columns:[r,{id:"id",header:"Rev.",width:40,sortable:false,dataIndex:"revision"},{header:"Content",width:130,sortable:true,dataIndex:"content"},{header:"By",width:50,sortable:true,dataIndex:"author"},{header:"Date",width:85,sortable:true,dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y/m/d, H:i")}],autoHeight:true,autoExpandColumn:"content",bodyBorder:false,sm:r,view:new Ext.grid.GridView({forceFit:true}),tbar:[{scope:this,tooltip:"<b>View</b> the diff",iconCls:"iconViewDiff",id:"FNU-PANEL-btn-logLang-"+u,disabled:true,handler:function(){var E,D,C;E=r.getSelections();D=E[0].data.revision;C=E[1].data.revision;this.winDiff(this.userLang+n,p,D,C)}}]});B=new Ext.grid.CheckboxSelectionModel({singleSelect:false,width:22,header:"",listeners! :{beforerowselect:function(D){var C=D.getCount();if(C===2){return fals e}},rowselect:function(D){var C=D.getCount();if(C===2){Ext.getCmp("FNU-PANEL-btn-logEn-"+u).enable();Ext.get("FNU-PANEL-btn-logEn-"+u).frame("3F8538")}else{Ext.getCmp("FNU-PANEL-btn-logEn-"+u).disable()}},rowdeselect:function(D){var C=D.getCount();if(C===2){Ext.getCmp("FNU-PANEL-btn-logEn-"+u).enable();Ext.get("FNU-PANEL-btn-logEn-"+u).frame("3F8538")}else{Ext.getCmp("FNU-PANEL-btn-logEn-"+u).disable()}}}});w=new Ext.grid.GridPanel({store:s,loadMask:true,columns:[B,{id:"id",header:"Rev.",width:40,sortable:false,dataIndex:"revision"},{header:"Content",width:130,sortable:true,dataIndex:"content"},{header:"By",width:50,sortable:true,dataIndex:"author"},{header:"Date",width:85,sortable:true,dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y/m/d, H:i")}],autoHeight:true,autoExpandColumn:"content",bodyBorder:false,sm:B,view:new Ext.grid.GridView({forceFit:true}),tbar:[{scope:this,tooltip:"<b>View</b> the diff",iconCls:"iconViewDiff",id:"FNU-PANEL-btn-logEn-"+u,disabled:true! ,handler:function(){var E,D,C;E=B.getSelections();D=E[0].data.revision;C=E[1].data.revision;this.winDiff("en"+n,p,D,C)}}]});if(this.userConf.conf_needupdate_diff==="using-viewvc"){A={xtype:"panel",layout:"fit",region:"north",title:"Diff From cvs",height:150,collapsed:true,items:{xtype:"iframepanel",id:"FNU-diff-"+u,loadMask:true,defaultSrc:"http://cvs.php.net/viewvc.cgi/phpdoc/en"+n+p+"?r1="+y+"&r2="+z}}}else{if(this.userConf.conf_needupdate_diff==="using-exec"){A={xtype:"panel",layout:"fit",region:"north",title:"Diff From cvs",height:150,autoScroll:true,collapsed:true,html:'<div id="FNU-diff-'+u+'" class="diff-content"></div>',listeners:{render:function(){Ext.Ajax.request({url:"./php/controler.php",params:{task:"get-diff2",FilePath:"en"+n,FileName:p,Rev2:y,Rev1:z},success:function(C){var D=Ext.util.JSON.decode(C.responseText);if(D.success){Ext.get("FNU-diff-"+u).dom.innerHTML=D.content}},failure:function(){}})}}}}}Ext.getCmp("main-panel").add({closable:true,title:p,originT! itle:p,tabTip:"Need Update : in "+n,iconCls:"iconTabNeedUpdate",id:"FN U-"+u,isModifiedLang:false,isModifiedEn:false,layout:"border",defaults:{collapsible:true,split:true},items:[A,{region:"west",xtype:"panel",layout:"fit",bodyBorder:false,title:"CvsLog",collapsed:true,width:375,items:{xtype:"tabpanel",activeTab:0,tabPosition:"bottom",defaults:{autoScroll:true},items:[{layout:"fit",title:this.userLang,items:[q]},{layout:"fit",title:"En",items:[w]}]}},{scope:this,title:this.userLang+" File: "+n+p,originTitle:this.userLang+" File: "+n+p,collapsible:false,id:"FNU-LANG-PANEL-"+u,region:"center",xtype:"form",height:"auto",width:"auto",items:[{xtype:"codemirror",id:"FNU-LANG-"+u,listeners:{scope:this,initialize:function(){this.getFile(u,this.userLang+n,p,"FNU-LANG-PANEL-","FNU-LANG-")},cmcursormove:function(){var C=Ext.util.JSON.decode(Ext.getCmp("FNU-LANG-"+u).getCursorPosition());Ext.get("FNU-LANG-status-line-"+u).dom.innerHTML=C.line;Ext.get("FNU-LANG-status-col-"+u).dom.innerHTML=C.caracter},cmchange:function(F,D,E){var C=Ext.util.JSON.decode(Ext! .getCmp("FNU-LANG-"+u).getCursorPosition());Ext.get("FNU-LANG-status-line-"+u).dom.innerHTML=C.line;Ext.get("FNU-LANG-status-col-"+u).dom.innerHTML=C.caracter;if(F!==27&&F!==33&&F!==34&&F!==37&&F!==38&&F!==39&&F!==40&&F!==17&&F!==16&&F!==67){if(!Ext.getCmp("FNU-"+u).isModifiedLang){Ext.getCmp("FNU-LANG-PANEL-"+u).setTitle(Ext.getCmp("FNU-LANG-PANEL-"+u).originTitle+' <span style="color:#ff0000; font-weight: bold;">[modified]</span>');Ext.getCmp("FNU-"+u).setTitle(Ext.getCmp("FNU-"+u).originTitle+' <t style="color:#ff0000; font-weight: bold;">*</t>');Ext.getCmp("FNU-LANG-PANEL-btn-save-"+u).enable();Ext.get("FNU-LANG-PANEL-btn-save-"+u).frame("3F8538");Ext.getCmp("FNU-LANG-PANEL-btn-saveas-"+u).enable();Ext.get("FNU-LANG-PANEL-btn-saveas-"+u).frame("3F8538");Ext.getCmp("FNU-"+u).isModifiedLang=true}}},cmscroll:function(C){if(this.userConf.conf_needupdate_scrollbars==="true"){Ext.getCmp("FNU-EN-"+u).scrollTo(C)}}}}],bbar:[{scope:this,xtype:"checkbox",hideLabel:true,checked:(t! his.userConf.conf_needupdate_scrollbars==="true")?true:false,boxLabel: "Synchronize scroll bars",name:"conf_needupdate_scrollbars",listeners:{scope:this,check:function(C){this.confUpdate("conf_needupdate_scrollbars",C.getValue())},render:function(C){Ext.DomHelper.insertHtml("beforeBegin",C.el.dom,'<div style="display: inline;" class="x-statusbar"><span class="x-status-text-panel">Line: <span id="FNU-LANG-status-line-'+u+'">-</span></span> <span class="x-status-text-panel">Col: <span id="FNU-LANG-status-col-'+u+'">-</span></span></div> ')}}}],tbar:[{scope:this,tooltip:"<b>Save</b> this file",iconCls:"saveFile",id:"FNU-LANG-PANEL-btn-save-"+u,disabled:true,handler:function(){this.saveLangFile(u,n,p,"FNU",x,this)}},{scope:this,tooltip:"<b>Save as</b> a patch",iconCls:"saveAsFile",id:"FNU-LANG-PANEL-btn-saveas-"+u,disabled:true,handler:function(){this.savePatch(this.userLang,u,n,p,"FNU",this)}},"->",{tooltip:"<b>Re-indent</b> all this file",iconCls:"iconIndent",handler:function(){Ext.getCmp("FNU-LANG-"+u).reIndentAll()}},{tool! tip:"Insert <b>Reviewed</b> tag",text:"Reviewed tag",iconCls:"iconInsertCode",handler:function(){Ext.getCmp("FNU-LANG-"+u).insertIntoLine(2,"end","\n<!-- Reviewed: no -->");Ext.getCmp("FNU-LANG-"+u).focus()}},{tooltip:"Insert <b>Revcheck</b> tag",text:"Rev tag",iconCls:"iconInsertCode",handler:function(){Ext.getCmp("FNU-LANG-"+u).insertIntoLine(2,"end","\n<!-- EN-Revision: 1.XX Maintainer: "+this.userLoggin+" Status: ready -->");Ext.getCmp("FNU-LANG-"+u).focus()}}]},{title:"En File: "+n+p,originTitle:"En File: "+n+p,collapsible:false,id:"FNU-EN-PANEL-"+u,region:"east",xtype:"form",height:"auto",width:575,items:[{xtype:"codemirror",id:"FNU-EN-"+u,listeners:{scope:this,initialize:function(){this.getFile(u,"en"+n,p,"FNU-EN-PANEL-","FNU-EN-")},cmchange:function(F,D,E){var C=Ext.util.JSON.decode(Ext.getCmp("FNU-EN-"+u).getCursorPosition());Ext.get("FNU-EN-status-line-"+u).dom.innerHTML=C.line;Ext.get("FNU-EN-status-col-"+u).dom.innerHTML=C.caracter;if(F!==27&&F!==33&&F!==34&&F!=! =37&&F!==38&&F!==39&&F!==40&&F!==17&&F!==16&&F!==67){if(!Ext.getCmp("F NU-"+u).isModifiedEn){Ext.getCmp("FNU-EN-PANEL-"+u).setTitle(Ext.getCmp("FNU-EN-PANEL-"+u).originTitle+' <span style="color:#ff0000; font-weight: bold;">[modified]</span>');Ext.getCmp("FNU-"+u).setTitle(Ext.getCmp("FNU-"+u).originTitle+' <t style="color:#ff0000; font-weight: bold;">*</t>');Ext.getCmp("FNU-EN-PANEL-btn-save-"+u).enable();Ext.get("FNU-EN-PANEL-btn-save-"+u).frame("3F8538");Ext.getCmp("FNU-EN-PANEL-btn-saveas-"+u).enable();Ext.get("FNU-EN-PANEL-btn-saveas-"+u).frame("3F8538");Ext.getCmp("FNU-"+u).isModifiedEn=true}}},cmscroll:function(C){if(this.userConf.conf_needupdate_scrollbars==="true"){Ext.getCmp("FNU-LANG-"+u).scrollTo(C)}},cmcursormove:function(D){var C=Ext.util.JSON.decode(Ext.getCmp("FNU-EN-"+u).getCursorPosition());Ext.get("FNU-EN-status-line-"+u).dom.innerHTML=C.line;Ext.get("FNU-EN-status-col-"+u).dom.innerHTML=C.caracter}}}],bbar:[{scope:this,xtype:"panel",height:21,baseCls:"",bodyStyle:"padding-top:5px;",html:'<div style="display: inline;" class="! x-statusbar"><span class="x-status-text-panel">Line: <span id="FNU-EN-status-line-'+u+'">-</span></span> <span class="x-status-text-panel">Col: <span id="FNU-EN-status-col-'+u+'">-</span></span></div> '}],tbar:[{scope:this,tooltip:"<b>Save</b> this file",iconCls:"saveFile",id:"FNU-EN-PANEL-btn-save-"+u,disabled:true,handler:function(){this.saveEnFile(u,n,p,"FNU",x,this)}},{scope:this,tooltip:"<b>Save as</b> a patch",iconCls:"saveAsFile",id:"FNU-EN-PANEL-btn-saveas-"+u,disabled:true,handler:function(){this.savePatch("en",u,n,p,"FNU",this)}},"->",{tooltip:"<b>Re-indent</b> all this file",iconCls:"iconIndent",handler:function(){Ext.getCmp("FNU-EN-"+u).reIndentAll()}}]}]});Ext.getCmp("main-panel").setActiveTab("FNU-"+u)}else{Ext.getCmp("main-panel").setActiveTab("FNU-"+u)}}}});a=new Ext.grid.GridPanel({store:this.storePendingPatch,loadMask:true,columns:[{id:"name",header:"Files",sortable:true,dataIndex:"name"},{header:"Posted by",width:45,sortable:true,dat! aIndex:"by"},{header:"Date",width:45,sortable:true,dataIndex:"date"},{ header:"Path",dataIndex:"path",hidden:true}],view:new Ext.grid.GroupingView({forceFit:true,groupTextTpl:'{[values.rs[0].data["path"]]} ({[values.rs.length]} {[values.rs.length > 1 ? "Files" : "File"]})',emptyText:'<div style="text-align: center;">No pending Patch</div>'}),autoExpandColumn:"name",bodyBorder:false,listeners:{scope:this,rowcontextmenu:function(n,t,r){var o,m,p,q,s;o=this.storePendingPatch.getAt(t).data.path;m=this.storePendingPatch.getAt(t).data.name;p=this.storePendingPatch.getAt(t).data.uniqID;q=Ext.util.md5("PP-"+p+o+m);n.getSelectionModel().selectRow(t);s=new Ext.menu.Menu({items:[{text:"<b>Edit in a new Tab</b>",iconCls:"PendingPatch",scope:this,handler:function(){a.fireEvent("rowdblclick",n,t,r)}},"-",{text:"Reject this patch",iconCls:"iconPageDelete",scope:this,handler:function(){this.rejectPatch(q,o,m,p,t,this)}}]});s.showAt(r.getXY())},rowdblclick:function(n,u,s){var m,o,v,t,r,q,p;m=this.storePendingPatch.getAt(u).data.path;o=this.storePendingPatch.get! At(u).data.name;v=this.storePendingPatch.getAt(u).data.uniqID;t=Ext.util.md5("PP-"+v+m+o);if(!Ext.getCmp("main-panel").findById("FE-"+t)){r=new Ext.data.Store({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controler.php"}),baseParams:{task:"get-log",Path:m,File:o},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"revision",mapping:"revision"},{name:"date",mapping:"date",type:"date",dateFormat:"Y/m/d H:i:s"},{name:"author",mapping:"author"},{name:"content",mapping:"content"}])});r.setDefaultSort("date","desc");q=new Ext.grid.CheckboxSelectionModel({singleSelect:false,width:22,header:"",listeners:{beforerowselect:function(x){var w=x.getCount();if(w===2){return false}},rowselect:function(x){var w=x.getCount();if(w===2){Ext.getCmp("PP-PANEL-btn-log-"+t).enable();Ext.get("PP-PANEL-btn-log-"+t).frame("3F8538")}else{Ext.getCmp("PP-PANEL-btn-log-"+t).disable()}},rowdeselect:function(x){var w=x.getCount();if(w===2)! {Ext.getCmp("PP-PANEL-btn-log-"+t).enable();Ext.get("PP-PANEL-btn-log- "+t).frame("3F8538")}else{Ext.getCmp("PP-PANEL-btn-log-"+t).disable()}}}});p=new Ext.grid.GridPanel({store:r,loadMask:true,columns:[q,{id:"id",header:"Rev.",width:40,sortable:false,dataIndex:"revision"},{header:"Content",width:130,sortable:true,dataIndex:"content"},{header:"By",width:50,sortable:true,dataIndex:"author"},{header:"Date",width:85,sortable:true,dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y/m/d, H:i")}],autoHeight:true,autoExpandColumn:"content",bodyBorder:false,sm:q,view:new Ext.grid.GridView({forceFit:true}),tbar:[{scope:this,tooltip:"<b>View</b> the diff",iconCls:"iconViewDiff",id:"PP-PANEL-btn-log-"+t,disabled:true,handler:function(){var y,x,w;y=q.getSelections();x=y[0].data.revision;w=y[1].data.revision;this.winDiff(m,o,x,w)}}]});Ext.getCmp("main-panel").add({closable:true,title:o,originTitle:o,tabTip:"Patch for "+m+o,iconCls:"PendingPatch",id:"PP-"+t,layout:"border",defaults:{collapsible:true,split:true},items:[{xtype:"panel",layout:"fit",region! :"north",title:"Patch content",id:"PP-patch-desc-"+t,height:150,autoScroll:true,collapsed:true,html:'<div id="diff_content_'+t+'" class="diff-content"></div>',listeners:{render:function(){Ext.Ajax.request({scope:this,url:"./php/controler.php",params:{task:"get-diff",FilePath:m,FileName:o,type:"patch",uniqID:v},success:function(w){var x=Ext.util.JSON.decode(w.responseText);if(x.success){Ext.get("diff_content_"+t).dom.innerHTML=x.content}},failure:function(){}})}}},{region:"west",xtype:"panel",layout:"fit",bodyBorder:false,title:"CvsLog",collapsed:true,width:375,items:{xtype:"tabpanel",activeTab:0,tabPosition:"bottom",defaults:{autoScroll:true},items:[{layout:"fit",title:"Log",items:[p]}]}},{title:"Proposed Patch for "+m+o,originTitle:"Proposed Patch for "+m+o,collapsible:false,id:"PP-PATCH-PANEL-"+t,region:"center",xtype:"form",height:"auto",width:"auto",items:[{xtype:"codemirror",id:"PP-PATCH-"+t,isModified:false,listeners:{scope:this,initialize:function(w){this.getFile(t,m! ,o+"."+v+".patch","PP-PATCH-PANEL-","PP-PATCH-")},cmcursormove:functio n(){var w=Ext.util.JSON.decode(Ext.getCmp("PP-PATCH-"+t).getCursorPosition());Ext.get("PP-PATCH-status-line-"+t).dom.innerHTML=w.line;Ext.get("PP-PATCH-status-col-"+t).dom.innerHTML=w.caracter},cmchange:function(z,x,y){var w=Ext.util.JSON.decode(Ext.getCmp("PP-PATCH-"+t).getCursorPosition());Ext.get("PP-PATCH-status-line-"+t).dom.innerHTML=w.line;Ext.get("PP-PATCH-status-col-"+t).dom.innerHTML=w.caracter;if(z!==27&&z!==33&&z!==34&&z!==37&&z!==38&&z!==39&&z!==40&&z!==17&&z!==16&&z!==67){if(!Ext.getCmp("PP-PATCH-"+t).isModified){Ext.getCmp("PP-PATCH-PANEL-"+t).setTitle(Ext.getCmp("PP-PATCH-PANEL-"+t).originTitle+' <span style="color:#ff0000; font-weight: bold;">[modified]</span>');Ext.getCmp("PP-"+t).setTitle(Ext.getCmp("PP-"+t).originTitle+' <t style="color:#ff0000; font-weight: bold;">*</t>');Ext.getCmp("PP-PATCH-"+t).isModified=true}}},cmscroll:function(w){if(this.userConf.conf_patch_scrollbars==="true"){Ext.getCmp("PP-ORIGIN-"+t).scrollTo(w)}}}}],bbar:[{scope:this,xtype:"c! heckbox",hideLabel:true,checked:(this.userConf.conf_patch_scrollbars==="true")?true:false,boxLabel:"Synchronize scroll bars",name:"conf_patch_scrollbars",listeners:{scope:this,check:function(w){this.confUpdate("conf_patch_scrollbars",w.getValue())},render:function(w){Ext.DomHelper.insertHtml("beforeBegin",w.el.dom,'<div style="display: inline;" class="x-statusbar"><span class="x-status-text-panel">Line: <span id="PP-PATCH-status-line-'+t+'">-</span></span> <span class="x-status-text-panel">Col: <span id="PP-PATCH-status-col-'+t+'">-</span></span></div> ')}}}],tbar:[{scope:this,tooltip:"<b>Accept</b> this patch and <b>Save</b> the file",iconCls:"saveFile",id:"PP-PATCH-PANEL-btn-save-"+t,handler:function(){this.saveFileViaPatch(t,m,o,v,u,this)}},{scope:this,tooltip:"<b>Reject</b> this patch",iconCls:"iconPageDelete",id:"PP-PATCH-PANEL-btn-reject-"+t,handler:function(){this.rejectPatch(t,m,o,v,u,this)}},"->",{tooltip:"<b>Re-indent</b> all this file",iconC! ls:"iconIndent",handler:function(){Ext.getCmp("PP-PATCH-"+t).reIndentA ll()}}]},{title:"Original File: "+m+o,originTitle:"Original File: "+m+o,collapsible:false,id:"PP-ORIGIN-PANEL-"+t,region:"east",xtype:"form",height:"auto",width:575,items:[{xtype:"codemirror",id:"PP-ORIGIN-"+t,readOnly:true,listeners:{scope:this,initialize:function(w){this.getFile(t,m,o,"PP-ORIGIN-PANEL-","PP-ORIGIN-")},cmscroll:function(w){if(this.userConf.conf_patch_scrollbars==="true"){Ext.getCmp("PP-PATCH-"+t).scrollTo(w)}},cmcursormove:function(x){var w=Ext.util.JSON.decode(Ext.getCmp("PP-ORIGIN-"+t).getCursorPosition());Ext.get("PP-ORIGIN-status-line-"+t).dom.innerHTML=w.line;Ext.get("PP-ORIGIN-status-col-"+t).dom.innerHTML=w.caracter}}}],bbar:[{scope:this,xtype:"panel",height:21,baseCls:"",bodyStyle:"padding-top:5px;",html:'<div style="display: inline;" class="x-statusbar"><span class="x-status-text-panel">Line: <span id="PP-ORIGIN-status-line-'+t+'">-</span></span> <span class="x-status-text-panel">Col: <span id="PP-ORIGIN-status-col-'+t+'">-</span></span>! </div> '}],tbar:[{}]}]});Ext.getCmp("main-panel").setActiveTab("PP-"+t);if(Ext.getCmp("PP-"+t).getLayout().north.collapsedEl){Ext.getCmp("PP-"+t).getLayout().north.collapsedEl.addClass("x-layout-collapsed-east-patch-desc")}}}}});c=new Ext.grid.GridPanel({store:this.storePendingCommit,loadMask:true,columns:[{id:"name",header:"Files",sortable:true,dataIndex:"name"},{header:"Modified by",width:45,sortable:true,dataIndex:"by"},{header:"Date",width:45,sortable:true,dataIndex:"date"},{header:"Path",dataIndex:"path",hidden:true}],view:new Ext.grid.GroupingView({forceFit:true,groupTextTpl:'{[values.rs[0].data["path"]]} ({[values.rs.length]} {[values.rs.length > 1 ? "Files" : "File"]})',emptyText:'<div style="text-align: center;">No pending for Commit</div>'}),autoExpandColumn:"name",bodyBorder:false,listeners:{scope:this,rowcontextmenu:function(n,r,p){var o,m,q;o=this.storePendingCommit.getAt(r).data.path;m=this.storePendingCommit.getAt(r).data.name;n.getSelectionModel()! .selectRow(r);q=new Ext.menu.Menu({items:[{text:"<b>Edit in a new Tab< /b>",iconCls:"PendingCommit",scope:this,handler:function(){c.fireEvent("rowdblclick",n,r,p)}},"-",{text:"View Diff",iconCls:"iconViewDiff",scope:this,handler:function(){Ext.getCmp("main-panel").add({xtype:"panel",id:"diff_panel_"+r,title:"Diff",tabTip:"Diff",closable:true,autoScroll:true,iconCls:"iconTabLink",html:'<div id="diff_content_'+r+'" class="diff-content"></div>'});Ext.getCmp("main-panel").setActiveTab("diff_panel_"+r);Ext.get("diff_panel_"+r).mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Please, Wait...');Ext.Ajax.request({url:"./php/controler.php",params:{task:"get-diff",FilePath:o,FileName:m},success:function(s){var t=Ext.util.JSON.decode(s.responseText);if(t.success){Ext.get("diff_content_"+r).dom.innerHTML=t.content;Ext.get("diff_panel_"+r).unmask()}},failure:function(){}})}},{text:"Download the diff as a patch",iconCls:"iconCommitFileCvs",scope:this,handler:function(){window.location.href="./dl_Patch.php?FilePath="+o+"&FileName="+m}},"-"! ,{text:"Clear this change",iconCls:"iconPageDelete",scope:this,handler:function(){function s(t){if(t==="yes"){if(Ext.getCmp("main-panel").findById("FNU-"+Ext.util.md5("FNU-"+o+m))){Ext.getCmp("main-panel").remove("FNU-"+Ext.util.md5("FNU-"+o+m))}Ext.Ajax.request({scope:this,url:"./php/controler.php",params:{task:"clear-local-change",FilePath:o,FileName:m},success:function(u){var v=Ext.util.JSON.decode(u.responseText);if(v.success){this.storeFilesNeedUpdate.reload();this.storeFilesError.reload();this.storeFilesNeedReviewed.reload();this.storePendingCommit.remove(this.storePendingCommit.getAt(r));this.storePendingCommit.fireEvent("add",this.storePendingCommit)}},failure:function(){}})}}Ext.MessageBox.confirm("Confirm","This action will clear your local modification and take back this file from his original stats.<br/>You need confirm.",s,this)}},"-",{text:"Commit...",iconCls:"iconCommitFileCvs",scope:this,menu:new Ext.menu.Menu({items:[{text:"...this file",iconCls:"iconCommit! FileCvs",scope:this,handler:function(){this.WinCommit(true,r)}},{text: "...all files modified by me",iconCls:"iconCommitFileCvs",scope:this,handler:function(){this.WinCommit(false,"","by me")}},{text:"...all files modified",iconCls:"iconCommitFileCvs",scope:this,handler:function(){this.WinCommit(false)}}]})}]});q.showAt(p.getXY())},rowdblclick:function(n,q,p){var o,m;o=this.storePendingCommit.getAt(q).data.path;m=this.storePendingCommit.getAt(q).data.name;this.openFile(o,m)}}});h=new Ext.grid.GridPanel({store:this.storeFilesNeedReviewed,loadMask:true,columns:[{id:"name",header:"Files",sortable:true,dataIndex:"name"},{header:"Reviewed",width:45,sortable:true,dataIndex:"reviewed"},{header:"Maintainer",width:45,sortable:true,dataIndex:"maintainer"},{header:"Path",dataIndex:"path",hidden:true}],view:new Ext.grid.GroupingView({forceFit:true,groupTextTpl:'{[values.rs[0].data["path"]]} ({[values.rs.length]} {[values.rs.length > 1 ? "Files" : "File"]})',getRowClass:function(m,p,o,n){if(m.data.needcommit){return"file-need-commit"}},emptyText:'<div style! ="text-align: center;">No files</div>'}),autoExpandColumn:"name",bodyBorder:false,listeners:{scope:this,rowcontextmenu:function(n,t,r){var m,p,s,o="",v="",u,q;n.getSelectionModel().selectRow(t);m=this.storeFilesNeedReviewed.getAt(t).data.path;p=this.storeFilesNeedReviewed.getAt(t).data.name;s=Ext.util.md5("FNR-"+this.userLang+m+p);if(this.storeFilesNeedReviewed.getAt(t).data.needcommit){o={text:"View Diff",iconCls:"iconViewDiff",scope:this,handler:function(){Ext.getCmp("main-panel").add({xtype:"panel",id:"diff_panel_"+t,title:"Diff",tabTip:"Diff",closable:true,autoScroll:true,iconCls:"iconTabLink",html:'<div id="diff_content_'+t+'" class="diff-content"></div>'});Ext.getCmp("main-panel").setActiveTab("diff_panel_"+t);Ext.get("diff_panel_"+t).mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Please, Wait...');Ext.Ajax.request({scope:this,url:"./php/controler.php",params:{task:"get-diff",FilePath:this.userLang+m,FileName:p},success:function(w){var x=Ext.util! .JSON.decode(w.responseText);if(x.success){Ext.get("diff_content_"+t). dom.innerHTML=x.content;Ext.get("diff_panel_"+t).unmask()}},failure:function(){}})}}}u=m.split("/");if(u[1]==="reference"){v={text:"Open all files about "+u[2]+" extension",iconCls:"iconViewDiff",scope:this,handler:function(){Ext.getBody().mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Open all files about '+u[2]+" extension. Please, wait...");Ext.Ajax.request({scope:this,url:"../php/controler.php",params:{task:"all-files-about-extension",ExtName:u[2]},success:function(y,x){var z,w;z=Ext.util.JSON.decode(y.responseText);this.filePendingOpen=[];for(w=0;w<z.files.length;w=w+1){this.filePendingOpen[w]=[this.userLang+z.files[w].path,z.files[w].name]}this.openFile(this.filePendingOpen[0][0],this.filePendingOpen[0][1]);Ext.getBody().unmask()}})}}}q=new Ext.menu.Menu({scope:this,items:[{text:"<b>Edit in a new Tab</b>",iconCls:"FilesNeedReviewed",scope:this,handler:function(){h.fireEvent("rowdblclick",n,t,r)}},o,"-",v]});r.stopEvent();q.showAt(r.getXY())},rowdb! lclick:function(o,y,v){var n,p,s,u,w,m,t,r,q,z,x;n=this.storeFilesNeedReviewed.getAt(y).data.path;p=this.storeFilesNeedReviewed.getAt(y).data.name;s=this.storeFilesNeedReviewed.getAt(y).data.reviewed;u=this.storeFilesNeedReviewed.getAt(y).data.needcommit;w=Ext.util.md5("FNR-"+this.userLang+n+p);if(!Ext.getCmp("main-panel").findById("FNR-"+w)){m=new Ext.data.Store({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controler.php"}),baseParams:{task:"get-log",Path:this.userLang+n,File:p},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"revision",mapping:"revision"},{name:"date",mapping:"date",type:"date",dateFormat:"Y/m/d H:i:s"},{name:"author",mapping:"author"},{name:"content",mapping:"content"}])});m.setDefaultSort("date","desc");t=new Ext.data.Store({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controler.php"}),baseParams:{task:"get-log",Path:"en"+n,File:p},reader:new Ext.data.JsonReader({root:"Items! ",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"re vision",mapping:"revision"},{name:"date",mapping:"date",type:"date",dateFormat:"Y/m/d H:i:s"},{name:"author",mapping:"author"},{name:"content",mapping:"content"}])});t.setDefaultSort("date","desc");r=new Ext.grid.CheckboxSelectionModel({singleSelect:false,width:22,header:"",listeners:{beforerowselect:function(B){var A=B.getCount();if(A===2){return false}},rowselect:function(B){var A=B.getCount();if(A===2){Ext.getCmp("FNR-PANEL-btn-logLang-"+w).enable();Ext.get("FNR-PANEL-btn-logLang-"+w).frame("3F8538")}else{Ext.getCmp("FNR-PANEL-btn-logLang-"+w).disable()}},rowdeselect:function(B){var A=B.getCount();if(A===2){Ext.getCmp("FNR-PANEL-btn-logLang-"+w).enable();Ext.get("FNR-PANEL-btn-logLang-"+w).frame("3F8538")}else{Ext.getCmp("FNR-PANEL-btn-logLang-"+w).disable()}}}});q=new Ext.grid.GridPanel({store:m,loadMask:true,columns:[r,{id:"id",header:"Rev.",width:40,sortable:false,dataIndex:"revision"},{header:"Content",width:130,sortable:true,dataIndex:"content"},{header:"By",width:50! ,sortable:true,dataIndex:"author"},{header:"Date",width:85,sortable:true,dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y/m/d, H:i")}],autoHeight:true,autoExpandColumn:"content",bodyBorder:false,sm:r,view:new Ext.grid.GridView({forceFit:true}),tbar:[{scope:this,tooltip:"<b>View</b> the diff",iconCls:"iconViewDiff",id:"FNR-PANEL-btn-logLang-"+w,disabled:true,handler:function(){var C,B,A;C=r.getSelections();B=C[0].data.revision;A=C[1].data.revision;this.winDiff(this.userLang+n,p,B,A)}}]});z=new Ext.grid.CheckboxSelectionModel({singleSelect:false,width:22,header:"",listeners:{beforerowselect:function(B){var A=B.getCount();if(A===2){return false}},rowselect:function(B){var A=B.getCount();if(A===2){Ext.getCmp("FNR-PANEL-btn-logEn-"+w).enable();Ext.get("FNR-PANEL-btn-logEn-"+w).frame("3F8538")}else{Ext.getCmp("FNR-PANEL-btn-logEn-"+w).disable()}},rowdeselect:function(B){var A=B.getCount();if(A===2){Ext.getCmp("FNR-PANEL-btn-logEn-"+w).enable();Ext.get("FNR-PANEL-btn-logE! n-"+w).frame("3F8538")}else{Ext.getCmp("FNR-PANEL-btn-logEn-"+w).disab le()}}}});x=new Ext.grid.GridPanel({store:t,loadMask:true,columns:[z,{id:"id",header:"Rev.",width:40,sortable:false,dataIndex:"revision"},{header:"Content",width:130,sortable:true,dataIndex:"content"},{header:"By",width:50,sortable:true,dataIndex:"author"},{header:"Date",width:85,sortable:true,dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y/m/d, H:i")}],autoHeight:true,autoExpandColumn:"content",bodyBorder:false,sm:z,view:new Ext.grid.GridView({forceFit:true}),tbar:[{scope:this,tooltip:"<b>View</b> the diff",iconCls:"iconViewDiff",id:"FNR-PANEL-btn-logEn-"+w,disabled:true,handler:function(){var C,B,A;C=z.getSelections();B=C[0].data.revision;A=C[1].data.revision;this.winDiff("en"+n,p,B,A)}}]});Ext.getCmp("main-panel").add({closable:true,title:p,originTitle:p,tabTip:"Need Reviewed : in "+n,iconCls:"iconTabNeedReviewed",id:"FNR-"+w,isModifiedLang:false,isModifiedEn:false,layout:"border",defaults:{collapsible:true,split:true},items:[{region:"west",xtype:"panel",layout:! "fit",bodyBorder:false,title:"CvsLog",collapsed:true,width:375,items:{xtype:"tabpanel",activeTab:0,tabPosition:"bottom",defaults:{autoScroll:true},items:[{layout:"fit",title:this.userLang,items:[q]},{layout:"fit",title:"En",items:[x]}]}},{title:this.userLang+" File: "+n+p,originTitle:this.userLang+" File: "+n+p,collapsible:false,id:"FNR-LANG-PANEL-"+w,region:"center",xtype:"form",height:"auto",width:"auto",items:[{xtype:"codemirror",id:"FNR-LANG-"+w,listeners:{scope:this,initialize:function(){this.getFile(w,this.userLang+n,p,"FNR-LANG-PANEL-","FNR-LANG-")},cmcursormove:function(B){var A=Ext.util.JSON.decode(Ext.getCmp("FNR-LANG-"+w).getCursorPosition());Ext.get("FNR-LANG-status-line-"+w).dom.innerHTML=A.line;Ext.get("FNR-LANG-status-col-"+w).dom.innerHTML=A.caracter},cmchange:function(D,B,C){var A=Ext.util.JSON.decode(Ext.getCmp("FNR-LANG-"+w).getCursorPosition());Ext.get("FNR-LANG-status-line-"+w).dom.innerHTML=A.line;Ext.get("FNR-LANG-status-col-"+w).dom.innerHTML=A.carac! ter;if(D!==27&&D!==33&&D!==34&&D!==37&&D!==38&&D!==39&&D!==40&&D!==17& &D!==16&&D!==67){if(!Ext.getCmp("FNR-"+w).isModifiedLang){Ext.getCmp("FNR-LANG-PANEL-"+w).setTitle(Ext.getCmp("FNR-LANG-PANEL-"+w).originTitle+' <span style="color:#ff0000; font-weight: bold;">[modified]</span>');Ext.getCmp("FNR-"+w).setTitle(Ext.getCmp("FNR-"+w).originTitle+' <t style="color:#ff0000; font-weight: bold;">*</t>');Ext.getCmp("FNR-LANG-PANEL-btn-save-"+w).enable();Ext.get("FNR-LANG-PANEL-btn-save-"+w).frame("3F8538");Ext.getCmp("FNR-LANG-PANEL-btn-saveas-"+w).enable();Ext.get("FNR-LANG-PANEL-btn-saveas-"+w).frame("3F8538");Ext.getCmp("FNR-"+w).isModifiedLang=true}}},cmscroll:function(A){if(this.userConf.conf_reviewed_scrollbars==="true"){Ext.getCmp("FNR-EN-"+w).scrollTo(A)}}}}],bbar:[{scope:this,xtype:"checkbox",hideLabel:true,checked:(this.userConf.conf_reviewed_scrollbars==="true")?true:false,boxLabel:"Synchronize scroll bars",name:"conf_reviewed_scrollbars",listeners:{scope:this,check:function(A){this.confUpdate("conf_reviewed_scrollbars",A.getValue())},rend! er:function(A){Ext.DomHelper.insertHtml("beforeBegin",A.el.dom,'<div style="display: inline;" class="x-statusbar"><span class="x-status-text-panel">Line: <span id="FNR-LANG-status-line-'+w+'">-</span></span> <span class="x-status-text-panel">Col: <span id="FNR-LANG-status-col-'+w+'">-</span></span></div> ')}}}],tbar:[{scope:this,tooltip:"<b>Save</b> this file",iconCls:"saveFile",id:"FNR-LANG-PANEL-btn-save-"+w,disabled:true,handler:function(){this.saveLangFile(w,n,p,"FNR",y,this)}},{scope:this,tooltip:"<b>Save as</b> a patch",iconCls:"saveAsFile",id:"FNR-LANG-PANEL-btn-saveas-"+w,disabled:true,handler:function(){this.savePatch(this.userLang,w,n,p,"FNR",this)}},"->",{tooltip:"<b>Re-indent</b> all this file",iconCls:"iconIndent",handler:function(){Ext.getCmp("FNR-LANG-"+w).reIndentAll()}},{tooltip:"Insert <b>Reviewed</b> tag",text:"Reviewed tag",iconCls:"iconInsertCode",handler:function(){Ext.getCmp("FNR-LANG-"+w).insertIntoLine(2,"end","\n<!-- Reviewed:! no -->");Ext.getCmp("FNR-LANG-"+w).focus()}},{tooltip:"Insert <b>Revc heck</b> tag",text:"Rev tag",iconCls:"iconInsertCode",handler:function(){Ext.getCmp("FNR-LANG-"+w).insertIntoLine(2,"end","\n<!-- EN-Revision: 1.XX Maintainer: "+this.userLoggin+" Status: ready -->");Ext.getCmp("FNR-LANG-"+w).focus()}}]},{title:"En File: "+n+p,originTitle:"En File: "+n+p,collapsible:false,id:"FNR-EN-PANEL-"+w,region:"east",xtype:"form",height:"auto",width:575,items:[{xtype:"codemirror",id:"FNR-EN-"+w,listeners:{scope:this,initialize:function(){this.getFile(w,"en"+n,p,"FNR-EN-PANEL-","FNR-EN-")},cmchange:function(D,B,C){var A=Ext.util.JSON.decode(Ext.getCmp("FNR-EN-"+w).getCursorPosition());Ext.get("FNR-EN-status-line-"+w).dom.innerHTML=A.line;Ext.get("FNR-EN-status-col-"+w).dom.innerHTML=A.caracter;if(D!==27&&D!==33&&D!==34&&D!==37&&D!==38&&D!==39&&D!==40&&D!==17&&D!==16&&D!==67){if(!Ext.getCmp("FNR-"+w).isModifiedEn){Ext.getCmp("FNR-EN-PANEL-"+w).setTitle(Ext.getCmp("FNR-EN-PANEL-"+w).originTitle+' <span style="color:#ff0000; font-weight: bold;">[modified]<! /span>');Ext.getCmp("FNR-"+w).setTitle(Ext.getCmp("FNR-"+w).originTitle+' <t style="color:#ff0000; font-weight: bold;">*</t>');Ext.getCmp("FNR-EN-PANEL-btn-save-"+w).enable();Ext.get("FNR-EN-PANEL-btn-save-"+w).frame("3F8538");Ext.getCmp("FNR-EN-PANEL-btn-saveas-"+w).enable();Ext.get("FNR-EN-PANEL-btn-saveas-"+w).frame("3F8538");Ext.getCmp("FNR-"+w).isModifiedEn=true}}},cmscroll:function(A){if(this.userConf.conf_reviewed_scrollbars==="true"){Ext.getCmp("FNR-LANG-"+w).scrollTo(A)}},cmcursormove:function(B){var A=Ext.util.JSON.decode(Ext.getCmp("FNR-EN-"+w).getCursorPosition());Ext.get("FNR-EN-status-line-"+w).dom.innerHTML=A.line;Ext.get("FNR-EN-status-col-"+w).dom.innerHTML=A.caracter}}}],bbar:[{scope:this,xtype:"panel",height:21,baseCls:"",bodyStyle:"padding-top:5px;",html:'<div style="display: inline;" class="x-statusbar"><span class="x-status-text-panel">Line: <span id="FNR-EN-status-line-'+w+'">-</span></span> <span class="x-status-text-panel">Col: <span id="! FNR-EN-status-col-'+w+'">-</span></span></div> '}],tbar:[{s cope:this,tooltip:"<b>Save</b> this file",iconCls:"saveFile",id:"FNR-EN-PANEL-btn-save-"+w,disabled:true,handler:function(){this.saveEnFile(w,n,p,"FNR",y,this)}},{scope:this,tooltip:"<b>Save as</b> a patch",iconCls:"saveAsFile",id:"FNR-EN-PANEL-btn-saveas-"+w,disabled:true,handler:function(){this.savePatch("en",w,n,p,"FNR",this)}},"->",{tooltip:"<b>Re-indent</b> all this file",iconCls:"iconIndent",handler:function(){Ext.getCmp("FNR-EN-"+w).reIndentAll()}}]}]});Ext.getCmp("main-panel").setActiveTab("FNR-"+w)}else{Ext.getCmp("main-panel").setActiveTab("FNR-"+w)}}}});g=new Ext.grid.GridPanel({title:"Summary",iconCls:"flag-"+this.userLang,store:this.storeSummary,loadMask:true,columns:[new Ext.grid.RowNumberer(),{id:"StatusType",header:"File status type",width:180,sortable:true,dataIndex:"libel"},{header:"Number of files",width:110,sortable:true,dataIndex:"nbFiles"},{header:"Percent of files",width:110,sortable:true,dataIndex:"percentFiles"},{header:"Size of files (kB)",width:110! ,sortable:true,dataIndex:"sizeFiles"},{header:"Percent of size",width:110,sortable:true,dataIndex:"percentSize"}],autoScroll:true,height:400,width:800,view:new Ext.grid.GridView({getRowClass:function(m,p,o,n){if(m.data.id===1){return"summary_1"}if(m.data.id===2){return"summary_2"}if(m.data.id===3){return"summary_3"}if(m.data.id===4){return"summary_4"}if(m.data.id===5){return"summary_5"}}}),listeners:{scope:this,render:function(m){m.store.load()}}});f=new Ext.grid.GridPanel({title:"Translators",iconCls:"iconTranslator",store:this.storeTranslators,loadMask:true,columns:[new Ext.grid.RowNumberer(),{id:"GridTransName",header:"Name",sortable:true,dataIndex:"name",summaryType:"count",summaryRenderer:this.rendererTotalTranslator},{header:"Email",width:110,sortable:true,dataIndex:"email"},{header:"Nick",width:70,sortable:true,dataIndex:"nick"},{header:"Cvs",width:45,sortable:true,dataIndex:"cvs"},{header:"UptoDate",width:60,sortable:true,renderer:this.rendererNumUptodate,dataIndex:! "uptodate",summaryType:"sum"},{header:"Old",width:45,sortable:true,ren derer:this.rendererSum,dataIndex:"old",summaryType:"sum"},{header:"Critical",width:60,sortable:true,renderer:this.rendererNumCritical,dataIndex:"critical",summaryType:"sum"},{header:"Sum",width:50,sortable:true,renderer:this.rendererSum,dataIndex:"sum",summaryType:"sum"}],plugins:[new Ext.ux.grid.GridSummary()],autoScroll:true,autoExpandColumn:"GridTransName",height:400,width:800,listeners:{scope:this,render:function(){this.storeTranslators.load()},rowdblclick:function(o,q,p){var m,n;o.getSelectionModel().selectRow(q);m=this.storeTranslators.getAt(q).data.email;n=this.storeTranslators.getAt(q).data.name;this.sendEmail(n,m)},rowcontextmenu:function(o,r,p){var m,n,q;o.getSelectionModel().selectRow(r);m=this.storeTranslators.getAt(r).data.email;n=this.storeTranslators.getAt(r).data.name;q=new Ext.menu.Menu({id:"submenu",items:[{scope:this,text:"<b>Send an email to "+n+"</b>",iconCls:"iconSendEmail",handler:function(){this.sendEmail(n,m)}},"-",{scope:this,text:"Send an email to ! the doc-"+this.userLang+"@lists.php.net",iconCls:"iconSendEmail",handler:function(){this.sendEmail("Php Doc Team "+this.userLang,"doc-"+this.userLang+"@lists.php.net")}}]});q.showAt(p.getXY())}}});i=new Ext.grid.GridPanel({store:this.storeMailing,title:"Mails from doc-"+this.userLang,iconCls:"home-mailing-title",loadMask:true,columns:[new Ext.grid.RowNumberer(),{id:"GridMailingTitle",header:"Title",sortable:true,dataIndex:"title"},{header:"By",width:110,sortable:true,dataIndex:"description"},{header:"Date",width:140,sortable:true,dataIndex:"pubDate",renderer:Ext.util.Format.dateRenderer("Y/m/d, H:i")}],autoScroll:true,height:400,width:800,autoExpandColumn:"GridMailingTitle",sm:new Ext.grid.RowSelectionModel({singleSelect:true}),tbar:[{scope:this,tooltip:"Refresh this grid",iconCls:"refresh",handler:function(){this.storeMailing.reload()}}],listeners:{scope:this,render:function(){this.storeMailing.load()},rowcontextmenu:function(m,p,n){var o;m.getSelectionModel().selectRow(p)! ;o=new Ext.menu.Menu({id:"submenu",items:[{text:"<b>Open in a new Tab< /b>",iconCls:"openInTab",scope:this,handler:function(){i.fireEvent("rowdblclick",m,p,n)}},"-",{text:"Refresh this grid",iconCls:"refresh",scope:this,handler:function(){this.storeMailing.reload()}}]});o.showAt(n.getXY())},rowdblclick:function(n,r,p){var m,q,o;m=this.storeMailing.getAt(r).data.pubDate;q=this.storeMailing.getAt(r).data.link;o=this.storeMailing.getAt(r).data.title;this.NewTabMailing(m,q,o)}}});e=new Ext.grid.GridPanel({store:this.storeBugs,title:"Open bugs for doc-"+this.userLang,iconCls:"iconBugs",loadMask:true,columns:[{id:"GridBugTitle",header:"Title",sortable:true,dataIndex:"title"}],stripeRows:true,autoHeight:true,viewConfig:{emptyText:"No open Bugs",forceFit:true,enableRowBody:true,getRowClass:function(m,q,o,n){o.body='<p class="bug-desc">'+m.data.description+"</p>";return"x-grid3-row-expanded"}},autoExpandColumn:"GridBugTitle",sm:new Ext.grid.RowSelectionModel({singleSelect:true}),width:800,tbar:[{scope:this,tooltip:"Refresh this grid",iconCls:"refresh",h! andler:function(){this.storeBugs.reload()}}],listeners:{scope:this,render:function(){this.storeBugs.load()},rowcontextmenu:function(m,p,n){var o;m.getSelectionModel().selectRow(p);o=new Ext.menu.Menu({id:"submenu",items:[{text:"<b>Open in a new Tab</b>",iconCls:"openInTab",scope:this,handler:function(){e.fireEvent("rowdblclick",m,p,n)}},"-",{text:"Refresh this grid",iconCls:"refresh",scope:this,handler:function(){this.storeBugs.reload()}}]});o.showAt(n.getXY())},rowdblclick:function(o,r,q){var m,n,p;m=this.storeBugs.getAt(r).data.id;n=this.storeBugs.getAt(r).data.link;p=this.storeBugs.getAt(r).data.title;this.NewTabBugs(m,n,p)}}});k={title:"Graphics",layout:"fit",autoHeight:true,iconCls:"home-graphic-title",html:'<div align="center" id="graph_container" style="width: 530px; height: 302px"><img id="graph_picture" src="" height="300"></div>',listeners:{afterlayout:function(){var m,o,n;m=Ext.get("graph_picture");o=Ext.get("graph_container");m.setVisibilityMode(Ext.Element.VISI! BILITY);n=new Ext.LoadMask(o);m.on("load",function(){m.stopFx();n.hide ();m.fadeIn({duration:2})});n.show();m.hide();m.dom.src="/php/image_info.php"}}};this.treeAllFiles=new Ext.tree.TreePanel({animate:true,autoScroll:true,useArrows:true,loader:new Ext.tree.TreeLoader({dataUrl:"./php/controler.php",baseParams:{task:"getAllFiles"}}),enableDD:false,containerScroll:true,bodyBorder:false,listeners:{scope:this,dblclick:function(q,v){var n,m,w,y,u,r,p,o,s,x;if(q.attributes.type==="file"){n=q.attributes.text;m=q.attributes.id;w=Ext.util.md5("AF-"+m+n);if(!Ext.getCmp("main-panel").findById("AF-"+w)){y=m.split("/");y.shift();y.shift();y.pop();m=y.join("/")+"/";u="xml";if(q.attributes.extension==="xml"){u="xml"}if(q.attributes.extension==="html"){u="html"}if(q.attributes.extension==="php"){u="php"}r=new Ext.data.Store({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controler.php"}),baseParams:{task:"get-log",Path:m,File:n},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"revision",mappi! ng:"revision"},{name:"date",mapping:"date",type:"date",dateFormat:"Y/m/d H:i:s"},{name:"author",mapping:"author"},{name:"content",mapping:"content"}])});r.setDefaultSort("date","desc");p=new Ext.grid.CheckboxSelectionModel({singleSelect:false,width:22,header:"",listeners:{beforerowselect:function(z){var t=z.getCount();if(t===2){return false}},rowselect:function(z){var t=z.getCount();if(t===2){Ext.getCmp("AF-PANEL-btn-log-"+w).enable();Ext.get("AF-PANEL-btn-log-"+w).frame("3F8538")}else{Ext.getCmp("AF-PANEL-btn-log-"+w).disable()}},rowdeselect:function(z){var t=z.getCount();if(t===2){Ext.getCmp("AF-PANEL-btn-log-"+w).enable();Ext.get("AF-PANEL-btn-log-"+w).frame("3F8538")}else{Ext.getCmp("AF-PANEL-btn-log-"+w).disable()}}}});o=new Ext.grid.GridPanel({store:r,id:"AF-PANEL-log-"+w,loadMask:true,columns:[p,{id:"id",header:"Rev.",width:40,sortable:false,dataIndex:"revision"},{header:"Content",width:130,sortable:true,dataIndex:"content"},{header:"By",width:50,sortable:true,dataIn! dex:"author"},{header:"Date",width:85,sortable:true,dataIndex:"date",r enderer:Ext.util.Format.dateRenderer("Y/m/d, H:i")}],autoHeight:true,autoExpandColumn:"content",bodyBorder:false,sm:p,view:new Ext.grid.GridView({forceFit:true}),tbar:[{scope:this,tooltip:"<b>View</b> the diff",iconCls:"iconViewDiff",id:"AF-PANEL-btn-log-"+w,disabled:true,handler:function(){var A,z,t;A=p.getSelections();z=A[0].data.revision;t=A[1].data.revision;this.winDiff(m,n,z,t)}}]});s={region:"west",xtype:"panel",layout:"fit",bodyBorder:false,title:"CvsLog",collapsed:true,width:375,items:{scope:this,xtype:"tabpanel",activeTab:0,tabPosition:"bottom",defaults:{autoScroll:true},items:[{layout:"fit",title:"Log",items:[o]}]}};x={title:"File: "+m+n,originTitle:"File: "+m+n,collapsible:false,id:"AF-PANEL-"+w,region:"center",xtype:"form",height:"auto",width:"auto",items:[{xtype:"codemirror",id:"AF-FILE-"+w,isModified:false,parser:u,listeners:{scope:this,initialize:function(){this.getFile(w,m,n,"AF-PANEL-","AF-FILE-")},cmchange:function(B,z,A){var t=Ext.util.JSON.decode(Ext.getC! mp("AF-FILE-"+w).getCursorPosition());Ext.get("AF-status-line-"+w).dom.innerHTML=t.line;Ext.get("AF-status-col-"+w).dom.innerHTML=t.caracter;if(B!==27&&B!==33&&B!==34&&B!==37&&B!==38&&B!==39&&B!==40&&B!==17&&B!==16&&B!==67){if(!Ext.getCmp("AF-FILE-"+w).isModified){Ext.getCmp("AF-PANEL-"+w).setTitle(Ext.getCmp("AF-PANEL-"+w).originTitle+' <span style="color:#ff0000; font-weight: bold;">[modified]</span>');Ext.getCmp("AF-"+w).setTitle(Ext.getCmp("AF-"+w).originTitle+' <t style="color:#ff0000; font-weight: bold;">*</t>');Ext.getCmp("AF-PANEL-btn-save-"+w).enable();Ext.get("AF-PANEL-btn-save-"+w).frame("3F8538");Ext.getCmp("AF-PANEL-btn-saveas-"+w).enable();Ext.get("AF-PANEL-btn-saveas-"+w).frame("3F8538");Ext.getCmp("AF-FILE-"+w).isModified=true}}},cmcursormove:function(){var t=Ext.util.JSON.decode(Ext.getCmp("AF-FILE-"+w).getCursorPosition());Ext.get("AF-status-line-"+w).dom.innerHTML=t.line;Ext.get("AF-status-col-"+w).dom.innerHTML=t.caracter}}}],bbar:[{scope:this,xtype:"pan! el",height:21,baseCls:"",bodyStyle:"padding-top:5px;",html:'<div style ="display: inline;" class="x-statusbar"><span class="x-status-text-panel">Line: <span id="AF-status-line-'+w+'">-</span></span> <span class="x-status-text-panel">Col: <span id="AF-status-col-'+w+'">-</span></span></div> '}],tbar:[{scope:this,tooltip:"<b>Save</b> this file",iconCls:"saveFile",id:"AF-PANEL-btn-save-"+w,disabled:true,handler:function(){Ext.getCmp("AF-PANEL-btn-save-"+w).disable();Ext.getCmp("AF-FILE-"+w).isModified=false;Ext.getCmp("AF-PANEL-"+w).setTitle(Ext.getCmp("AF-PANEL-"+w).originTitle);Ext.getCmp("AF-"+w).setTitle(Ext.getCmp("AF-"+w).originTitle);var t=Ext.MessageBox.wait("Saving data...");Ext.Ajax.request({scope:this,url:"../php/controler.php",params:{task:"save-file",filePath:m,fileName:n,fileLang:"all",fileContent:Ext.getCmp("AF-FILE-"+w).getCode()},success:function(A,z){var B=Ext.util.JSON.decode(A.responseText);if(B.success){this.addToPendingCommit(m,n);t.hide()}}})}},{scope:this,tooltip:"<b>Save as</b> a patch",iconCls:"saveA! sFile",id:"AF-PANEL-btn-saveas-"+w,disabled:true,handler:function(){this.savePatch("all",w,m,n,"AF",this)}},"->",{tooltip:"<b>Re-indent</b> all this file",iconCls:"iconIndent",handler:function(){Ext.getCmp("AF-FILE-"+w).reIndentAll()}}]};if(q.attributes.extension==="gif"||q.attributes.extension==="png"){x={xtype:"panel",layout:"fit",bodyStyle:"padding:5px 5px 0",html:'<img src="/data/'+this.userLoggin+"/phpdoc-"+this.userLang+m+'" />'};s={}}Ext.getCmp("main-panel").add({closable:true,title:n,originTitle:n,tabTip:"in "+m,iconCls:"AllFiles",id:"AF-"+w,layout:"border",defaults:{collapsible:true,split:true},items:[x,s]});Ext.getCmp("main-panel").setActiveTab("AF-"+w)}else{Ext.getCmp("main-panel").setActiveTab("AF-"+w)}}}}});this.treeSort=new Ext.tree.TreeSorter(this.treeAllFiles,{folderSort:true});this.treeAllFilesRoot=new Ext.tree.AsyncTreeNode({text:"Repository",draggable:false,id:"/"});this.treeAllFiles.setRootNode(this.treeAllFilesRoot);b=new Ext.menu.Menu({id:"mainMenu",it! ems:[{scope:this,text:"Refresh all data",iconCls:"refresh",tooltip:"<b >Refresh all data</b><br>Cvs update & apply all tools",handler:this.WinUpdate},{scope:this,text:"Check Build",iconCls:"checkBuild",tooltip:"<b>Check your build</b> using configure.php script",handler:this.WinCheckBuild},"-",{scope:this,text:"Configure",iconCls:"iconConf",tooltip:"<b>Configure</b> this tool",id:"winconf-btn",handler:this.WinConf},"-",{scope:this,text:"Erase my personal data",iconCls:"iconErasePersonalData",tooltip:"<b>Log out</b>",handler:function(){Ext.MessageBox.confirm("Confirm","This action will erase your personal data. All content about this account will be deleted definitively. Are you sure you want to do that ?",function(m){if(m==="yes"){Ext.getBody().mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Please, wait...');Ext.Ajax.request({url:"./php/controler.php",params:{task:"erase-personal-data"},success:function(n){Ext.getBody().unmask();var p=Ext.util.JSON.decode(n.responseText);if(p.success){Ext.MessageBox.show({title:"Thanks !",! msg:"Thank you for using this application !",icon:Ext.MessageBox.INFO,buttons:Ext.MessageBox.OK,fn:function(){window.location.href="/logout.php"}})}}})}})}},"-",{text:"Log out",iconCls:"iconLogOut",tooltip:"<b>Log out</b>",handler:function(){Ext.MessageBox.confirm("Confirm","Are you sure you want to logout?",function(m){if(m==="yes"){window.location.href="/logout.php"}})}},"-",{scope:this,text:"About",iconCls:"iconHelp",tooltip:"<b>About</b><br/>"+this.appName,id:"winabout-btn",handler:function(){this.WinAbout()}}]});d=new Ext.Viewport({layout:"border",items:[{region:"north",html:'<h1 class="x-panel-header"><img src="/img/mini_php.png" style="vertical-align: middle;" /> '+this.appName+"</h1>",autoHeight:true,border:false,margins:"0 0 5 0"},{region:"west",collapsible:true,collapseMode:"mini",animate:true,split:true,layout:"fit",width:300,autoScroll:true,items:[{layout:"accordion",animate:true,bodyBorder:false,border:false,tbar:[{text:"Main Menu",iconCls:"MainMenu"! ,menu:b}],items:[{title:'Files Need Update - <em id="acc-need-update-n b">0</em>',id:"acc-need-update",layout:"fit",iconCls:"FilesNeedUpdate",items:[l],collapsed:true},{title:'Error in current translation - <em id="acc-error-nb">0</em>',id:"acc-error",layout:"fit",iconCls:"FilesError",items:[j],collapsed:true},{title:'Files Need Reviewed - <em id="acc-need-reviewed-nb">0</em>',id:"acc-need-reviewed",layout:"fit",iconCls:"FilesNeedReviewed",items:[h],collapsed:true},{title:"All files",id:"acc-all-files",layout:"fit",iconCls:"AllFiles",items:[this.treeAllFiles],collapsed:true},{title:'Pending for commit - <em id="acc-pendingCommit-nb">0</em>',id:"acc-need-pendingCommit",layout:"fit",iconCls:"PendingCommit",items:[c],collapsed:true},{title:'Pending Patch - <em id="acc-pendingPatch-nb">0</em>',id:"acc-need-pendingPatch",layout:"fit",iconCls:"PendingPatch",items:[a],collapsed:true}]}]},{region:"center",xtype:"tabpanel",id:"main-panel",activeTab:0,enableTabScroll:true,plugins:new Ext.ux.TabCloseMenu(),listeners:{scope:this,beforeremove:this.removeTab! Event},items:[{title:"Home",baseCls:"MainInfoTabPanel",xtype:"panel",autoScroll:true,id:"MainInfoTabPanel",plain:true,items:[{xtype:"panel",border:false,html:'<div class="res-block"><div class="res-block-inner"><h3>Connected as <em>'+this.userLoggin+"</em></h3></div></div>"},{xtype:"tabpanel",activeTab:0,plain:true,autoScroll:true,height:400,border:false,defaults:{border:true},items:[g,f,i,e,k]}]}]}]})}}}();Ext.EventManager.onDocumentReady(phpDoc.init,phpDoc,true); \ No newline at end of file +var phpDoc=function(){Ext.QuickTips.init();Ext.BLANK_IMAGE_URL="/extjs/resources/images/default/s.gif";return{TaskPing:"",storeCommitLogMessage:"",storeFilesError:"",storeFilesNeedUpdate:"",storeFilesNeedReviewed:"",storePendingCommit:"",storePendingPatch:"",storeMailing:"",storeBugs:"",storeTranslators:"",storeSummary:"",userLoggin:"",userLang:"",appName:"PhpDocumentation Online Editor",appVer:"0.2",userConf:{conf_needupdate_diff:"using-exec",conf_needupdate_scrollbars:true,conf_error_skipnbliteraltag:true,conf_error_scrollbars:true,conf_reviewed_scrollbars:true,conf_patch_scrollbars:true,conf_theme:"xtheme-default.css"},treeAllFiles:"",treeSort:"",treeAllFilesRoot:"",filePendingOpen:"",init:function(){Ext.getBody().on("contextmenu",function(a){a.stopEvent()},this);Ext.Ajax.request({scope:this,url:"./php/controller.php",params:{task:"get-conf"},success:function(a){var b=Ext.util.JSON.decode(a.responseText);if(b.success){this.userLoggin=b.mess.userLoggin;this.userLang=b.mes! s.userLang;this.userConf.conf_needupdate_diff=b.mess.userConf.conf_needupdate_diff;this.userConf.conf_needupdate_scrollbars=b.mess.userConf.conf_needupdate_scrollbars;this.userConf.conf_error_skipnbliteraltag=b.mess.userConf.conf_error_skipnbliteraltag;this.userConf.conf_error_scrollbars=b.mess.userConf.conf_error_scrollbars;this.userConf.conf_reviewed_scrollbars=b.mess.userConf.conf_reviewed_scrollbars;this.userConf.conf_theme=b.mess.userConf.conf_theme;Ext.util.CSS.swapStyleSheet("appTheme",this.userConf.conf_theme);this.loadDataStore();this.drawInterface()}}})},loadDataStore:function(){this.storeCommitLogMessage=new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:"/php/controller.php"}),baseParams:{task:"get-commit-log-message"},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"text",mapping:"text"}])});this.storeFilesError=new Ext.data.GroupingStore({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/cont! roller.php"}),baseParams:{task:"GetFilesError"},reader:new Ext.data.Js onReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"path",mapping:"path"},{name:"name",mapping:"name"},{name:"maintainer",mapping:"maintainer"},{name:"type",mapping:"type"},{name:"value_en",mapping:"value_en"},{name:"value_lang",mapping:"value_lang"},{name:"needcommit",mapping:"needcommit"}]),sortInfo:{field:"path",direction:"ASC"},groupField:"path",listeners:{datachanged:function(a){Ext.getDom("acc-error-nb").innerHTML=a.getCount()}}});this.storeFilesNeedUpdate=new Ext.data.GroupingStore({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controller.php"}),baseParams:{task:"GetFilesNeedUpdate"},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"path",mapping:"path"},{name:"name",mapping:"name"},{name:"revision",mapping:"revision"},{name:"en_revision",mapping:"en_revision"},{name:"maintainer",mapping:"maintainer"},{name:"needcommit",mapping:"needcommit"},{name:"isCritical",map! ping:"isCritical"}]),sortInfo:{field:"path",direction:"ASC"},groupField:"path",listeners:{datachanged:function(a){Ext.getDom("acc-need-update-nb").innerHTML=a.getCount()}}});this.storePendingCommit=new Ext.data.GroupingStore({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controller.php"}),baseParams:{task:"GetFilesPendingCommit"},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"path",mapping:"path"},{name:"name",mapping:"name"},{name:"by",mapping:"by"},{name:"date",mapping:"date"}]),sortInfo:{field:"path",direction:"ASC"},groupField:"path",listeners:{datachanged:function(a){Ext.getDom("acc-pendingCommit-nb").innerHTML=a.getCount()},add:function(a){Ext.getDom("acc-pendingCommit-nb").innerHTML=a.getCount()}}});this.storePendingPatch=new Ext.data.GroupingStore({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controller.php"}),baseParams:{task:"GetFilesPendingPatch"},reader:new Ext.data.JsonReader({root! :"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{n ame:"path",mapping:"path"},{name:"name",mapping:"name"},{name:"by",mapping:"by"},{name:"uniqID",mapping:"uniqID"},{name:"date",mapping:"date"}]),sortInfo:{field:"path",direction:"ASC"},groupField:"path",listeners:{datachanged:function(a){Ext.getDom("acc-pendingPatch-nb").innerHTML=a.getCount()},add:function(a){Ext.getDom("acc-pendingPatch-nb").innerHTML=a.getCount()}}});this.storeFilesNeedReviewed=new Ext.data.GroupingStore({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controller.php"}),baseParams:{task:"GetFilesNeedReviewed"},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"path",mapping:"path"},{name:"name",mapping:"name"},{name:"reviewed",mapping:"reviewed"},{name:"maintainer",mapping:"maintainer"},{name:"needcommit",mapping:"needcommit"}]),sortInfo:{field:"path",direction:"ASC"},groupField:"path",listeners:{datachanged:function(a){Ext.getDom("acc-need-reviewed-nb").innerHTML=a.getCount()}}});this.stor! eMailing=new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:"/php/controller.php"}),baseParams:{task:"get-mailing-info"},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"title",mapping:"title"},{name:"link",mapping:"link"},{name:"description",mapping:"description"},{name:"pubDate",mapping:"pubDate",type:"date",dateFormat:"Y/m/d H:i:s"}])});this.storeMailing.setDefaultSort("pubDate","desc");this.storeBugs=new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:"/php/controller.php"}),baseParams:{task:"get-open-bugs"},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"title",mapping:"title"},{name:"link",mapping:"link"},{name:"description",mapping:"description"}])});this.storeTranslators=new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:"/php/controller.php"}),baseParams:{task:"get-translator-info"},reader:new Ext.data.JsonReader({root:"Items",totalPr! operty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"name",mappi ng:"name"},{name:"email",mapping:"mail"},{name:"nick",mapping:"nick"},{name:"cvs",mapping:"cvs"},{name:"uptodate",mapping:"uptodate",type:"int"},{name:"old",mapping:"old",type:"int"},{name:"critical",mapping:"critical",type:"int"},{name:"sum",mapping:"sum",type:"int"}])});this.storeTranslators.setDefaultSort("nick","asc");this.storeSummary=new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:"/php/controller.php"}),baseParams:{task:"get-summary-info"},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"libel",mapping:"libel"},{name:"nbFiles",mapping:"nbFiles"},{name:"percentFiles",mapping:"percentFiles"},{name:"sizeFiles",mapping:"sizeFiles"},{name:"percentSize",mapping:"percentSize"}])})},openFile:function(d,a){Ext.getCmp("acc-all-files").expand();var c=d.split("/");function b(f,e){f.expand(false,true,function(h){var g;h.ensureVisible();if(c[0]&&c[0]!==""){for(g=0;g<h.childNodes.length;g=g+1){if(h.childNodes[g].tex! t===c[0]){c.shift();b(h.childNodes[g],e)}}}else{for(g=0;g<h.childNodes.length;g=g+1){if(h.childNodes[g].text===a){h.childNodes[g].ensureVisible();h.childNodes[g].ui.highlight();e.treeAllFiles.fireEvent("dblclick",h.childNodes[g])}}}})}b(this.treeAllFilesRoot,this)},rejectPatch:function(f,d,a,e,g,c){function b(h){if(h==="yes"){var i=Ext.MessageBox.wait("Please, wait...");Ext.Ajax.request({scope:c,url:"../php/controller.php",params:{task:"after-patch-reject",PatchUniqID:e},success:function(){this.storePendingPatch.remove(this.storePendingPatch.getAt(g));this.storePendingPatch.fireEvent("add",this.storePendingPatch);Ext.getCmp("main-panel").remove("PP-"+f);i.hide()}})}}Ext.MessageBox.confirm("Confirm","This action will <b>reject</b> this patch, send an email to his author and close this tab.",b,c)},saveFileViaPatch:function(e,c,a,d,g,b){function f(h){if(h==="yes"){Ext.getCmp("PP-PATCH-PANEL-btn-save-"+e).disable();Ext.getCmp("PP-PATCH-"+e).isModified=false;Ext.getCmp("PP-PATCH! -PANEL-"+e).setTitle(Ext.getCmp("PP-PATCH-PANEL-"+e).originTitle);Ext. getCmp("PP-"+e).setTitle(Ext.getCmp("PP-"+e).originTitle);var i=Ext.MessageBox.wait("Saving data...");Ext.Ajax.request({scope:b,url:"../php/controller.php",params:{task:"save-file",filePath:c,fileName:a,fileLang:"all",fileContent:Ext.getCmp("PP-PATCH-"+e).getCode()},success:function(k,j){var l=Ext.util.JSON.decode(k.responseText);if(l.success){this.addToPendingCommit(c,a);this.storePendingPatch.remove(this.storePendingPatch.getAt(g));this.storePendingPatch.fireEvent("add",this.storePendingPatch);Ext.Ajax.request({scope:b,url:"../php/controller.php",params:{task:"after-patch-accept",PatchUniqID:d}});i.hide();Ext.getCmp("main-panel").remove("PP-"+e)}}})}}Ext.MessageBox.confirm("Confirm","This action will accept this patch, send an email to his author, save the file and close this tab.",f,b)},saveEnFile:function(e,c,a,d,g,b){Ext.getCmp(d+"-EN-PANEL-btn-save-"+e).disable();Ext.getCmp(d+"-"+e).isModifiedEn=false;Ext.getCmp(d+"-EN-PANEL-"+e).setTitle(Ext.getCmp(d+"-EN-PANEL-"+e).o! riginTitle);if(!Ext.getCmp(d+"-"+e).isModifiedEn&&!Ext.getCmp(d+"-"+e).isModifiedLang){Ext.getCmp(d+"-"+e).setTitle(Ext.getCmp(d+"-"+e).originTitle)}var f=Ext.MessageBox.wait("Saving data...");Ext.Ajax.request({scope:b,url:"../php/controller.php",params:{task:"save-file",filePath:c,fileName:a,fileLang:"en",fileContent:Ext.getCmp(d+"-EN-"+e).getCode()},success:function(i,h){var j=Ext.util.JSON.decode(i.responseText);if(j.success){if(d==="FNU"){this.storeFilesNeedUpdate.getAt(g).set("en_revision","1."+j.en_revision);this.storeFilesNeedUpdate.getAt(g).set("needcommit",true)}if(d==="FE"){this.storeFilesError.getAt(g).set("needcommit",true)}if(d==="FNR"){this.storeFilesNeedReviewed.getAt(g).set("needcommit",true)}this.addToPendingCommit("en"+c,a);f.hide()}}})},savePatch:function(d,g,a,c,h,i){var b,f,e;if(d==="en"){b="-EN"}else{if(d==="all"){b=""}else{b="-LANG"}}if(i.userLoggin!=="cvsread"){f=i.userLoggin+"@php.net"}e=new Ext.Window({title:"Do you want to be alerted ?",iconCls:"p! atchAlert",width:350,height:150,resizable:false,modal:true,autoScroll: true,bodyStyle:"padding: 5px;",layout:"form",labelWidth:50,items:[{xtype:"panel",baseCls:"x-plain",bodyStyle:"padding-bottom: 10px;",html:"If you want to be notified when your patch will be dealt with, thank you to leave an email address below."},{xtype:"textfield",fieldLabel:"Email",name:"patch-email-alert",anchor:"100%",value:f}],buttons:[{text:"Save",handler:function(){var j,k;j=this.ownerCt.items.items[1].getValue();k=Ext.MessageBox.wait("Saving data as a patch...");e.close();if(d!=="all"){Ext.getCmp(h+b+"-PANEL-btn-saveas-"+g).disable();Ext.getCmp(h+b+"-"+g).isModifiedLang=false;Ext.getCmp(h+b+"-PANEL-"+g).setTitle(Ext.getCmp(h+b+"-PANEL-"+g).originTitle);Ext.getCmp(h+"-"+g).setTitle(Ext.getCmp(h+"-"+g).originTitle)}else{Ext.getCmp("AF-PANEL-btn-saveas-"+g).disable();Ext.getCmp("AF-FILE-"+g).isModified=false;Ext.getCmp("AF-PANEL-"+g).setTitle(Ext.getCmp("AF-PANEL-"+g).originTitle);Ext.getCmp("AF-"+g).setTitle(Ext.getCmp("AF-"+g).originTitle)}Ext.Ajax.request({scope:i,ur! l:"../php/controller.php",params:{task:"save-file",filePath:a,fileName:c,fileLang:d,fileContent:(d!=="all")?Ext.getCmp(h+b+"-"+g).getCode():Ext.getCmp("AF-FILE-"+g).getCode(),type:"patch",emailAlert:j},success:function(m,l){var n=Ext.util.JSON.decode(m.responseText);if(n.success){if(d!=="all"){this.addToPendingPatch(d+a,c,n.uniqID)}else{this.addToPendingPatch(a,c,n.uniqID)}k.hide()}}})}},{text:"Cancel",handler:function(){e.close()}}]});e.show()},saveLangFile:function(f,d,b,e,g,c){function a(h){if(h==="no"){Ext.getCmp(e+"-LANG-PANEL-btn-save-"+f).disable();Ext.getCmp(e+"-"+f).isModifiedLang=false;Ext.getCmp(e+"-LANG-PANEL-"+f).setTitle(Ext.getCmp(e+"-LANG-PANEL-"+f).originTitle);if(!Ext.getCmp(e+"-"+f).isModifiedEn&&!Ext.getCmp(e+"-"+f).isModifiedLang){Ext.getCmp(e+"-"+f).setTitle(Ext.getCmp(e+"-"+f).originTitle)}var i=Ext.MessageBox.wait("Saving data...");Ext.Ajax.request({scope:this,url:"../php/controller.php",params:{task:"save-file",filePath:d,fileName:b,fileLang:this.us! erLang,fileContent:Ext.getCmp(e+"-LANG-"+f).getCode()},success:functio n(k,j){var l=Ext.util.JSON.decode(k.responseText);if(l.success){if(e==="FE"){this.storeFilesError.getAt(g).set("needcommit",true);this.storeFilesError.getAt(g).set("maintainer",l.maintainer)}if(e==="FNU"){this.storeFilesNeedUpdate.getAt(g).set("revision","1."+l.new_revision);this.storeFilesNeedUpdate.getAt(g).set("needcommit",true);this.storeFilesNeedUpdate.getAt(g).set("maintainer",l.maintainer)}if(e==="FNR"){this.storeFilesNeedReviewed.getAt(g).set("needcommit",true);this.storeFilesNeedReviewed.getAt(g).set("maintainer",l.maintainer);this.storeFilesNeedReviewed.getAt(g).set("reviewed",l.reviewed)}this.addToPendingCommit(this.userLang+d,b);i.hide()}}})}else{if(h==="yes"){Ext.getBody().mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Checking for error. Please, wait...');Ext.getCmp(e+"-LANG-PANEL-btn-save-"+f).disable();Ext.getCmp(e+"-"+f).isModifiedLang=false;Ext.getCmp(e+"-LANG-PANEL-"+f).setTitle(Ext.getCmp(e+"-LANG-PANEL-"+f).originTitle);if(!Ext.getC! mp(e+"-"+f).isModifiedEn&&!Ext.getCmp(e+"-"+f).isModifiedLang){Ext.getCmp(e+"-"+f).setTitle(Ext.getCmp(e+"-"+f).originTitle)}Ext.Ajax.request({scope:this,url:"../php/controller.php",params:{task:"check-file-error",FilePath:d,FileName:b,FileLang:this.userLang,FileContent:Ext.getCmp(e+"-LANG-"+f).getCode()},success:function(k,j){Ext.getBody().unmask();var l=Ext.util.JSON.decode(k.responseText);if(l.success){if(l.error&&l.error_first!=="-No error-"){Ext.getCmp("main-panel").add({closable:true,title:"Error in "+b,iconCls:"FilesError",id:"FE-help-"+f,autoScroll:true,autoLoad:"/error_type.php?dir="+d+"&file="+b});Ext.getCmp("main-panel").setActiveTab("FE-help-"+f);this.storeFilesError.reload()}else{Ext.MessageBox.show({title:"Check for errors",msg:"There is no error.",buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.INFO})}Ext.Ajax.request({scope:this,url:"../php/controller.php",params:{task:"save-file",filePath:d,fileName:b,fileLang:this.userLang,fileContent:Ext.getCmp(e+"-LANG-"+f! ).getCode()},success:function(n,m){var p=Ext.util.JSON.decode(n.respon seText);if(p.success){if(e==="FE"){this.storeFilesError.getAt(g).set("needcommit",true);this.storeFilesError.getAt(g).set("maintainer",p.maintainer)}if(e==="FNU"){this.storeFilesNeedUpdate.getAt(g).set("revision","1."+p.new_revision);this.storeFilesNeedUpdate.getAt(g).set("needcommit",true);this.storeFilesNeedUpdate.getAt(g).set("maintainer",p.maintainer)}if(e==="FNR"){this.storeFilesNeedReviewed.getAt(g).set("needcommit",true);this.storeFilesNeedReviewed.getAt(g).set("maintainer",p.maintainer);this.storeFilesNeedReviewed.getAt(g).set("reviewed",p.reviewed)}this.addToPendingCommit(this.userLang+d,b)}}});if(e==="FE"){Ext.getCmp(e+"-error-type-"+f).setSrc("/error_type.php?dir="+d+"&file="+b+"&nocache="+new Date().getTime())}}}})}}}Ext.MessageBox.show({scope:c,title:"Confirm",msg:"Do you want to check for error before saving ?",icon:Ext.MessageBox.INFO,buttons:Ext.MessageBox.YESNOCANCEL,fn:a})},getFile:function(e,d,a,c,b){Ext.get(c+e).mask('<img src="/img/loading.gif" style="ve! rtical-align: middle;" /> Loading...');Ext.Ajax.request({scope:this,url:"../php/controller.php",params:{task:"get-file",FilePath:d,FileName:a},success:function(h,g){var i,f;i=Ext.util.JSON.decode(h.responseText);if(i.success){Ext.getCmp(b+e).setCode(i.content);Ext.get(c+e).unmask();if(c==="FE-LANG-PANEL-"||c==="FNR-LANG-PANEL-"||c==="FNR-EN-PANEL-"||c==="AF-PANEL-"){f=Ext.getCmp(c+e).getSize();f.height=f.height+1;Ext.getCmp(c+e).setSize(f);Ext.getCmp(c+e).fireEvent("resize")}}},callback:function(){if(this.filePendingOpen[0]){this.filePendingOpen.shift();if(this.filePendingOpen[0]){if(this.filePendingOpen[0][0]){this.openFile(this.filePendingOpen[0][0],this.filePendingOpen[0][1])}}}}})},addToPendingPatch:function(b,a,e){var d,c;d=new Date();c=new this.storePendingPatch.recordType({id:Ext.id("",""),path:b,name:a,by:this.userLoggin,uniqID:e,date:d.format("Y-m-d H:i:s")});this.storePendingPatch.insert(0,c)},addToPendingCommit:function(d,a){var c,e,b;c=false;this.storePendingCom! mit.each(function(f){if(f.data.path===d&&f.data.name===a){c=true}});if (!c){e=new Date();b=new this.storePendingCommit.recordType({id:Ext.id("",""),path:d,name:a,by:this.userLoggin,date:e.format("Y-m-d H:i:s")});this.storePendingCommit.insert(0,b)}},rendererNumUptodate:function(a){if(a==="0"){return}else{return'<span style="color:green; font-weight: bold;">'+a+"</span>"}},rendererNumCritical:function(a){if(a==="0"){return}else{return'<span style="color:red; font-weight: bold;">'+a+"</span>"}},rendererTotalTranslator:function(a,c,b){return a?((a===0||a>1)?"("+a+" Translators)":"(1 Translator)"):""},rendererSum:function(a){return(a==="0")?"":a},NewTabBugs:function(a,b,c){Ext.getCmp("main-panel").add({xtype:"iframepanel",id:"mifp_bugs_"+a,title:"Loading...",tabTip:c,iconCls:"iconBugs",loadMask:true,defaultSrc:b,listeners:{documentloaded:function(d){d.ownerCt.setTitle(Ext.util.Format.substr(c,0,20)+"...")}}});Ext.getCmp("main-panel").setActiveTab("mifp_bugs_"+a)},NewTabMailing:function(a,c,b){Ext.getCmp("main-panel").add({xtype:"iframepanel",id:"mi! fp_"+a,title:"Loading...",tabTip:b,iconCls:"home-mailing-title",loadMask:true,defaultSrc:c,listeners:{documentloaded:function(d){d.ownerCt.setTitle(Ext.util.Format.substr(b,0,20)+"...")}}});Ext.getCmp("main-panel").setActiveTab("mifp_"+a)},winDiff:function(d,b,c,a){Ext.getBody().mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Finding the diff. Please, wait...');Ext.Ajax.request({url:"./php/controller.php",params:{task:"get-diff2",FilePath:d,FileName:b,Rev1:c,Rev2:a},success:function(f){var g,e;g=Ext.util.JSON.decode(f.responseText);if(g.success){Ext.getBody().unmask();e=new Ext.Window({title:"Diff between "+c+" & "+a,width:650,height:350,resizable:false,modal:true,autoScroll:true,bodyStyle:"background-color: white; padding: 5px;",html:'<div class="diff-content">'+g.content+"</div>",buttons:[{text:"Close",handler:function(){e.close()}}]});e.show()}},failure:function(){}})},removeTabEvent:function(d,e){var b,c,f,a;a=e.id.split("-");if((a[0]==="FE"||a[0]==! ="FNU"||a[0]==="FNR"||a[0]==="PP")&&a[1]!=="help"){if(a[0]==="FE"){b=E xt.getCmp("FE-"+a[1]).isModifiedLang}if(a[0]==="FNU"){b=Ext.getCmp("FNU-"+a[1]).isModifiedLang}if(a[0]==="FNR"){b=Ext.getCmp("FNR-"+a[1]).isModifiedLang}if(a[0]==="FE"){c=Ext.getCmp("FE-"+a[1]).isModifiedEn}if(a[0]==="FNU"){c=Ext.getCmp("FNU-"+a[1]).isModifiedEn}if(a[0]==="FNR"){c=Ext.getCmp("FNR-"+a[1]).isModifiedEn}if(a[0]==="PP"){f=Ext.getCmp("PP-PATCH-"+a[1]).isModified}if(c||b||f){Ext.Msg.show({scope:this,title:"Confirm",msg:"This file has been modified without being saved.<br/>Do you really want to close?",buttons:Ext.Msg.YESNO,icon:Ext.Msg.QUESTION,fn:function(g,h){if(g==="yes"){d.un("beforeremove",this.removeTabEvent,this);d.remove(e);d.addListener("beforeremove",this.removeTabEvent,this)}}})}else{return true}return false}else{return true}},WinCommit:function(i,h,e){var f,c,g,a,b,d;c=Ext.get("acc-need-update");if(!f){f=new Ext.Window({scope:this,id:"winCvsCommit",title:"CVS commit",closable:false,layout:"form",width:400,height:480,resizable:false,modal:true,bodyStyle! :"padding:5px 5px 0",labelAlign:"top",items:[{xtype:"checktreepanel",id:"tree-panel",anchor:"100%",height:180,autoScroll:true,rootVisible:false,root:{text:"root",expanded:true,children:[]}},{scope:this,xtype:"combo",fieldLabel:"Older messages",editable:false,name:"first2",anchor:"100%",store:this.storeCommitLogMessage,triggerAction:"all",tpl:'<tpl for="."><div class="x-combo-list-item">{[values.text.split("\n").join("<br/>")]}</div></tpl>',valueField:"id",displayField:"text",listeners:{scope:this,render:function(){this.storeCommitLogMessage.load()},select:function(l,j,k){Ext.getCmp("form-commit-message-log").setValue(j.data.text)}}},{xtype:"textarea",id:"form-commit-message-log",fieldLabel:"Log message",name:"first3",anchor:"100%",height:150,value:""}],tools:[{scope:this,id:"gear",qtip:"Configure this tools",handler:function(){var m,k,l;function j(n){return n.split("\n").join("<br/>")}m=new Ext.form.TextArea({grow:true,growMin:120});k=new Ext.grid.ColumnModel([new Ext.grid.! RowNumberer(),{id:"GridManageLog",header:"Log Message",dataIndex:"text ",renderer:j,editor:new Ext.Editor(m,{shadow:false,autoSize:true,listeners:{scope:this,complete:function(p,q,o){var n=p.record.data.id;Ext.Ajax.request({scope:this,url:"../php/controller.php",params:{task:"save-LogMessage",messID:n,mess:q},success:function(s,r){var t=Ext.util.JSON.decode(s.responseText);if(t.success){this.storeCommitLogMessage.getById(n).commit()}}})}}})}]);l=new Ext.Window({title:"Manage Log Message",iconCls:"winManageLog",width:650,height:350,layout:"fit",resizable:false,modal:true,autoScroll:true,html:'<div class="diff-content"></div>',items:[{xtype:"editorgrid",store:this.storeCommitLogMessage,loadMask:true,cm:k,sm:new Ext.grid.RowSelectionModel({singleSelect:true}),autoExpandColumn:"GridManageLog",listeners:{scope:this,rowcontextmenu:function(n,q,o){o.stopEvent();n.getSelectionModel().selectRow(q);var p=new Ext.menu.Menu({items:[{text:"Delete this Log Message",iconCls:"iconDelete",scope:this,handler:function(){Ext.Ajax.request({scope:this,url:"../php/co! ntroller.php",params:{task:"delete-LogMessage",messID:this.storeCommitLogMessage.getAt(q).data.id},success:function(s,r){var t=Ext.util.JSON.decode(s.responseText);if(t.success){this.storeCommitLogMessage.remove(this.storeCommitLogMessage.getAt(q))}}})}}]});p.showAt(o.getXY())}}}],buttons:[{text:"Close",handler:function(){l.close()}}],listeners:{scope:this,close:function(){this.storeCommitLogMessage.reload()}}});l.show()}}],buttons:[{scope:this,text:"Submit",id:"win-commit-btn-submit",handler:function(){var j,n,q,s,k,l,o=[],r,p="",m;if(this.userLoggin==="cvsread"){f.close();Ext.MessageBox.show({title:"Cvsread restriction",msg:"You are logging in with Cvsread account.<br><br>You can't commit anything with this account.",icon:Ext.MessageBox.INFO,buttons:Ext.MessageBox.OK});return}j=Ext.getCmp("tree-panel").getValue();n=[];for(m=0;m<j.length;m=m+1){q=Ext.getCmp("tree-panel").getNodeById(j[m]).attributes;s="FE-"+Ext.util.md5("FE-"+q.FilePath+q.FileName);k="FNU-"+Ext.util.md5("F! NU-"+q.FilePath+q.FileName);l="FNR-"+Ext.util.md5("FNR-"+q.FilePath+q. FileName);if(Ext.getCmp("main-panel").findById(s)||Ext.getCmp("main-panel").findById(k)||Ext.getCmp("main-panel").findById(l)){if(Ext.getCmp("main-panel").findById(s)){r=s}if(Ext.getCmp("main-panel").findById(k)){r=k}if(Ext.getCmp("main-panel").findById(l)){r=l}o[0]=r;o[1]=q.FileName;n.push(o)}}if(n.length>0){for(m=0;m<n.length;m=m+1){p+=n[m][1]+"<br>"}Ext.MessageBox.show({scope:this,title:"Warning",msg:"There is "+n.length+" file"+((n.length>1)?"s":"")+" to close before commit.<br><br>"+p+"<br><br>Would you like I close it for you ?",icon:Ext.MessageBox.INFO,buttons:Ext.MessageBox.YESNOCANCEL,fn:function(t){if(t==="yes"){for(m=0;m<n.length;m=m+1){Ext.getCmp("main-panel").remove(n[m][0])}this.WinCommitLastStep(j,this)}else{return}}})}else{this.WinCommitLastStep(j,this)}return}},{text:"Close",id:"win-commit-btn-close",handler:function(){f.close()}}]})}f.show(c);if(i){a=this.storePendingCommit.getAt(h).data.path;b=this.storePendingCommit.getAt(h).data.name;g=Ext.util.md5(a+b);! d=new Ext.tree.TreeNode({id:"need-commit-"+g,text:a+b,FilePath:a,FileName:b,leaf:true,checked:true,uiProvider:Ext.ux.tree.CheckTreeNodeUI});Ext.getCmp("tree-panel").getRootNode().appendChild(d)}else{this.storePendingCommit.each(function(j){if(e&&e==="by me"&&j.data.by!==this.userLoggin){}else{a=j.data.path;b=j.data.name;g=Ext.util.md5(a+b);d=new Ext.tree.TreeNode({id:"need-commit-"+g,text:a+b,FilePath:a,FileName:b,leaf:true,checked:true,uiProvider:Ext.ux.tree.CheckTreeNodeUI});Ext.getCmp("tree-panel").getRootNode().appendChild(d)}},this)}},WinCommitLastStep:function(g,d){Ext.getBody().mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Please, wait until commit...');var a=[],f,c,e,b;for(b=0;b<g.length;b=b+1){f=Ext.getCmp("tree-panel").getNodeById(g[b]);c=[];c[0]=f.attributes.FilePath;c[1]=f.attributes.FileName;a.push(c)}e=Ext.getCmp("form-commit-message-log").getValue();Ext.getCmp("winCvsCommit").close();Ext.Ajax.request({url:"../php/controller.php",params:! {task:"cvs-commit",nodes:Ext.util.JSON.encode(a),logMessage:e},success :function(i){var j,h;j=Ext.util.JSON.decode(i.responseText);if(j.success){Ext.getBody().unmask();h=new Ext.Window({title:"Status",width:450,height:350,resizable:false,modal:true,autoScroll:true,bodyStyle:"background-color: white; padding: 5px;",html:j.mess.join("<br>"),buttons:[{text:"Close",handler:function(){h.close()}}]});h.show();Ext.Ajax.request({url:"../php/controller.php",params:{task:"on-succes-commit",nodes:Ext.util.JSON.encode(a),logMessage:e},success:function(k){d.storeFilesError.reload();d.storeFilesNeedReviewed.reload();d.storeFilesNeedUpdate.reload();d.storePendingCommit.reload();d.storeTranslators.reload();d.storeSummary.reload()}})}else{}}})},WinUpdate:function(){var e,d;function c(f){f.TaskPing.cancel();Ext.get("wizard-step-1").replaceClass("wizard-step-before","wizard-step-working");Ext.get("wizard-step-1.1").replaceClass("wizard-wait","wizard-show");Ext.Ajax.request({scope:f,url:"../php/controller.php",params:{task:"update-repo"},success:function(g){var h=! Ext.util.JSON.decode(g.responseText);if(h.success){Ext.get("wizard-step-1").replaceClass("wizard-step-working","wizard-step-done");Ext.get("wizard-step-1.1").replaceClass("wizard-show","wizard-wait");b(f)}},failure:function(){function h(){Ext.Ajax.request({scope:f,url:"../php/controller.php",params:{task:"check-lock-file",lockFile:"lock_update_repository"},success:function(i){var j=Ext.util.JSON.decode(i.responseText);if(!j.success){Ext.get("wizard-step-1").replaceClass("wizard-step-working","wizard-step-done");Ext.get("wizard-step-1.1").replaceClass("wizard-show","wizard-wait");b(this)}else{g.delay(5000)}},failure:function(){g.delay(5000)}})}var g=new Ext.util.DelayedTask(function(){h()});g.delay(5000)}})}function b(f){Ext.get("wizard-step-2").replaceClass("wizard-step-before","wizard-step-working");Ext.Ajax.request({scope:f,url:"../php/controller.php",params:{task:"apply-tools"},success:function(g){var h=Ext.util.JSON.decode(g.responseText);if(h.success){Ext.get("wizard-s! tep-2").replaceClass("wizard-step-working","wizard-step-done");a(this) }},failure:function(){function h(){Ext.Ajax.request({scope:f,url:"../php/controller.php",params:{task:"check-lock-file",lockFile:"lock_apply_tools"},success:function(i){var j=Ext.util.JSON.decode(i.responseText);if(!j.success){Ext.get("wizard-step-2").replaceClass("wizard-step-working","wizard-step-done");a(this)}else{g.delay(5000)}},failure:function(){g.delay(5000)}})}var g=new Ext.util.DelayedTask(function(){h()});g.delay(5000)}})}function a(f){Ext.get("wizard-step-3").replaceClass("wizard-step-before","wizard-step-working");f.storeFilesNeedUpdate.reload();f.storeTranslators.reload();f.storeFilesError.reload();Ext.get("wizard-step-3").replaceClass("wizard-step-working","wizard-step-done");Ext.getCmp("btn-start-refresh").setIconClass("finishRefresh");Ext.getCmp("btn-start-refresh").setText("Finish !");Ext.getCmp("btn-start-refresh").setHandler(function(){e.close()});Ext.getCmp("btn-start-refresh").enable();f.TaskPing.delay(30000);e.tools.close.setVisible(true)}d=Ext.get("ac! c-need-update");if(!e){e=new Ext.Window({title:"Refresh all data",layout:"form",width:300,height:200,resizable:false,modal:true,bodyStyle:"padding:15px 15px 0",iconCls:"refresh",html:'<div id="wizard-step-1" class="wizard-step-before">Update all files from Cvs</div><div id="wizard-step-1.1" class="wizard-wait">This may take time. Thank you for your patience...</div><div id="wizard-step-2" class="wizard-step-before">Apply all tools</div><div id="wizard-step-3" class="wizard-step-before">Reload data</div>',buttons:[{scope:this,text:"Start",id:"btn-start-refresh",iconCls:"startRefresh",handler:function(){Ext.getCmp("btn-start-refresh").disable();e.tools.close.setVisible(false);c(this)}}]})}e.show(d)},WinCheckBuild:function(){var c,a;a=Ext.get("acc-need-update");function b(d){Ext.Ajax.request({scope:d,url:"./php/controller.php",params:{task:"get-logfile",file:"log_check_build"},success:function(f){var g,e;g=Ext.util.JSON.decode(f.responseText);if(g.success){this.TaskPing.delay(! 30000);e=new Ext.Window({title:"Status",width:450,height:350,resizable :false,modal:true,autoScroll:true,bodyStyle:"background-color: white; padding: 5px;",html:g.mess,buttons:[{text:"Close",handler:function(){e.close()}}]});e.show()}}})}if(!c){c=new Ext.Window({title:"Check Build",iconCls:"checkBuild",layout:"form",width:350,height:200,resizable:false,modal:true,bodyStyle:"padding:5px 5px 0",labelAlign:"top",buttons:[{scope:this,text:"Go !",id:"win-check-build-btn-submit",handler:function(){var d=Ext.getCmp("option-xml-details").checked;c.close();Ext.getBody().mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Please, wait until the build is checked...');this.TaskPing.cancel();Ext.Ajax.request({scope:this,url:"./php/controller.php",params:{task:"check-build",xmlDetails:d},success:function(e){var f=Ext.util.JSON.decode(e.responseText);if(f.success){Ext.getBody().unmask();b(this)}},failure:function(g){function e(){Ext.Ajax.request({url:"../php/controller.php",params:{task:"check-lock-file",lockFile:"lock_check_build"},success:f! unction(h){var i=Ext.util.JSON.decode(h.responseText);if(!i.success){Ext.getBody().unmask();b()}else{f.delay(5000)}},failure:function(){f.delay(5000)}})}var f=new Ext.util.DelayedTask(function(){e()});f.delay(5000)}})}}],items:[{xtype:"panel",baseCls:"x-plain",bodyStyle:"padding:5px 5px 0",html:"You're about to check the build via this command :<br/><br/>/usr/bin/php configure.php --with-lang="+this.userLang+"<br><br>",modal:false},{xtype:"checkbox",hideLabel:true,checked:false,boxLabel:"Enable detailed XML error messages",name:"option-xml-details",id:"option-xml-details"}]})}c.show(a)},WinConf:function(){var a,c,e,d,b;if(!a){b=new Ext.XTemplate('<tpl for=".">','<div class="thumb-wrap" id="tplMenu-{id}">','<div class="thumb"><img src="/img/{img}" title=""></div>',"<span>{label}</span></div>","</tpl>");b.compile();d=[["1","go-home.png","Main"],["2","edit-redo.png",'Module "Files Need Update"'],["3","dialog-cancel.png",'Module "Files with Error"'],["4","document-properties.pn! g",'Module "Files need Reviewed"'],["5","view-media-playlist.png",'Mod ule "Pending Patch"']];e=new Ext.data.SimpleStore({id:0,fields:[{name:"id"},{name:"img"},{name:"label"}]});e.loadData(d);c=new Ext.DataView({tpl:b,singleSelect:true,overClass:"x-view-over",itemSelector:"div.thumb-wrap",store:e,listeners:{selectionchange:function(f,g){var h=f.getSelectedRecords();Ext.getCmp("confCard").layout.setActiveItem("conf-card-"+h[0].data.id)}}});a=new Ext.Window({scope:this,layout:"border",width:550,height:400,iconCls:"iconConf",modal:true,title:"Configuration",plain:true,closeAction:"hide",listeners:{show:function(){c.select(c.getNode(0))}},items:[{scope:this,region:"west",width:190,id:"confMenu",autoScroll:true,items:c},{scope:this,layout:"slide",region:"center",id:"confCard",width:375,frame:true,activeItem:0,bbar:new Ext.StatusBar({defaultText:"All changes take effect immediately",defaultIconCls:"confStatusBar"}),items:[{scope:this,id:"conf-card-1",xtype:"form",bodyStyle:"padding: 10px;",items:[{xtype:"fieldset",title:"Themes",autoHeight:true,defau! lts:{hideLabel:true},items:[{xtype:"combo",store:new Ext.data.SimpleStore({fields:["themeFile",{name:"themeName",type:"string"}],data:[["/themes/black/css/xtheme-black.css","Black"],["xtheme-default.css","Default"],["/themes/darkgray/css/xtheme-darkgray.css","DarkGray"],["/extjs/resources/css/xtheme-gray.css","Gray"],["/themes/gray-extend/css/xtheme-gray-extend.css","Gray Extend"],["/themes/indigo/css/xtheme-indigo.css","Indigo"],["/themes/midnight/css/xtheme-midnight.css","Midnight"],["/themes/olive/css/xtheme-olive.css","Olive"],["/themes/purple/css/xtheme-purple.css","Purple"],["/extjs/resources/css/xtheme-slate.css","Slate"],["/themes/silverCherry/css/xtheme-silverCherry.css","SilverCherry"]]}),valueField:"themeFile",displayField:"themeName",triggerAction:"all",mode:"local",forceSelection:true,editable:false,fieldLabel:"fieldlabel",value:this.userConf.conf_theme,listeners:{scope:this,select:function(h,f,g){Ext.util.CSS.swapStyleSheet("appTheme",h.getValue());this.confUp! date("conf_theme",h.getValue())}}}]}]},{scope:this,id:"conf-card-2",xt ype:"form",bodyStyle:"padding: 10px;",items:[{xtype:"fieldset",title:"Diff view",autoHeight:true,defaults:{hideLabel:true},defaultType:"radio",items:[{scope:this,checked:(this.userConf.conf_needupdate_diff==="using-viewvc")?true:false,boxLabel:"Using ViewVc from php web site",name:"conf_needupdate_diff",inputValue:"using-viewvc",listeners:{scope:this,check:function(g){if(g.checked){this.confUpdate("conf_needupdate_diff",g.getRawValue())}}}},{checked:(this.userConf.conf_needupdate_diff==="using-exec")?true:false,boxLabel:"Using diff -kk -u command line",name:"conf_needupdate_diff",inputValue:"using-exec",listeners:{scope:this,check:function(g){if(g.checked){this.confUpdate("conf_needupdate_diff",g.getRawValue())}}}}]},{xtype:"fieldset",title:"Editor",autoHeight:true,defaults:{hideLabel:true},defaultType:"checkbox",items:[{scope:this,checked:(this.userConf.conf_needupdate_scrollbars==="true")?true:false,boxLabel:"Synchronize scroll bars",name:"conf_needupdate_scrollbars",liste! ners:{scope:this,check:function(g){this.confUpdate("conf_needupdate_scrollbars",g.getValue())}}}]}]},{id:"conf-card-3",xtype:"form",bodyStyle:"padding: 10px;",items:[{xtype:"fieldset",title:"Error type",autoHeight:true,defaults:{hideLabel:true},defaultType:"checkbox",items:[{scope:this,checked:(this.userConf.conf_error_skipnbliteraltag==="true")?true:false,boxLabel:"Skip nbLiteralTag error",name:"conf_error_skipnbliteraltag",listeners:{scope:this,check:function(g){this.confUpdate("conf_error_skipnbliteraltag",g.getValue())}}}]},{xtype:"fieldset",title:"Editor",autoHeight:true,defaults:{hideLabel:true},defaultType:"checkbox",items:[{scope:this,checked:(this.userConf.conf_error_scrollbars==="true")?true:false,boxLabel:"Synchronize scroll bars",name:"conf_error_scrollbars",listeners:{scope:this,check:function(g){this.confUpdate("conf_error_scrollbars",g.getValue())}}}]}]},{id:"conf-card-4",xtype:"form",bodyStyle:"padding: 10px;",items:[{xtype:"fieldset",title:"Editor",autoHeig! ht:true,defaults:{hideLabel:true},defaultType:"checkbox",items:[{scope :this,checked:(this.userConf.conf_reviewed_scrollbars==="true")?true:false,boxLabel:"Synchronize scroll bars",name:"conf_reviewed_scrollbars",listeners:{scope:this,check:function(g){this.confUpdate("conf_reviewed_scrollbars",g.getValue())}}}]}]},{id:"conf-card-5",xtype:"form",bodyStyle:"padding: 10px;",items:[{xtype:"fieldset",title:"Editor",autoHeight:true,defaults:{hideLabel:true},defaultType:"checkbox",items:[{scope:this,checked:(this.userConf.conf_patch_scrollbars==="true")?true:false,boxLabel:"Synchronize scroll bars",name:"conf_patch_scrollbars",listeners:{scope:this,check:function(g){this.confUpdate("conf_patch_scrollbars",g.getValue())}}}]}]}]}],buttons:[{text:"Close",handler:function(){a.hide()}}]})}a.show(Ext.get("winconf-btn"))},confUpdate:function(b,a){Ext.Ajax.request({scope:this,url:"../php/controller.php",params:{task:"conf-update",item:b,value:a},success:function(c){if(b==="conf_needupdate_diff"){this.userConf.conf_needupdate_diff=a}if(b==="conf_needupdate_sc! rollbars"){this.userConf.conf_needupdate_scrollbars=""+a+""}if(b==="conf_error_skipnbliteraltag"){this.userConf.conf_error_skipnbliteraltag=""+a+"";this.storeFilesError.reload()}if(b==="conf_error_scrollbars"){this.userConf.conf_error_scrollbars=""+a+""}if(b==="conf_reviewed_scrollbars"){this.userConf.conf_reviewed_scrollbars=""+a+""}if(b==="conf_patch_scrollbars"){this.userConf.conf_patch_scrollbars=""+a+""}}})},WinAbout:function(){var a;if(!a){a=new Ext.Window({layout:"fit",width:515,height:320,iconCls:"iconHelp",modal:true,title:"About "+this.appName,closeAction:"hide",plain:true,bodyStyle:"color:#000",items:new Ext.TabPanel({autoTabs:true,activeTab:0,border:false,defaults:{autoScroll:true},items:[{title:"About",html:'<div id="phd-oe-about"><img src="/img/logo.png" alt="'+this.appName+'" /></div><div id="phd-oe-about-info">'+this.appName+" ver "+this.appVer+' (c) 2008-2009, Yannick Torrèss - <a href="mailto:yannick@php.net">yannick@php.net</a></div>'},{title:"Cred! its",bodyStyle:"padding:15px",html:'<div id="phd-oe-credit"><ul><li><a href="http://extjs.com" target="_blank">ExtJs Team</a><div class="phd-oe-credit-info">Javascript FrameWork</div></li><li><a href="http://marijn.haverbeke.nl/codemirror/" target="_blank">CodeMirror</a><div class="phd-oe-credit-info">Code editor</div></li><li><a href="http://famfamfam.com" target="_blank">famfamfam.com</a><div class="phd-oe-credit-info">Icon pack</div></li></ul></div>'},{title:"License",autoLoad:{url:"/license_LGPL_v2.txt"}}]}),buttons:[{text:"Close",handler:function(){a.hide()}}]})}a.show(Ext.get("winabout-btn"))},sendEmail:function(b,a){var c,d;c=new Ext.form.FormPanel({baseCls:"x-plain",labelWidth:55,url:"save-form.php",defaultType:"textfield",items:[{fieldLabel:"Send To",name:"to",readOnly:true,anchor:"100%",value:'"'+b+'" <'+a+">"},{fieldLabel:"Subject",name:"subject",anchor:"100%"},{xtype:"textarea",hideLabel:true,name:"msg",anchor:"100% -53"}]});d=new Ext.Window({title:"Send an email",width:500,height:300,minWidth:300,minHeight:200,layout:"fit",plain:t! rue,bodyStyle:"padding:5px;",buttonAlign:"center",items:c,iconCls:"iconSendEmail",buttons:[{text:"Send",handler:function(){var e=c.getForm().getValues();Ext.Ajax.request({url:"./php/controller.php",params:{task:"send-email",to:e.to,subject:e.subject,msg:e.msg},success:function(f){var g=Ext.util.JSON.decode(f.responseText);if(g.success){d.close();Ext.MessageBox.alert("Status","Email sent to "+b+" with success!")}},failure:function(){}})}},{text:"Cancel",handler:function(){d.close()}}]});d.show()},drawInterface:function(){var j,l,a,c,h,g,f,i,e,k,b,d;this.TaskPing=new Ext.util.DelayedTask(function(){Ext.Ajax.request({url:"./php/controller.php",params:{task:"ping"},success:function(m){if(m.responseText!=="pong"){window.location.href="/login.php"}},failure:function(){window.location.href="/login.php"}});this.TaskPing.delay(30000)},this);this.TaskPing.delay(30000);j=new Ext.grid.GridPanel({store:this.storeFilesError,loadMask:true,columns:[{id:"name",header:"Files",sortable:true,d! ataIndex:"name"},{header:"Maintainer",width:45,sortable:true,dataIndex :"maintainer"},{header:"Type",width:45,sortable:true,dataIndex:"type"},{header:"Path",dataIndex:"path",hidden:true}],view:new Ext.grid.GroupingView({emptyText:'<div style="text-align: center;">No files</div>',forceFit:true,groupTextTpl:'{[values.rs[0].data["path"]]} ({[values.rs.length]} {[values.rs.length > 1 ? "Files" : "File"]})',getRowClass:function(m,p,o,n){if(m.data.needcommit){return"file-need-commit"}}}),autoExpandColumn:"name",bodyBorder:false,listeners:{scope:this,render:function(m){j.view.refresh()},rowdblclick:function(o,y,u){var n,p,v,t,w,m,s,r,q,z,x;n=this.storeFilesError.getAt(y).data.path;p=this.storeFilesError.getAt(y).data.name;v=Ext.util.md5("FE-"+this.userLang+n+p);t=this.storeFilesError.getAt(y).data.needcommit;if(!Ext.getCmp("main-panel").findById("FE-"+v)){w=[];this.storeFilesError.each(function(A){if(A.data.path===n&&A.data.name===p){if(!w[A.data.type]){w.push(A.data.type)}}});m=new Ext.data.Store({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php! /controller.php"}),baseParams:{task:"get-log",Path:this.userLang+n,File:p},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"revision",mapping:"revision"},{name:"date",mapping:"date",type:"date",dateFormat:"Y/m/d H:i:s"},{name:"author",mapping:"author"},{name:"content",mapping:"content"}])});m.setDefaultSort("date","desc");s=new Ext.data.Store({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controller.php"}),baseParams:{task:"get-log",Path:"en"+n,File:p},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"revision",mapping:"revision"},{name:"date",mapping:"date",type:"date",dateFormat:"Y/m/d H:i:s"},{name:"author",mapping:"author"},{name:"content",mapping:"content"}])});s.setDefaultSort("date","desc");r=new Ext.grid.CheckboxSelectionModel({singleSelect:false,width:22,header:"",listeners:{beforerowselect:function(B){var A=B.getCount();if(A===2){retur! n false}},rowselect:function(B){var A=B.getCount();if(A===2){Ext.getCm p("FE-PANEL-btn-logLang-"+v).enable();Ext.get("FE-PANEL-btn-logLang-"+v).frame("3F8538")}else{Ext.getCmp("FE-PANEL-btn-logLang-"+v).disable()}},rowdeselect:function(B){var A=B.getCount();if(A===2){Ext.getCmp("FE-PANEL-btn-logLang-"+v).enable();Ext.get("FE-PANEL-btn-logLang-"+v).frame("3F8538")}else{Ext.getCmp("FE-PANEL-btn-logLang-"+v).disable()}}}});q=new Ext.grid.GridPanel({store:m,loadMask:true,columns:[r,{id:"id",header:"Rev.",width:40,sortable:false,dataIndex:"revision"},{header:"Content",width:130,sortable:true,dataIndex:"content"},{header:"By",width:50,sortable:true,dataIndex:"author"},{header:"Date",width:85,sortable:true,dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y/m/d, H:i")}],autoHeight:true,autoExpandColumn:"content",bodyBorder:false,sm:r,view:new Ext.grid.GridView({forceFit:true}),tbar:[{scope:this,tooltip:"<b>View</b> the diff",iconCls:"iconViewDiff",id:"FE-PANEL-btn-logLang-"+v,disabled:true,handler:function(){var C,B,A;C=r.getSelections();B=C[0].! data.revision;A=C[1].data.revision;this.winDiff(this.userLang+n,p,B,A)}}]});z=new Ext.grid.CheckboxSelectionModel({singleSelect:false,width:22,header:"",listeners:{beforerowselect:function(B){var A=B.getCount();if(A===2){return false}},rowselect:function(B){var A=B.getCount();if(A===2){Ext.getCmp("FE-PANEL-btn-logEn-"+v).enable();Ext.get("FE-PANEL-btn-logEn-"+v).frame("3F8538")}else{Ext.getCmp("FE-PANEL-btn-logEn-"+v).disable()}},rowdeselect:function(B){var A=B.getCount();if(A===2){Ext.getCmp("FE-PANEL-btn-logEn-"+v).enable();Ext.get("FE-PANEL-btn-logEn-"+v).frame("3F8538")}else{Ext.getCmp("FE-PANEL-btn-logEn-"+v).disable()}}}});x=new Ext.grid.GridPanel({store:s,loadMask:true,columns:[z,{id:"id",header:"Rev.",width:40,sortable:false,dataIndex:"revision"},{header:"Content",width:130,sortable:true,dataIndex:"content"},{header:"By",width:50,sortable:true,dataIndex:"author"},{header:"Date",width:85,sortable:true,dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y/m/d, H:i! ")}],autoHeight:true,autoExpandColumn:"content",bodyBorder:false,sm:z, view:new Ext.grid.GridView({forceFit:true}),tbar:[{scope:this,tooltip:"<b>View</b> the diff",iconCls:"iconViewDiff",id:"FE-PANEL-btn-logEn-"+v,disabled:true,handler:function(){var C,B,A;C=z.getSelections();B=C[0].data.revision;A=C[1].data.revision;this.winDiff("en"+n,p,B,A)}}]});Ext.getCmp("main-panel").add({closable:true,title:p,originTitle:p,tabTip:"File with error : in "+n,iconCls:"iconTabError",id:"FE-"+v,isModifiedLang:false,isModifiedEn:false,layout:"border",defaults:{collapsible:true,split:true},items:[{xtype:"panel",layout:"fit",region:"north",title:"Error description",id:"FE-error-desc-"+v,height:150,collapsed:true,items:{xtype:"iframepanel",id:"FE-error-type-"+v,loadMask:true,defaultSrc:"/error_type.php?dir="+n+"&file="+p}},{region:"west",xtype:"panel",layout:"fit",bodyBorder:false,title:"CvsLog",collapsed:true,width:375,items:{xtype:"tabpanel",activeTab:0,tabPosition:"bottom",defaults:{autoScroll:true},items:[{layout:"fit",title:this.userLang,items:[q]},{layout:"f! it",title:"En",items:[x]}]}},{title:this.userLang+" File: "+n+p,originTitle:this.userLang+" File: "+n+p,collapsible:false,id:"FE-LANG-PANEL-"+v,region:"center",xtype:"form",height:"auto",width:"auto",items:[{xtype:"codemirror",id:"FE-LANG-"+v,listeners:{scope:this,initialize:function(A){this.getFile(v,this.userLang+n,p,"FE-LANG-PANEL-","FE-LANG-")},cmcursormove:function(){var A=Ext.util.JSON.decode(Ext.getCmp("FE-LANG-"+v).getCursorPosition());Ext.get("FE-LANG-status-line-"+v).dom.innerHTML=A.line;Ext.get("FE-LANG-status-col-"+v).dom.innerHTML=A.caracter},cmchange:function(D,B,C){var A=Ext.util.JSON.decode(Ext.getCmp("FE-LANG-"+v).getCursorPosition());Ext.get("FE-LANG-status-line-"+v).dom.innerHTML=A.line;Ext.get("FE-LANG-status-col-"+v).dom.innerHTML=A.caracter;if(D!==27&&D!==33&&D!==34&&D!==37&&D!==38&&D!==39&&D!==40&&D!==17&&D!==16&&D!==67){if(!Ext.getCmp("FE-"+v).isModifiedLang){Ext.getCmp("FE-LANG-PANEL-"+v).setTitle(Ext.getCmp("FE-LANG-PANEL-"+v).originTitle+' <span s! tyle="color:#ff0000; font-weight: bold;">[modified]</span>');Ext.getCm p("FE-"+v).setTitle(Ext.getCmp("FE-"+v).originTitle+' <t style="color:#ff0000; font-weight: bold;">*</t>');Ext.getCmp("FE-LANG-PANEL-btn-save-"+v).enable();Ext.get("FE-LANG-PANEL-btn-save-"+v).frame("3F8538");Ext.getCmp("FE-LANG-PANEL-btn-saveas-"+v).enable();Ext.get("FE-LANG-PANEL-btn-saveas-"+v).frame("3F8538");Ext.getCmp("FE-"+v).isModifiedLang=true}}},cmscroll:function(A){if(this.userConf.conf_error_scrollbars==="true"){Ext.getCmp("FE-EN-"+v).scrollTo(A)}}}}],bbar:[{scope:this,xtype:"checkbox",hideLabel:true,checked:(this.userConf.conf_error_scrollbars==="true")?true:false,boxLabel:"Synchronize scroll bars",name:"conf_error_scrollbars",listeners:{scope:this,check:function(A){this.confUpdate("conf_error_scrollbars",A.getValue())},render:function(A){Ext.DomHelper.insertHtml("beforeBegin",A.el.dom,'<div style="display: inline;" class="x-statusbar"><span class="x-status-text-panel">Line: <span id="FE-LANG-status-line-'+v+'">-</span></span> <span class="x-status-te! xt-panel">Col: <span id="FE-LANG-status-col-'+v+'">-</span></span></div> ')}}}],tbar:[{scope:this,tooltip:"<b>Save</b> this file",iconCls:"saveFile",id:"FE-LANG-PANEL-btn-save-"+v,disabled:true,handler:function(){this.saveLangFile(v,n,p,"FE",y,this)}},{scope:this,tooltip:"<b>Save as</b> a patch",iconCls:"saveAsFile",id:"FE-LANG-PANEL-btn-saveas-"+v,disabled:true,handler:function(){this.savePatch(this.userLang,v,n,p,"FE",this)}},"->",{tooltip:"<b>Re-indent</b> all this file",iconCls:"iconIndent",handler:function(){Ext.getCmp("FE-LANG-"+v).reIndentAll()}}]},{title:"En File: "+n+p,originTitle:"En File: "+n+p,collapsible:false,id:"FE-EN-PANEL-"+v,region:"east",xtype:"form",height:"auto",width:575,items:[{xtype:"codemirror",id:"FE-EN-"+v,listeners:{scope:this,initialize:function(A){this.getFile(v,"en"+n,p,"FE-EN-PANEL-","FE-EN-")},cmchange:function(D,B,C){var A=Ext.util.JSON.decode(Ext.getCmp("FE-EN-"+v).getCursorPosition());Ext.get("FE-EN-status-line-"+v).dom.innerHT! ML=A.line;Ext.get("FE-EN-status-col-"+v).dom.innerHTML=A.caracter;if(D !==27&&D!==33&&D!==34&&D!==37&&D!==38&&D!==39&&D!==40&&D!==17&&D!==16&&D!==67){if(!Ext.getCmp("FE-"+v).isModifiedEn){Ext.getCmp("FE-EN-PANEL-"+v).setTitle(Ext.getCmp("FE-EN-PANEL-"+v).originTitle+' <span style="color:#ff0000; font-weight: bold;">[modified]</span>');Ext.getCmp("FE-"+v).setTitle(Ext.getCmp("FE-"+v).originTitle+' <t style="color:#ff0000; font-weight: bold;">*</t>');Ext.getCmp("FE-EN-PANEL-btn-save-"+v).enable();Ext.get("FE-EN-PANEL-btn-save-"+v).frame("3F8538");Ext.getCmp("FE-EN-PANEL-btn-saveas-"+v).enable();Ext.get("FE-EN-PANEL-btn-saveas-"+v).frame("3F8538");Ext.getCmp("FE-"+v).isModifiedEn=true}}},cmscroll:function(A){if(this.userConf.conf_error_scrollbars==="true"){Ext.getCmp("FE-LANG-"+v).scrollTo(A)}},cmcursormove:function(B){var A=Ext.util.JSON.decode(Ext.getCmp("FE-EN-"+v).getCursorPosition());Ext.get("FE-EN-status-line-"+v).dom.innerHTML=A.line;Ext.get("FE-EN-status-col-"+v).dom.innerHTML=A.caracter}}}],bbar:[{scope:this,xtype:"panel",height:21,baseCl! s:"",bodyStyle:"padding-top:5px;",html:'<div style="display: inline;" class="x-statusbar"><span class="x-status-text-panel">Line: <span id="FE-EN-status-line-'+v+'">-</span></span> <span class="x-status-text-panel">Col: <span id="FE-EN-status-col-'+v+'">-</span></span></div> '}],tbar:[{scope:this,tooltip:"<b>Save</b> this file",iconCls:"saveFile",id:"FE-EN-PANEL-btn-save-"+v,disabled:true,handler:function(){this.saveEnFile(v,n,p,"FE",y,this)}},{scope:this,tooltip:"<b>Save as</b> a patch",iconCls:"saveAsFile",id:"FE-EN-PANEL-btn-saveas-"+v,disabled:true,handler:function(){this.savePatch("en",v,n,p,"FE",this)}},"->",{tooltip:"<b>Re-indent</b> all this file",iconCls:"iconIndent",handler:function(){Ext.getCmp("FE-EN-"+v).reIndentAll()}}]}]});Ext.getCmp("main-panel").setActiveTab("FE-"+v);if(Ext.getCmp("FE-"+v).getLayout().north.collapsedEl){Ext.getCmp("FE-"+v).getLayout().north.collapsedEl.addClass("x-layout-collapsed-east-error-desc")}}else{Ext.getCmp("ma! in-panel").setActiveTab("FE-"+v)}},rowcontextmenu:function(o,t,r){var p,m,q,n="",s;o.getSelectionModel().selectRow(t);p=this.storeFilesError.getAt(t).data.path;m=this.storeFilesError.getAt(t).data.name;q=Ext.util.md5("FE-"+p+m);if(this.storeFilesError.getAt(t).data.needcommit){n={text:"View Diff",iconCls:"iconViewDiff",scope:this,handler:function(){Ext.getCmp("main-panel").add({xtype:"panel",id:"diff_panel_"+t,title:"Diff",tabTip:"Diff",closable:true,autoScroll:true,iconCls:"iconTabLink",html:'<div id="diff_content_'+t+'" class="diff-content"></div>'});Ext.getCmp("main-panel").setActiveTab("diff_panel_"+t);Ext.get("diff_panel_"+t).mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Please, Wait...');Ext.Ajax.request({scope:this,url:"./php/controller.php",params:{task:"get-diff",FilePath:this.userLang+p,FileName:m},success:function(u){var v=Ext.util.JSON.decode(u.responseText);if(v.success){Ext.get("diff_content_"+t).dom.innerHTML=v.content;Ext.get("diff_panel_"+t).unmask()}},failure:function(){}})}}}s=new Ext.menu.Menu({items:! [{text:"<b>Edit in a new Tab</b>",iconCls:"FilesError",scope:this,handler:function(){j.fireEvent("rowdblclick",o,t,r)}},n,"-",{text:"About error type",iconCls:"iconHelp",scope:this,handler:function(){Ext.getCmp("main-panel").add({closable:true,title:"About error type",iconCls:"iconHelp",id:"FE-help-"+q,autoScroll:true,autoLoad:"/error_type.php"});Ext.getCmp("main-panel").setActiveTab("FE-help-"+q)}}]});s.showAt(r.getXY())}}});l=new Ext.grid.GridPanel({store:this.storeFilesNeedUpdate,loadMask:true,columns:[{id:"name",header:"Files",sortable:true,dataIndex:"name"},{header:"EN revision",width:45,sortable:true,dataIndex:"en_revision"},{header:Ext.util.Format.uppercase(this.userLang)+" revision",width:45,sortable:true,dataIndex:"revision"},{header:"Maintainer",width:45,sortable:true,dataIndex:"maintainer"},{header:"Path",dataIndex:"path",hidden:true}],view:new Ext.grid.GroupingView({forceFit:true,groupTextTpl:'{[values.rs[0].data["path"]]} ({[values.rs.length]} {[values.rs.lengt! h > 1 ? "Files" : "File"]})',getRowClass:function(m,p,o,n){if(m.data.n eedcommit){return"file-need-commit"}if(m.data.isCritical){return"file-critical"}},emptyText:'<div style="text-align: center;">No Files</div>'}),autoExpandColumn:"name",bodyBorder:false,listeners:{scope:this,rowcontextmenu:function(o,s,q){var p,m,n="",r;p=this.storeFilesNeedUpdate.getAt(s).data.path;m=this.storeFilesNeedUpdate.getAt(s).data.name;o.getSelectionModel().selectRow(s);if(this.storeFilesNeedUpdate.getAt(s).data.needcommit){n={text:"View Diff",iconCls:"iconViewDiff",scope:this,handler:function(){Ext.getCmp("main-panel").add({xtype:"panel",id:"diff_panel_"+s,title:"Diff",tabTip:"Diff",closable:true,autoScroll:true,iconCls:"iconTabLink",html:'<div id="diff_content_'+s+'" class="diff-content"></div>'});Ext.getCmp("main-panel").setActiveTab("diff_panel_"+s);Ext.get("diff_panel_"+s).mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Please, Wait...');Ext.Ajax.request({url:"./php/controller.php",params:{task:"get-diff",FilePath:this.userLang+p,FileName:m! },success:function(t){var u=Ext.util.JSON.decode(t.responseText);if(u.success){Ext.get("diff_content_"+s).dom.innerHTML=u.content;Ext.get("diff_panel_"+s).unmask()}},failure:function(){}})}}}r=new Ext.menu.Menu({items:[{text:"<b>Edit in a new Tab</b>",iconCls:"iconTabNeedUpdate",scope:this,handler:function(){l.fireEvent("rowdblclick",o,s,q)}},n]});q.stopEvent();r.showAt(q.getXY())},rowdblclick:function(o,x,v){var n,p,z,y,t,u,m,s,r,q,B,w,A;n=this.storeFilesNeedUpdate.getAt(x).data.path;p=this.storeFilesNeedUpdate.getAt(x).data.name;z=this.storeFilesNeedUpdate.getAt(x).data.en_revision;y=this.storeFilesNeedUpdate.getAt(x).data.revision;t=this.storeFilesNeedUpdate.getAt(x).data.needcommit;u=Ext.util.md5("FNU-"+this.userLang+n+p);if(!Ext.getCmp("main-panel").findById("FNU-"+u)){m=new Ext.data.Store({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controller.php"}),baseParams:{task:"get-log",Path:this.userLang+n,File:p},reader:new Ext.data.JsonReader({root:"Items",totalPro! perty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"revision",ma pping:"revision"},{name:"date",mapping:"date",type:"date",dateFormat:"Y/m/d H:i:s"},{name:"author",mapping:"author"},{name:"content",mapping:"content"}])});m.setDefaultSort("date","desc");s=new Ext.data.Store({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controller.php"}),baseParams:{task:"get-log",Path:"en"+n,File:p},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"revision",mapping:"revision"},{name:"date",mapping:"date",type:"date",dateFormat:"Y/m/d H:i:s"},{name:"author",mapping:"author"},{name:"content",mapping:"content"}])});s.setDefaultSort("date","desc");r=new Ext.grid.CheckboxSelectionModel({singleSelect:false,width:22,header:"",listeners:{beforerowselect:function(D){var C=D.getCount();if(C===2){return false}},rowselect:function(D){var C=D.getCount();if(C===2){Ext.getCmp("FNU-PANEL-btn-logLang-"+u).enable();Ext.get("FNU-PANEL-btn-logLang-"+u).frame("3F8538")}else{Ext.getCmp("FNU-PANEL-btn-logLang! -"+u).disable()}},rowdeselect:function(D){var C=D.getCount();if(C===2){Ext.getCmp("FNU-PANEL-btn-logLang-"+u).enable();Ext.get("FNU-PANEL-btn-logLang-"+u).frame("3F8538")}else{Ext.getCmp("FNU-PANEL-btn-logLang-"+u).disable()}}}});q=new Ext.grid.GridPanel({store:m,loadMask:true,columns:[r,{id:"id",header:"Rev.",width:40,sortable:false,dataIndex:"revision"},{header:"Content",width:130,sortable:true,dataIndex:"content"},{header:"By",width:50,sortable:true,dataIndex:"author"},{header:"Date",width:85,sortable:true,dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y/m/d, H:i")}],autoHeight:true,autoExpandColumn:"content",bodyBorder:false,sm:r,view:new Ext.grid.GridView({forceFit:true}),tbar:[{scope:this,tooltip:"<b>View</b> the diff",iconCls:"iconViewDiff",id:"FNU-PANEL-btn-logLang-"+u,disabled:true,handler:function(){var E,D,C;E=r.getSelections();D=E[0].data.revision;C=E[1].data.revision;this.winDiff(this.userLang+n,p,D,C)}}]});B=new Ext.grid.CheckboxSelectionModel({single! Select:false,width:22,header:"",listeners:{beforerowselect:function(D) {var C=D.getCount();if(C===2){return false}},rowselect:function(D){var C=D.getCount();if(C===2){Ext.getCmp("FNU-PANEL-btn-logEn-"+u).enable();Ext.get("FNU-PANEL-btn-logEn-"+u).frame("3F8538")}else{Ext.getCmp("FNU-PANEL-btn-logEn-"+u).disable()}},rowdeselect:function(D){var C=D.getCount();if(C===2){Ext.getCmp("FNU-PANEL-btn-logEn-"+u).enable();Ext.get("FNU-PANEL-btn-logEn-"+u).frame("3F8538")}else{Ext.getCmp("FNU-PANEL-btn-logEn-"+u).disable()}}}});w=new Ext.grid.GridPanel({store:s,loadMask:true,columns:[B,{id:"id",header:"Rev.",width:40,sortable:false,dataIndex:"revision"},{header:"Content",width:130,sortable:true,dataIndex:"content"},{header:"By",width:50,sortable:true,dataIndex:"author"},{header:"Date",width:85,sortable:true,dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y/m/d, H:i")}],autoHeight:true,autoExpandColumn:"content",bodyBorder:false,sm:B,view:new Ext.grid.GridView({forceFit:true}),tbar:[{scope:this,tooltip:"<b>View</b> the diff",iconCls:"iconViewDiff",! id:"FNU-PANEL-btn-logEn-"+u,disabled:true,handler:function(){var E,D,C;E=B.getSelections();D=E[0].data.revision;C=E[1].data.revision;this.winDiff("en"+n,p,D,C)}}]});if(this.userConf.conf_needupdate_diff==="using-viewvc"){A={xtype:"panel",layout:"fit",region:"north",title:"Diff From cvs",height:150,collapsed:true,items:{xtype:"iframepanel",id:"FNU-diff-"+u,loadMask:true,defaultSrc:"http://cvs.php.net/viewvc.cgi/phpdoc/en"+n+p+"?r1="+y+"&r2="+z}}}else{if(this.userConf.conf_needupdate_diff==="using-exec"){A={xtype:"panel",layout:"fit",region:"north",title:"Diff From cvs",height:150,autoScroll:true,collapsed:true,html:'<div id="FNU-diff-'+u+'" class="diff-content"></div>',listeners:{render:function(){Ext.Ajax.request({url:"./php/controller.php",params:{task:"get-diff2",FilePath:"en"+n,FileName:p,Rev2:y,Rev1:z},success:function(C){var D=Ext.util.JSON.decode(C.responseText);if(D.success){Ext.get("FNU-diff-"+u).dom.innerHTML=D.content}},failure:function(){}})}}}}}Ext.getCmp("main-! panel").add({closable:true,title:p,originTitle:p,tabTip:"Need Update : in "+n,iconCls:"iconTabNeedUpdate",id:"FNU-"+u,isModifiedLang:false,isModifiedEn:false,layout:"border",defaults:{collapsible:true,split:true},items:[A,{region:"west",xtype:"panel",layout:"fit",bodyBorder:false,title:"CvsLog",collapsed:true,width:375,items:{xtype:"tabpanel",activeTab:0,tabPosition:"bottom",defaults:{autoScroll:true},items:[{layout:"fit",title:this.userLang,items:[q]},{layout:"fit",title:"En",items:[w]}]}},{scope:this,title:this.userLang+" File: "+n+p,originTitle:this.userLang+" File: "+n+p,collapsible:false,id:"FNU-LANG-PANEL-"+u,region:"center",xtype:"form",height:"auto",width:"auto",items:[{xtype:"codemirror",id:"FNU-LANG-"+u,listeners:{scope:this,initialize:function(){this.getFile(u,this.userLang+n,p,"FNU-LANG-PANEL-","FNU-LANG-")},cmcursormove:function(){var C=Ext.util.JSON.decode(Ext.getCmp("FNU-LANG-"+u).getCursorPosition());Ext.get("FNU-LANG-status-line-"+u).dom.innerHTML=C.line;Ext.get("FNU-LANG-status-col-"+u).dom.innerHTML=C.caracter},cmchange:func! tion(F,D,E){var C=Ext.util.JSON.decode(Ext.getCmp("FNU-LANG-"+u).getCursorPosition());Ext.get("FNU-LANG-status-line-"+u).dom.innerHTML=C.line;Ext.get("FNU-LANG-status-col-"+u).dom.innerHTML=C.caracter;if(F!==27&&F!==33&&F!==34&&F!==37&&F!==38&&F!==39&&F!==40&&F!==17&&F!==16&&F!==67){if(!Ext.getCmp("FNU-"+u).isModifiedLang){Ext.getCmp("FNU-LANG-PANEL-"+u).setTitle(Ext.getCmp("FNU-LANG-PANEL-"+u).originTitle+' <span style="color:#ff0000; font-weight: bold;">[modified]</span>');Ext.getCmp("FNU-"+u).setTitle(Ext.getCmp("FNU-"+u).originTitle+' <t style="color:#ff0000; font-weight: bold;">*</t>');Ext.getCmp("FNU-LANG-PANEL-btn-save-"+u).enable();Ext.get("FNU-LANG-PANEL-btn-save-"+u).frame("3F8538");Ext.getCmp("FNU-LANG-PANEL-btn-saveas-"+u).enable();Ext.get("FNU-LANG-PANEL-btn-saveas-"+u).frame("3F8538");Ext.getCmp("FNU-"+u).isModifiedLang=true}}},cmscroll:function(C){if(this.userConf.conf_needupdate_scrollbars==="true"){Ext.getCmp("FNU-EN-"+u).scrollTo(C)}}}}],bbar:[{scope:this,! xtype:"checkbox",hideLabel:true,checked:(this.userConf.conf_needupdate _scrollbars==="true")?true:false,boxLabel:"Synchronize scroll bars",name:"conf_needupdate_scrollbars",listeners:{scope:this,check:function(C){this.confUpdate("conf_needupdate_scrollbars",C.getValue())},render:function(C){Ext.DomHelper.insertHtml("beforeBegin",C.el.dom,'<div style="display: inline;" class="x-statusbar"><span class="x-status-text-panel">Line: <span id="FNU-LANG-status-line-'+u+'">-</span></span> <span class="x-status-text-panel">Col: <span id="FNU-LANG-status-col-'+u+'">-</span></span></div> ')}}}],tbar:[{scope:this,tooltip:"<b>Save</b> this file",iconCls:"saveFile",id:"FNU-LANG-PANEL-btn-save-"+u,disabled:true,handler:function(){this.saveLangFile(u,n,p,"FNU",x,this)}},{scope:this,tooltip:"<b>Save as</b> a patch",iconCls:"saveAsFile",id:"FNU-LANG-PANEL-btn-saveas-"+u,disabled:true,handler:function(){this.savePatch(this.userLang,u,n,p,"FNU",this)}},"->",{tooltip:"<b>Re-indent</b> all this file",iconCls:"iconIndent",handler:function(){Ext.g! etCmp("FNU-LANG-"+u).reIndentAll()}},{tooltip:"Insert <b>Reviewed</b> tag",text:"Reviewed tag",iconCls:"iconInsertCode",handler:function(){Ext.getCmp("FNU-LANG-"+u).insertIntoLine(2,"end","\n<!-- Reviewed: no -->");Ext.getCmp("FNU-LANG-"+u).focus()}},{tooltip:"Insert <b>Revcheck</b> tag",text:"Rev tag",iconCls:"iconInsertCode",handler:function(){Ext.getCmp("FNU-LANG-"+u).insertIntoLine(2,"end","\n<!-- EN-Revision: 1.XX Maintainer: "+this.userLoggin+" Status: ready -->");Ext.getCmp("FNU-LANG-"+u).focus()}}]},{title:"En File: "+n+p,originTitle:"En File: "+n+p,collapsible:false,id:"FNU-EN-PANEL-"+u,region:"east",xtype:"form",height:"auto",width:575,items:[{xtype:"codemirror",id:"FNU-EN-"+u,listeners:{scope:this,initialize:function(){this.getFile(u,"en"+n,p,"FNU-EN-PANEL-","FNU-EN-")},cmchange:function(F,D,E){var C=Ext.util.JSON.decode(Ext.getCmp("FNU-EN-"+u).getCursorPosition());Ext.get("FNU-EN-status-line-"+u).dom.innerHTML=C.line;Ext.get("FNU-EN-status-col-"+u).dom.innerHTML! =C.caracter;if(F!==27&&F!==33&&F!==34&&F!==37&&F!==38&&F!==39&&F!==40& &F!==17&&F!==16&&F!==67){if(!Ext.getCmp("FNU-"+u).isModifiedEn){Ext.getCmp("FNU-EN-PANEL-"+u).setTitle(Ext.getCmp("FNU-EN-PANEL-"+u).originTitle+' <span style="color:#ff0000; font-weight: bold;">[modified]</span>');Ext.getCmp("FNU-"+u).setTitle(Ext.getCmp("FNU-"+u).originTitle+' <t style="color:#ff0000; font-weight: bold;">*</t>');Ext.getCmp("FNU-EN-PANEL-btn-save-"+u).enable();Ext.get("FNU-EN-PANEL-btn-save-"+u).frame("3F8538");Ext.getCmp("FNU-EN-PANEL-btn-saveas-"+u).enable();Ext.get("FNU-EN-PANEL-btn-saveas-"+u).frame("3F8538");Ext.getCmp("FNU-"+u).isModifiedEn=true}}},cmscroll:function(C){if(this.userConf.conf_needupdate_scrollbars==="true"){Ext.getCmp("FNU-LANG-"+u).scrollTo(C)}},cmcursormove:function(D){var C=Ext.util.JSON.decode(Ext.getCmp("FNU-EN-"+u).getCursorPosition());Ext.get("FNU-EN-status-line-"+u).dom.innerHTML=C.line;Ext.get("FNU-EN-status-col-"+u).dom.innerHTML=C.caracter}}}],bbar:[{scope:this,xtype:"panel",height:21,baseCls:"",bodyStyle:"padding-top:5px;",h! tml:'<div style="display: inline;" class="x-statusbar"><span class="x-status-text-panel">Line: <span id="FNU-EN-status-line-'+u+'">-</span></span> <span class="x-status-text-panel">Col: <span id="FNU-EN-status-col-'+u+'">-</span></span></div> '}],tbar:[{scope:this,tooltip:"<b>Save</b> this file",iconCls:"saveFile",id:"FNU-EN-PANEL-btn-save-"+u,disabled:true,handler:function(){this.saveEnFile(u,n,p,"FNU",x,this)}},{scope:this,tooltip:"<b>Save as</b> a patch",iconCls:"saveAsFile",id:"FNU-EN-PANEL-btn-saveas-"+u,disabled:true,handler:function(){this.savePatch("en",u,n,p,"FNU",this)}},"->",{tooltip:"<b>Re-indent</b> all this file",iconCls:"iconIndent",handler:function(){Ext.getCmp("FNU-EN-"+u).reIndentAll()}}]}]});Ext.getCmp("main-panel").setActiveTab("FNU-"+u)}else{Ext.getCmp("main-panel").setActiveTab("FNU-"+u)}}}});a=new Ext.grid.GridPanel({store:this.storePendingPatch,loadMask:true,columns:[{id:"name",header:"Files",sortable:true,dataIndex:"name"},{hea! der:"Posted by",width:45,sortable:true,dataIndex:"by"},{header:"Date", width:45,sortable:true,dataIndex:"date"},{header:"Path",dataIndex:"path",hidden:true}],view:new Ext.grid.GroupingView({forceFit:true,groupTextTpl:'{[values.rs[0].data["path"]]} ({[values.rs.length]} {[values.rs.length > 1 ? "Files" : "File"]})',emptyText:'<div style="text-align: center;">No pending Patch</div>'}),autoExpandColumn:"name",bodyBorder:false,listeners:{scope:this,rowcontextmenu:function(n,t,r){var o,m,p,q,s;o=this.storePendingPatch.getAt(t).data.path;m=this.storePendingPatch.getAt(t).data.name;p=this.storePendingPatch.getAt(t).data.uniqID;q=Ext.util.md5("PP-"+p+o+m);n.getSelectionModel().selectRow(t);s=new Ext.menu.Menu({items:[{text:"<b>Edit in a new Tab</b>",iconCls:"PendingPatch",scope:this,handler:function(){a.fireEvent("rowdblclick",n,t,r)}},"-",{text:"Reject this patch",iconCls:"iconPageDelete",scope:this,handler:function(){this.rejectPatch(q,o,m,p,t,this)}}]});s.showAt(r.getXY())},rowdblclick:function(n,u,s){var m,o,v,t,r,q,p;m=this.storePendingPatch.getAt! (u).data.path;o=this.storePendingPatch.getAt(u).data.name;v=this.storePendingPatch.getAt(u).data.uniqID;t=Ext.util.md5("PP-"+v+m+o);if(!Ext.getCmp("main-panel").findById("FE-"+t)){r=new Ext.data.Store({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controller.php"}),baseParams:{task:"get-log",Path:m,File:o},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"revision",mapping:"revision"},{name:"date",mapping:"date",type:"date",dateFormat:"Y/m/d H:i:s"},{name:"author",mapping:"author"},{name:"content",mapping:"content"}])});r.setDefaultSort("date","desc");q=new Ext.grid.CheckboxSelectionModel({singleSelect:false,width:22,header:"",listeners:{beforerowselect:function(x){var w=x.getCount();if(w===2){return false}},rowselect:function(x){var w=x.getCount();if(w===2){Ext.getCmp("PP-PANEL-btn-log-"+t).enable();Ext.get("PP-PANEL-btn-log-"+t).frame("3F8538")}else{Ext.getCmp("PP-PANEL-btn-log-"+t).disable()}},rowdesele! ct:function(x){var w=x.getCount();if(w===2){Ext.getCmp("PP-PANEL-btn-l og-"+t).enable();Ext.get("PP-PANEL-btn-log-"+t).frame("3F8538")}else{Ext.getCmp("PP-PANEL-btn-log-"+t).disable()}}}});p=new Ext.grid.GridPanel({store:r,loadMask:true,columns:[q,{id:"id",header:"Rev.",width:40,sortable:false,dataIndex:"revision"},{header:"Content",width:130,sortable:true,dataIndex:"content"},{header:"By",width:50,sortable:true,dataIndex:"author"},{header:"Date",width:85,sortable:true,dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y/m/d, H:i")}],autoHeight:true,autoExpandColumn:"content",bodyBorder:false,sm:q,view:new Ext.grid.GridView({forceFit:true}),tbar:[{scope:this,tooltip:"<b>View</b> the diff",iconCls:"iconViewDiff",id:"PP-PANEL-btn-log-"+t,disabled:true,handler:function(){var y,x,w;y=q.getSelections();x=y[0].data.revision;w=y[1].data.revision;this.winDiff(m,o,x,w)}}]});Ext.getCmp("main-panel").add({closable:true,title:o,originTitle:o,tabTip:"Patch for "+m+o,iconCls:"PendingPatch",id:"PP-"+t,layout:"border",defaults:{collapsible:true,split:true! },items:[{xtype:"panel",layout:"fit",region:"north",title:"Patch content",id:"PP-patch-desc-"+t,height:150,autoScroll:true,collapsed:true,html:'<div id="diff_content_'+t+'" class="diff-content"></div>',listeners:{render:function(){Ext.Ajax.request({scope:this,url:"./php/controller.php",params:{task:"get-diff",FilePath:m,FileName:o,type:"patch",uniqID:v},success:function(w){var x=Ext.util.JSON.decode(w.responseText);if(x.success){Ext.get("diff_content_"+t).dom.innerHTML=x.content}},failure:function(){}})}}},{region:"west",xtype:"panel",layout:"fit",bodyBorder:false,title:"CvsLog",collapsed:true,width:375,items:{xtype:"tabpanel",activeTab:0,tabPosition:"bottom",defaults:{autoScroll:true},items:[{layout:"fit",title:"Log",items:[p]}]}},{title:"Proposed Patch for "+m+o,originTitle:"Proposed Patch for "+m+o,collapsible:false,id:"PP-PATCH-PANEL-"+t,region:"center",xtype:"form",height:"auto",width:"auto",items:[{xtype:"codemirror",id:"PP-PATCH-"+t,isModified:false,listeners:{scope:! this,initialize:function(w){this.getFile(t,m,o+"."+v+".patch","PP-PATC H-PANEL-","PP-PATCH-")},cmcursormove:function(){var w=Ext.util.JSON.decode(Ext.getCmp("PP-PATCH-"+t).getCursorPosition());Ext.get("PP-PATCH-status-line-"+t).dom.innerHTML=w.line;Ext.get("PP-PATCH-status-col-"+t).dom.innerHTML=w.caracter},cmchange:function(z,x,y){var w=Ext.util.JSON.decode(Ext.getCmp("PP-PATCH-"+t).getCursorPosition());Ext.get("PP-PATCH-status-line-"+t).dom.innerHTML=w.line;Ext.get("PP-PATCH-status-col-"+t).dom.innerHTML=w.caracter;if(z!==27&&z!==33&&z!==34&&z!==37&&z!==38&&z!==39&&z!==40&&z!==17&&z!==16&&z!==67){if(!Ext.getCmp("PP-PATCH-"+t).isModified){Ext.getCmp("PP-PATCH-PANEL-"+t).setTitle(Ext.getCmp("PP-PATCH-PANEL-"+t).originTitle+' <span style="color:#ff0000; font-weight: bold;">[modified]</span>');Ext.getCmp("PP-"+t).setTitle(Ext.getCmp("PP-"+t).originTitle+' <t style="color:#ff0000; font-weight: bold;">*</t>');Ext.getCmp("PP-PATCH-"+t).isModified=true}}},cmscroll:function(w){if(this.userConf.conf_patch_scrollbars==="true"){Ext.getCmp("PP-ORIGIN-"+t)! .scrollTo(w)}}}}],bbar:[{scope:this,xtype:"checkbox",hideLabel:true,checked:(this.userConf.conf_patch_scrollbars==="true")?true:false,boxLabel:"Synchronize scroll bars",name:"conf_patch_scrollbars",listeners:{scope:this,check:function(w){this.confUpdate("conf_patch_scrollbars",w.getValue())},render:function(w){Ext.DomHelper.insertHtml("beforeBegin",w.el.dom,'<div style="display: inline;" class="x-statusbar"><span class="x-status-text-panel">Line: <span id="PP-PATCH-status-line-'+t+'">-</span></span> <span class="x-status-text-panel">Col: <span id="PP-PATCH-status-col-'+t+'">-</span></span></div> ')}}}],tbar:[{scope:this,tooltip:"<b>Accept</b> this patch and <b>Save</b> the file",iconCls:"saveFile",id:"PP-PATCH-PANEL-btn-save-"+t,handler:function(){this.saveFileViaPatch(t,m,o,v,u,this)}},{scope:this,tooltip:"<b>Reject</b> this patch",iconCls:"iconPageDelete",id:"PP-PATCH-PANEL-btn-reject-"+t,handler:function(){this.rejectPatch(t,m,o,v,u,this)}},"->",{to! oltip:"<b>Re-indent</b> all this file",iconCls:"iconIndent",handler:fu nction(){Ext.getCmp("PP-PATCH-"+t).reIndentAll()}}]},{title:"Original File: "+m+o,originTitle:"Original File: "+m+o,collapsible:false,id:"PP-ORIGIN-PANEL-"+t,region:"east",xtype:"form",height:"auto",width:575,items:[{xtype:"codemirror",id:"PP-ORIGIN-"+t,readOnly:true,listeners:{scope:this,initialize:function(w){this.getFile(t,m,o,"PP-ORIGIN-PANEL-","PP-ORIGIN-")},cmscroll:function(w){if(this.userConf.conf_patch_scrollbars==="true"){Ext.getCmp("PP-PATCH-"+t).scrollTo(w)}},cmcursormove:function(x){var w=Ext.util.JSON.decode(Ext.getCmp("PP-ORIGIN-"+t).getCursorPosition());Ext.get("PP-ORIGIN-status-line-"+t).dom.innerHTML=w.line;Ext.get("PP-ORIGIN-status-col-"+t).dom.innerHTML=w.caracter}}}],bbar:[{scope:this,xtype:"panel",height:21,baseCls:"",bodyStyle:"padding-top:5px;",html:'<div style="display: inline;" class="x-statusbar"><span class="x-status-text-panel">Line: <span id="PP-ORIGIN-status-line-'+t+'">-</span></span> <span class="x-status-text-panel">Col: <span id=! "PP-ORIGIN-status-col-'+t+'">-</span></span></div> '}],tbar:[{}]}]});Ext.getCmp("main-panel").setActiveTab("PP-"+t);if(Ext.getCmp("PP-"+t).getLayout().north.collapsedEl){Ext.getCmp("PP-"+t).getLayout().north.collapsedEl.addClass("x-layout-collapsed-east-patch-desc")}}}}});c=new Ext.grid.GridPanel({store:this.storePendingCommit,loadMask:true,columns:[{id:"name",header:"Files",sortable:true,dataIndex:"name"},{header:"Modified by",width:45,sortable:true,dataIndex:"by"},{header:"Date",width:45,sortable:true,dataIndex:"date"},{header:"Path",dataIndex:"path",hidden:true}],view:new Ext.grid.GroupingView({forceFit:true,groupTextTpl:'{[values.rs[0].data["path"]]} ({[values.rs.length]} {[values.rs.length > 1 ? "Files" : "File"]})',emptyText:'<div style="text-align: center;">No pending for Commit</div>'}),autoExpandColumn:"name",bodyBorder:false,listeners:{scope:this,rowcontextmenu:function(n,r,p){var o,m,q;o=this.storePendingCommit.getAt(r).data.path;m=this.storePendingCom! mit.getAt(r).data.name;n.getSelectionModel().selectRow(r);q=new Ext.me nu.Menu({items:[{text:"<b>Edit in a new Tab</b>",iconCls:"PendingCommit",scope:this,handler:function(){c.fireEvent("rowdblclick",n,r,p)}},"-",{text:"View Diff",iconCls:"iconViewDiff",scope:this,handler:function(){Ext.getCmp("main-panel").add({xtype:"panel",id:"diff_panel_"+r,title:"Diff",tabTip:"Diff",closable:true,autoScroll:true,iconCls:"iconTabLink",html:'<div id="diff_content_'+r+'" class="diff-content"></div>'});Ext.getCmp("main-panel").setActiveTab("diff_panel_"+r);Ext.get("diff_panel_"+r).mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Please, Wait...');Ext.Ajax.request({url:"./php/controller.php",params:{task:"get-diff",FilePath:o,FileName:m},success:function(s){var t=Ext.util.JSON.decode(s.responseText);if(t.success){Ext.get("diff_content_"+r).dom.innerHTML=t.content;Ext.get("diff_panel_"+r).unmask()}},failure:function(){}})}},{text:"Download the diff as a patch",iconCls:"iconCommitFileCvs",scope:this,handler:function(){window.location.href="./d! l_Patch.php?FilePath="+o+"&FileName="+m}},"-",{text:"Clear this change",iconCls:"iconPageDelete",scope:this,handler:function(){function s(t){if(t==="yes"){if(Ext.getCmp("main-panel").findById("FNU-"+Ext.util.md5("FNU-"+o+m))){Ext.getCmp("main-panel").remove("FNU-"+Ext.util.md5("FNU-"+o+m))}Ext.Ajax.request({scope:this,url:"./php/controller.php",params:{task:"clear-local-change",FilePath:o,FileName:m},success:function(u){var v=Ext.util.JSON.decode(u.responseText);if(v.success){this.storeFilesNeedUpdate.reload();this.storeFilesError.reload();this.storeFilesNeedReviewed.reload();this.storePendingCommit.remove(this.storePendingCommit.getAt(r));this.storePendingCommit.fireEvent("add",this.storePendingCommit)}},failure:function(){}})}}Ext.MessageBox.confirm("Confirm","This action will clear your local modification and take back this file from his original stats.<br/>You need confirm.",s,this)}},"-",{text:"Commit...",iconCls:"iconCommitFileCvs",scope:this,menu:new Ext.menu.Menu({i! tems:[{text:"...this file",iconCls:"iconCommitFileCvs",scope:this,hand ler:function(){this.WinCommit(true,r)}},{text:"...all files modified by me",iconCls:"iconCommitFileCvs",scope:this,handler:function(){this.WinCommit(false,"","by me")}},{text:"...all files modified",iconCls:"iconCommitFileCvs",scope:this,handler:function(){this.WinCommit(false)}}]})}]});q.showAt(p.getXY())},rowdblclick:function(n,q,p){var o,m;o=this.storePendingCommit.getAt(q).data.path;m=this.storePendingCommit.getAt(q).data.name;this.openFile(o,m)}}});h=new Ext.grid.GridPanel({store:this.storeFilesNeedReviewed,loadMask:true,columns:[{id:"name",header:"Files",sortable:true,dataIndex:"name"},{header:"Reviewed",width:45,sortable:true,dataIndex:"reviewed"},{header:"Maintainer",width:45,sortable:true,dataIndex:"maintainer"},{header:"Path",dataIndex:"path",hidden:true}],view:new Ext.grid.GroupingView({forceFit:true,groupTextTpl:'{[values.rs[0].data["path"]]} ({[values.rs.length]} {[values.rs.length > 1 ? "Files" : "File"]})',getRowClass:function(m,p,o,n){if(m.data.needcommit){re! turn"file-need-commit"}},emptyText:'<div style="text-align: center;">No files</div>'}),autoExpandColumn:"name",bodyBorder:false,listeners:{scope:this,rowcontextmenu:function(n,t,r){var m,p,s,o="",v="",u,q;n.getSelectionModel().selectRow(t);m=this.storeFilesNeedReviewed.getAt(t).data.path;p=this.storeFilesNeedReviewed.getAt(t).data.name;s=Ext.util.md5("FNR-"+this.userLang+m+p);if(this.storeFilesNeedReviewed.getAt(t).data.needcommit){o={text:"View Diff",iconCls:"iconViewDiff",scope:this,handler:function(){Ext.getCmp("main-panel").add({xtype:"panel",id:"diff_panel_"+t,title:"Diff",tabTip:"Diff",closable:true,autoScroll:true,iconCls:"iconTabLink",html:'<div id="diff_content_'+t+'" class="diff-content"></div>'});Ext.getCmp("main-panel").setActiveTab("diff_panel_"+t);Ext.get("diff_panel_"+t).mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Please, Wait...');Ext.Ajax.request({scope:this,url:"./php/controller.php",params:{task:"get-diff",FilePath:this.userLang+m! ,FileName:p},success:function(w){var x=Ext.util.JSON.decode(w.response Text);if(x.success){Ext.get("diff_content_"+t).dom.innerHTML=x.content;Ext.get("diff_panel_"+t).unmask()}},failure:function(){}})}}}u=m.split("/");if(u[1]==="reference"){v={text:"Open all files about "+u[2]+" extension",iconCls:"iconViewDiff",scope:this,handler:function(){Ext.getBody().mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Open all files about '+u[2]+" extension. Please, wait...");Ext.Ajax.request({scope:this,url:"../php/controller.php",params:{task:"all-files-about-extension",ExtName:u[2]},success:function(y,x){var z,w;z=Ext.util.JSON.decode(y.responseText);this.filePendingOpen=[];for(w=0;w<z.files.length;w=w+1){this.filePendingOpen[w]=[this.userLang+z.files[w].path,z.files[w].name]}this.openFile(this.filePendingOpen[0][0],this.filePendingOpen[0][1]);Ext.getBody().unmask()}})}}}q=new Ext.menu.Menu({scope:this,items:[{text:"<b>Edit in a new Tab</b>",iconCls:"FilesNeedReviewed",scope:this,handler:function(){h.fireEvent("rowdblclick",n,t,r)}},o,"! -",v]});r.stopEvent();q.showAt(r.getXY())},rowdblclick:function(o,y,v){var n,p,s,u,w,m,t,r,q,z,x;n=this.storeFilesNeedReviewed.getAt(y).data.path;p=this.storeFilesNeedReviewed.getAt(y).data.name;s=this.storeFilesNeedReviewed.getAt(y).data.reviewed;u=this.storeFilesNeedReviewed.getAt(y).data.needcommit;w=Ext.util.md5("FNR-"+this.userLang+n+p);if(!Ext.getCmp("main-panel").findById("FNR-"+w)){m=new Ext.data.Store({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controller.php"}),baseParams:{task:"get-log",Path:this.userLang+n,File:p},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"revision",mapping:"revision"},{name:"date",mapping:"date",type:"date",dateFormat:"Y/m/d H:i:s"},{name:"author",mapping:"author"},{name:"content",mapping:"content"}])});m.setDefaultSort("date","desc");t=new Ext.data.Store({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controller.php"}),baseParams:{task:"get-log",Path:"en"+n,F! ile:p},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbI tems",id:"id"},[{name:"id",mapping:"id"},{name:"revision",mapping:"revision"},{name:"date",mapping:"date",type:"date",dateFormat:"Y/m/d H:i:s"},{name:"author",mapping:"author"},{name:"content",mapping:"content"}])});t.setDefaultSort("date","desc");r=new Ext.grid.CheckboxSelectionModel({singleSelect:false,width:22,header:"",listeners:{beforerowselect:function(B){var A=B.getCount();if(A===2){return false}},rowselect:function(B){var A=B.getCount();if(A===2){Ext.getCmp("FNR-PANEL-btn-logLang-"+w).enable();Ext.get("FNR-PANEL-btn-logLang-"+w).frame("3F8538")}else{Ext.getCmp("FNR-PANEL-btn-logLang-"+w).disable()}},rowdeselect:function(B){var A=B.getCount();if(A===2){Ext.getCmp("FNR-PANEL-btn-logLang-"+w).enable();Ext.get("FNR-PANEL-btn-logLang-"+w).frame("3F8538")}else{Ext.getCmp("FNR-PANEL-btn-logLang-"+w).disable()}}}});q=new Ext.grid.GridPanel({store:m,loadMask:true,columns:[r,{id:"id",header:"Rev.",width:40,sortable:false,dataIndex:"revision"},{header:"Content",width:130,sortab! le:true,dataIndex:"content"},{header:"By",width:50,sortable:true,dataIndex:"author"},{header:"Date",width:85,sortable:true,dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y/m/d, H:i")}],autoHeight:true,autoExpandColumn:"content",bodyBorder:false,sm:r,view:new Ext.grid.GridView({forceFit:true}),tbar:[{scope:this,tooltip:"<b>View</b> the diff",iconCls:"iconViewDiff",id:"FNR-PANEL-btn-logLang-"+w,disabled:true,handler:function(){var C,B,A;C=r.getSelections();B=C[0].data.revision;A=C[1].data.revision;this.winDiff(this.userLang+n,p,B,A)}}]});z=new Ext.grid.CheckboxSelectionModel({singleSelect:false,width:22,header:"",listeners:{beforerowselect:function(B){var A=B.getCount();if(A===2){return false}},rowselect:function(B){var A=B.getCount();if(A===2){Ext.getCmp("FNR-PANEL-btn-logEn-"+w).enable();Ext.get("FNR-PANEL-btn-logEn-"+w).frame("3F8538")}else{Ext.getCmp("FNR-PANEL-btn-logEn-"+w).disable()}},rowdeselect:function(B){var A=B.getCount();if(A===2){Ext.getCmp("FNR-PANEL-b! tn-logEn-"+w).enable();Ext.get("FNR-PANEL-btn-logEn-"+w).frame("3F8538 ")}else{Ext.getCmp("FNR-PANEL-btn-logEn-"+w).disable()}}}});x=new Ext.grid.GridPanel({store:t,loadMask:true,columns:[z,{id:"id",header:"Rev.",width:40,sortable:false,dataIndex:"revision"},{header:"Content",width:130,sortable:true,dataIndex:"content"},{header:"By",width:50,sortable:true,dataIndex:"author"},{header:"Date",width:85,sortable:true,dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y/m/d, H:i")}],autoHeight:true,autoExpandColumn:"content",bodyBorder:false,sm:z,view:new Ext.grid.GridView({forceFit:true}),tbar:[{scope:this,tooltip:"<b>View</b> the diff",iconCls:"iconViewDiff",id:"FNR-PANEL-btn-logEn-"+w,disabled:true,handler:function(){var C,B,A;C=z.getSelections();B=C[0].data.revision;A=C[1].data.revision;this.winDiff("en"+n,p,B,A)}}]});Ext.getCmp("main-panel").add({closable:true,title:p,originTitle:p,tabTip:"Need Reviewed : in "+n,iconCls:"iconTabNeedReviewed",id:"FNR-"+w,isModifiedLang:false,isModifiedEn:false,layout:"border",defaults:{collapsible:true,split! :true},items:[{region:"west",xtype:"panel",layout:"fit",bodyBorder:false,title:"CvsLog",collapsed:true,width:375,items:{xtype:"tabpanel",activeTab:0,tabPosition:"bottom",defaults:{autoScroll:true},items:[{layout:"fit",title:this.userLang,items:[q]},{layout:"fit",title:"En",items:[x]}]}},{title:this.userLang+" File: "+n+p,originTitle:this.userLang+" File: "+n+p,collapsible:false,id:"FNR-LANG-PANEL-"+w,region:"center",xtype:"form",height:"auto",width:"auto",items:[{xtype:"codemirror",id:"FNR-LANG-"+w,listeners:{scope:this,initialize:function(){this.getFile(w,this.userLang+n,p,"FNR-LANG-PANEL-","FNR-LANG-")},cmcursormove:function(B){var A=Ext.util.JSON.decode(Ext.getCmp("FNR-LANG-"+w).getCursorPosition());Ext.get("FNR-LANG-status-line-"+w).dom.innerHTML=A.line;Ext.get("FNR-LANG-status-col-"+w).dom.innerHTML=A.caracter},cmchange:function(D,B,C){var A=Ext.util.JSON.decode(Ext.getCmp("FNR-LANG-"+w).getCursorPosition());Ext.get("FNR-LANG-status-line-"+w).dom.innerHTML=A.line;Ext.g! et("FNR-LANG-status-col-"+w).dom.innerHTML=A.caracter;if(D!==27&&D!==3 3&&D!==34&&D!==37&&D!==38&&D!==39&&D!==40&&D!==17&&D!==16&&D!==67){if(!Ext.getCmp("FNR-"+w).isModifiedLang){Ext.getCmp("FNR-LANG-PANEL-"+w).setTitle(Ext.getCmp("FNR-LANG-PANEL-"+w).originTitle+' <span style="color:#ff0000; font-weight: bold;">[modified]</span>');Ext.getCmp("FNR-"+w).setTitle(Ext.getCmp("FNR-"+w).originTitle+' <t style="color:#ff0000; font-weight: bold;">*</t>');Ext.getCmp("FNR-LANG-PANEL-btn-save-"+w).enable();Ext.get("FNR-LANG-PANEL-btn-save-"+w).frame("3F8538");Ext.getCmp("FNR-LANG-PANEL-btn-saveas-"+w).enable();Ext.get("FNR-LANG-PANEL-btn-saveas-"+w).frame("3F8538");Ext.getCmp("FNR-"+w).isModifiedLang=true}}},cmscroll:function(A){if(this.userConf.conf_reviewed_scrollbars==="true"){Ext.getCmp("FNR-EN-"+w).scrollTo(A)}}}}],bbar:[{scope:this,xtype:"checkbox",hideLabel:true,checked:(this.userConf.conf_reviewed_scrollbars==="true")?true:false,boxLabel:"Synchronize scroll bars",name:"conf_reviewed_scrollbars",listeners:{scope:this,check:function(A){this.confUpd! ate("conf_reviewed_scrollbars",A.getValue())},render:function(A){Ext.DomHelper.insertHtml("beforeBegin",A.el.dom,'<div style="display: inline;" class="x-statusbar"><span class="x-status-text-panel">Line: <span id="FNR-LANG-status-line-'+w+'">-</span></span> <span class="x-status-text-panel">Col: <span id="FNR-LANG-status-col-'+w+'">-</span></span></div> ')}}}],tbar:[{scope:this,tooltip:"<b>Save</b> this file",iconCls:"saveFile",id:"FNR-LANG-PANEL-btn-save-"+w,disabled:true,handler:function(){this.saveLangFile(w,n,p,"FNR",y,this)}},{scope:this,tooltip:"<b>Save as</b> a patch",iconCls:"saveAsFile",id:"FNR-LANG-PANEL-btn-saveas-"+w,disabled:true,handler:function(){this.savePatch(this.userLang,w,n,p,"FNR",this)}},"->",{tooltip:"<b>Re-indent</b> all this file",iconCls:"iconIndent",handler:function(){Ext.getCmp("FNR-LANG-"+w).reIndentAll()}},{tooltip:"Insert <b>Reviewed</b> tag",text:"Reviewed tag",iconCls:"iconInsertCode",handler:function(){Ext.getCmp("FNR-! LANG-"+w).insertIntoLine(2,"end","\n<!-- Reviewed: no -->");Ext.getCmp ("FNR-LANG-"+w).focus()}},{tooltip:"Insert <b>Revcheck</b> tag",text:"Rev tag",iconCls:"iconInsertCode",handler:function(){Ext.getCmp("FNR-LANG-"+w).insertIntoLine(2,"end","\n<!-- EN-Revision: 1.XX Maintainer: "+this.userLoggin+" Status: ready -->");Ext.getCmp("FNR-LANG-"+w).focus()}}]},{title:"En File: "+n+p,originTitle:"En File: "+n+p,collapsible:false,id:"FNR-EN-PANEL-"+w,region:"east",xtype:"form",height:"auto",width:575,items:[{xtype:"codemirror",id:"FNR-EN-"+w,listeners:{scope:this,initialize:function(){this.getFile(w,"en"+n,p,"FNR-EN-PANEL-","FNR-EN-")},cmchange:function(D,B,C){var A=Ext.util.JSON.decode(Ext.getCmp("FNR-EN-"+w).getCursorPosition());Ext.get("FNR-EN-status-line-"+w).dom.innerHTML=A.line;Ext.get("FNR-EN-status-col-"+w).dom.innerHTML=A.caracter;if(D!==27&&D!==33&&D!==34&&D!==37&&D!==38&&D!==39&&D!==40&&D!==17&&D!==16&&D!==67){if(!Ext.getCmp("FNR-"+w).isModifiedEn){Ext.getCmp("FNR-EN-PANEL-"+w).setTitle(Ext.getCmp("FNR-EN-PANEL-"+w).originTitle+' <span sty! le="color:#ff0000; font-weight: bold;">[modified]</span>');Ext.getCmp("FNR-"+w).setTitle(Ext.getCmp("FNR-"+w).originTitle+' <t style="color:#ff0000; font-weight: bold;">*</t>');Ext.getCmp("FNR-EN-PANEL-btn-save-"+w).enable();Ext.get("FNR-EN-PANEL-btn-save-"+w).frame("3F8538");Ext.getCmp("FNR-EN-PANEL-btn-saveas-"+w).enable();Ext.get("FNR-EN-PANEL-btn-saveas-"+w).frame("3F8538");Ext.getCmp("FNR-"+w).isModifiedEn=true}}},cmscroll:function(A){if(this.userConf.conf_reviewed_scrollbars==="true"){Ext.getCmp("FNR-LANG-"+w).scrollTo(A)}},cmcursormove:function(B){var A=Ext.util.JSON.decode(Ext.getCmp("FNR-EN-"+w).getCursorPosition());Ext.get("FNR-EN-status-line-"+w).dom.innerHTML=A.line;Ext.get("FNR-EN-status-col-"+w).dom.innerHTML=A.caracter}}}],bbar:[{scope:this,xtype:"panel",height:21,baseCls:"",bodyStyle:"padding-top:5px;",html:'<div style="display: inline;" class="x-statusbar"><span class="x-status-text-panel">Line: <span id="FNR-EN-status-line-'+w+'">-</span></span>  ! ;<span class="x-status-text-panel">Col: <span id="FNR-EN-status-col-'+ w+'">-</span></span></div> '}],tbar:[{scope:this,tooltip:"<b>Save</b> this file",iconCls:"saveFile",id:"FNR-EN-PANEL-btn-save-"+w,disabled:true,handler:function(){this.saveEnFile(w,n,p,"FNR",y,this)}},{scope:this,tooltip:"<b>Save as</b> a patch",iconCls:"saveAsFile",id:"FNR-EN-PANEL-btn-saveas-"+w,disabled:true,handler:function(){this.savePatch("en",w,n,p,"FNR",this)}},"->",{tooltip:"<b>Re-indent</b> all this file",iconCls:"iconIndent",handler:function(){Ext.getCmp("FNR-EN-"+w).reIndentAll()}}]}]});Ext.getCmp("main-panel").setActiveTab("FNR-"+w)}else{Ext.getCmp("main-panel").setActiveTab("FNR-"+w)}}}});g=new Ext.grid.GridPanel({title:"Summary",iconCls:"flag-"+this.userLang,store:this.storeSummary,loadMask:true,columns:[new Ext.grid.RowNumberer(),{id:"StatusType",header:"File status type",width:180,sortable:true,dataIndex:"libel"},{header:"Number of files",width:110,sortable:true,dataIndex:"nbFiles"},{header:"Percent of files",width:110,sortable:true,dataIndex:"per! centFiles"},{header:"Size of files (kB)",width:110,sortable:true,dataIndex:"sizeFiles"},{header:"Percent of size",width:110,sortable:true,dataIndex:"percentSize"}],autoScroll:true,height:400,width:800,view:new Ext.grid.GridView({getRowClass:function(m,p,o,n){if(m.data.id===1){return"summary_1"}if(m.data.id===2){return"summary_2"}if(m.data.id===3){return"summary_3"}if(m.data.id===4){return"summary_4"}if(m.data.id===5){return"summary_5"}}}),listeners:{scope:this,render:function(m){m.store.load()}}});f=new Ext.grid.GridPanel({title:"Translators",iconCls:"iconTranslator",store:this.storeTranslators,loadMask:true,columns:[new Ext.grid.RowNumberer(),{id:"GridTransName",header:"Name",sortable:true,dataIndex:"name",summaryType:"count",summaryRenderer:this.rendererTotalTranslator},{header:"Email",width:110,sortable:true,dataIndex:"email"},{header:"Nick",width:70,sortable:true,dataIndex:"nick"},{header:"Cvs",width:45,sortable:true,dataIndex:"cvs"},{header:"UptoDate",width:60,sortable! :true,renderer:this.rendererNumUptodate,dataIndex:"uptodate",summaryTy pe:"sum"},{header:"Old",width:45,sortable:true,renderer:this.rendererSum,dataIndex:"old",summaryType:"sum"},{header:"Critical",width:60,sortable:true,renderer:this.rendererNumCritical,dataIndex:"critical",summaryType:"sum"},{header:"Sum",width:50,sortable:true,renderer:this.rendererSum,dataIndex:"sum",summaryType:"sum"}],plugins:[new Ext.ux.grid.GridSummary()],autoScroll:true,autoExpandColumn:"GridTransName",height:400,width:800,listeners:{scope:this,render:function(){this.storeTranslators.load()},rowdblclick:function(o,q,p){var m,n;o.getSelectionModel().selectRow(q);m=this.storeTranslators.getAt(q).data.email;n=this.storeTranslators.getAt(q).data.name;this.sendEmail(n,m)},rowcontextmenu:function(o,r,p){var m,n,q;o.getSelectionModel().selectRow(r);m=this.storeTranslators.getAt(r).data.email;n=this.storeTranslators.getAt(r).data.name;q=new Ext.menu.Menu({id:"submenu",items:[{scope:this,text:"<b>Send an email to "+n+"</b>",iconCls:"iconSendEmail",handler:function(){this.sendEm! ail(n,m)}},"-",{scope:this,text:"Send an email to the doc-"+this.userLang+"@lists.php.net",iconCls:"iconSendEmail",handler:function(){this.sendEmail("Php Doc Team "+this.userLang,"doc-"+this.userLang+"@lists.php.net")}}]});q.showAt(p.getXY())}}});i=new Ext.grid.GridPanel({store:this.storeMailing,title:"Mails from doc-"+this.userLang,iconCls:"home-mailing-title",loadMask:true,columns:[new Ext.grid.RowNumberer(),{id:"GridMailingTitle",header:"Title",sortable:true,dataIndex:"title"},{header:"By",width:110,sortable:true,dataIndex:"description"},{header:"Date",width:140,sortable:true,dataIndex:"pubDate",renderer:Ext.util.Format.dateRenderer("Y/m/d, H:i")}],autoScroll:true,height:400,width:800,autoExpandColumn:"GridMailingTitle",sm:new Ext.grid.RowSelectionModel({singleSelect:true}),tbar:[{scope:this,tooltip:"Refresh this grid",iconCls:"refresh",handler:function(){this.storeMailing.reload()}}],listeners:{scope:this,render:function(){this.storeMailing.load()},rowcontextmenu:functi! on(m,p,n){var o;m.getSelectionModel().selectRow(p);o=new Ext.menu.Menu ({id:"submenu",items:[{text:"<b>Open in a new Tab</b>",iconCls:"openInTab",scope:this,handler:function(){i.fireEvent("rowdblclick",m,p,n)}},"-",{text:"Refresh this grid",iconCls:"refresh",scope:this,handler:function(){this.storeMailing.reload()}}]});o.showAt(n.getXY())},rowdblclick:function(n,r,p){var m,q,o;m=this.storeMailing.getAt(r).data.pubDate;q=this.storeMailing.getAt(r).data.link;o=this.storeMailing.getAt(r).data.title;this.NewTabMailing(m,q,o)}}});e=new Ext.grid.GridPanel({store:this.storeBugs,title:"Open bugs for doc-"+this.userLang,iconCls:"iconBugs",loadMask:true,columns:[{id:"GridBugTitle",header:"Title",sortable:true,dataIndex:"title"}],stripeRows:true,autoHeight:true,viewConfig:{emptyText:"No open Bugs",forceFit:true,enableRowBody:true,getRowClass:function(m,q,o,n){o.body='<p class="bug-desc">'+m.data.description+"</p>";return"x-grid3-row-expanded"}},autoExpandColumn:"GridBugTitle",sm:new Ext.grid.RowSelectionModel({singleSelect:true}),width:800,tbar:[{scope:th! is,tooltip:"Refresh this grid",iconCls:"refresh",handler:function(){this.storeBugs.reload()}}],listeners:{scope:this,render:function(){this.storeBugs.load()},rowcontextmenu:function(m,p,n){var o;m.getSelectionModel().selectRow(p);o=new Ext.menu.Menu({id:"submenu",items:[{text:"<b>Open in a new Tab</b>",iconCls:"openInTab",scope:this,handler:function(){e.fireEvent("rowdblclick",m,p,n)}},"-",{text:"Refresh this grid",iconCls:"refresh",scope:this,handler:function(){this.storeBugs.reload()}}]});o.showAt(n.getXY())},rowdblclick:function(o,r,q){var m,n,p;m=this.storeBugs.getAt(r).data.id;n=this.storeBugs.getAt(r).data.link;p=this.storeBugs.getAt(r).data.title;this.NewTabBugs(m,n,p)}}});k={title:"Graphics",layout:"fit",autoHeight:true,iconCls:"home-graphic-title",html:'<div align="center" id="graph_container" style="width: 530px; height: 302px"><img id="graph_picture" src="" height="300"></div>',listeners:{afterlayout:function(){var m,o,n;m=Ext.get("graph_picture");o=Ext.get("grap! h_container");m.setVisibilityMode(Ext.Element.VISIBILITY);n=new Ext.Lo adMask(o);m.on("load",function(){m.stopFx();n.hide();m.fadeIn({duration:2})});n.show();m.hide();m.dom.src="/php/image_info.php"}}};this.treeAllFiles=new Ext.tree.TreePanel({animate:true,autoScroll:true,useArrows:true,loader:new Ext.tree.TreeLoader({dataUrl:"./php/controller.php",baseParams:{task:"getAllFiles"}}),enableDD:false,containerScroll:true,bodyBorder:false,listeners:{scope:this,dblclick:function(q,v){var n,m,w,y,u,r,p,o,s,x;if(q.attributes.type==="file"){n=q.attributes.text;m=q.attributes.id;w=Ext.util.md5("AF-"+m+n);if(!Ext.getCmp("main-panel").findById("AF-"+w)){y=m.split("/");y.shift();y.shift();y.pop();m=y.join("/")+"/";u="xml";if(q.attributes.extension==="xml"){u="xml"}if(q.attributes.extension==="html"){u="html"}if(q.attributes.extension==="php"){u="php"}r=new Ext.data.Store({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controller.php"}),baseParams:{task:"get-log",Path:m,File:n},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"i! d"},[{name:"id",mapping:"id"},{name:"revision",mapping:"revision"},{name:"date",mapping:"date",type:"date",dateFormat:"Y/m/d H:i:s"},{name:"author",mapping:"author"},{name:"content",mapping:"content"}])});r.setDefaultSort("date","desc");p=new Ext.grid.CheckboxSelectionModel({singleSelect:false,width:22,header:"",listeners:{beforerowselect:function(z){var t=z.getCount();if(t===2){return false}},rowselect:function(z){var t=z.getCount();if(t===2){Ext.getCmp("AF-PANEL-btn-log-"+w).enable();Ext.get("AF-PANEL-btn-log-"+w).frame("3F8538")}else{Ext.getCmp("AF-PANEL-btn-log-"+w).disable()}},rowdeselect:function(z){var t=z.getCount();if(t===2){Ext.getCmp("AF-PANEL-btn-log-"+w).enable();Ext.get("AF-PANEL-btn-log-"+w).frame("3F8538")}else{Ext.getCmp("AF-PANEL-btn-log-"+w).disable()}}}});o=new Ext.grid.GridPanel({store:r,id:"AF-PANEL-log-"+w,loadMask:true,columns:[p,{id:"id",header:"Rev.",width:40,sortable:false,dataIndex:"revision"},{header:"Content",width:130,sortable:true,dataIndex:"! content"},{header:"By",width:50,sortable:true,dataIndex:"author"},{hea der:"Date",width:85,sortable:true,dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y/m/d, H:i")}],autoHeight:true,autoExpandColumn:"content",bodyBorder:false,sm:p,view:new Ext.grid.GridView({forceFit:true}),tbar:[{scope:this,tooltip:"<b>View</b> the diff",iconCls:"iconViewDiff",id:"AF-PANEL-btn-log-"+w,disabled:true,handler:function(){var A,z,t;A=p.getSelections();z=A[0].data.revision;t=A[1].data.revision;this.winDiff(m,n,z,t)}}]});s={region:"west",xtype:"panel",layout:"fit",bodyBorder:false,title:"CvsLog",collapsed:true,width:375,items:{scope:this,xtype:"tabpanel",activeTab:0,tabPosition:"bottom",defaults:{autoScroll:true},items:[{layout:"fit",title:"Log",items:[o]}]}};x={title:"File: "+m+n,originTitle:"File: "+m+n,collapsible:false,id:"AF-PANEL-"+w,region:"center",xtype:"form",height:"auto",width:"auto",items:[{xtype:"codemirror",id:"AF-FILE-"+w,isModified:false,parser:u,listeners:{scope:this,initialize:function(){this.getFile(w,m,n,"AF-PANEL-","AF-FILE-")},cmchange! :function(B,z,A){var t=Ext.util.JSON.decode(Ext.getCmp("AF-FILE-"+w).getCursorPosition());Ext.get("AF-status-line-"+w).dom.innerHTML=t.line;Ext.get("AF-status-col-"+w).dom.innerHTML=t.caracter;if(B!==27&&B!==33&&B!==34&&B!==37&&B!==38&&B!==39&&B!==40&&B!==17&&B!==16&&B!==67){if(!Ext.getCmp("AF-FILE-"+w).isModified){Ext.getCmp("AF-PANEL-"+w).setTitle(Ext.getCmp("AF-PANEL-"+w).originTitle+' <span style="color:#ff0000; font-weight: bold;">[modified]</span>');Ext.getCmp("AF-"+w).setTitle(Ext.getCmp("AF-"+w).originTitle+' <t style="color:#ff0000; font-weight: bold;">*</t>');Ext.getCmp("AF-PANEL-btn-save-"+w).enable();Ext.get("AF-PANEL-btn-save-"+w).frame("3F8538");Ext.getCmp("AF-PANEL-btn-saveas-"+w).enable();Ext.get("AF-PANEL-btn-saveas-"+w).frame("3F8538");Ext.getCmp("AF-FILE-"+w).isModified=true}}},cmcursormove:function(){var t=Ext.util.JSON.decode(Ext.getCmp("AF-FILE-"+w).getCursorPosition());Ext.get("AF-status-line-"+w).dom.innerHTML=t.line;Ext.get("AF-status-col-"+w).dom.i! nnerHTML=t.caracter}}}],bbar:[{scope:this,xtype:"panel",height:21,base Cls:"",bodyStyle:"padding-top:5px;",html:'<div style="display: inline;" class="x-statusbar"><span class="x-status-text-panel">Line: <span id="AF-status-line-'+w+'">-</span></span> <span class="x-status-text-panel">Col: <span id="AF-status-col-'+w+'">-</span></span></div> '}],tbar:[{scope:this,tooltip:"<b>Save</b> this file",iconCls:"saveFile",id:"AF-PANEL-btn-save-"+w,disabled:true,handler:function(){Ext.getCmp("AF-PANEL-btn-save-"+w).disable();Ext.getCmp("AF-FILE-"+w).isModified=false;Ext.getCmp("AF-PANEL-"+w).setTitle(Ext.getCmp("AF-PANEL-"+w).originTitle);Ext.getCmp("AF-"+w).setTitle(Ext.getCmp("AF-"+w).originTitle);var t=Ext.MessageBox.wait("Saving data...");Ext.Ajax.request({scope:this,url:"../php/controller.php",params:{task:"save-file",filePath:m,fileName:n,fileLang:"all",fileContent:Ext.getCmp("AF-FILE-"+w).getCode()},success:function(A,z){var B=Ext.util.JSON.decode(A.responseText);if(B.success){this.addToPendingCommit(m,n);t.hide()}}})}},{scope! :this,tooltip:"<b>Save as</b> a patch",iconCls:"saveAsFile",id:"AF-PANEL-btn-saveas-"+w,disabled:true,handler:function(){this.savePatch("all",w,m,n,"AF",this)}},"->",{tooltip:"<b>Re-indent</b> all this file",iconCls:"iconIndent",handler:function(){Ext.getCmp("AF-FILE-"+w).reIndentAll()}}]};if(q.attributes.extension==="gif"||q.attributes.extension==="png"){x={xtype:"panel",layout:"fit",bodyStyle:"padding:5px 5px 0",html:'<img src="/data/'+this.userLoggin+"/phpdoc-"+this.userLang+m+'" />'};s={}}Ext.getCmp("main-panel").add({closable:true,title:n,originTitle:n,tabTip:"in "+m,iconCls:"AllFiles",id:"AF-"+w,layout:"border",defaults:{collapsible:true,split:true},items:[x,s]});Ext.getCmp("main-panel").setActiveTab("AF-"+w)}else{Ext.getCmp("main-panel").setActiveTab("AF-"+w)}}}}});this.treeSort=new Ext.tree.TreeSorter(this.treeAllFiles,{folderSort:true});this.treeAllFilesRoot=new Ext.tree.AsyncTreeNode({text:"Repository",draggable:false,id:"/"});this.treeAllFiles.setRootNode(this.tr! eeAllFilesRoot);b=new Ext.menu.Menu({id:"mainMenu",items:[{scope:this, text:"Refresh all data",iconCls:"refresh",tooltip:"<b>Refresh all data</b><br>Cvs update & apply all tools",handler:this.WinUpdate},{scope:this,text:"Check Build",iconCls:"checkBuild",tooltip:"<b>Check your build</b> using configure.php script",handler:this.WinCheckBuild},"-",{scope:this,text:"Configure",iconCls:"iconConf",tooltip:"<b>Configure</b> this tool",id:"winconf-btn",handler:this.WinConf},"-",{scope:this,text:"Erase my personal data",iconCls:"iconErasePersonalData",tooltip:"<b>Log out</b>",handler:function(){Ext.MessageBox.confirm("Confirm","This action will erase your personal data. All content about this account will be deleted definitively. Are you sure you want to do that ?",function(m){if(m==="yes"){Ext.getBody().mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Please, wait...');Ext.Ajax.request({url:"./php/controller.php",params:{task:"erase-personal-data"},success:function(n){Ext.getBody().unmask();var p=Ext.util.JSON.decode(n.responseText! );if(p.success){Ext.MessageBox.show({title:"Thanks !",msg:"Thank you for using this application !",icon:Ext.MessageBox.INFO,buttons:Ext.MessageBox.OK,fn:function(){window.location.href="/logout.php"}})}}})}})}},"-",{text:"Log out",iconCls:"iconLogOut",tooltip:"<b>Log out</b>",handler:function(){Ext.MessageBox.confirm("Confirm","Are you sure you want to logout?",function(m){if(m==="yes"){window.location.href="/logout.php"}})}},"-",{scope:this,text:"About",iconCls:"iconHelp",tooltip:"<b>About</b><br/>"+this.appName,id:"winabout-btn",handler:function(){this.WinAbout()}}]});d=new Ext.Viewport({layout:"border",items:[{region:"north",html:'<h1 class="x-panel-header"><img src="/img/mini_php.png" style="vertical-align: middle;" /> '+this.appName+"</h1>",autoHeight:true,border:false,margins:"0 0 5 0"},{region:"west",collapsible:true,collapseMode:"mini",animate:true,split:true,layout:"fit",width:300,autoScroll:true,items:[{layout:"accordion",animate:true,bodyBorder:false,b! order:false,tbar:[{text:"Main Menu",iconCls:"MainMenu",menu:b}],items: [{title:'Files Need Update - <em id="acc-need-update-nb">0</em>',id:"acc-need-update",layout:"fit",iconCls:"FilesNeedUpdate",items:[l],collapsed:true},{title:'Error in current translation - <em id="acc-error-nb">0</em>',id:"acc-error",layout:"fit",iconCls:"FilesError",items:[j],collapsed:true},{title:'Files Need Reviewed - <em id="acc-need-reviewed-nb">0</em>',id:"acc-need-reviewed",layout:"fit",iconCls:"FilesNeedReviewed",items:[h],collapsed:true},{title:"All files",id:"acc-all-files",layout:"fit",iconCls:"AllFiles",items:[this.treeAllFiles],collapsed:true},{title:'Pending for commit - <em id="acc-pendingCommit-nb">0</em>',id:"acc-need-pendingCommit",layout:"fit",iconCls:"PendingCommit",items:[c],collapsed:true},{title:'Pending Patch - <em id="acc-pendingPatch-nb">0</em>',id:"acc-need-pendingPatch",layout:"fit",iconCls:"PendingPatch",items:[a],collapsed:true}]}]},{region:"center",xtype:"tabpanel",id:"main-panel",activeTab:0,enableTabScroll:true,plugins:new Ext.ux.TabCloseMe! nu(),listeners:{scope:this,beforeremove:this.removeTabEvent},items:[{title:"Home",baseCls:"MainInfoTabPanel",xtype:"panel",autoScroll:true,id:"MainInfoTabPanel",plain:true,items:[{xtype:"panel",border:false,html:'<div class="res-block"><div class="res-block-inner"><h3>Connected as <em>'+this.userLoggin+"</em></h3></div></div>"},{xtype:"tabpanel",activeTab:0,plain:true,autoScroll:true,height:400,border:false,defaults:{border:true},items:[g,f,i,e,k]}]}]}]})}}}();Ext.EventManager.onDocumentReady(phpDoc.init,phpDoc,true); http://cvs.php.net/viewvc.cgi/doc-editor/php/class.php?r1=1.3&r2=1.4&diff_format=u Index: doc-editor/php/class.php diff -u doc-editor/php/class.php:1.3 doc-editor/php/class.php:1.4 --- doc-editor/php/class.php:1.3 Sat Mar 28 23:53:29 2009 +++ doc-editor/php/class.php Sun Mar 29 02:44:06 2009 @@ -57,25 +57,25 @@ function __construct() { // Database settings - $_MysqlServ='localhost'; - $_MysqlUser='root'; - $_MysqlMdp='xxxxxxx'; - $_MysqlDB='doc-editor'; + $_MysqlServ = 'localhost'; + $_MysqlUser = 'root'; + $_MysqlMdp = 'xxxxxxx'; + $_MysqlDB = 'doc-editor'; // Connection MySqli try { $this->db = new mysqli($_MysqlServ, $_MysqlUser, $_MysqlMdp, $_MysqlDB); - if(mysqli_connect_errno()){ + if (mysqli_connect_errno()) { throw new Exception('connect databases faild!'); } } - catch (Exception $e){ - echo $e->getMessage(); + catch (Exception $e) { + echo $e->getMessage(); exit; } // - $this->availableLanguage = Array('ar','pt_BR','bg','zh','hk','tw','cs','da','nl','fi','fr','de','el','he','hu','it','ja','kr','no','fa','pl','pt','ro','ru', 'se','sk','sl','es','sv','tr'); + $this->availableLanguage = array('ar','pt_BR','bg','zh','hk','tw','cs','da','nl','fi','fr','de','el','he','hu','it','ja','kr','no','fa','pl','pt','ro','ru', 'se','sk','sl','es','sv','tr'); // $this->cvsDoc = $_SERVER["DOCUMENT_ROOT"].$this->dataPath."phpdoc-all/"; @@ -88,15 +88,17 @@ function checkoutRepository() { + $lock_file = $_SERVER["DOCUMENT_ROOT"].$this->dataPath.".lock_checkout_repository"; + // We place a lock file to test if checkout is finish - touch($_SERVER["DOCUMENT_ROOT"].$this->dataPath.".lock_checkout_repository"); + touch($lock_file); // We exec the checkout $cmd = "cd ".$_SERVER["DOCUMENT_ROOT"].$this->dataPath."; cvs -d :pserver:cvsread:phpfi@cvs.php.net:/repository login; cvs -d :pserver:cvsread:phpfi@cvs.php.net:/repository checkout phpdoc-all;"; exec($cmd); // We remove the lock file - unlink($_SERVER["DOCUMENT_ROOT"].$this->dataPath.".lock_checkout_repository"); + unlink($lock_file); } @@ -108,8 +110,6 @@ * @return Nothing. */ function rev_do_revcheck( $dir = '', $idDir ) { - static $id = 1; - if ($dh = opendir($this->cvsDoc . 'en/' . $dir)) { $entriesDir = array(); @@ -158,7 +158,7 @@ // $this->Check_doc() ? is this dir is /reference/*/functions/ ? $tmp = explode('/', $dir); - if( isset($tmp[1]) && isset($tmp[3]) && $tmp[1] == 'reference' && $tmp[3] == 'functions' ) { + if (isset($tmp[1]) && isset($tmp[3]) && $tmp[1] == 'reference' && $tmp[3] == 'functions' ) { $check_doc = $this->check_doc($infoEN['content']); @@ -180,12 +180,12 @@ $s = "INSERT INTO files (lang, xmlid, dir, path, name, revision, size, mdate, maintainer, status, check_oldstyle, check_undoc, check_roleerror, check_badorder, check_noseealso, check_noreturnvalues, check_noparameters, check_noexamples,check_noerrors) VALUES ('en', $xmlid, '$idDir', '$dir/', '$file', $en_revision, $en_size,$en_date, NULL, NULL, ".$check_doc['check_oldstyle'].", ".$check_doc['check_undoc'].", ".$check_doc['check_roleerror'].", ".$check_doc['check_badorder'].", ".$check_doc['check_noseealso'].", ".$check_doc['check_noreturnvalues'].", ".$check_doc['check_noparameters'].", ".$check_doc['check_noexamples'].", ".$check_doc['check_noerrors'].")"; - $this->db->query($s) or die('erreur:'.$this->db->error); + $this->db->query($s) or die('Error: '.$this->db->error); reset($this->availableLanguage); // Do for all language - while( list(, $lang) = each($this->availableLanguage)) { + while (list(, $lang) = each($this->availableLanguage)) { $path = $this->cvsDoc . $lang . $dir . '/' . $file; @@ -225,16 +225,16 @@ $status )"; - $this->db->query($s) or die('erreur:'.$this->db->error); + $this->db->query($s) or die('Error: '.$this->db->error); // Check for error in this file ONLY if this file is uptodate - if( $revision == $en_revision ) { + if ($revision == $en_revision ) { $error = $this->tools_error_check_all($infoLANG['content'], $infoEN['content']); - if( count($error) > 0 ) { $this->tools_error_log($lang, $dir.'/', $file, $error, $maintainer); } + if (count($error) > 0 ) { $this->tools_error_log($lang, $dir.'/', $file, $error, $maintainer); } } } else { - $this->db->query("INSERT INTO files (lang, dir, path, name, revision, size, mdate, maintainer, status) VALUES ('".$lang."', '$idDir', '$dir/', '$file', NULL, NULL, NULL, NULL, NULL);") or die('erreur:'.$this->db->error); + $this->db->query("INSERT INTO files (lang, dir, path, name, revision, size, mdate, maintainer, status) VALUES ('".$lang."', '$idDir', '$dir/', '$file', NULL, NULL, NULL, NULL, NULL);") or die('Error: '.$this->db->error); } } @@ -253,7 +253,7 @@ $path = $this->cvsDoc . 'en/' . $dir . '/' . $Edir; - $this->db->query("INSERT INTO dirs (parentDir, name) VALUES (" . $idDir . ", '$Edir');") or die('erreur:'.$this->db->error); + $this->db->query("INSERT INTO dirs (parentDir, name) VALUES (" . $idDir . ", '$Edir');") or die('Error: '.$this->db->error); $last_id = $this->db->insert_id; $this->rev_do_revcheck($dir . '/' . $Edir, $last_id); @@ -277,8 +277,8 @@ /** * Log into this application. - * @param $cvsLogin The login use to identify this user into Cvs Php server. - * @param $cvsPasswd The password, in plain text, to identify this user into Cvs Php server. + * @param $cvsLogin The login use to identify this user into PHP CVS server. + * @param $cvsPasswd The password, in plain text, to identify this user into PHP CVS server. * @param $lang The language we want to access. * @return An associated array. */ @@ -291,7 +291,7 @@ $r = $this->db->query($s) or die($this->db->error); $n = $r->num_rows; - if( $n == 0 ) { + if ($n == 0 ) { // No match $this->cvsLogin = $cvsLogin; @@ -301,13 +301,13 @@ $s = 'SELECT * FROM users WHERE cvs_login=\''.$cvsLogin.'\''; $r = $this->db->query($s) or die($this->db->error); $n = $r->num_rows; - if( $n == 0 ) { + if ($n == 0 ) { //User unknow from this server for now. // Is a valid cvs user ? $r = $this->cvsLoggingIn(); - if( $r === TRUE ) { + if ($r === TRUE ) { // We register this new valid user $userID = $this->register_user(); @@ -317,7 +317,7 @@ $_SESSION['cvsLogin'] = $this->cvsLogin; $_SESSION['cvsPasswd'] = $this->cvsPasswd; $_SESSION['lang'] = $this->cvsLang; - $_SESSION['userConf'] = Array( + $_SESSION['userConf'] = array( "conf_needupdate_diff" => 'using-exec', "conf_needupdate_scrollbars" => 'true', "conf_error_skipnbliteraltag" => 'true', @@ -329,7 +329,7 @@ $return['state'] = TRUE; - } elseif( $r == 'Bad password') { + } elseif ($r == 'Bad password') { $return['state'] = FALSE; $return['msg'] = 'Bad cvs password'; } else { @@ -352,7 +352,7 @@ $this->cvsLogin = $cvsLogin; $this->cvsPasswd = $cvsPasswd; $this->cvsLang = $lang; - $this->userConf = Array( + $this->userConf = array( "conf_needupdate_diff" => $a->conf_needupdate_diff, "conf_needupdate_scrollbars" => $a->conf_needupdate_scrollbars, "conf_error_skipnbliteraltag" => $a->conf_error_skipnbliteraltag, @@ -394,13 +394,13 @@ */ function isLogged() { - if( isset($_SESSION['userID']) ) { + if (isset($_SESSION['userID'])) { $this->userID = $_SESSION['userID']; $this->cvsLogin = $_SESSION['cvsLogin']; $this->cvsPasswd = $_SESSION['cvsPasswd']; $this->cvsLang = $_SESSION['lang']; - $this->userConf = ( isset($_SESSION['userConf']) ) ? $_SESSION['userConf'] : Array( + $this->userConf = ( isset($_SESSION['userConf']) ) ? $_SESSION['userConf'] : array( "conf_needupdate_diff" => 'using-exec', "conf_needupdate_scrollbars" => 'true', "conf_error_skipnbliteraltag" => 'true', @@ -418,12 +418,15 @@ } /** - * Register a new valid user on this application. - * Warning : Actually, we store the cvs password in plain text into the database to use it later. No others solution for now... + * Register a new valid user on the application. + * + * @todo The CVS password is stored in plain text into the database for later use. We need to find something better + * @return int The database insert id */ - function register_user() { - $s = 'INSERT INTO users (`cvs_login`, `cvs_passwd`) VALUES (\''.$this->cvsLogin.'\',\''.$this->cvsPasswd.'\')'; - $r = $this->db->query($s) or die($this->db->error); + function register_user() + { + $s = sprintf('INSERT INTO users (`cvs_login`, `cvs_passwd`) VALUES ("%s", "%s")', $this->cvsLogin, $this->cvsPasswd); + $this->db->query($s) or die($this->db->error); return $this->db->insert_id; } @@ -444,18 +447,14 @@ } /** - * Test if a lock file exist. + * Tells whether the lock file exist + * * @param $lockFile The name of the lock file we want to test. - * @return TRUE if the lock file exist, FALSE otherwise. + * @return TRUE if the lock file exists, FALSE otherwise. */ - function lockFileCheck($lockFile) { - - if( is_file($_SERVER["DOCUMENT_ROOT"].$this->dataPath."/.".$lockFile) ) { - return TRUE; - } else { - return FALSE; - } - + function lockFileCheck($lockFile) + { + return is_file($_SERVER["DOCUMENT_ROOT"].$this->dataPath."/.".$lockFile); } /** @@ -478,45 +477,56 @@ /** * CleanUp the dataBase before an Update. + * * @see updateRepository */ - function cleanUp() { - + function cleanUp() + { // We cleanUp the database before update Cvs and apply again all tools - $s = 'TRUNCATE TABLE dirs'; - $this->db->query($s) or die($this->db->error); - $s = 'TRUNCATE TABLE files'; - $this->db->query($s) or die($this->db->error); - $s = 'TRUNCATE TABLE translators'; - $this->db->query($s) or die($this->db->error); - $s = 'TRUNCATE TABLE errorfiles'; - $this->db->query($s) or die($this->db->error); - + foreach (array('dirs', 'files', 'translators', 'errorfiles') as $table) { + $this->db->query(sprintf('TRUNCATE TABLE %s', $table)) or die($this->db->error); + } } /** - * Use to encode Cvs Password when we try to identify the user into Cvs Php Server. + * Use to encode Cvs Password when we try to identify the user into PHP CVS Server. * @param $pass The password to encode. * @param $letter The password to encode. * @return TRUE if the lock file is present, FALSE otherwise. */ function encodeCvsPass($pass, $letter) { - define('CVS_AUTH_CODES', "0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 114, 120, 53, 79, 96, 109, 72, 108, 70, 64, 76, 67, 116, 74, 68, 87, 111, 52, 75, 119, 49, 34, 82, 81, 95, 65, 112, 86, 118, 110, 122, 105, 41, 57, 83, 43, 46, 102, 40, 89, 38, 103, 45, 50, 42, 123, 91, 35, 125, 55, 54, 66, 124, 126, 59, 47, 92, 71, 115, 78, 88, 107, 106, 56, 36, 121, 117, 104, 101, 100, 69, 73, 99, 63, 94, 93, 39, 37, 61, 48, 58, 113, 32, 90, 44, 98, 60, 51, 33, 97, 62, 77, 84, 80, 85, 223, 225, 216, 187, 166, 229, 189, 222, 188, 141, 249, 148, 200, 184, 136, 248, 190, 199, 170, 181, 204, 138, 232, 218, 183, 255, 234, 220, 247, 213, 203, 226, 193, 174, 172, 228, 252, 217, 201, 131, 230, 197, 211, 145, 238, 161, 179, 160, 212, 207, 221, 254, 173, 202, 146, 224, 151, 140, 196, 205, 130, 135, 133, 143, 246, 192, 159, 244, 239, 185, 168, 215, 144, 139, 165, 180, 157, 147, 186, 214, 176, 227, 231, 219, 169, 175,! 156, 206, 198, 129, 164, 150, 210, 154, 177, 134, 127, 182, 128, 158, 208, 162, 132, 167, 209, 149, 241, 153, 251, 237, 236, 171, 195, 243, 233, 253, 240, 194, 250, 191, 155, 142, 137, 245, 235, 163, 242, 178, 152" ); + static $code = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 114, 120, 53, 79, 96, 109, 72, 108, 70, 64, 76, 67, 116, 74, 68, + 87, 111, 52, 75, 119, 49, 34, 82, 81, 95, 65, 112, 86, 118, 110, 122, + 105, 41, 57, 83, 43, 46, 102, 40, 89, 38, 103, 45, 50, 42, 123, 91, + 35, 125, 55, 54, 66, 124, 126, 59, 47, 92, 71, 115, 78, 88, 107, 106, + 56, 36, 121, 117, 104, 101, 100, 69, 73, 99, 63, 94, 93, 39, 37, 61, + 48, 58, 113, 32, 90, 44, 98, 60, 51, 33, 97, 62, 77, 84, 80, 85, 223, + 225, 216, 187, 166, 229, 189, 222, 188, 141, 249, 148, 200, 184, 136, + 248, 190, 199, 170, 181, 204, 138, 232, 218, 183, 255, 234, 220, 247, + 213, 203, 226, 193, 174, 172, 228, 252, 217, 201, 131, 230, 197, 211, + 145, 238, 161, 179, 160, 212, 207, 221, 254, 173, 202, 146, 224, 151, + 140, 196, 205, 130, 135, 133, 143, 246, 192, 159, 244, 239, 185, 168, + 215, 144, 139, 165, 180, 157, 147, 186, 214, 176, 227, 231, 219, 169, + 175, 156, 206, 198, 129, 164, 150, 210, 154, 177, 134, 127, 182, 128, + 158, 208, 162, 132, 167, 209, 149, 241, 153, 251, 237, 236, 171, 195, + 243, 233, 253, 240, 194, 250, 191, 155, 142, 137, 245, 235, 163, 242, + 178, 152); - $code = explode(", ",CVS_AUTH_CODES); - $f=$letter; - for($i=0; $i < strlen($pass); $i++) - $f .=chr( $code[ ord($pass[$i]) ] ); - return $f; + for ($i = 0; $i < strlen($pass); $i++) { + $letter .= chr($code[ord($pass[$i])]); + } + return $letter; } /** - * Loggin into Cvs Php Server. + * Loggin into PHP CVS Server. * @return TRUE if the loggin success, error message otherwise. */ function cvsLoggingIn() { - $fp = fsockopen( "cvs.php.net", 2401,$e,$errorstr); + $fp = fsockopen("cvs.php.net", 2401); fwrite($fp, "BEGIN AUTH REQUEST\n"); fwrite($fp, "/repository\n"); fwrite($fp, $this->cvsLogin."\n"); @@ -526,13 +536,13 @@ $r = fread($fp,1024); - if ( trim($r) != "I LOVE YOU" ) { - if ( trim($r) == "I HATE YOU") { - return "Bad password"; + if (trim($r) != 'I LOVE YOU') { + if (trim($r) == 'I HATE YOU') { + return 'Bad password'; } else { return $r; } - }else { + } else { return TRUE; } @@ -548,6 +558,7 @@ $cmd = 'cd '.$this->cvsDoc.$Path.'; cvs log '.$File; + $output = array(); exec($cmd, $output); $output = implode("\n", $output); @@ -556,36 +567,39 @@ $part = explode("----------------------------", $output); - for( $i=1; $i < count($part); $i++ ) { + for ($i=1; $i < count($part); $i++ ) { $final[$i-1]['id'] = $i; $final[$i-1]['raw'] = $part[$i]; // Get revision - preg_match("/revision (.*?)\n/e", $part[$i], $out); + $out = array(); + preg_match('/revision (.*?)\n/e', $part[$i], $out); $final[$i-1]['revision'] = $out[1]; // Get date - preg_match("/date: (.*?);/e", $part[$i], $out); + $out = array(); + preg_match('/date: (.*?);/e', $part[$i], $out); $final[$i-1]['date'] = $out[1]; // Get user - preg_match("/author: (.*?);/e", $part[$i], $out); + $out = array(); + preg_match('/author: (.*?);/e', $part[$i], $out); $final[$i-1]['author'] = $out[1]; //Get content $content = explode("\n", $part[$i]); - if( substr($content[3], 0, 9) == 'branches:' ) { $j=4; } + if (substr($content[3], 0, 9) == 'branches:' ) { $j=4; } else { $j=3; } $final[$i-1]['content'] = ''; - for( $h=$j; $h < count($content); $h++) { + for ($h=$j; $h < count($content); $h++) { $final[$i-1]['content'] .= $content[$h]."\n"; } - $final[$i-1]['content'] = str_replace("\n", "<br/>", trim($final[$i-1]['content'])); + $final[$i-1]['content'] = str_replace("\n", '<br/>', trim($final[$i-1]['content'])); } return $final; @@ -605,7 +619,8 @@ foreach ($tags_attrs as $attrib_list) { // Get attr name and values - preg_match_all("!(.+)=\\s*([\"'])\\s*(.+)\\2!U", $attrib_list, $attribs); + $attribs = array(); + preg_match_all('!(.+)=\\s*(["\'])\\s*(.+)\\2!U', $attrib_list, $attribs); // Assign all attributes to one associative array $attrib_array = array(); @@ -620,7 +635,6 @@ } function rev_check_old_files($dir = '') { - static $id = 1; if ($dh = opendir($this->cvsDoc . $this->cvsLang . $dir)) { @@ -653,27 +667,20 @@ } // Files first - if (sizeof($entriesFiles) > 0 ) { - + if (!empty($entriesFiles)) { foreach($entriesFiles as $file) { - $path_en = $this->cvsDoc . 'en/' . $dir . '/' . $file; $path = $this->cvsDoc . $this->cvsLang . $dir . '/' . $file; - if( !@is_file($path_en) ) { - + if (!@is_file($path_en)) { $size = intval(filesize($path) / 1024); - $this->db->query("INSERT INTO old_files (lang, dir, file, size, userID) VALUES ('$lang', '$dir', '$file', '$size', ".$this->userID.");") or die('erreur:'.$mysqli->error); - + $this->db->query("INSERT INTO old_files (lang, dir, file, size, userID) VALUES ('$lang', '$dir', '$file', '$size', ".$this->userID.");") or die('Error: '.$this->db->error); } } } // Directories.. - if (sizeof($entriesDir) > 0) { - - reset($entriesDir); - + if (!empty($entriesDir)) { foreach ($entriesDir as $Edir) { $this->rev_check_old_files($dir . '/' . $Edir); } @@ -689,7 +696,7 @@ function rev_parse_translation() { reset($this->availableLanguage); - while( list(, $lang) = each($this->availableLanguage)) { + while (list(, $lang) = each($this->availableLanguage)) { // Path to find translation.xml file, set default values, // in case we can't find the translation file @@ -698,14 +705,14 @@ if (file_exists($translation_xml)) { // Else go on, and load in the file, replacing all // space type chars with one space - $txml = join("", file($translation_xml)); - $txml = preg_replace("/\\s+/", " ", $txml); + $txml = preg_replace('/\\s+/', ' ', join('', file($translation_xml))); } if (isset($txml)) { // Find all persons matching the pattern - if (preg_match_all("!<person (.+)/\\s?>!U", $txml, $matches)) { + $matches = array(); + if (preg_match_all('!<person (.+)/\\s?>!U', $txml, $matches)) { $default = array('cvs' => 'n/a', 'nick' => 'n/a', 'editor' => 'n/a', 'email' => 'n/a', 'name' => 'n/a'); $persons = $this->rev_parse_attr_string($matches[1]); @@ -713,7 +720,7 @@ foreach ($persons as $person) { - if( $charset == 'utf-8' ) { + if ($charset == 'utf-8' ) { $name = utf8_decode($person['name']); } else { $name = $person['name']; @@ -735,25 +742,16 @@ function get_modified_files() { // Get Modified Files - - $s = 'SELECT * FROM `pendingCommit` WHERE `lang`=\''.$this->cvsLang.'\' OR `lang`=\'en\''; + $s = sprintf('SELECT id, dir AS path, name, CONCAT("1.", revision) AS revision, + CONCAT("1.", en_revision) AS en_revision, maintainer, reviewed FROM `pendingCommit` WHERE + `lang`="%s" OR lang="en"', $this->cvsLang); + $r = $this->db->query($s) or die($this->db->error); - $nb = $r->num_rows; $node = array(); - while( $a = $r->fetch_object() ) { - - $node[$a->lang.$a->path.$a->name] = array( - "id" => $a->id, - "dir" => $a->path, - "name" => $a->name, - "revision" => '1.'.$a->revision, - "en_revision" => '1.'.$a->en_revision, - "maintainer" => $a->maintainer, - "reviewed" => $a->reviewed - ); - + while ($a = $r->fetch_assoc()) { + $node[$a->lang.$a->path.$a->name] = $a; } return $node; @@ -769,7 +767,7 @@ // Get Files Need Commit $ModifiedFiles = $this->get_modified_files(); - if( $_SESSION['userConf']['conf_error_skipnbliteraltag'] == 'true' ) { + if ($_SESSION['userConf']['conf_error_skipnbliteraltag'] == 'true' ) { $type = ' type != \'nbLiteralTags\' AND '; } else { $type = ''; @@ -782,17 +780,17 @@ $alreadyNode = array(); - while( $a = $r->fetch_object() ) { + while ($a = $r->fetch_object()) { - if( !isset($alreadyNode[$a->path.$a->name]) ) { + if (!isset($alreadyNode[$a->path.$a->name])) { - if( isset($ModifiedFiles[$this->cvsLang.$a->path.$a->name]) || isset($ModifiedFiles['en'.$a->path.$a->name]) ) { + if (isset($ModifiedFiles[$this->cvsLang.$a->path.$a->name]) || isset($ModifiedFiles['en'.$a->path.$a->name])) { - if(isset($ModifiedFiles['en'.$a->path.$a->name])) { + if (isset($ModifiedFiles['en'.$a->path.$a->name])) { $new_maintainer = $a->maintainer; } - if(isset($ModifiedFiles[$this->cvsLang.$a->path.$a->name])) { + if (isset($ModifiedFiles[$this->cvsLang.$a->path.$a->name])) { $new_maintainer = $ModifiedFiles[$this->cvsLang.$a->path.$a->name]['maintainer']; } @@ -827,7 +825,7 @@ } - return Array('nb'=>$nb, 'node'=>$node); + return array('nb'=>$nb, 'node'=>$node); } @@ -846,17 +844,17 @@ $node = array(); - while( $a = $r->fetch_object() ) { + while ($a = $r->fetch_object()) { - if( isset($ModifiedFiles[$this->cvsLang.$a->path.$a->name]) || isset($ModifiedFiles['en'.$a->path.$a->name]) ) { + if (isset($ModifiedFiles[$this->cvsLang.$a->path.$a->name]) || isset($ModifiedFiles['en'.$a->path.$a->name])) { - if(isset($ModifiedFiles['en'.$a->path.$a->name])) { + if (isset($ModifiedFiles['en'.$a->path.$a->name])) { $new_en_revision = $ModifiedFiles['en'.$a->path.$a->name]['revision']; $new_revision = '1.'.$a->revision; $new_maintainer = $a->maintainer; } - if(isset($ModifiedFiles[$this->cvsLang.$a->path.$a->name])) { + if (isset($ModifiedFiles[$this->cvsLang.$a->path.$a->name])) { $new_en_revision = '1.'.$a->en_revision; $new_revision = $ModifiedFiles[$this->cvsLang.$a->path.$a->name]['en_revision']; $new_maintainer = $ModifiedFiles[$this->cvsLang.$a->path.$a->name]['maintainer']; @@ -885,7 +883,7 @@ ); } } - return Array('nb'=>$nb, 'node'=>$node); + return array('nb'=>$nb, 'node'=>$node); } /** @@ -901,18 +899,18 @@ $r = $this->db->query($s); $nb = $r->num_rows; - $node=Array(); + $node=array(); - while( $a = $r->fetch_object() ) { + while ($a = $r->fetch_object()) { - if( isset($ModifiedFiles[$this->cvsLang.$a->path.$a->name]) || isset($ModifiedFiles['en'.$a->path.$a->name]) ) { + if (isset($ModifiedFiles[$this->cvsLang.$a->path.$a->name]) || isset($ModifiedFiles['en'.$a->path.$a->name])) { - if(isset($ModifiedFiles['en'.$a->path.$a->name])) { + if (isset($ModifiedFiles['en'.$a->path.$a->name])) { $new_reviewed = $a->reviewed; $new_maintainer = $a->maintainer; } - if(isset($ModifiedFiles[$this->cvsLang.$a->path.$a->name])) { + if (isset($ModifiedFiles[$this->cvsLang.$a->path.$a->name])) { $new_reviewed = $ModifiedFiles[$this->cvsLang.$a->path.$a->name]['reviewed']; $new_maintainer = $ModifiedFiles[$this->cvsLang.$a->path.$a->name]['maintainer']; } @@ -936,7 +934,7 @@ ); } } - return Array('nb'=>$nb, 'node'=>$node); + return array('nb'=>$nb, 'node'=>$node); } /** @@ -951,7 +949,7 @@ $node = array(); - while( $a = $r->fetch_object() ) { + while ($a = $r->fetch_object()) { $node[] = array( "id" => $a->id, @@ -964,7 +962,7 @@ } - return Array('nb'=>$nb, 'node'=>$node); + return array('nb'=>$nb, 'node'=>$node); } /** @@ -979,7 +977,7 @@ $node = array(); - while( $a = $r->fetch_object() ) { + while ($a = $r->fetch_object()) { $node[] = array( "id" => $a->id, @@ -991,7 +989,7 @@ } - return Array('nb'=>$nb, 'node'=>$node); + return array('nb'=>$nb, 'node'=>$node); } /** @@ -1000,15 +998,7 @@ */ function get_translators() { - $sql = 'SELECT - id, - nick, - name, - mail, - cvs - FROM - translators - WHERE lang="' . $this->cvsLang . '"'; + $sql = sprintf('SELECT id, nick, name, mail, cvs FROM translators WHERE lang="%s"', $this->cvsLang); $persons = array(); $result = $this->db->query($sql) or die($this->db->error); @@ -1061,7 +1051,7 @@ $nbFiles[1] = $uptodate[1]+$old[1]+$critical[1]+$withoutRevTag[1]+$missFiles[1]; - $summary=array(); + $summary = array(); $summary[0]['id'] = 1; $summary[0]['libel'] = 'Up to date files'; @@ -1426,25 +1416,23 @@ */ function get_last_mailing() { - if( $this->cvsLang != 'en' ) { - $url = 'http://news.php.net/group.php?group=php.doc.'.strtolower(str_replace('_', '-', $this->cvsLang)).'&format=rss'; - } else { - $url = 'http://news.php.net/group.php?group=php.doc&format=rss'; - } + $url = 'http://news.php.net/group.php?format=rss&group=php.doc'; - $r = file_get_contents($url); + if ($this->cvsLang != 'en') { + $url .= '.' . strtolower(str_replace('_', '-', $this->cvsLang)); + } - $xml = new SimpleXMLElement($r); + $xml = new SimpleXMLElement(file_get_contents($url)); $channel = $xml->channel; - $i=0; + $i = 0; foreach ($channel->item as $item) { $result[$i]['id'] = $i; $result[$i]['title'] = (string) $item->title; $result[$i]['description'] = preg_replace('/(<a href[^>]+">)([^>]+)(<\/a>)/', "$2", (string) $item->description); $result[$i]['link'] = (string) $item->link; - $result[$i]['pubDate'] = date("Y/m/d H:i:s", strtotime((string) $item->pubDate)); + $result[$i]['pubDate'] = date('Y/m/d H:i:s', strtotime((string) $item->pubDate)); $i++; } return $result; @@ -1470,15 +1458,16 @@ $title = (string) $item->title; $description = $item->description; - if( strstr($title, '['.strtoupper($this->cvsLang).']')) { + if (strstr($title, '['.strtoupper($this->cvsLang).']')) { $result[$i]['id'] = $i; $result[$i]['title'] = $title; - if( strstr($description, "Reproduce code:")) { - preg_match_all("/Description:\s*?------------(.*?)Reproduce code:/s", $description, $match); + $match = array(); + if (strstr($description, "Reproduce code:")) { + preg_match_all('/Description:\s*?------------(.*?)Reproduce code:/s', $description, $match); } else { - preg_match_all("/Description:\s*?------------(.*)/s", $description, $match); + preg_match_all('/Description:\s*?------------(.*)/s', $description, $match); } $result[$i]['description'] = (isset($match[1][0])) ? highlight_string(trim($match[1][0]), true) : ''; @@ -1498,18 +1487,19 @@ */ function getFileEncoding($file, $mode) { - if( $mode == 'file' ) { + if ($mode == 'file' ) { $txml = file_get_contents($file); } else { $txml = $file; } - $txml = preg_replace("/\\s+/", " ", $txml); + $txml = preg_replace('/\\s+/', ' ', $txml); - preg_match("!<\?xml(.+)\?>!U", $txml, $match); + $match = array(); + preg_match('!<\?xml(.+)\?>!U', $txml, $match); $xmlinfo = $this->rev_parse_attr_string($match); - $charset = (isset($xmlinfo[1]["encoding"])) ? strtolower($xmlinfo[1]["encoding"]) : 'iso-8859-1'; + $charset = (isset($xmlinfo[1]['encoding'])) ? strtolower($xmlinfo[1]['encoding']) : 'iso-8859-1'; return $charset; } @@ -1528,10 +1518,10 @@ $file = $FilePath.$FileName; - // Is this file have been modified ? + // Is this file modified ? $ModifiedFiles = $this->get_modified_files(); - if( isset($ModifiedFiles[$file]) ) { $extension = '.new'; } + if (isset($ModifiedFiles[$file])) { $extension = '.new'; } else { $extension = ''; } $file = $this->cvsDoc.$file.$extension; @@ -1555,7 +1545,7 @@ */ function saveFile($FilePath, $content, $lang, $type, $uniqID='') { - if( $type == 'file' ) { $ext = '.new'; } + if ($type == 'file' ) { $ext = '.new'; } else { $ext = '.'.$uniqID.'.patch'; } // Security @@ -1587,7 +1577,7 @@ $nb = $r->num_rows; // We insert or update the pendingCommit table - if( $nb == 0 ) { + if ($nb == 0 ) { $s = 'INSERT into pendingCommit (`lang`, `path`, `name`, `revision`, `en_revision`, `reviewed`, `maintainer`, `modified_by`, `date`) VALUES (\''.$lang.'\', \''.$FilePath.'\', \''.$FileName.'\', \''.$revision.'\', \''.$en_revision.'\', \''.$reviewed.'\', \''.$maintainer.'\', \''.$this->cvsLogin.'\', now())'; $this->db->query($s) or die($this->db->error); $fileID = $this->db->insert_id; @@ -1602,6 +1592,7 @@ /** * Register a new patch, into the database. + * @todo FIXME: Do we really want to return $uniqId and not $fileID ? If so, $fileId definition may be removed * @param $lang The lang. * @param $FilePath The path for the file. * @param $FileName The name of the file. @@ -1629,13 +1620,15 @@ $info = array('rev'=>0, 'en-rev'=>0, 'maintainer'=>'NULL', 'reviewed'=>'NULL', 'status'=>'NULL', 'xmlid'=>'NULL', 'content'=>$content); // Cvs tag - preg_match("/<!-- .Revision: \d+\.(\d+) . -->/", $content, $match); + $match = array(); + preg_match('/<!-- .Revision: \d+\.(\d+) . -->/', $content, $match); if (!empty($match)) { $info['rev'] = $match[1]; } //Rev tag - preg_match("/<!--\s*EN-Revision:\s*\d+\.(\d+)\s*Maintainer:\s*(\\S*)\s*Status:\s*(.+)\s*-->/U", $content, $match); + $match = array(); + preg_match('/<!--\s*EN-Revision:\s*\d+\.(\d+)\s*Maintainer:\s*(\\S*)\s*Status:\s*(.+)\s*-->/U', $content, $match); if (!empty($match)) { $info['en-rev'] = $match[1]; $info['maintainer'] = $match[2]; @@ -1643,17 +1636,17 @@ } // Reviewed tag - if( preg_match("/<!--\s*Reviewed:\s*(.*?)*-->/Ui", $content, $match) ) { + $match = array(); + if (preg_match('/<!--\s*Reviewed:\s*(.*?)*-->/Ui', $content, $match)) { $info['reviewed'] = trim($match[1]); } // All xmlid - if( preg_match_all("/xml:id=\"(.*?)\"/", $content, $match) ) { + $match = array(); + if (preg_match_all('/xml:id="(.*?)"/', $content, $match)) { $info['xmlid'] = implode('|',$match[1]); } - - return $info; } @@ -1693,6 +1686,7 @@ $cmd = 'cd '.$this->cvsDoc.$path.'; diff -uN '.$file.' '.$file.'.new'; + $output = array(); exec($cmd, $output); return implode("\r\n",$output); @@ -1710,17 +1704,18 @@ $cmd = 'cd '.$this->cvsDoc.$path.'; cvs diff -kk -u -r '.$rev2.' -r '.$rev1.' '.$file; + $output = array(); exec($cmd, $output); - $output = join("\n", $output); + $output = htmlentities(join("\n", $output)); - $output = htmlentities($output); + $match = array(); - preg_match_all("/@@(.*?)@@(.[^@@]*)/s", $output,$match); + preg_match_all('/@@(.*?)@@(.[^@@]*)/s', $output, $match); $diff = array(); - for( $i=0; $i < count($match[1]); $i++ ) { + for ($i = 0; $i < count($match[1]); $i++ ) { $diff[$i]['line'] = $match[1][$i]; $diff[$i]['content'] = $match[2][$i]; @@ -1729,7 +1724,7 @@ $return = '<table class="code">'; - for( $i=0; $i < count($diff); $i++ ) { + for ($i = 0; $i < count($diff); $i++ ) { // Line $return .= ' @@ -1741,13 +1736,21 @@ // Content $tmp = explode("\n", trim($diff[$i]['content'])); - for( $j=0; $j < count($tmp); $j++ ) { + for ($j=0; $j < count($tmp); $j++ ) { $tmp[$j] = str_replace(" ", " ", $tmp[$j]); - - if( substr($tmp[$j], 0, 1) == "+" ) $class = 'ins'; - else if( substr($tmp[$j], 0, 1) == "-" ) $class = 'del'; - else $class = ''; + switch (substr($tmp[$j], 0, 1)) { + case '+': + $class = 'ins'; + break; + case '-': + $class = 'del'; + break; + + default: + $class = ''; + break; + } $return .= ' <tr> @@ -1778,13 +1781,13 @@ * Each time we commit, we store in DB the commit message to be use later. This method get all this message from DB. * @return An indexed array of commit message. */ - function getCommitLogMessage() { - - $result=array(); + function getCommitLogMessage() + { + $result = array(); - $s = 'SELECT id, text FROM commitMessage WHERE userID=\''.$this->userID.'\''; + $s = sprintf('SELECT id, text FROM commitMessage WHERE userID="%s"', $this->userID); $r = $this->db->query($s); - while( $a = $r->fetch_assoc() ) { + while ($a = $r->fetch_assoc()) { $result[] = $a; } @@ -1797,12 +1800,11 @@ * @param $output The output message. * @return Nothing. */ - function saveOutputLogFile($file, $output) { - - $fp = fopen($this->cvsDoc.'../.'.$file, 'w'); + function saveOutputLogFile($file, $output) + { + $fp = fopen($this->cvsDoc . '../.' . $file, 'w'); fwrite($fp, implode("<br>",$output)); fclose($fp); - } /** @@ -1811,7 +1813,7 @@ * @return $content The content. */ function getOutputLogFile($file) { - return file_get_contents($this->cvsDoc.'../.'.$file); + return file_get_contents($this->cvsDoc . '../.' . $file); } /** @@ -1821,16 +1823,17 @@ */ function checkBuild($enable_xml_details='false') { - if( $enable_xml_details == 'true' ) { + if ($enable_xml_details == 'true' ) { $cmd = 'cd '.$this->cvsDoc.';/usr/bin/php configure.php --with-lang='.$this->cvsLang.' --disable-segfault-error --enable-xml-details;'; } else { $cmd = 'cd '.$this->cvsDoc.';/usr/bin/php configure.php --with-lang='.$this->cvsLang.' --disable-segfault-error;'; } + $output = array(); exec($cmd, $output); //Format the outPut - $output = str_replace("Warning", "<span style=\"color: #FF0000; font-weight: bold;\">Warning</span>", $output); + $output = str_replace("Warning", '<span style="color: #FF0000; font-weight: bold;">Warning</span>', $output); return $output; } @@ -1866,7 +1869,7 @@ @unlink($doc); // We need check for error in this file - $anode[0] = Array( 0 => $path, 1 => $file, 2 => $lang); + $anode[0] = array( 0 => $path, 1 => $file, 2 => $lang); $error = $this->updateFilesError($anode, 'nocommit'); // We need reload original lang_revision @@ -1879,7 +1882,7 @@ $info['maintainer'] = $a->maintainer; $info['reviewed'] = $a->reviewed; - if( isset($error['first']) ) { + if (isset($error['first'])) { $info['errorState'] = true; $info['errorFirst'] = $error['first']; } else { @@ -1902,7 +1905,7 @@ $files = ''; - for( $i=0; $i < count($anode); $i++ ) { + for ($i = 0; $i < count($anode); $i++ ) { // We need move .new file into the real file @unlink( $this->cvsDoc.$anode[$i][0].$anode[$i][1]); @@ -1913,10 +1916,11 @@ } // Escape single quote - $log = str_replace("'", "\'", $log); + $log = str_replace("'", "\\'", $log); // First, login into Cvs $cmd = 'export CVS_PASSFILE='.$_SERVER["DOCUMENT_ROOT"].$this->dataPath.'.cvspass && cd '.$this->cvsDoc.' && cvs -d :pserver:'.$this->cvsLogin.':'.$this->cvsPasswd.'@cvs.php.net:/repository login && cvs -d :pserver:'.$this->cvsLogin.':'.$this->cvsPasswd.'@cvs.php.net:/repository -f commit -l -m \''.$log.'\' '.$files; + $output = array(); exec($cmd, $output); $this->debug('commit cmd : '.$cmd); @@ -1944,7 +1948,7 @@ */ function updateRev($anode) { - for( $i=0; $i < count($anode); $i++ ) { + for ($i = 0; $i < count($anode); $i++ ) { $t = explode("/", $anode[$i][0]); @@ -1955,7 +1959,7 @@ $FileName = $anode[$i][1]; //En file ? - if( $FileLang == 'en' ) { + if ($FileLang == 'en' ) { $path = $this->cvsDoc.'en/'.$FilePath.$FileName; $content = file_get_contents($path); @@ -2040,24 +2044,23 @@ */ function updateFilesError($anode, $action='commit', $lang_content='', $en_content='') { - for( $i=0; $i < count($anode); $i++ ) { + for ($i = 0; $i < count($anode); $i++) { - $FileLang = $anode[$i][2]; $FilePath = $anode[$i][0]; $FileName = $anode[$i][1]; + $FileLang = $anode[$i][2]; // Remove all row in errorfiles tables $s = 'DELETE FROM errorfiles WHERE lang=\''.$FileLang.'\' AND path=\''.$FilePath.'\' AND name=\''.$FileName.'\''; $this->db->query($s) or die($this->db->error.'|'.$s); - if( $lang_content == '' ) { + if ($lang_content == '' ) { // Do tools_error on this file $en_content = file_get_contents($this->cvsDoc.'en'.$FilePath.$FileName); $lang_content = file_get_contents($this->cvsDoc.$FileLang.$FilePath.$FileName); $info = $this->getInfoFromFile($this->cvsDoc.$FileLang.$FilePath.$FileName); - } else { $info = $this->getInfoFromContent($lang_content); } @@ -2066,20 +2069,25 @@ $error = $this->tools_error_check_all($lang_content, $en_content); - if( count($error) > 0 ) { + if (count($error)) { $this->tools_error_log($FileLang, $FilePath, $FileName, $error, $maintainer); - } elseif( $action != 'commit' ) { + } elseif ($action != 'commit' ) { // Case if there is no error but this file isn't commit now. We must stay it in DB for commit later // Build empty error - $error[0] = Array( "value_en" => "-", "value_lang" => "-", "type" => "-No error-" ); + $error[0] = array( 'value_en' => '-', 'value_lang' => '-', 'type' => '-No error-' ); $this->tools_error_log($FileLang, $FilePath, $FileName, $error, $maintainer); } - if( $i == 0 && $action != 'commit' ) { - if( count($error) > 0 ) { $return['state'] = true; $return['first'] = $error[0]['type']; } - else { $return['state'] = false; $return['first']='';} + if ($i == 0 && $action != 'commit' ) { + if (count($error)) { + $return['state'] = true; + $return['first'] = $error[0]['type']; + } else { + $return['state'] = false; + $return['first'] = ''; + } return $return; } @@ -2094,7 +2102,7 @@ */ function removeNeedCommit($anode) { - for( $i=0; $i < count($anode); $i++ ) { + for ($i = 0; $i < count($anode); $i++ ) { $t = explode("/", $anode[$i][0]); @@ -2121,7 +2129,7 @@ function debug($mess) { - $mess = '['.date("d/m:Y � H:i:s").'] by '.$this->cvsLogin.' : '.$mess."\n"; + $mess = '['.date("d/m:Y H:i:s").'] by '.$this->cvsLogin.' : '.$mess."\n"; $fp = fopen($this->cvsDoc.'../.debug', 'a+'); fwrite($fp, $mess); @@ -2140,7 +2148,7 @@ $r = $this->db->query($s) or die($this->db->error); $nb = $r->num_rows; - if( $nb == 0 ) { + if ($nb == 0 ) { $s = 'INSERT INTO commitMessage (`text`,`userID`) VALUES (\''.$this->db->real_escape_string($logMessage).'\', \''.$this->userID.'\')'; $this->db->query($s) or die($this->db->error); } @@ -2164,14 +2172,10 @@ /* Methods to check error in a translation */ - function tools_error_start() { - $dir = $this->cvsDoc.$this->cvsLang."/"; - $this->tools_error_do('/'); - } - - - function tools_error_do($dir) { + function tools_error_do($dir) + { + static $ignoredDirs = array('.', '..', 'CVS'); $heredir = $this->cvsDoc.$this->cvsLang.$dir; $en_dir = str_replace("/".$this->cvsLang."/", "/en/", $heredir); @@ -2187,8 +2191,9 @@ // If we found a file with one or two point as a name, // or a CVS directory, skip the file - if (preg_match("/^\.{1,2}/",$file) || $file == 'CVS') - continue; + if (in_array($file, $ignoredDirs)) { + continue; + } // JUST TEMPORARY TILL THE <TRANSLATION>/REFERENCE/FUNCTIONS.XML - ISSUE IS CLARIFIED // If we found a file functions.xml in the @@ -2227,7 +2232,7 @@ foreach ($files as $file) { - if( is_file($heredir.$file) && is_file($en_dir.$file) ) { + if (is_file($heredir.$file) && is_file($en_dir.$file)) { $infoLANG = $this->getInfoFromFile($heredir.$file); $infoEN = $this->getInfoFromFile($en_dir.$file); @@ -2236,11 +2241,11 @@ continue; } - if( $infoLANG['en-rev'] == $infoEN['rev'] ) { + if ($infoLANG['en-rev'] == $infoEN['rev'] ) { $error = $this->tools_error_check_all($infoLANG['content'], $infoEN['content']); - if( count($error) > 0 ) { $this->tools_error_log($dir, $file, $error, $infoLANG['maintainer']); } + if (count($error) > 0 ) { $this->tools_error_log($dir, $file, $error, $infoLANG['maintainer']); } } } else { @@ -2258,7 +2263,7 @@ // this dir and subdirectories [if any] return; - } // tools_error_start() function end + } // tools_error_do() function end function tools_error_getInfo($path, $name) { @@ -2274,114 +2279,122 @@ $r = $this->db->query($s); - $return = ''; + $return = array(); - while( $a = $r->fetch_object()) { - - if( isset($return[$a->type]['error']) ) { - $i=count($return[$a->type]['error']); + while ($record = $r->fetch_object()) { + if (isset($return[$record->type]['error'])) { + $i = count($return[$record->type]['error']); } else { - $i=0; + $i = 0; } - - $return[$a->type]['error'][$i]['value_en'] = $a->value_en; - $return[$a->type]['error'][$i]['value_lang'] = $a->value_lang; + $return[$record->type]['error'][$i]['value_en'] = $record->value_en; + $return[$record->type]['error'][$i]['value_lang'] = $record->value_lang; } return $return; } - function tools_error_log($lang, $path, $name, $error, $maintainer) { - for( $i=0; $i < count($error); $i++) { - $s = 'INSERT INTO errorfiles (`lang`, `path`, `name`, `maintainer`, `value_en`,`value_lang`,`type`) VALUES - (\''.$lang.'\', \''.$path.'\',\''.$name.'\','.$maintainer.',\''.$this->db->real_escape_string($error[$i]['value_en']).'\',\''.$this->db->real_escape_string($error[$i]['value_lang']).'\',\''.$error[$i]['type'].'\')'; - $this->db->query($s) or die($this->db->error.'<hr><pre>'.$s.'</pre>'); + function tools_error_log($lang, $path, $name, $errors, $maintainer) + { + + $sql = 'INSERT INTO errorfiles (`lang`, `path`, `name`, `maintainer`, `value_en`,`value_lang`,`type`) VALUES'; + $pattern = ' ("%s", "%s", "%s", "%s", "%s", "%s", "%s"),'; + + //(\''.$lang.'\', \''.$path.'\',\''.$name.'\','.$maintainer.',\''.$this->db->real_escape_string($error[$i]['value_en']).'\',\''.$this->db->real_escape_string($error[$i]['value_lang']).'\',\''.$error[$i]['type'].'\')'; + + foreach ($errors as $error) { + $sql .= sprintf($pattern, $lang, $path, $name, $maintainer, $this->db->real_escape_string($error['value_en']), + $this->db->real_escape_string($error['value_lang']), $error['type']); } + + $sql = substr($sql, 0, -1); + $this->db->query($sql) or die($this->db->error.'<hr/><pre>'.$sql.'</pre>'); + } function tools_error_check_all($lang_content, $en_content) { // We remove comment in EN and lang content - $lang_content = preg_replace("/<!--(.*?)?-->/s", "", $lang_content); - $en_content = preg_replace("/<!--(.*?)?-->/s", "", $en_content); + $lang_content = preg_replace('/<!--(.*?)?-->/s', '', $lang_content); + $en_content = preg_replace('/<!--(.*?)?-->/s', '', $en_content); $result_error = array(); $r = $this->tools_error_check_methodsynopsis($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_nbMemberInSeeAlso($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_nbElInTable($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } // Get user pref - if( isset($_SESSION['userConf']['conf_error_skipnbliteraltag']) && $_SESSION['userConf']['conf_error_skipnbliteraltag'] == 'false' ) { + if (isset($_SESSION['userConf']['conf_error_skipnbliteraltag']) && $_SESSION['userConf']['conf_error_skipnbliteraltag'] == 'false' ) { $r = $this->tools_error_check_nbLiteralTag($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } } $r = $this->tools_error_check_nbParaTag($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_nbNoteTag($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_nbChapterTag($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_classsynopsis($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_nbCdataTags($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_spaceOrPeriodRefpurposeTags($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_attributRefsec1Tags($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_attributRefentryTags($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_attributReferenceTags($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_attributVarlistentryTags($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_attributSectionTags($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_attributPrefaceTags($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_attributBookTags($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_attributSect1Tags($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_attributQandaentryTags($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_attributLinkTags($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_attributAppendixTags($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_attributChapterTags($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } - $return = Array(); + $return = array(); for($i=0;$i<count($result_error);$i++){ - for( $j=0;$j<count($result_error[$i]);$j++){ + for ($j=0;$j<count($result_error[$i]);$j++){ array_push($return, $result_error[$i][$j]); } } @@ -2392,78 +2405,55 @@ function tools_error_check_attributChapterTags($lang_content, $en_content) { // attributs in chapter tags - $result_error = FALSE; - - $en_chapter = array(); - preg_match_all("/<chapter\s*?xml:id=\"(.*?)\"\s*?(xmlns=\"(.*?)\")?\s*?(xmlns:xlink=\"(.*?)\"\s*?)?(version=\"(.*?)\"\s*?)?>/s", $en_content, $match); - $en_chapter["xmlid"] = $match[1]; - $en_chapter["xmlns"] = $match[3]; - $en_chapter["xmlnsxlink"] = $match[5]; - $en_chapter["version"] = $match[7]; - - $lang_chapter = array(); - preg_match_all("/<chapter\s*?xml:id=\"(.*?)\"\s*?(xmlns=\"(.*?)\")?\s*?(xmlns:xlink=\"(.*?)\"\s*?)?(version=\"(.*?)\"\s*?)?>/s", $lang_content, $match); - $lang_chapter["xmlid"] = $match[1]; - $lang_chapter["xmlns"] = $match[3]; - $lang_chapter["xmlnsxlink"] = $match[5]; - $lang_chapter["version"] = $match[7]; - - for( $i=0; $i < count($en_chapter["xmlid"]); $i ++ ) { - - if( !isset($en_chapter["xmlid"][$i]) ) { $en_chapter["xmlid"][$i] = ''; } - if( !isset($lang_chapter["xmlid"][$i]) ) { $lang_chapter["xmlid"][$i] = ''; } - - if( $en_chapter["xmlid"][$i] != $lang_chapter["xmlid"][$i] ) { - $result_error[] = array( - "value_en" => $en_chapter["xmlid"][$i], - "value_lang" => $lang_chapter["xmlid"][$i], - "type" => "attributXmlIdChapter" - ); - - } - } - - for( $i=0; $i < count($en_chapter["xmlns"]); $i ++ ) { + $result_error = array(); - if( !isset($en_chapter["xmlns"][$i]) ) { $en_chapter["xmlns"][$i] = ''; } - if( !isset($lang_chapter["xmlns"][$i]) ) { $lang_chapter["xmlns"][$i] = ''; } + $reg = '/<chapter\s*?xml:id="(.*?)"\s*?(xmlns="(.*?)")?\s*?(xmlns:xlink="(.*?)"\s*?)?(version="(.*?)"\s*?)?>/s'; - if( $en_chapter["xmlns"][$i] != $lang_chapter["xmlns"][$i] ) { - $result_error[] = array( - "value_en" => $en_chapter["xmlns"][$i], - "value_lang" => $lang_chapter["xmlns"][$i], - "type" => "attributXmlNsChapter" - ); - } + $en_chapter = array(); + $match = array(); + if (preg_match_all($reg, $en_content, $match)) { + $en_chapter['xmlid'] = $match[1]; + $en_chapter['xmlns'] = $match[3]; + $en_chapter['xmlnsxlink'] = $match[5]; + $en_chapter['version'] = $match[7]; } - for( $i=0; $i < count($en_chapter["xmlnsxlink"]); $i ++ ) { + $lang_chapter = array(); + $match = array(); + if (preg_match_all($reg, $lang_content, $match)) { + $lang_chapter['xmlid'] = $match[1]; + $lang_chapter['xmlns'] = $match[3]; + $lang_chapter['xmlnsxlink'] = $match[5]; + $lang_chapter['version'] = $match[7]; + } + + $properties = array( + 'xmlid' => 'XmlId', + 'xmlns' => 'XmlNs', + 'xmlnsxlink' => 'XmlXlink', + 'version' => 'Version', + ); + + foreach ($properties as $property => $label) { + for ($i = 0; $i < count($en_chapter[$property]); $i++) { + if (!isset($en_chapter[$property][$i])) { + $en_chapter[$property][$i] = ''; + } + if (!isset($lang_chapter[$property][$i])) { + $lang_chapter[$property][$i] = ''; + } - if( !isset($en_chapter["xmlnsxlink"][$i]) ) { $en_chapter["xmlnsxlink"][$i] = ''; } - if( !isset($lang_chapter["xmlnsxlink"][$i]) ) { $lang_chapter["xmlnsxlink"][$i] = ''; } + if ($en_chapter[$property][$i] != $lang_chapter[$property][$i] ) { + $result_error[] = array( + 'value_en' => $en_chapter[$property][$i], + 'value_lang' => $lang_chapter[$property][$i], + 'type' => 'attribut' . $label . 'Chapter', + ); - if( $en_chapter["xmlnsxlink"][$i] != $lang_chapter["xmlnsxlink"][$i] ) { - $result_error[] = array( - "value_en" => $en_chapter["xmlnsxlink"][$i], - "value_lang" => $lang_chapter["xmlnsxlink"][$i], - "type" => "attributXmlXlinkChapter" - ); + } } } - for( $i=0; $i < count($en_chapter["version"]); $i ++ ) { - - if( !isset($en_chapter["version"][$i]) ) { $en_chapter["version"][$i] = ''; } - if( !isset($lang_chapter["version"][$i]) ) { $lang_chapter["version"][$i] = ''; } - - if( $en_chapter["version"][$i] != $lang_chapter["version"][$i] ) { - $result_error[] = array( - "value_en" => $en_chapter["version"][$i], - "value_lang" => $lang_chapter["version"][$i], - "type" => "attributVersionChapter" - ); - } - } return $result_error; } @@ -2472,62 +2462,45 @@ // attributs in appendix tags $result_error = FALSE; - $en_appendix = array(); - preg_match_all("/<appendix\s*?xml:id=\"(.*?)\"\s*?(xmlns=\"(.*?)\")?\s*?(xmlns:xlink=\"(.*?)\"\s*?)?>/s", $en_content, $match); + $reg = '/<appendix\s*?xml:id="(.*?)"\s*?(xmlns="(.*?)")?\s*?(xmlns:xlink="(.*?)"\s*?)?>/s'; + + $match = $en_appendix = array(); + preg_match_all($reg, $en_content, $match); $en_appendix["xmlid"] = $match[1]; $en_appendix["xmlns"] = $match[3]; $en_appendix["xmlnsxlink"] = $match[5]; - $lang_appendix = array(); - preg_match_all("/<appendix\s*?xml:id=\"(.*?)\"\s*?(xmlns=\"(.*?)\")?\s*?(xmlns:xlink=\"(.*?)\"\s*?)?>/s", $lang_content, $match); - $lang_appendix["xmlid"] = $match[1]; - $lang_appendix["xmlns"] = $match[3]; - $lang_appendix["xmlnsxlink"] = $match[5]; + $match = $lang_appendix = array(); + preg_match_all($reg, $lang_content, $match); + $lang_appendix['xmlid'] = $match[1]; + $lang_appendix['xmlns'] = $match[3]; + $lang_appendix['xmlnsxlink'] = $match[5]; - for( $i=0; $i < count($en_appendix["xmlid"]); $i ++ ) { - if( !isset($en_appendix["xmlid"][$i]) ) { $en_appendix["xmlid"][$i] = ''; } - if( !isset($lang_appendix["xmlid"][$i]) ) { $lang_appendix["xmlid"][$i] = ''; } + $properties = array( + 'xmlid' => 'XmlId', + 'xmlns' => 'XmlNs', + 'xmlnsxlink' => 'XmlXlink', + ); - if( $en_appendix["xmlid"][$i] != $lang_appendix["xmlid"][$i] ) { - $result_error[] = array( - "value_en" => $en_appendix["xmlid"][$i], - "value_lang" => $lang_appendix["xmlid"][$i], - "type" => "attributXmlIdAppendix" - ); + foreach ($properties as $property => $label) { - } - } - - for( $i=0; $i < count($en_appendix["xmlns"]); $i ++ ) { + for ($i = 0; $i < count($en_appendix[$property]); $i++) { - if( !isset($en_appendix["xmlns"][$i]) ) { $en_appendix["xmlns"][$i] = ''; } - if( !isset($lang_appendix["xmlns"][$i]) ) { $lang_appendix["xmlns"][$i] = ''; } + if (!isset($en_appendix[$property][$i])) { $en_appendix[$property][$i] = ''; } + if (!isset($lang_appendix[$property][$i])) { $lang_appendix[$property][$i] = ''; } - if( $en_appendix["xmlns"][$i] != $lang_appendix["xmlns"][$i] ) { - $result_error[] = array( - "value_en" => $en_appendix["xmlns"][$i], - "value_lang" => $lang_appendix["xmlns"][$i], - "type" => "attributXmlNsAppendix" - ); + if ($en_appendix[$property][$i] != $lang_appendix[$property][$i] ) { + $result_error[] = array( + 'value_en' => $en_appendix[$property][$i], + 'value_lang' => $lang_appendix[$property][$i], + 'type' => 'attribut' . $label . 'Appendix', + ); + } } } - for( $i=0; $i < count($en_appendix["xmlnsxlink"]); $i ++ ) { - - if( !isset($en_appendix["xmlnsxlink"][$i]) ) { $en_appendix["xmlnsxlink"][$i] = ''; } - if( !isset($lang_appendix["xmlnsxlink"][$i]) ) { $lang_appendix["xmlnsxlink"][$i] = ''; } - - if( $en_appendix["xmlnsxlink"][$i] != $lang_appendix["xmlnsxlink"][$i] ) { - $result_error[] = array( - "value_en" => $en_appendix["xmlnsxlink"][$i], - "value_lang" => $lang_appendix["xmlnsxlink"][$i], - "type" => "attributXmlXlinkAppendix" - ); - - } - } return $result_error; } @@ -2536,24 +2509,32 @@ // attributs in qandaentry tags $result_error = FALSE; - $en_qandaentry = array(); - preg_match_all("/<qandaentry\s*?xml:id=\"(.*?)\"\s*?>/s", $en_content, $match); - $en_qandaentry = $match[1]; + $reg = '/<qandaentry\s*?xml:id="(.*?)"\s*?>/s'; - $lang_qandaentry = array(); - preg_match_all("/<qandaentry\s*?xml:id=\"(.*?)\"\s*?>/s", $lang_content, $match); - $lang_qandaentry = $match[1]; + $match = $en_qandaentry = array(); + if (preg_match_all($reg, $en_content, $match)) { + $en_qandaentry = $match[1]; + } - for( $i=0; $i < count($en_qandaentry); $i ++ ) { + $match = $lang_qandaentry = array(); + if (preg_match_all($reg, $lang_content, $match)) { + $lang_qandaentry = $match[1]; + } - if( !isset($en_qandaentry[$i]) ) { $en_qandaentry[$i] = ''; } - if( !isset($lang_qandaentry[$i]) ) { $lang_qandaentry[$i] = ''; } + for ($i = 0; $i < count($en_qandaentry); $i++) { - if( $en_qandaentry[$i] != $lang_qandaentry[$i] ) { + if (!isset($en_qandaentry[$i])) { + $en_qandaentry[$i] = ''; + } + if (!isset($lang_qandaentry[$i])) { + $lang_qandaentry[$i] = ''; + } + + if ($en_qandaentry[$i] != $lang_qandaentry[$i] ) { $result_error[] = array( - "value_en" => $en_qandaentry[$i], - "value_lang" => $lang_qandaentry[$i], - "type" => "attributXmlIdQandaentry" + 'value_en' => $en_qandaentry[$i], + 'value_lang' => $lang_qandaentry[$i], + 'type' => 'attributXmlIdQandaentry' ); } @@ -2566,20 +2547,20 @@ // attributs in Link tags $result_error = FALSE; - $en_xlink = array(); - preg_match_all("/<link\s*?xlink:href=\"(.*?)\">/s", $en_content, $match); + $match = $en_xlink = array(); + preg_match_all('/<link\s*?xlink:href="(.*?)">/s', $en_content, $match); $en_xlink = $match[1]; - $lang_xlink = array(); - preg_match_all("/<link\s*?xlink:href=\"(.*?)\">/s", $lang_content, $match); + $match = $lang_xlink = array(); + preg_match_all('/<link\s*?xlink:href="(.*?)">/s', $lang_content, $match); $lang_xlink = $match[1]; - for( $i=0; $i < count($en_xlink); $i ++ ) { + for ($i = 0; $i < count($en_xlink); $i++) { - if( !isset($en_xlink[$i]) ) { $en_xlink[$i] = ''; } - if( !isset($lang_xlink[$i]) ) { $lang_xlink[$i] = ''; } + if (!isset($en_xlink[$i]) ) { $en_xlink[$i] = ''; } + if (!isset($lang_xlink[$i])) { $lang_xlink[$i] = ''; } - if( $en_xlink[$i] != $lang_xlink[$i] ) { + if ($en_xlink[$i] != $lang_xlink[$i] ) { $result_error[] = array( "value_en" => $en_xlink[$i], "value_lang" => $lang_xlink[$i], @@ -2590,16 +2571,22 @@ } $en_linkend = array(); - preg_match_all("/<link\s*?linkend=(\"|')(.*?)(\"|')\s*?>/s", $en_content, $match); - $en_linkend = $match[2]; + $match = array(); + if (preg_match_all('/<link\s*?linkend=("|\')(.*?)("|\')\s*?>/s', $en_content, $match)) { + $en_linkend = $match[2]; + } $lang_linkend = array(); - preg_match_all("/<link\s*?linkend=(\"|')(.*?)(\"|')\s*?>/s", $lang_content, $match); - $lang_linkend = $match[2]; + $match = array(); + if (preg_match_all('/<link\s*?linkend=("|\')(.*?)("|\')\s*?>/s', $lang_content, $match)) { + $lang_linkend = $match[2]; + } - for( $i=0; $i < count($en_linkend); $i ++ ) { - if( !isset($lang_linkend[$i]) ) { $lang_linkend[$i] = ''; } - if( $en_linkend[$i] != $lang_linkend[$i] ) { + for ($i = 0; $i <count($en_linkend); $i++) { + if (!isset($lang_linkend[$i])) { + $lang_linkend[$i] = ''; + } + if ($en_linkend[$i] != $lang_linkend[$i]) { $result_error[] = array( "value_en" => $en_linkend[$i], "value_lang" => $lang_linkend[$i], @@ -2617,19 +2604,21 @@ $result_error = FALSE; $en_sect1 = array(); - preg_match_all("/<sect1\s*?xml:id=\"(.*?)\"\s*?(xmlns=\"(.*?)\")?\s*?(xmlns:xlink=\"(.*?)\"\s*?)?>/s", $en_content, $match); + $match = array(); + preg_match_all('/<sect1\s*?xml:id="(.*?)"\s*?(xmlns="(.*?)")?\s*?(xmlns:xlink="(.*?)"\s*?)?>/s', $en_content, $match); $en_sect1["xmlid"] = $match[1]; $en_sect1["xmlns"] = $match[3]; $en_sect1["xmlnsxlink"] = $match[5]; $lang_sect1 = array(); - preg_match_all("/<sect1\s*?xml:id=\"(.*?)\"\s*?(xmlns=\"(.*?)\")?\s*?(xmlns:xlink=\"(.*?)\"\s*?)?>/s", $lang_content, $match); + $match = array(); + preg_match_all('/<sect1\s*?xml:id="(.*?)"\s*?(xmlns="(.*?)")?\s*?(xmlns:xlink="(.*?)"\s*?)?>/s', $lang_content, $match); $lang_sect1["xmlid"] = $match[1]; $lang_sect1["xmlns"] = $match[3]; $lang_sect1["xmlnsxlink"] = $match[5]; - for( $i=0; $i < count($en_sect1["xmlid"]); $i ++ ) { - if( isset($lang_sect1["xmlid"][$i]) && $en_sect1["xmlid"][$i] != $lang_sect1["xmlid"][$i] ) { + for ($i = 0; $i < count($en_sect1["xmlid"]); $i++) { + if (isset($lang_sect1["xmlid"][$i]) && $en_sect1["xmlid"][$i] != $lang_sect1["xmlid"][$i] ) { $result_error[] = array( "value_en" => $en_sect1["xmlid"][$i], "value_lang" => $lang_sect1["xmlid"][$i], @@ -2638,8 +2627,8 @@ } } - for( $i=0; $i < count($en_sect1["xmlns"]); $i ++ ) { - if( isset($lang_sect1["xmlns"][$i]) && $en_sect1["xmlns"][$i] != $lang_sect1["xmlns"][$i] ) { + for ($i = 0; $i < count($en_sect1["xmlns"]); $i++) { + if (isset($lang_sect1["xmlns"][$i]) && $en_sect1["xmlns"][$i] != $lang_sect1["xmlns"][$i] ) { $result_error[] = array( "value_en" => $en_sect1["xmlns"][$i], "value_lang" => $lang_sect1["xmlns"][$i], @@ -2648,8 +2637,8 @@ } } - for( $i=0; $i < count($en_sect1["xmlnsxlink"]); $i ++ ) { - if( isset($lang_sect1["xmlnsxlink"][$i]) && $en_sect1["xmlnsxlink"][$i] != $lang_sect1["xmlnsxlink"][$i] ) { + for ($i = 0; $i < count($en_sect1["xmlnsxlink"]); $i++) { + if (isset($lang_sect1["xmlnsxlink"][$i]) && $en_sect1["xmlnsxlink"][$i] != $lang_sect1["xmlnsxlink"][$i] ) { $result_error[] = array( "value_en" => $en_sect1["xmlnsxlink"][$i], "value_lang" => $lang_sect1["xmlnsxlink"][$i], @@ -2666,20 +2655,20 @@ // attributs in Book tags $result_error = FALSE; - $en_book = array(); - preg_match_all("/<book\s*?xml:id=\"(.*?)\"\s*?(xmlns=\"(.*?)\")?\s*?(xmlns:xlink=\"(.*?)\"\s*?)?>/s", $en_content, $match); + $en_book = $match = array(); + preg_match_all('/<book\s*?xml:id="(.*?)"\s*?(xmlns="(.*?)")?\s*?(xmlns:xlink="(.*?)"\s*?)?>/s', $en_content, $match); $en_book["xmlid"] = $match[1]; $en_book["xmlns"] = $match[3]; $en_book["xmlnsxlink"] = $match[5]; - $lang_book = array(); - preg_match_all("/<book\s*?xml:id=\"(.*?)\"\s*?(xmlns=\"(.*?)\")?\s*?(xmlns:xlink=\"(.*?)\"\s*?)?>/s", $lang_content, $match); + $lang_book = $match = array(); + preg_match_all('/<book\s*?xml:id="(.*?)"\s*?(xmlns="(.*?)")?\s*?(xmlns:xlink="(.*?)"\s*?)?>/s', $lang_content, $match); $lang_book["xmlid"] = $match[1]; $lang_book["xmlns"] = $match[3]; $lang_book["xmlnsxlink"] = $match[5]; - for( $i=0; $i < count($en_book["xmlid"]); $i ++ ) { - if( $en_book["xmlid"][$i] != $lang_book["xmlid"][$i] ) { + for ($i = 0; $i < count($en_book["xmlid"]); $i++) { + if ($en_book["xmlid"][$i] != $lang_book["xmlid"][$i] ) { $result_error[] = array( "value_en" => $en_book["xmlid"][$i], "value_lang" => $lang_book["xmlid"][$i], @@ -2689,8 +2678,8 @@ } } - for( $i=0; $i < count($en_book["xmlns"]); $i ++ ) { - if( $en_book["xmlns"][$i] != $lang_book["xmlns"][$i] ) { + for ($i = 0; $i < count($en_book["xmlns"]); $i++) { + if ($en_book["xmlns"][$i] != $lang_book["xmlns"][$i] ) { $result_error[] = array( "value_en" => $en_book["xmlns"][$i], "value_lang" => $lang_book["xmlns"][$i], @@ -2700,8 +2689,8 @@ } } - for( $i=0; $i < count($en_book["xmlnsxlink"]); $i ++ ) { - if( $en_book["xmlnsxlink"][$i] != $lang_book["xmlnsxlink"][$i] ) { + for ($i = 0; $i < count($en_book["xmlnsxlink"]); $i++) { + if ($en_book["xmlnsxlink"][$i] != $lang_book["xmlnsxlink"][$i] ) { $result_error[] = array( "value_en" => $en_book["xmlnsxlink"][$i], "value_lang" => $lang_book["xmlnsxlink"][$i], @@ -2715,48 +2704,39 @@ function tools_error_check_attributPrefaceTags($lang_content, $en_content) { // attributs in Preface tags - $result_error = FALSE; - - $en_preface = array(); - preg_match_all("/<preface\s*?xml:id=\"(.*?)\"\s*?(xmlns=\"(.*?)\")?\s*?(xmlns:xlink=\"(.*?)\"\s*?)?>/s", $en_content, $match); - $en_preface["xmlid"] = $match[1]; - $en_preface["xmlns"] = $match[3]; - $en_preface["xmlnsxlink"] = $match[5]; - - $lang_preface = array(); - preg_match_all("/<preface\s*?xml:id=\"(.*?)\"\s*?(xmlns=\"(.*?)\")?\s*?(xmlns:xlink=\"(.*?)\"\s*?)?>/s", $lang_content, $match); - $lang_preface["xmlid"] = $match[1]; - $lang_preface["xmlns"] = $match[3]; - $lang_preface["xmlnsxlink"] = $match[5]; - - for( $i=0; $i < count($en_preface["xmlid"]); $i ++ ) { - if( $en_preface["xmlid"][$i] != $lang_preface["xmlid"][$i] ) { - $result_error[] = array( - "value_en" => $en_preface["xmlid"][$i], - "value_lang" => $lang_preface["xmlid"][$i], - "type" => "attributXmlIdPreface" - ); + $result_error = array(); - } - } - for( $i=0; $i < count($en_preface["xmlns"]); $i ++ ) { - if( $en_preface["xmlns"][$i] != $lang_preface["xmlns"][$i] ) { - $result_error[] = array( - "value_en" => $en_preface["xmlns"][$i], - "value_lang" => $lang_preface["xmlns"][$i], - "type" => "attributXmlNsPreface" - ); + $reg = '/<preface\s*?xml:id="(.*?)"\s*?(xmlns="(.*?)")?\s*?(xmlns:xlink="(.*?)"\s*?)?>/s'; - } - } - for( $i=0; $i < count($en_preface["xmlnsxlink"]); $i ++ ) { - if( $en_preface["xmlnsxlink"][$i] != $lang_preface["xmlnsxlink"][$i] ) { - $result_error[] = array( - "value_en" => $en_preface["xmlnsxlink"][$i], - "value_lang" => $lang_preface["xmlnsxlink"][$i], - "type" => "attributXmlNsXlinkPreface" - ); + $match = $en_preface = array(); + if (preg_match_all($reg, $en_content, $match)) { + $en_preface['xmlid'] = $match[1]; + $en_preface['xmlns'] = $match[3]; + $en_preface['xmlnsxlink'] = $match[5]; + } + + $match = $lang_preface = array(); + if (preg_match_all($reg, $lang_content, $match)) { + $lang_preface['xmlid'] = $match[1]; + $lang_preface['xmlns'] = $match[3]; + $lang_preface['xmlnsxlink'] = $match[5]; + } + + $properties = array( + 'xmlid' => 'XmlId', + 'xmlns' => 'XmlNs', + 'xmlnsxlink' => 'XmlNsXlink', + ); + foreach ($properties as $property => $label) { + for ($i = 0; $i < count($en_preface[$property]); $i++) { + if ($en_preface[$property][$i] != $lang_preface[$property][$i] ) { + $result_error[] = array( + 'value_en' => $en_preface[$property][$i], + 'value_lang' => $lang_preface[$property][$i], + 'type' => 'attribut' . $label . 'Preface', + ); + } } } return $result_error; @@ -2764,117 +2744,109 @@ function tools_error_check_attributSectionTags($lang_content, $en_content) { // attributs in Section tags - $result_error = FALSE; - - $en_section = array(); - preg_match_all("/<section\s*?xml:id=(\"|')(.*?)(\"|')\s*?(xmlns=(\"|')(.*?)(\"|'))?\s*?(xmlns:xlink=(\"|')(.*?)(\"|')\s*?)?>/s", $en_content, $match); - $en_section["xmlid"] = $match[2]; - $en_section["xmlns"] = $match[6]; - $en_section["xmlnsxlink"] = $match[10]; - - $lang_section = array(); - preg_match_all("/<section\s*?xml:id=(\"|')(.*?)(\"|')\s*?(xmlns=(\"|')(.*?)(\"|'))?\s*?(xmlns:xlink=(\"|')(.*?)(\"|')\s*?)?>/s", $lang_content, $match); - $lang_section["xmlid"] = $match[2]; - $lang_section["xmlns"] = $match[6]; - $lang_section["xmlnsxlink"] = $match[10]; - - - - for( $i=0; $i < count($en_section["xmlid"]); $i ++ ) { - - if( !isset($en_section["xmlid"][$i]) ) { $en_section["xmlid"][$i] = ''; } - if( !isset($lang_section["xmlid"][$i]) ) { $lang_section["xmlid"][$i] = ''; } + $result_error = array(); - if( $en_section["xmlid"][$i] != $lang_section["xmlid"][$i] ) { - $result_error[] = array( - "value_en" => $en_section["xmlid"][$i], - "value_lang" => $lang_section["xmlid"][$i], - "type" => "attributXmlIdSection" - ); + $reg = '/<section\s*?xml:id=("|\')(.*?)("|\')\s*?(xmlns=("|\')(.*?)("|\'))?\s*?(xmlns:xlink=("|\')(.*?)("|\')\s*?)?>/s'; - } + $en_section = array(); + $match = array(); + if (preg_match_all($reg, $en_content, $match)) { + $en_section["xmlid"] = $match[2]; + $en_section["xmlns"] = $match[6]; + $en_section["xmlnsxlink"] = $match[10]; } - for( $i=0; $i < count($en_section["xmlns"]); $i ++ ) { - - if( !isset($en_section["xmlns"][$i]) ) { $en_section["xmlns"][$i] = ''; } - if( !isset($lang_section["xmlns"][$i]) ) { $lang_section["xmlns"][$i] = ''; } - - if( $en_section["xmlns"][$i] != $lang_section["xmlns"][$i] ) { - $result_error[] = array( - "value_en" => $en_section["xmlns"][$i], - "value_lang" => $lang_section["xmlns"][$i], - "type" => "attributXmlNsSection" - ); - } + $lang_section = array(); + $match = array(); + if (preg_match_all($reg, $lang_content, $match)) { + $lang_section["xmlid"] = $match[2]; + $lang_section["xmlns"] = $match[6]; + $lang_section["xmlnsxlink"] = $match[10]; } - for( $i=0; $i < count($en_section["xmlnsxlink"]); $i ++ ) { - - if( !isset($en_section["xmlnsxlink"][$i]) ) { $en_section["xmlnsxlink"][$i] = ''; } - if( !isset($lang_section["xmlnsxlink"][$i]) ) { $lang_section["xmlnsxlink"][$i] = ''; } - if( $en_section["xmlnsxlink"][$i] != $lang_section["xmlnsxlink"][$i] ) { - $result_error[] = array( - "value_en" => $en_section["xmlnsxlink"][$i], - "value_lang" => $lang_section["xmlnsxlink"][$i], - "type" => "attributXmlNsXlinkSection" - ); + $properties = array( + 'xmlid' => 'XmlId', + 'xmlns' => 'XmlNs', + 'xmlnsxlink' => 'XmlNsXlink', + ); + foreach ($properties as $property => $label) { + for ($i = 0; $i < count($en_section[$property]); $i++) { + if ($en_section[$property][$i] != $lang_section[$property][$i] ) { + $result_error[] = array( + 'value_en' => $en_section[$property][$i], + 'value_lang' => $lang_section[$property][$i], + 'type' => 'attribut' . $label . 'Section', + ); + } } } return $result_error; } + function tools_error_check_attributVarlistentryTags($lang_content, $en_content) { // attributs in Varlistentry tags - $result_error = FALSE; + $result_error = array(); - $en_varlistentry = array(); - preg_match_all("/<varlistentry\s*?xml:id=(\"|')(.*?)(\"|')\s*?>/s", $en_content, $match); - $en_varlistentry = $match[2]; + $reg = '/<varlistentry\s*?xml:id=("|\')(.*?)("|\')\s*?>/s'; - $lang_varlistentry = array(); - preg_match_all("/<varlistentry\s*?xml:id=(\"|')(.*?)(\"|')\s*?>/s", $lang_content, $match); - $lang_varlistentry = $match[2]; + $match = $en_varlistentry = array(); + if (preg_match_all($reg, $en_content, $match)) { + $en_varlistentry = $match[2]; + } - for( $i=0; $i < count($en_varlistentry); $i ++ ) { + $match = $lang_varlistentry = array(); + if (preg_match_all($reg, $lang_content, $match)) { + $lang_varlistentry = $match[2]; + } - if( !isset($en_varlistentry[$i]) ) { $en_varlistentry[$i] = ''; } - if( !isset($lang_varlistentry[$i]) ) { $lang_varlistentry[$i] = ''; } + for ($i = 0; $i < count($en_varlistentry); $i++) { - if( $en_varlistentry[$i] != $lang_varlistentry[$i] ) { - $result_error[] = array( - "value_en" => $en_varlistentry[$i], - "value_lang" => $lang_varlistentry[$i], - "type" => "attributXmlIdVarlistentry" - ); + if (!isset($en_varlistentry[$i]) ) { + $en_varlistentry[$i] = ''; + } + if (!isset($lang_varlistentry[$i])) { + + $lang_varlistentry[$i] = ''; } } + + if ($en_varlistentry[$i] != $lang_varlistentry[$i] ) { + $result_error[] = array( + "value_en" => $en_varlistentry[$i], + "value_lang" => $lang_varlistentry[$i], + "type" => "attributXmlIdVarlistentry" + ); + } return $result_error; } + function tools_error_check_attributReferenceTags($lang_content, $en_content) { // attributs in Reference tags $result_error = FALSE; $en_reference = array(); - preg_match_all("/<reference\s*?xml:id=\"(.*?)\"\s*?xmlns=\"(.*?)\"\s*?(xmlns:xlink=\"(.*?)\"\s*?)?>/s", $en_content, $match); + $match = array(); + preg_match_all('/<reference\s*?xml:id="(.*?)"\s*?xmlns="(.*?)"\s*?(xmlns:xlink="(.*?)"\s*?)?>/s', $en_content, $match); $en_reference["xmlid"] = $match[1]; $en_reference["xmlns"] = $match[2]; $en_reference["xmlnsxlink"] = $match[4]; $lang_reference = array(); - preg_match_all("/<reference\s*?xml:id=\"(.*?)\"\s*?xmlns=\"(.*?)\"\s*?(xmlns:xlink=\"(.*?)\"\s*?)?>/s", $lang_content, $match); + $match = array(); + preg_match_all('/<reference\s*?xml:id="(.*?)"\s*?xmlns="(.*?)"\s*?(xmlns:xlink="(.*?)"\s*?)?>/s', $lang_content, $match); $lang_reference["xmlid"] = $match[1]; $lang_reference["xmlns"] = $match[2]; $lang_reference["xmlnsxlink"] = $match[4]; - for( $i=0; $i < count($en_reference["xmlid"]); $i ++ ) { + for ($i = 0; $i < count($en_reference["xmlid"]); $i++) { - if( !isset($en_reference["xmlid"][$i]) ) { $en_reference["xmlid"][$i] = ''; } - if( !isset($lang_reference["xmlid"][$i]) ) { $lang_reference["xmlid"][$i] = ''; } + if (!isset($en_reference["xmlid"][$i]) ) { $en_reference["xmlid"][$i] = ''; } + if (!isset($lang_reference["xmlid"][$i])) { $lang_reference["xmlid"][$i] = ''; } - if( $en_reference["xmlid"][$i] != $lang_reference["xmlid"][$i] ) { + if ($en_reference["xmlid"][$i] != $lang_reference["xmlid"][$i] ) { $result_error[] = array( "value_en" => $en_reference["xmlid"][$i], "value_lang" => $lang_reference["xmlid"][$i], @@ -2884,12 +2856,12 @@ } } - for( $i=0; $i < count($en_reference["xmlns"]); $i ++ ) { + for ($i = 0; $i < count($en_reference["xmlns"]); $i++) { - if( !isset($en_reference["xmlns"][$i]) ) { $en_reference["xmlns"][$i] = ''; } - if( !isset($lang_reference["xmlns"][$i]) ) { $lang_reference["xmlns"][$i] = ''; } + if (!isset($en_reference["xmlns"][$i]) ) { $en_reference["xmlns"][$i] = ''; } + if (!isset($lang_reference["xmlns"][$i])) { $lang_reference["xmlns"][$i] = ''; } - if( $en_reference["xmlns"][$i] != $lang_reference["xmlns"][$i] ) { + if ($en_reference["xmlns"][$i] != $lang_reference["xmlns"][$i] ) { $result_error[] = array( "value_en" => $en_reference["xmlns"][$i], "value_lang" => $lang_reference["xmlns"][$i], @@ -2898,12 +2870,12 @@ } } - for( $i=0; $i < count($en_reference["xmlnsxlink"]); $i ++ ) { + for ($i = 0; $i < count($en_reference["xmlnsxlink"]); $i++) { - if( !isset($en_reference["xmlnsxlink"][$i]) ) { $en_reference["xmlnsxlink"][$i] = ''; } - if( !isset($lang_reference["xmlnsxlink"][$i]) ) { $lang_reference["xmlnsxlink"][$i] = ''; } + if (!isset($en_reference["xmlnsxlink"][$i]) ) { $en_reference["xmlnsxlink"][$i] = ''; } + if (!isset($lang_reference["xmlnsxlink"][$i])) { $lang_reference["xmlnsxlink"][$i] = ''; } - if( $en_reference["xmlnsxlink"][$i] != $lang_reference["xmlnsxlink"][$i] ) { + if ($en_reference["xmlnsxlink"][$i] != $lang_reference["xmlnsxlink"][$i] ) { $result_error[] = array( "value_en" => $en_reference["xmlnsxlink"][$i], "value_lang" => $lang_reference["xmlnsxlink"][$i], @@ -2913,29 +2885,32 @@ } return $result_error; } + function tools_error_check_attributRefentryTags($lang_content, $en_content) { // attributs in Refentry tags $result_error = FALSE; $en_refentry = array(); - preg_match_all("/<refentry\s*?xml:id=\"(.*?)\"\s*?xmlns=\"(.*?)\"\s*?(xmlns:xlink=\"(.*?)\"\s*?)?>/s", $en_content, $match); + $match = array(); + preg_match_all('/<refentry\s*?xml:id="(.*?)"\s*?xmlns="(.*?)"\s*?(xmlns:xlink="(.*?)"\s*?)?>/s', $en_content, $match); $en_refentry["xmlid"] = $match[1]; $en_refentry["xmlns"] = $match[2]; $en_refentry["xmlnsxlink"] = $match[4]; $lang_refentry = array(); - preg_match_all("/<refentry\s*?xml:id=\"(.*?)\"\s*?xmlns=\"(.*?)\"\s*?(xmlns:xlink=\"(.*?)\"\s*?)?>/s", $lang_content, $match); + $match = array(); + preg_match_all('/<refentry\s*?xml:id="(.*?)"\s*?xmlns="(.*?)"\s*?(xmlns:xlink="(.*?)"\s*?)?>/s', $lang_content, $match); $lang_refentry["xmlid"] = $match[1]; $lang_refentry["xmlns"] = $match[2]; $lang_refentry["xmlnsxlink"] = $match[4]; - for( $i=0; $i < count($en_refentry["xmlid"]); $i ++ ) { + for ($i = 0; $i < count($en_refentry["xmlid"]); $i++) { - if( !isset($en_refentry["xmlid"][$i]) ) { $en_refentry["xmlid"][$i] = ''; } - if( !isset($lang_refentry["xmlid"][$i]) ) { $lang_refentry["xmlid"][$i] = ''; } + if (!isset($en_refentry["xmlid"][$i])) { $en_refentry["xmlid"][$i] = ''; } + if (!isset($lang_refentry["xmlid"][$i])) { $lang_refentry["xmlid"][$i] = ''; } - if( $en_refentry["xmlid"][$i] != $lang_refentry["xmlid"][$i] ) { + if ($en_refentry["xmlid"][$i] != $lang_refentry["xmlid"][$i] ) { $result_error[] = array( "value_en" => $en_refentry["xmlid"][$i], "value_lang" => $lang_refentry["xmlid"][$i], @@ -2944,12 +2919,12 @@ } } - for( $i=0; $i < count($en_refentry["xmlns"]); $i ++ ) { + for ($i = 0; $i < count($en_refentry["xmlns"]); $i++) { - if( !isset($en_refentry["xmlns"][$i]) ) { $en_refentry["xmlns"][$i] = ''; } - if( !isset($lang_refentry["xmlns"][$i]) ) { $lang_refentry["xmlns"][$i] = ''; } + if (!isset($en_refentry["xmlns"][$i])) { $en_refentry["xmlns"][$i] = ''; } + if (!isset($lang_refentry["xmlns"][$i])) { $lang_refentry["xmlns"][$i] = ''; } - if( $en_refentry["xmlns"][$i] != $lang_refentry["xmlns"][$i] ) { + if ($en_refentry["xmlns"][$i] != $lang_refentry["xmlns"][$i] ) { $result_error[] = array( "value_en" => $en_refentry["xmlns"][$i], "value_lang" => $lang_refentry["xmlns"][$i], @@ -2959,19 +2934,19 @@ } } - for( $i=0; $i < count($en_refentry["xmlnsxlink"]); $i ++ ) { + for ($i = 0; $i < count($en_refentry["xmlnsxlink"]); $i++) { - if( !isset($en_refentry["xmlnsxlink"][$i]) ) { $en_refentry["xmlnsxlink"][$i] = ''; } - if( !isset($lang_refentry["xmlnsxlink"][$i]) ) { $lang_refentry["xmlnsxlink"][$i] = ''; } + if (!isset($en_refentry["xmlnsxlink"][$i])) { $en_refentry["xmlnsxlink"][$i] = ''; } + if (!isset($lang_refentry["xmlnsxlink"][$i])) { $lang_refentry["xmlnsxlink"][$i] = ''; } - if( $en_refentry["xmlnsxlink"][$i] != $lang_refentry["xmlnsxlink"][$i] ) { + if ($en_refentry["xmlnsxlink"][$i] != $lang_refentry["xmlnsxlink"][$i] ) { $result_error[] = array( "value_en" => $en_refentry["xmlnsxlink"][$i], "value_lang" => $lang_refentry["xmlnsxlink"][$i], "type" => "attributXmlNsXlinkRefentry" ); - } + } } return $result_error; } @@ -2981,15 +2956,17 @@ $result_error = FALSE; $en_refsect1 = array(); - preg_match_all("/<refsect1\s*?role=\"(.*?)\"\s*?>/s", $en_content, $match); + $match = array(); + preg_match_all('/<refsect1\s*?role="(.*?)"\s*?>/s', $en_content, $match); $en_refsect1 = $match[1]; $lang_refsect1 = array(); - preg_match_all("/<refsect1\s*?role=\"(.*?)\"\s*?>/s", $lang_content, $match); + $match = array(); + preg_match_all('/<refsect1\s*?role="(.*?)"\s*?>/s', $lang_content, $match); $lang_refsect1 = $match[1]; - for( $i=0; $i < count($en_refsect1); $i ++ ) { - if( isset($lang_refsect1[$i]) && $en_refsect1[$i] != $lang_refsect1[$i] ) { + for ($i = 0; $i < count($en_refsect1); $i++) { + if (isset($lang_refsect1[$i]) && $en_refsect1[$i] != $lang_refsect1[$i] ) { $result_error[] = array( "value_en" => $en_refsect1[$i], "value_lang" => $lang_refsect1[$i], @@ -3004,15 +2981,16 @@ // Space or period at the end of Refpurpose tags $result_error = FALSE; - preg_match_all("/<refpurpose>.*([^A-Za-z1-9 ])<\/refpurpose>/s", $lang_content, $match); + $match = array(); + preg_match_all('/<refpurpose>.*([^A-Za-z1-9 ])<\/refpurpose>/s', $lang_content, $match); - if( isset($match[1][0]) ) { + if (isset($match[1][0])) { - if($match[1][0] == '.') { + if ($match[1][0] == '.') { $result_error[] = array( - "value_en" => "N/A", - "value_lang" => "N/A", - "type" => "spaceOrPeriodRefpurpose" + 'value_en' => 'N/A', + 'value_lang' => 'N/A', + 'type' => 'spaceOrPeriodRefpurpose' ); } } @@ -3024,14 +3002,18 @@ $result_error = FALSE; $en_cdataSection = 0; - preg_match_all("/<!\[CDATA\[(.*?)\]\]>/s", $en_content, $match2); - $en_cdataSection = count($match2[1]); + $match = array(); + if (preg_match_all('/<!\[CDATA\[(.*?)\]\]>/s', $en_content, $match)) { + $en_cdataSection = count($match[1]); + } $lang_cdataSection = 0; - preg_match_all("/<!\[CDATA\[(.*?)\]\]>/s", $lang_content, $match2); - $lang_cdataSection = count($match2[1]); + $match = array(); + if (preg_match_all('/<!\[CDATA\[(.*?)\]\]>/s', $lang_content, $match)) { + $lang_cdataSection = count($match[1]); + } - if( $en_cdataSection != $lang_cdataSection ) { + if ($en_cdataSection != $lang_cdataSection ) { $result_error[] = array( "value_en" => $en_cdataSection, "value_lang" => $lang_cdataSection, @@ -3043,19 +3025,20 @@ function tools_error_check_classsynopsis($lang_content, $en_content) { // Error in <classsynopsis> tags - $result_error = FALSE; + $result_error = array(); - $en_classsynopsis = array(); - preg_match_all("/<classsynopsis>(\s.*?)<\/classsynopsis>/s", $en_content, $match); + $match = $en_classsynopsis = array(); + preg_match_all('/<classsynopsis>(\s.*?)<\/classsynopsis>/s', $en_content, $match); - for( $i = 0; $i < count($match[1]); $i++) { - preg_match_all("/<ooclass><classname>(.*?)<\/classname><\/ooclass>/s", $match[1][$i], $match2); - if( !isset($match2[1][0]) ) { $match2[1][0] = ''; } + for ($i = 0; $i < count($match[1]); $i++) { + $match2 = array(); + preg_match_all('/<ooclass><classname>(.*?)<\/classname><\/ooclass>/s', $match[1][$i], $match2); + if (!isset($match2[1][0])) { $match2[1][0] = ''; } $en_classsynopsis[$i]['ooclass']['classname']['libel'] = $match2[1][0]; $en_classsynopsis[$i]['ooclass']['classname']['nb'] = count($match2[1]); - preg_match_all("/<fieldsynopsis>\s*?<modifier>(.*?)<\/modifier>\s*?<type>(.*?)<\/type>\s*?<varname(.*?)>(.*?)<\/varname>\s*?<initializer>(.*?)<\/initializer>\s*?<\/fieldsynopsis>/s", $match[1][$i], $match2); - + $match2 = array(); + preg_match_all('/<fieldsynopsis>\s*?<modifier>(.*?)<\/modifier>\s*?<type>(.*?)<\/type>\s*?<varname(.*?)>(.*?)<\/varname>\s*?<initializer>(.*?)<\/initializer>\s*?<\/fieldsynopsis>/s', $match[1][$i], $match2); $en_classsynopsis[$i]['fieldsynopsis']['modifier'] = $match2[1]; $en_classsynopsis[$i]['fieldsynopsis']['type'] = $match2[2]; $en_classsynopsis[$i]['fieldsynopsis']['varname']['attr'] = $match2[3]; @@ -3065,16 +3048,17 @@ } $lang_classsynopsis = array(); - preg_match_all("/<classsynopsis>(\s.*?)<\/classsynopsis>/s", $lang_content, $match); - - for( $i = 0; $i < count($match[1]); $i++) { + $match = array(); + preg_match_all('/<classsynopsis>(\s.*?)<\/classsynopsis>/s', $lang_content, $match); - preg_match_all("/<ooclass><classname>(.*?)<\/classname><\/ooclass>/s", $match[1][$i], $match2); - if( !isset($match2[1][0]) ) { $match2[1][0] = ''; } + for ($i = 0; $i < count($match[1]); $i++) { + $match2 = array(); + preg_match_all('/<ooclass><classname>(.*?)<\/classname><\/ooclass>/s', $match[1][$i], $match2); + if (!isset($match2[1][0])) { $match2[1][0] = ''; } $lang_classsynopsis[$i]['ooclass']['classname']['libel'] = $match2[1][0]; $lang_classsynopsis[$i]['ooclass']['classname']['nb'] = count($match2[1]); - preg_match_all("/<fieldsynopsis>\s*?<modifier>(.*?)<\/modifier>\s*?<type>(.*?)<\/type>\s*?<varname(.*?)>(.*?)<\/varname>\s*?<initializer>(.*?)<\/initializer>\s*?<\/fieldsynopsis>/s", $match[1][$i], $match2); + preg_match_all('/<fieldsynopsis>\s*?<modifier>(.*?)<\/modifier>\s*?<type>(.*?)<\/type>\s*?<varname(.*?)>(.*?)<\/varname>\s*?<initializer>(.*?)<\/initializer>\s*?<\/fieldsynopsis>/s', $match[1][$i], $match2); $lang_classsynopsis[$i]['fieldsynopsis']['modifier'] = $match2[1]; $lang_classsynopsis[$i]['fieldsynopsis']['type'] = $match2[2]; @@ -3084,13 +3068,15 @@ } - // V�rif - for( $i=0; $i < count($en_classsynopsis); $i++) { + // Verification + for ($i = 0; $i < count($en_classsynopsis); $i++) { - if( !isset($lang_classsynopsis[$i]['ooclass']['classname']['libel']) ) { $lang_classsynopsis[$i]['ooclass']['classname']['libel'] = ''; } + if (!isset($lang_classsynopsis[$i]['ooclass']['classname']['libel'])) { + $lang_classsynopsis[$i]['ooclass']['classname']['libel'] = ''; + } // ooclass, classname - if( $en_classsynopsis[$i]['ooclass']['classname']['libel'] != $lang_classsynopsis[$i]['ooclass']['classname']['libel'] ) { + if ($en_classsynopsis[$i]['ooclass']['classname']['libel'] != $lang_classsynopsis[$i]['ooclass']['classname']['libel'] ) { $result_error[] = array( "value_en" => $en_classsynopsis[$i]['ooclass']['classname']['libel'], "value_lang" => $lang_classsynopsis[$i]['ooclass']['classname']['libel'], @@ -3098,10 +3084,10 @@ ); } - if( !isset($lang_classsynopsis[$i]['ooclass']['classname']['nb']) ) { $lang_classsynopsis[$i]['ooclass']['classname']['nb'] = 0; } + if (!isset($lang_classsynopsis[$i]['ooclass']['classname']['nb'])) { $lang_classsynopsis[$i]['ooclass']['classname']['nb'] = 0; } // ooclass, classname - if( $en_classsynopsis[$i]['ooclass']['classname']['nb'] != $lang_classsynopsis[$i]['ooclass']['classname']['nb'] ) { + if ($en_classsynopsis[$i]['ooclass']['classname']['nb'] != $lang_classsynopsis[$i]['ooclass']['classname']['nb'] ) { $result_error[] = array( "value_en" => $en_classsynopsis[$i]['ooclass']['classname']['nb'], "value_lang" => $lang_classsynopsis[$i]['ooclass']['classname']['nb'], @@ -3112,11 +3098,13 @@ // fieldsynopsis - for( $j = 0; $j < count($en_classsynopsis[$i]['fieldsynopsis']['varname']['value']); $j++ ) { + for ($j = 0; $j < count($en_classsynopsis[$i]['fieldsynopsis']['varname']['value']); $j++ ) { // fieldsynopsis varname value - if( !isset($lang_classsynopsis[$i]['fieldsynopsis']['varname']['value'][$j]) ) { $lang_classsynopsis[$i]['fieldsynopsis']['varname']['value'][$j] = ''; } - if( $en_classsynopsis[$i]['fieldsynopsis']['varname']['value'][$j] != $lang_classsynopsis[$i]['fieldsynopsis']['varname']['value'][$j] ) { + if (!isset($lang_classsynopsis[$i]['fieldsynopsis']['varname']['value'][$j])) { + $lang_classsynopsis[$i]['fieldsynopsis']['varname']['value'][$j] = ''; + } + if ($en_classsynopsis[$i]['fieldsynopsis']['varname']['value'][$j] != $lang_classsynopsis[$i]['fieldsynopsis']['varname']['value'][$j] ) { $result_error[] = array( "value_en" => $en_classsynopsis[$i]['fieldsynopsis']['varname']['value'][$j], "value_lang" => $lang_classsynopsis[$i]['fieldsynopsis']['varname']['value'][$j], @@ -3126,8 +3114,10 @@ } // fieldsynopsis varname attr - if( !isset($lang_classsynopsis[$i]['fieldsynopsis']['varname']['attr'][$j]) ) { $lang_classsynopsis[$i]['fieldsynopsis']['varname']['attr'][$j] = ''; } - if( $en_classsynopsis[$i]['fieldsynopsis']['varname']['attr'][$j] != $lang_classsynopsis[$i]['fieldsynopsis']['varname']['attr'][$j] ) { + if (!isset($lang_classsynopsis[$i]['fieldsynopsis']['varname']['attr'][$j])) { + $lang_classsynopsis[$i]['fieldsynopsis']['varname']['attr'][$j] = ''; + } + if ($en_classsynopsis[$i]['fieldsynopsis']['varname']['attr'][$j] != $lang_classsynopsis[$i]['fieldsynopsis']['varname']['attr'][$j] ) { $result_error[] = array( "value_en" => $en_classsynopsis[$i]['fieldsynopsis']['varname']['attr'][$j], "value_lang" => $lang_classsynopsis[$i]['fieldsynopsis']['varname']['attr'][$j], @@ -3137,8 +3127,10 @@ } // fieldsynopsis type - if( !isset($lang_classsynopsis[$i]['fieldsynopsis']['type'][$j]) ) { $lang_classsynopsis[$i]['fieldsynopsis']['type'][$j] = ''; } - if( $en_classsynopsis[$i]['fieldsynopsis']['type'][$j] != $lang_classsynopsis[$i]['fieldsynopsis']['type'][$j] ) { + if (!isset($lang_classsynopsis[$i]['fieldsynopsis']['type'][$j])) { + $lang_classsynopsis[$i]['fieldsynopsis']['type'][$j] = ''; + } + if ($en_classsynopsis[$i]['fieldsynopsis']['type'][$j] != $lang_classsynopsis[$i]['fieldsynopsis']['type'][$j] ) { $result_error[] = array( "value_en" => $en_classsynopsis[$i]['fieldsynopsis']['type'][$j], "value_lang" => $lang_classsynopsis[$i]['fieldsynopsis']['type'][$j], @@ -3148,8 +3140,8 @@ } // fieldsynopsis modifier - if( !isset($lang_classsynopsis[$i]['fieldsynopsis']['modifier'][$j]) ) { $lang_classsynopsis[$i]['fieldsynopsis']['modifier'][$j] = ''; } - if( $en_classsynopsis[$i]['fieldsynopsis']['modifier'][$j] != $lang_classsynopsis[$i]['fieldsynopsis']['modifier'][$j] ) { + if (!isset($lang_classsynopsis[$i]['fieldsynopsis']['modifier'][$j])) { $lang_classsynopsis[$i]['fieldsynopsis']['modifier'][$j] = ''; } + if ($en_classsynopsis[$i]['fieldsynopsis']['modifier'][$j] != $lang_classsynopsis[$i]['fieldsynopsis']['modifier'][$j] ) { $result_error[] = array( "value_en" => $en_classsynopsis[$i]['fieldsynopsis']['modifier'][$j], "value_lang" => $lang_classsynopsis[$i]['fieldsynopsis']['modifier'][$j], @@ -3159,8 +3151,8 @@ } // fieldsynopsis initializer - if( !isset($lang_classsynopsis[$i]['fieldsynopsis']['initializer'][$j]) ) { $lang_classsynopsis[$i]['fieldsynopsis']['initializer'][$j] = ''; } - if( $en_classsynopsis[$i]['fieldsynopsis']['initializer'][$j] != $lang_classsynopsis[$i]['fieldsynopsis']['initializer'][$j] ) { + if (!isset($lang_classsynopsis[$i]['fieldsynopsis']['initializer'][$j])) { $lang_classsynopsis[$i]['fieldsynopsis']['initializer'][$j] = ''; } + if ($en_classsynopsis[$i]['fieldsynopsis']['initializer'][$j] != $lang_classsynopsis[$i]['fieldsynopsis']['initializer'][$j] ) { $result_error[] = array( "value_en" => $en_classsynopsis[$i]['fieldsynopsis']['initializer'][$j], "value_lang" => $lang_classsynopsis[$i]['fieldsynopsis']['initializer'][$j], @@ -3177,21 +3169,21 @@ function tools_error_check_nbParaTag($lang_content, $en_content) { // Nb <para> tags - $result_error = FALSE; + $result_error = array(); - $en_para = 0; - preg_match_all("/<para(( )(.*?))?>/s", $en_content, $match); + $match = array(); + preg_match_all('/<para(( )(.*?))?>/s', $en_content, $match); $en_para = count($match[0]); - $lang_para = 0; - preg_match_all("/<para(( )(.*?))?>/s", $lang_content, $match); + $match = array(); + preg_match_all('/<para(( )(.*?))?>/s', $lang_content, $match); $lang_para = count($match[0]); - if( $en_para != $lang_para ) { + if ($en_para != $lang_para) { $result_error[] = array( - "value_en" => $en_para, - "value_lang" => $lang_para, - "type" => "nbParaTags", + 'value_en' => $en_para, + 'value_lang' => $lang_para, + 'type' => 'nbParaTags', ); } @@ -3201,17 +3193,21 @@ function tools_error_check_nbNoteTag($lang_content, $en_content) { // Nb <note> tags - $result_error = FALSE; + $result_error = array(); $en_note = 0; - preg_match_all("/<note>/s", $en_content, $match); - $en_note = count($match[0]); + $match = array(); + if (preg_match_all('/<note>/s', $en_content, $match)) { + $en_note = count($match[0]); + } $lang_note = 0; - preg_match_all("/<note>/s", $lang_content, $match); - $lang_note = count($match[0]); + $match = array(); + if (preg_match_all('/<note>/s', $lang_content, $match)) { + $lang_note = count($match[0]); + } - if( $en_note != $lang_note ) { + if ($en_note != $lang_note) { $result_error[] = array( "value_en" => $en_note, "value_lang" => $lang_note, @@ -3227,14 +3223,18 @@ // Nb <chapter> tags $result_error = FALSE; $en_chapter = 0; - preg_match_all("/<chapter /s", $en_content, $match); - $en_chapter = count($match[0]); + $match = array(); + if (preg_match_all('/<chapter /s', $en_content, $match)) { + $en_chapter = count($match[0]); + } $lang_chapter = 0; - preg_match_all("/<chapter /s", $lang_content, $match); - $lang_chapter = count($match[0]); + $match = array(); + if (preg_match_all('/<chapter /s', $lang_content, $match)) { + $lang_chapter = count($match[0]); + } - if( $en_chapter != $lang_chapter ) { + if ($en_chapter != $lang_chapter ) { $result_error[] = array( "value_en" => $en_chapter, "value_lang" => $lang_chapter, @@ -3249,14 +3249,18 @@ // Nb <literal> tags $result_error = FALSE; $en_literal = 0; - preg_match_all("/<literal>/s", $en_content, $match); - $en_literal = count($match[0]); + $match = array(); + if (preg_match_all('/<literal>/s', $en_content, $match)) { + $en_literal = count($match[0]); + } $lang_literal = 0; - preg_match_all("/<literal>/s", $lang_content, $match); - $lang_literal = count($match[0]); + $match = array(); + if (preg_match_all('/<literal>/s', $lang_content, $match)) { + $lang_literal = count($match[0]); + } - if( $en_literal != $lang_literal ) { + if ($en_literal != $lang_literal ) { $result_error[] = array( "value_en" => $en_literal, "value_lang" => $lang_literal, @@ -3268,99 +3272,62 @@ function tools_error_check_nbElInTable($lang_content, $en_content) { - $result_error = FALSE; + $result_error = array(); // attr in <row> tags $en_attrRow = array(); - preg_match_all("/<row(\s.*?)xml:id=\"(.*?)\">/s", $en_content, $match); - $en_attrRow["xmlid"] = $match[2]; + $match = array(); + $reg = '/<row(\s.*?)xml:id="(.*?)">/s'; + if (preg_match_all($reg, $en_content, $match)) { + $en_attrRow['xmlid'] = $match[2]; + } $lang_attrRow = array(); - preg_match_all("/<row(\s.*?)xml:id=\"(.*?)\">/s", $lang_content, $match); - $lang_attrRow["xmlid"] = $match[2]; + $match = array(); + if (preg_match_all($reg, $lang_content, $match)) { + $lang_attrRow['xmlid'] = $match[2]; + } - for( $i=0; $i < count($en_attrRow["xmlid"]); $i ++ ) { + for ($i = 0; $i < count($en_attrRow['xmlid']); $i++) { - if( !isset($en_attrRow["xmlid"][$i]) ) { $en_attrRow["xmlid"][$i] = ''; } - if( !isset($lang_attrRow["xmlid"][$i]) ) { $lang_attrRow["xmlid"][$i] = ''; } + if (!isset($en_attrRow['xmlid'][$i])) { $en_attrRow['xmlid'][$i] = ''; } + if (!isset($lang_attrRow['xmlid'][$i])) { $lang_attrRow['xmlid'][$i] = ''; } - if( $en_attrRow["xmlid"][$i] != $lang_attrRow["xmlid"][$i] ) { + if ($en_attrRow['xmlid'][$i] != $lang_attrRow['xmlid'][$i] ) { $result_error[] = array( - "value_en" => $en_attrRow["xmlid"][$i], - "value_lang" => $lang_attrRow["xmlid"][$i], - "type" => "attributXmlIdRow" + 'value_en' => $en_attrRow['xmlid'][$i], + 'value_lang' => $lang_attrRow['xmlid'][$i], + 'type' => 'attributXmlIdRow' ); } } - // Nb <row> tags - $en_row = 0; - preg_match_all("/<row>/s", $en_content, $match); - $en_row = count($match[0]); - - $lang_row = 0; - preg_match_all("/<row>/s", $lang_content, $match); - $lang_row = count($match[0]); - - if( $en_row != $lang_row ) { - $result_error[] = array( - "value_en" => $en_row, - "value_lang" => $lang_row, - "type" => "nbRowTags", - ); - } - - // Nb <thead> tags - $en_thead = 0; - preg_match_all("/<thead>/s", $en_content, $match); - $en_thead = count($match[0]); - - $lang_thead = 0; - preg_match_all("/<thead>/s", $lang_content, $match); - $lang_thead = count($match[0]); - - if( $en_thead != $lang_thead ) { - $result_error[] = array( - "value_en" => $en_thead, - "value_lang" => $lang_thead, - "type" => "nbTheadTags", - ); - } + $tags = array('row', 'thead', 'tbody', 'entry'); - // Nb <tbody> tags - $en_tbody = 0; - preg_match_all("/<tbody>/s", $en_content, $match); - $en_tbody = count($match[0]); - - $lang_tbody = 0; - preg_match_all("/<tbody>/s", $lang_content, $match); - $lang_tbody = count($match[0]); + foreach ($tags as $tag) { - if( $en_tbody != $lang_tbody ) { - $result_error[] = array( - "value_en" => $en_tbody, - "value_lang" => $lang_tbody, - "type" => "nbTbodyTags", - ); - } + $reg = '/<' . $tag . '>/s'; + $en_tag = 0; + $match = array(); + if (preg_match_all($reg, $en_content, $match)) { + $en_tag = count($match[0]); + } - // Nb <entry> tags - $en_entry = 0; - preg_match_all("/<entry>/s", $en_content, $match); - $en_entry = count($match[0]); - - $lang_entry = 0; - preg_match_all("/<entry>/s", $lang_content, $match); - $lang_entry = count($match[0]); + $lang_tag = 0; + $match = array(); + if (preg_match_all($reg, $lang_content, $match)) { + $lang_tag = count($match[0]); + } - if( $en_entry != $lang_entry ) { - $result_error[] = array( - "value_en" => $en_entry, - "value_lang" => $lang_entry, - "type" => "nbEntryTags", - ); + if ($en_tag != $lang_tag) { + $result_error[] = array( + 'value_en' => $en_tag, + 'value_lang' => $lang_tag, + 'type' => 'nb' . ucfirst($tag) . 'Tags', + ); + } } return $result_error; @@ -3369,29 +3336,33 @@ function tools_error_check_nbMemberInSeeAlso($lang_content, $en_content) { // SeeAlso section : check nb member - $result_error = FALSE; + $result_error = array(); + $reg = '!<refsect1 role="seealso">(.*)</refsect1>!s'; + $reg2 = '!<member>(.*?)</member>!s'; + $match = array(); $en_seeAlsoMember = 0; - preg_match("/<refsect1 role=\"seealso\">(.*)<\/refsect1>/s", $en_content, $match2); - - if (isset($match2[1])) { - preg_match_all("/<member>(.*?)<\/member>/s", $match2[1], $match3); - if (isset($match3[1])) { - $en_seeAlsoMember = count($match3[1]); + preg_match($reg, $en_content, $match); + if (isset($match[1])) { + $match2 = array(); + preg_match_all($reg2, $match[1], $match2); + if (isset($match2[1])) { + $en_seeAlsoMember = count($match2[1]); } } + $match = array(); $lang_seeAlsoMember = 0; - preg_match("/<refsect1 role=\"seealso\">(.*)<\/refsect1>/s", $lang_content, $match2); - - if (isset($match2[1])) { - preg_match_all("/<member>(.*?)<\/member>/s", $match2[1], $match3); - if (isset($match3[1])) { - $lang_seeAlsoMember = count($match3[1]); + preg_match($reg, $lang_content, $match); + if (isset($match[1])) { + $match2 = array(); + preg_match_all($reg2, $match[1], $match2); + if (isset($match2[1])) { + $lang_seeAlsoMember = count($match2[1]); } } - if( $en_seeAlsoMember != $lang_seeAlsoMember ) { + if ($en_seeAlsoMember != $lang_seeAlsoMember ) { $result_error[] = array( "value_en" => $en_seeAlsoMember, "value_lang" => $lang_seeAlsoMember, @@ -3408,19 +3379,22 @@ // test with methodsynopsis $result_error = FALSE; - $en_methodsynopsis = array(); - preg_match_all("/<methodsynopsis>(\s.*?)<\/methodsynopsis>/s", $en_content, $match); + $match = $en_methodsynopsis = array(); + preg_match_all('/<methodsynopsis>(\s.*?)<\/methodsynopsis>/s', $en_content, $match); - for( $i = 0; $i < count($match[1]); $i++) { + for ($i = 0; $i < count($match[1]); $i++) { - preg_match_all("/<type>(.*?)<\/type>\s*?<methodname>(.*?)<\/methodname>/s", $match[1][$i], $match2); + $match2 = array(); - if( isset($match2[2][0]) && isset($match2[1][0]) ) { + preg_match_all('/<type>(.*?)<\/type>\s*?<methodname>(.*?)<\/methodname>/s', $match[1][$i], $match2); + + if (isset($match2[2][0]) && isset($match2[1][0])) { $en_methodsynopsis[$i]['methodname']['name'] = $match2[2][0]; $en_methodsynopsis[$i]['methodname']['type'] = $match2[1][0]; - preg_match_all("/<methodparam\s*?((choice=\"opt\")|(choice='opt'))?>\s*?<type>(.*?)<\/type>\s*?<parameter\s*?((role=\"reference\")|(role='reference'))?>(.*?)<\/parameter>\s*?(<initializer>(.*?)<\/initializer>\s*?)?<\/methodparam>/s", $match[1][$i], $match2); + $match2 = array(); + preg_match_all('/<methodparam\s*?((choice=\'opt\')|(choice="opt"))?>\s*?<type>(.*?)<\/type>\s*?<parameter\s*?((role=\'reference\')|(role="reference"))?>(.*?)<\/parameter>\s*?(<initializer>(.*?)<\/initializer>\s*?)?<\/methodparam>/s', $match[1][$i], $match2); $en_methodsynopsis[$i]['methodparam']['parameter'] = $match2[8]; $en_methodsynopsis[$i]['methodparam']['initializer'] = $match2[10]; @@ -3428,49 +3402,63 @@ - for( $j=0; $j < count($match2[1]); $j++) { - if( trim($match2[1][$j]) == 'choice="opt"' || trim($match2[1][$j]) == "choice='opt'" ) { $en_methodsynopsis[$i]['methodparam']['optionnel'][$j] = 1; } - else { $en_methodsynopsis[$i]['methodparam']['optionnel'][$j] = 0; } + for ($j = 0; $j < count($match2[1]); $j++) { + if (trim($match2[1][$j]) == 'choice="opt"' || trim($match2[1][$j]) == "choice='opt'" ) { + $en_methodsynopsis[$i]['methodparam']['optionnel'][$j] = 1; + } + else { + $en_methodsynopsis[$i]['methodparam']['optionnel'][$j] = 0; + } } - for( $j=0; $j < count($match2[5]); $j++) { - if( trim($match2[5][$j]) == 'role="reference"' || trim($match2[5][$j]) == "role='reference'" ) { $en_methodsynopsis[$i]['methodparam']['role'][$j] = 1; } - else { $en_methodsynopsis[$i]['methodparam']['role'][$j] = 0; } + for ($j = 0; $j < count($match2[5]); $j++) { + if (trim($match2[5][$j]) == "role='reference'" || trim($match2[5][$j]) == 'role="reference"' ) { + $en_methodsynopsis[$i]['methodparam']['role'][$j] = 1; + } + else { + $en_methodsynopsis[$i]['methodparam']['role'][$j] = 0; + } } } } - $lang_methodsynopsis = array(); - preg_match_all("/<methodsynopsis>(\s.*?)<\/methodsynopsis>/s", $lang_content, $match); + $match = $lang_methodsynopsis = array(); + preg_match_all('/<methodsynopsis>(\s.*?)<\/methodsynopsis>/s', $lang_content, $match); - for( $i = 0; $i < count($match[1]); $i++) { + for ($i = 0; $i < count($match[1]); $i++) { - preg_match_all("/<type>(.*?)<\/type>\s*?<methodname>(.*?)<\/methodname>/s", $match[1][$i], $match2); + $match2 = array(); + preg_match_all('/<type>(.*?)<\/type>\s*?<methodname>(.*?)<\/methodname>/s', $match[1][$i], $match2); - if( isset($match2[2][0]) && isset($match2[1][0]) ) { + if (isset($match2[2][0]) && isset($match2[1][0])) { $lang_methodsynopsis[$i]['methodname']['name'] = $match2[2][0]; $lang_methodsynopsis[$i]['methodname']['type'] = $match2[1][0]; - preg_match_all("/<methodparam\s*?((choice=\"opt\")|(choice='opt'))?>\s*?<type>(.*?)<\/type>\s*?<parameter\s*?((role=\"reference\")|(role='reference'))?>(.*?)<\/parameter>\s*?(<initializer>(.*?)<\/initializer>\s*?)?<\/methodparam>/s", $match[1][$i], $match2); + $match2 = array(); + preg_match_all('/<methodparam\s*?((choice=\'opt\')|(choice="opt"))?>\s*?<type>(.*?)<\/type>\s*?<parameter\s*?((role=\'reference\')|(role="reference"))?>(.*?)<\/parameter>\s*?(<initializer>(.*?)<\/initializer>\s*?)?<\/methodparam>/s', $match[1][$i], $match2); $lang_methodsynopsis[$i]['methodparam']['parameter'] = $match2[8]; $lang_methodsynopsis[$i]['methodparam']['initializer'] = $match2[10]; $lang_methodsynopsis[$i]['methodparam']['type'] = $match2[4]; - for( $j=0; $j < count($match2[1]); $j++) { + for ($j=0; $j < count($match2[1]); $j++) { - if( trim($match2[1][$j]) == 'choice="opt"' || trim($match2[1][$j]) == "choice='opt'" ) { $lang_methodsynopsis[$i]['methodparam']['optionnel'][$j] = 1; } - else { $lang_methodsynopsis[$i]['methodparam']['optionnel'][$j] = 0; } + if (trim($match2[1][$j]) == 'choice="opt"' || trim($match2[1][$j]) == "choice='opt'" ) { + $lang_methodsynopsis[$i]['methodparam']['optionnel'][$j] = 1; + } else { + $lang_methodsynopsis[$i]['methodparam']['optionnel'][$j] = 0; + } } - - for( $j=0; $j < count($match2[5]); $j++) { - - if( trim($match2[5][$j]) == 'role="reference"' ) { $lang_methodsynopsis[$i]['methodparam']['role'][$j] = 1; } - else { $lang_methodsynopsis[$i]['methodparam']['role'][$j] = 0; } + for ($j=0; $j < count($match2[5]); $j++) { + if (trim($match2[5][$j]) == "role='reference'" || trim($match2[5][$j]) == 'role="reference"' ) { + $lang_methodsynopsis[$i]['methodparam']['role'][$j] = 1; + } else { + $lang_methodsynopsis[$i]['methodparam']['role'][$j] = 0; + } } @@ -3478,17 +3466,17 @@ } - for( $i=0; $i < count($en_methodsynopsis); $i++) { + for ($i = 0; $i < count($en_methodsynopsis); $i++) { // Check on name - if( isset($en_methodsynopsis[$i]['methodname']['name']) ) { + if (isset($en_methodsynopsis[$i]['methodname']['name'])) { - if( !isset($lang_methodsynopsis[$i]['methodname']['name']) ) { $lang_methodsynopsis[$i]['methodname']['name'] = ''; } - if( $en_methodsynopsis[$i]['methodname']['name'] != $lang_methodsynopsis[$i]['methodname']['name'] ) { + if (!isset($lang_methodsynopsis[$i]['methodname']['name'])) { $lang_methodsynopsis[$i]['methodname']['name'] = ''; } + if ($en_methodsynopsis[$i]['methodname']['name'] != $lang_methodsynopsis[$i]['methodname']['name'] ) { $result_error[] = array( - "value_en" => $en_methodsynopsis[$i]['methodname']['name'], - "value_lang" => $lang_methodsynopsis[$i]['methodname']['name'], - "type" => "errorMethodnameMethodsynopsis" + 'value_en' => $en_methodsynopsis[$i]['methodname']['name'], + 'value_lang' => $lang_methodsynopsis[$i]['methodname']['name'], + 'type' => 'errorMethodnameMethodsynopsis' ); } @@ -3496,115 +3484,117 @@ } // Check on type - if( isset($en_methodsynopsis[$i]['methodname']['type']) ) { + if (isset($en_methodsynopsis[$i]['methodname']['type'])) { - if( !isset($lang_methodsynopsis[$i]['methodname']['type']) ) { $lang_methodsynopsis[$i]['methodname']['type'] = ''; } - if( $en_methodsynopsis[$i]['methodname']['type'] != $lang_methodsynopsis[$i]['methodname']['type'] ) { + if (!isset($lang_methodsynopsis[$i]['methodname']['type'])) { $lang_methodsynopsis[$i]['methodname']['type'] = ''; } + if ($en_methodsynopsis[$i]['methodname']['type'] != $lang_methodsynopsis[$i]['methodname']['type'] ) { $result_error[] = array( - "value_en" => $en_methodsynopsis[$i]['methodname']['type'], - "value_lang" => $lang_methodsynopsis[$i]['methodname']['type'], - "type" => "errorTypeMethodsynopsis" + 'value_en' => $en_methodsynopsis[$i]['methodname']['type'], + 'value_lang' => $lang_methodsynopsis[$i]['methodname']['type'], + 'type' => 'errorTypeMethodsynopsis' ); } } // Check on methodparam - if(isset($en_methodsynopsis[$i]['methodparam']['parameter'])) { + if (isset($en_methodsynopsis[$i]['methodparam']['parameter'])) { // Init - if(!isset($en_methodsynopsis[$i]['methodparam']['parameter'])) { $en_methodsynopsis[$i]['methodparam']['parameter']=array(); } - if(!isset($lang_methodsynopsis[$i]['methodparam']['parameter'])) { $lang_methodsynopsis[$i]['methodparam']['parameter']=array(); } + if (!isset($en_methodsynopsis[$i]['methodparam']['parameter'])) { $en_methodsynopsis[$i]['methodparam']['parameter']=array(); } + if (!isset($lang_methodsynopsis[$i]['methodparam']['parameter'])) { $lang_methodsynopsis[$i]['methodparam']['parameter']=array(); } // Check on Nb $nb_lang = count($lang_methodsynopsis[$i]['methodparam']['parameter']); $nb_en = count($en_methodsynopsis[$i]['methodparam']['parameter']); - if($nb_lang != $nb_en){ + if ($nb_lang != $nb_en){ $result_error[]=array( - "value_en" =>$nb_en, - "value_lang" =>$nb_lang, - "type"=>"errorNbMethodparamMethodsynopsis" + 'value_en' =>$nb_en, + 'value_lang' =>$nb_lang, + 'type'=>'errorNbMethodparamMethodsynopsis' ); } for($j=0;$j<count($en_methodsynopsis[$i]['methodparam']['parameter']);$j++) { // Check on parameter - if(isset($en_methodsynopsis[$i]['methodparam']['parameter'][$j])) { + if (isset($en_methodsynopsis[$i]['methodparam']['parameter'][$j])) { - if(!isset($lang_methodsynopsis[$i]['methodparam']['parameter'][$j])) { $lang_methodsynopsis[$i]['methodparam']['parameter'][$j]=''; } + if (!isset($lang_methodsynopsis[$i]['methodparam']['parameter'][$j])) { $lang_methodsynopsis[$i]['methodparam']['parameter'][$j]=''; } - if($en_methodsynopsis[$i]['methodparam']['parameter'][$j] != $lang_methodsynopsis[$i]['methodparam']['parameter'][$j]) { + if ($en_methodsynopsis[$i]['methodparam']['parameter'][$j] != $lang_methodsynopsis[$i]['methodparam']['parameter'][$j]) { $result_error[]=array( - "value_en" => $en_methodsynopsis[$i]['methodparam']['parameter'][$j], - "value_lang" => $lang_methodsynopsis[$i]['methodparam']['parameter'][$j], - "type"=>"errorParameterNameMethodsynopsis" + 'value_en' => $en_methodsynopsis[$i]['methodparam']['parameter'][$j], + 'value_lang' => $lang_methodsynopsis[$i]['methodparam']['parameter'][$j], + 'type'=>'errorParameterNameMethodsynopsis' ); } } // Check on type - if(isset($en_methodsynopsis[$i]['methodparam']['type'][$j])) { + if (isset($en_methodsynopsis[$i]['methodparam']['type'][$j])) { - if(!isset($lang_methodsynopsis[$i]['methodparam']['type'][$j])) { $lang_methodsynopsis[$i]['methodparam']['type'][$j]=''; } + if (!isset($lang_methodsynopsis[$i]['methodparam']['type'][$j])) { $lang_methodsynopsis[$i]['methodparam']['type'][$j]=''; } - if($en_methodsynopsis[$i]['methodparam']['type'][$j]!=$lang_methodsynopsis[$i]['methodparam']['type'][$j]) { + if ($en_methodsynopsis[$i]['methodparam']['type'][$j]!=$lang_methodsynopsis[$i]['methodparam']['type'][$j]) { $result_error[]=array( - "value_en"=>$en_methodsynopsis[$i]['methodparam']['type'][$j], - "value_lang"=>$lang_methodsynopsis[$i]['methodparam']['type'][$j], - "type"=>"errorParameterTypeMethodsynopsis" + 'value_en'=>$en_methodsynopsis[$i]['methodparam']['type'][$j], + 'value_lang'=>$lang_methodsynopsis[$i]['methodparam']['type'][$j], + 'type'=>'errorParameterTypeMethodsynopsis' ); } } // Check on initializer - if(isset($en_methodsynopsis[$i]['methodparam']['initializer'][$j])) { + if (isset($en_methodsynopsis[$i]['methodparam']['initializer'][$j])) { - if(!isset($lang_methodsynopsis[$i]['methodparam']['initializer'][$j])) { $lang_methodsynopsis[$i]['methodparam']['initializer'][$j]=''; } + if (!isset($lang_methodsynopsis[$i]['methodparam']['initializer'][$j])) { $lang_methodsynopsis[$i]['methodparam']['initializer'][$j]=''; } - if($en_methodsynopsis[$i]['methodparam']['initializer'][$j]!=$lang_methodsynopsis[$i]['methodparam']['initializer'][$j]) { + if ($en_methodsynopsis[$i]['methodparam']['initializer'][$j]!=$lang_methodsynopsis[$i]['methodparam']['initializer'][$j]) { $result_error[]=array( - "value_en"=>$en_methodsynopsis[$i]['methodparam']['initializer'][$j], - "value_lang"=>$lang_methodsynopsis[$i]['methodparam']['initializer'][$j], - "type"=>"errorParameterInitializerMethodsynopsis" + 'value_en'=>$en_methodsynopsis[$i]['methodparam']['initializer'][$j], + 'value_lang'=>$lang_methodsynopsis[$i]['methodparam']['initializer'][$j], + 'type'=>'errorParameterInitializerMethodsynopsis' ); } } // Check on optionnel - if(isset($en_methodsynopsis[$i]['methodparam']['optionnel'][$j])) { + if (isset($en_methodsynopsis[$i]['methodparam']['optionnel'][$j])) { - if(!isset($lang_methodsynopsis[$i]['methodparam']['optionnel'][$j])) { $lang_methodsynopsis[$i]['methodparam']['optionnel'][$j]=''; } + if (!isset($lang_methodsynopsis[$i]['methodparam']['optionnel'][$j])) { + $lang_methodsynopsis[$i]['methodparam']['optionnel'][$j] = ''; + } - if($en_methodsynopsis[$i]['methodparam']['optionnel'][$j]!=$lang_methodsynopsis[$i]['methodparam']['optionnel'][$j]) { - $tmp1 = ($en_methodsynopsis[$i]['methodparam']['optionnel'][$j] == 0) ? $en_methodsynopsis[$i]['methodparam']['parameter'][$j]." <strong>ISN'T</strong> optionnel" : $en_methodsynopsis[$i]['methodparam']['parameter'][$j]." <strong>IS</strong> optionnel (choice=\"opt\")"; + if ($en_methodsynopsis[$i]['methodparam']['optionnel'][$j] != $lang_methodsynopsis[$i]['methodparam']['optionnel'][$j]) { + $tmp1 = ($en_methodsynopsis[$i]['methodparam']['optionnel'][$j] == 0) ? $en_methodsynopsis[$i]['methodparam']['parameter'][$j] . ' <strong>ISN\'T</strong> optional' : $en_methodsynopsis[$i]['methodparam']['parameter'][$j].' <strong>IS</strong> optional (choice="opt")'; - $tmp2 = ($lang_methodsynopsis[$i]['methodparam']['optionnel'][$j] == 0) ? $lang_methodsynopsis[$i]['methodparam']['parameter'][$j]." <strong>ISN'T</strong> optionnel" : $lang_methodsynopsis[$i]['methodparam']['parameter'][$j]." <strong>IS</strong> optionnel (choice=\"opt\")"; + $tmp2 = ($lang_methodsynopsis[$i]['methodparam']['optionnel'][$j] == 0) ? $lang_methodsynopsis[$i]['methodparam']['parameter'][$j].' <strong>ISN\'T</strong> optional' : $lang_methodsynopsis[$i]['methodparam']['parameter'][$j].' <strong>IS</strong> optional (choice="opt")'; - $result_error[]=array( - "value_en" => $tmp1, - "value_lang" => $tmp2, - "type"=>"errorOptionalMethodsynopsis" + $result_error[] = array( + 'value_en' => $tmp1, + 'value_lang' => $tmp2, + 'type'=>'errorOptionalMethodsynopsis', ); } } // Check on role - if(isset($en_methodsynopsis[$i]['methodparam']['role'][$j])) { + if (isset($en_methodsynopsis[$i]['methodparam']['role'][$j])) { - if(!isset($lang_methodsynopsis[$i]['methodparam']['role'][$j])) { + if (!isset($lang_methodsynopsis[$i]['methodparam']['role'][$j])) { $lang_methodsynopsis[$i]['methodparam']['role'][$j]=''; } - if( $en_methodsynopsis[$i]['methodparam']['role'][$j] != $lang_methodsynopsis[$i]['methodparam']['role'][$j] ) { - $tmp1 = ($en_methodsynopsis[$i]['methodparam']['role'][$j] == 0) ? $en_methodsynopsis[$i]['methodparam']['parameter'][$j]." <strong>ISN'T</strong> reference" : $en_methodsynopsis[$i]['methodparam']['parameter'][$j]." <strong>IS</strong> reference (role=\"reference\")"; - $tmp2 = ($lang_methodsynopsis[$i]['methodparam']['role'][$j]==0) ? $lang_methodsynopsis[$i]['methodparam']['parameter'][$j]." <strong>ISN'T</strong> reference" : $lang_methodsynopsis[$i]['methodparam']['parameter'][$j]." <strong>IS</strong> reference (role=\"reference\")"; + if ($en_methodsynopsis[$i]['methodparam']['role'][$j] != $lang_methodsynopsis[$i]['methodparam']['role'][$j] ) { + $tmp1 = ($en_methodsynopsis[$i]['methodparam']['role'][$j] == 0) ? $en_methodsynopsis[$i]['methodparam']['parameter'][$j].' <strong>ISN\'T</strong> reference' : $en_methodsynopsis[$i]['methodparam']['parameter'][$j].' <strong>IS</strong> reference (role="reference")'; + $tmp2 = ($lang_methodsynopsis[$i]['methodparam']['role'][$j]==0) ? $lang_methodsynopsis[$i]['methodparam']['parameter'][$j].' <strong>ISN\'T</strong> reference' : $lang_methodsynopsis[$i]['methodparam']['parameter'][$j].' <strong>IS</strong> reference (role="reference")'; $result_error[]=array( - "value_en"=>$tmp1, - "value_lang"=>$tmp2, - "type"=>"errorRoleMethodsynopsis",); + 'value_en'=>$tmp1, + 'value_lang'=>$tmp2, + 'type'=>'errorRoleMethodsynopsis',); } } } @@ -3619,9 +3609,10 @@ * @param $value The value of the option. * @return Nothing */ - function updateConf($item, $value) { + function updateConf($item, $value) + { - $s = 'UPDATE users SET '.$item.'=\''.$value.'\' WHERE cvs_login=\''.$this->cvsLogin.'\''; + $s = sprintf('UPDATE users SET %s="%s" WHERE cvs_login="%s"', $item, $value, $this->cvsLogin); $this->db->query($s) or die($this->db->error); @@ -3636,13 +3627,11 @@ * Erase personal data. Delete all reference into the DB for this user. * @return Nothing */ - function erasePersonalData() { + function erasePersonalData() + { - /* The DB */ - $s = 'DELETE FROM commitMessage WHERE userID=\''.$this->userID.'\''; - $this->db->query($s); - $s = 'DELETE FROM users WHERE userID=\''.$this->userID.'\''; - $this->db->query($s); + $this->db->query(sprintf('DELETE FROM commitMessage WHERE userID="%s"', $this->userID)); + $this->db->query(sprintf('DELETE FROM users WHERE userID="%s"', $this->userID)); return; @@ -3662,12 +3651,12 @@ while($f = $d->read()){ // We display only 'en' and 'LANG' tree - if( $node == '/' && $f != 'en' && $f != $this->cvsLang ) { + if ($node == '/' && $f != 'en' && $f != $this->cvsLang ) { continue; } - if( $f == '.' || + if ($f == '.' || $f == '..' || substr($f, 0, 1) == '.' || // skip hidden files substr($f, -4) == '.new' || // skip pendingCommit files @@ -3676,11 +3665,11 @@ ) continue; - if(is_dir($this->cvsDoc.$node.'/'.$f)) { - $nodes[] = array('text'=>$f, 'id'=>$node.'/'.$f, 'cls'=>'folder', 'type'=>'folder'); + if (is_dir($this->cvsDoc . $node . '/' . $f)) { + $nodes[] = array('text' => $f, 'id' => $node . '/' . $f, 'cls' => 'folder', 'type' => 'folder'); } else { - if( isset($ModifiedFiles[substr($node, 2, (strlen($node)-1)).'/'.$f]) ) { + if (isset($ModifiedFiles[substr($node, 2, (strlen($node)-1)).'/'.$f])) { $cls = 'file modified'; } else { $cls = 'file'; @@ -3697,26 +3686,26 @@ return $nodes; } - function saveLogMessage($messID, $mess) { - - $s = 'UPDATE commitMessage SET text=\''.$this->db->real_escape_string($mess).'\' WHERE id=\''.$messID.'\''; - $r = $this->db->query($s) or die($this->db->error); - + function saveLogMessage($messID, $mess) + { + $s = sprintf('UPDATE commitMessage SET text="%s" WHERE id="%s"', $this->db->real_escape_string($mess), $messID); + $this->db->query($s) or die($this->db->error); } - function deleteLogMessage($messID) { - $s = 'DELETE FROM commitMessage WHERE id=\''.$messID.'\''; - $r = $this->db->query($s) or die($this->db->error); + function deleteLogMessage($messID) + { + $s = sprintf('DELETE FROM commitMessage WHERE id="%s"', $messID); + $this->db->query($s) or die($this->db->error); } function allFilesExtension($ExtName) { $s = 'SELECT `path`, `name` FROM `files` WHERE `path` LIKE \'/reference/'.$ExtName.'/%\' AND lang=\''.$this->cvsLang.'\' ORDER BY `path`, `name`'; $r = $this->db->query($s) or die($this->db->error); - $node = Array(); + $node = array(); $i=0; - while( $a = $r->fetch_object() ) { + while ($a = $r->fetch_object()) { $node[$i]['path'] = $a->path; $node[$i]['name'] = $a->name; @@ -3735,7 +3724,7 @@ $a = $r->fetch_object(); // We need to send an email ? - if( trim($a->email) != '' ) { + if (trim($a->email) != '' ) { $to = trim($a->email); $subject = '[PHP-DOC] - Patch Accepted for '.$a->lang.$a->path.$a->name; @@ -3755,12 +3744,12 @@ function afterPatchReject($PatchUniqID) { - $s = 'SELECT * FROM `pendingPatch` WHERE uniqID = \''.$PatchUniqID.'\''; + $s = sprintf('SELECT * FROM `pendingPatch` WHERE uniqID = "%s"', $PatchUniqID); $r = $this->db->query($s) or die($this->db->error); $a = $r->fetch_object(); // We need to send an email ? - if( trim($a->email) != '' ) { + if (trim($a->email) != '' ) { $to = trim($a->email); $subject = '[PHP-DOC] - Patch Rejected for '.$a->lang.$a->path.$a->name; @@ -3773,17 +3762,16 @@ @unlink($this->cvsDoc.$a->lang.$a->path.$a->name.'.'.$a->uniqID.'.patch'); // ... and from DB - $s = 'DELETE FROM `pendingPatch` WHERE id=\''.$a->id.'\''; + $s = sprintf('DELETE FROM `pendingPatch` WHERE id="%s"', $a->id); $this->db->query($s) or die($this->db->error); } - function searchXmlID($lang, $fileID) { - - $s = 'SELECT lang, path, name FROM files WHERE lang=\''.$lang.'\' AND xmlid LIKE \'%'.$fileID.'%\''; + function searchXmlID($lang, $fileID) + { + $s = sprintf('SELECT lang, path, name FROM files WHERE lang="%s" AND xmlid LIKE "%' . $fileID . '%"', $lang); $r = $this->db->query($s) or die($this->db->error); - $a = $r->fetch_object(); - return $a; + return $r->fetch_object(); } function check_doc($content) { @@ -3862,7 +3850,7 @@ case 'void': // This either the return type or 0 parameters if (!isset($methodname)) { - $returnvoid = true; + //$returnvoid = true; } else { // no parameters $noparameters = true; } @@ -3977,7 +3965,7 @@ function get_Check_Doc_Data() { - $nodes = array(); + $node = array(); $s = 'SELECT path, @@ -4005,7 +3993,7 @@ $r = $this->db->query($s); $nb = $r->num_rows; $i = 0; - while( $a = $r->fetch_object() ) { + while ($a = $r->fetch_object()) { $i++; $tmp = explode('/', $a->path); @@ -4028,28 +4016,20 @@ } // While - return Array('nb'=>$nb, 'node'=>$node); + return array('nb' => $nb, 'node' => $node); } //get_Check_Doc_Data - function get_Check_Doc_Files($path, $errorType) { - - $s = 'SELECT path, name FROM `files` WHERE `lang`=\'en\' AND `path`=\''.$path.'\' and `'.$errorType.'`=1'; + function get_Check_Doc_Files($path, $errorType) + { + $s = sprintf('SELECT name FROM `files` WHERE `lang`="en" AND `path`="%s" AND `%s`=1', $path, $errorType); $r = $this->db->query($s); - $i = 0; - $node = Array(); - - while( $a = $r->fetch_object() ) { - - $node[$i]['name'] = $a->name; - - $i++; + $node = array(); + while ($row = $r->fetch_assoc()) { + $node[] = $row; } - return $node; - - } // get_Check_Doc_Files } // End of class \ No newline at end of file http://cvs.php.net/viewvc.cgi/doc-editor/php/controler.php?r1=1.2&r2=1.3&diff_format=u Index: doc-editor/php/controler.php diff -u doc-editor/php/controler.php:1.2 doc-editor/php/controler.php:1.3 --- doc-editor/php/controler.php:1.2 Sat Mar 28 23:53:29 2009 +++ doc-editor/php/controler.php Sun Mar 29 02:44:06 2009 @@ -78,7 +78,7 @@ $phpDoc->rev_parse_translation(); // Check errors in files - //$phpDoc->tools_error_start(); + //$phpDoc->tools_error_do('/'); // Remove the lock File $phpDoc->lockFileRemove('lock_apply_tools'); @@ -683,4 +683,4 @@ } echo '{"success":false}'; -exit; \ No newline at end of file +exit;
http://cvs.php.net/viewvc.cgi/doc-editor/js/login.js?r1=1.1&r2=1.2&diff_format=u Index: doc-editor/js/login.js diff -u doc-editor/js/login.js:1.1 doc-editor/js/login.js:1.2 --- doc-editor/js/login.js:1.1 Sat Mar 28 20:55:35 2009 +++ doc-editor/js/login.js Sun Mar 29 02:44:06 2009 @@ -97,7 +97,7 @@ xtype : 'form', region : 'south', id : 'login-form', - url : '../php/controler.php', + url : '../php/controller.php', bodyStyle : 'padding:5px 5px 0', border : false, height : 100, @@ -249,4 +249,4 @@ }(); -Ext.EventManager.onDocumentReady(loginPage.init, loginPage, true); \ No newline at end of file +Ext.EventManager.onDocumentReady(loginPage.init, loginPage, true); http://cvs.php.net/viewvc.cgi/doc-editor/js/main.js?r1=1.1&r2=1.2&diff_format=u Index: doc-editor/js/main.js diff -u doc-editor/js/main.js:1.1 doc-editor/js/main.js:1.2 --- doc-editor/js/main.js:1.1 Sat Mar 28 20:55:35 2009 +++ doc-editor/js/main.js Sun Mar 29 02:44:06 2009 @@ -54,7 +54,7 @@ // We load the configuration for this user Ext.Ajax.request({ scope: this, - url: './php/controler.php', + url: './php/controller.php', params: { task: 'get-conf' }, @@ -235,7 +235,7 @@ this.storeCommitLogMessage = new Ext.data.Store({ //autoLoad: true, proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'get-commit-log-message' @@ -257,7 +257,7 @@ this.storeFilesError = new Ext.data.GroupingStore({ autoLoad: ( this.userLang === 'en' ) ? false : true, proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'GetFilesError' @@ -307,7 +307,7 @@ this.storeFilesNeedUpdate = new Ext.data.GroupingStore({ autoLoad: ( this.userLang === 'en' ) ? false : true, proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'GetFilesNeedUpdate' @@ -357,7 +357,7 @@ this.storeFilesNeedReviewed = new Ext.data.GroupingStore({ autoLoad: (this.userLang === 'en' ) ? false : true, proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'GetFilesNeedReviewed' @@ -402,7 +402,7 @@ this.storePendingCommit = new Ext.data.GroupingStore({ autoLoad: true, proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'GetFilesPendingCommit' @@ -446,7 +446,7 @@ this.storePendingPatch = new Ext.data.GroupingStore({ autoLoad: true, proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'GetFilesPendingPatch' @@ -493,7 +493,7 @@ this.storeMailing = new Ext.data.Store({ //autoLoad: true, proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'get-mailing-info' @@ -526,7 +526,7 @@ // Store : All open bugs for documentation this.storeBugs = new Ext.data.Store({ proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'get-open-bugs' @@ -553,7 +553,7 @@ // Store : Translator with Informations like Revcheck first table this.storeTranslators = new Ext.data.Store({ proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'get-translator-info' @@ -600,7 +600,7 @@ // Store : storeSummary with Informations like Revcheck second table this.storeSummary = new Ext.data.Store({ proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'get-summary-info' @@ -639,7 +639,7 @@ // The store ds = new Ext.data.Store({ proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'get-check-doc-data' @@ -795,7 +795,7 @@ Ext.Ajax.request({ scope: this, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'get-check-doc-files', path: path, @@ -1004,7 +1004,7 @@ Ext.Ajax.request({ scope: scope, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'after-patch-reject', PatchUniqID: FileUniqID @@ -1057,7 +1057,7 @@ // We save LANG File Ext.Ajax.request({ scope: scope, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'save-file', filePath: FilePath, @@ -1081,7 +1081,7 @@ // We need to send an accept patch email, delete .patch file, and remove this patch from dataBase Ext.Ajax.request({ scope: scope, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'after-patch-accept', PatchUniqID: FileUniqID @@ -1126,7 +1126,7 @@ // We save LANG File Ext.Ajax.request({ scope: scope, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'save-file', filePath: FilePath, @@ -1246,7 +1246,7 @@ // We save this patch Ext.Ajax.request({ scope: scope, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'save-file', filePath: FilePath, @@ -1308,7 +1308,7 @@ // We save LANG File Ext.Ajax.request({ scope: this, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'save-file', filePath: FilePath, @@ -1370,7 +1370,7 @@ // We check for error Ext.Ajax.request({ scope: this, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'check-file-error', FilePath: FilePath, @@ -1415,7 +1415,7 @@ // Now, We save LANG File Ext.Ajax.request({ scope: this, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'save-file', filePath: FilePath, @@ -1483,7 +1483,7 @@ // We load the File Ext.Ajax.request({ scope: this, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'get-file', FilePath: FilePath, @@ -1646,7 +1646,7 @@ // Load diff data Ext.Ajax.request({ - url: './php/controler.php', + url: './php/controller.php', params: { task: 'get-diff2', FilePath: FilePath, @@ -1845,7 +1845,7 @@ // Ext.Ajax.request({ scope: this, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'save-LogMessage', messID: messID, @@ -1902,7 +1902,7 @@ // Ext.Ajax.request({ scope: this, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'delete-LogMessage', messID: this.storeCommitLogMessage.getAt(rowIndex).data.id @@ -2123,7 +2123,7 @@ Ext.getCmp('winCvsCommit').close(); Ext.Ajax.request({ - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'cvs-commit', nodes: Ext.util.JSON.encode(nodes), @@ -2159,7 +2159,7 @@ // Apply modification Ext.Ajax.request({ - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'on-succes-commit', nodes: Ext.util.JSON.encode(nodes), @@ -2209,7 +2209,7 @@ Ext.get('wizard-step-1.1').replaceClass('wizard-wait', 'wizard-show'); Ext.Ajax.request({ scope: scope, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'update-repo' }, @@ -2232,7 +2232,7 @@ function checkLockFile(){ Ext.Ajax.request({ scope: scope, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'check-lock-file', lockFile: 'lock_update_repository' @@ -2273,7 +2273,7 @@ Ext.get('wizard-step-2').replaceClass('wizard-step-before', 'wizard-step-working'); Ext.Ajax.request({ scope: scope, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'apply-tools' }, @@ -2292,7 +2292,7 @@ function checkLockFile2(){ Ext.Ajax.request({ scope: scope, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'check-lock-file', lockFile: 'lock_apply_tools' @@ -2404,7 +2404,7 @@ Ext.Ajax.request({ scope: scope, - url: './php/controler.php', + url: './php/controller.php', params: { task: 'get-logfile', file: 'log_check_build' @@ -2471,7 +2471,7 @@ Ext.Ajax.request({ scope: this, - url: './php/controler.php', + url: './php/controller.php', params: { task: 'check-build', xmlDetails: choice @@ -2494,7 +2494,7 @@ function checkLockFile(){ Ext.Ajax.request({ - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'check-lock-file', lockFile: 'lock_check_build' @@ -2839,7 +2839,7 @@ // Apply modification in DB Ext.Ajax.request({ scope: this, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'conf-update', item: item, @@ -2970,7 +2970,7 @@ var v = form.getForm().getValues(); Ext.Ajax.request({ - url: './php/controler.php', + url: './php/controller.php', params: { task: 'send-email', to: v.to, @@ -3010,7 +3010,7 @@ this.TaskPing = new Ext.util.DelayedTask(function(){ Ext.Ajax.request({ - url: './php/controler.php', + url: './php/controller.php', params: { task: 'ping' }, @@ -3099,7 +3099,7 @@ storeLogLang = new Ext.data.Store({ autoLoad: true, proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'get-log', @@ -3134,7 +3134,7 @@ storeLogEn = new Ext.data.Store({ autoLoad: true, proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'get-log', @@ -3646,7 +3646,7 @@ // Load diff data Ext.Ajax.request({ scope: this, - url: './php/controler.php', + url: './php/controller.php', params: { task: 'get-diff', FilePath: this.userLang + FilePath, @@ -3782,7 +3782,7 @@ // Load diff data Ext.Ajax.request({ - url: './php/controler.php', + url: './php/controller.php', params: { task: 'get-diff', FilePath: this.userLang + FilePath, @@ -3841,7 +3841,7 @@ storeLogLang = new Ext.data.Store({ autoLoad: true, proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'get-log', @@ -3876,7 +3876,7 @@ storeLogEn = new Ext.data.Store({ autoLoad: true, proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'get-log', @@ -4119,7 +4119,7 @@ // Load diff data Ext.Ajax.request({ - url: './php/controler.php', + url: './php/controller.php', params: { task: 'get-diff2', FilePath: 'en' + FilePath, @@ -4483,7 +4483,7 @@ storeLog = new Ext.data.Store({ autoLoad: true, proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'get-log', @@ -4630,7 +4630,7 @@ // Load diff data Ext.Ajax.request({ scope: this, - url: './php/controler.php', + url: './php/controller.php', params: { task: 'get-diff', FilePath: FilePath, @@ -4900,7 +4900,7 @@ // Load diff data Ext.Ajax.request({ - url: './php/controler.php', + url: './php/controller.php', params: { task: 'get-diff', FilePath: FilePath, @@ -4953,7 +4953,7 @@ // Ext.Ajax.request({ scope: this, - url: './php/controler.php', + url: './php/controller.php', params: { task: 'clear-local-change', FilePath: FilePath, @@ -5111,7 +5111,7 @@ // Load diff data Ext.Ajax.request({ scope: this, - url: './php/controler.php', + url: './php/controller.php', params: { task: 'get-diff', FilePath: this.userLang + FilePath, @@ -5150,7 +5150,7 @@ Ext.Ajax.request({ scope: this, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'all-files-about-extension', ExtName: group[2] @@ -5213,7 +5213,7 @@ storeLogLang = new Ext.data.Store({ autoLoad: true, proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'get-log', @@ -5248,7 +5248,7 @@ storeLogEn = new Ext.data.Store({ autoLoad: true, proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'get-log', @@ -6087,7 +6087,7 @@ autoScroll: true, useArrows: true, loader: new Ext.tree.TreeLoader({ - dataUrl: './php/controler.php', + dataUrl: './php/controller.php', baseParams: { task: 'getAllFiles' } @@ -6138,7 +6138,7 @@ storeLog = new Ext.data.Store({ autoLoad: true, proxy: new Ext.data.HttpProxy({ - url: '/php/controler.php' + url: '/php/controller.php' }), baseParams: { task: 'get-log', @@ -6365,7 +6365,7 @@ // We save LANG File Ext.Ajax.request({ scope: this, - url: '../php/controler.php', + url: '../php/controller.php', params: { task: 'save-file', filePath: FilePath, @@ -6516,7 +6516,7 @@ // Ext.Ajax.request({ scope: this, - url: './php/controler.php', + url: './php/controller.php', params: { task: 'erase-personal-data' }, http://cvs.php.net/viewvc.cgi/doc-editor/js/main_min.js?r1=1.1&r2=1.2&diff_format=u Index: doc-editor/js/main_min.js diff -u doc-editor/js/main_min.js:1.1 doc-editor/js/main_min.js:1.2 --- doc-editor/js/main_min.js:1.1 Sat Mar 28 20:55:35 2009 +++ doc-editor/js/main_min.js Sun Mar 29 02:44:06 2009 @@ -1 +1 @@ -var phpDoc=function(){Ext.QuickTips.init();Ext.BLANK_IMAGE_URL="/extjs/resources/images/default/s.gif";return{TaskPing:"",storeCommitLogMessage:"",storeFilesError:"",storeFilesNeedUpdate:"",storeFilesNeedReviewed:"",storePendingCommit:"",storePendingPatch:"",storeMailing:"",storeBugs:"",storeTranslators:"",storeSummary:"",userLoggin:"",userLang:"",appName:"PhpDocumentation Online Editor",appVer:"0.2",userConf:{conf_needupdate_diff:"using-exec",conf_needupdate_scrollbars:true,conf_error_skipnbliteraltag:true,conf_error_scrollbars:true,conf_reviewed_scrollbars:true,conf_patch_scrollbars:true,conf_theme:"xtheme-default.css"},treeAllFiles:"",treeSort:"",treeAllFilesRoot:"",filePendingOpen:"",init:function(){Ext.getBody().on("contextmenu",function(a){a.stopEvent()},this);Ext.Ajax.request({scope:this,url:"./php/controler.php",params:{task:"get-conf"},success:function(a){var b=Ext.util.JSON.decode(a.responseText);if(b.success){this.userLoggin=b.mess.userLoggin;this.userLang=b.mess! .userLang;this.userConf.conf_needupdate_diff=b.mess.userConf.conf_needupdate_diff;this.userConf.conf_needupdate_scrollbars=b.mess.userConf.conf_needupdate_scrollbars;this.userConf.conf_error_skipnbliteraltag=b.mess.userConf.conf_error_skipnbliteraltag;this.userConf.conf_error_scrollbars=b.mess.userConf.conf_error_scrollbars;this.userConf.conf_reviewed_scrollbars=b.mess.userConf.conf_reviewed_scrollbars;this.userConf.conf_theme=b.mess.userConf.conf_theme;Ext.util.CSS.swapStyleSheet("appTheme",this.userConf.conf_theme);this.loadDataStore();this.drawInterface()}}})},loadDataStore:function(){this.storeCommitLogMessage=new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:"/php/controler.php"}),baseParams:{task:"get-commit-log-message"},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"text",mapping:"text"}])});this.storeFilesError=new Ext.data.GroupingStore({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/contro! ler.php"}),baseParams:{task:"GetFilesError"},reader:new Ext.data.JsonR eader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"path",mapping:"path"},{name:"name",mapping:"name"},{name:"maintainer",mapping:"maintainer"},{name:"type",mapping:"type"},{name:"value_en",mapping:"value_en"},{name:"value_lang",mapping:"value_lang"},{name:"needcommit",mapping:"needcommit"}]),sortInfo:{field:"path",direction:"ASC"},groupField:"path",listeners:{datachanged:function(a){Ext.getDom("acc-error-nb").innerHTML=a.getCount()}}});this.storeFilesNeedUpdate=new Ext.data.GroupingStore({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controler.php"}),baseParams:{task:"GetFilesNeedUpdate"},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"path",mapping:"path"},{name:"name",mapping:"name"},{name:"revision",mapping:"revision"},{name:"en_revision",mapping:"en_revision"},{name:"maintainer",mapping:"maintainer"},{name:"needcommit",mapping:"needcommit"},{name:"isCritical",mapping! :"isCritical"}]),sortInfo:{field:"path",direction:"ASC"},groupField:"path",listeners:{datachanged:function(a){Ext.getDom("acc-need-update-nb").innerHTML=a.getCount()}}});this.storePendingCommit=new Ext.data.GroupingStore({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controler.php"}),baseParams:{task:"GetFilesPendingCommit"},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"path",mapping:"path"},{name:"name",mapping:"name"},{name:"by",mapping:"by"},{name:"date",mapping:"date"}]),sortInfo:{field:"path",direction:"ASC"},groupField:"path",listeners:{datachanged:function(a){Ext.getDom("acc-pendingCommit-nb").innerHTML=a.getCount()},add:function(a){Ext.getDom("acc-pendingCommit-nb").innerHTML=a.getCount()}}});this.storePendingPatch=new Ext.data.GroupingStore({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controler.php"}),baseParams:{task:"GetFilesPendingPatch"},reader:new Ext.data.JsonReader({root:"Item! s",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"p ath",mapping:"path"},{name:"name",mapping:"name"},{name:"by",mapping:"by"},{name:"uniqID",mapping:"uniqID"},{name:"date",mapping:"date"}]),sortInfo:{field:"path",direction:"ASC"},groupField:"path",listeners:{datachanged:function(a){Ext.getDom("acc-pendingPatch-nb").innerHTML=a.getCount()},add:function(a){Ext.getDom("acc-pendingPatch-nb").innerHTML=a.getCount()}}});this.storeFilesNeedReviewed=new Ext.data.GroupingStore({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controler.php"}),baseParams:{task:"GetFilesNeedReviewed"},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"path",mapping:"path"},{name:"name",mapping:"name"},{name:"reviewed",mapping:"reviewed"},{name:"maintainer",mapping:"maintainer"},{name:"needcommit",mapping:"needcommit"}]),sortInfo:{field:"path",direction:"ASC"},groupField:"path",listeners:{datachanged:function(a){Ext.getDom("acc-need-reviewed-nb").innerHTML=a.getCount()}}});this.storeMailin! g=new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:"/php/controler.php"}),baseParams:{task:"get-mailing-info"},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"title",mapping:"title"},{name:"link",mapping:"link"},{name:"description",mapping:"description"},{name:"pubDate",mapping:"pubDate",type:"date",dateFormat:"Y/m/d H:i:s"}])});this.storeMailing.setDefaultSort("pubDate","desc");this.storeBugs=new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:"/php/controler.php"}),baseParams:{task:"get-open-bugs"},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"title",mapping:"title"},{name:"link",mapping:"link"},{name:"description",mapping:"description"}])});this.storeTranslators=new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:"/php/controler.php"}),baseParams:{task:"get-translator-info"},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nb! Items",id:"id"},[{name:"id",mapping:"id"},{name:"name",mapping:"name"} ,{name:"email",mapping:"mail"},{name:"nick",mapping:"nick"},{name:"cvs",mapping:"cvs"},{name:"uptodate",mapping:"uptodate",type:"int"},{name:"old",mapping:"old",type:"int"},{name:"critical",mapping:"critical",type:"int"},{name:"sum",mapping:"sum",type:"int"}])});this.storeTranslators.setDefaultSort("nick","asc");this.storeSummary=new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:"/php/controler.php"}),baseParams:{task:"get-summary-info"},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"libel",mapping:"libel"},{name:"nbFiles",mapping:"nbFiles"},{name:"percentFiles",mapping:"percentFiles"},{name:"sizeFiles",mapping:"sizeFiles"},{name:"percentSize",mapping:"percentSize"}])})},openFile:function(d,a){Ext.getCmp("acc-all-files").expand();var c=d.split("/");function b(f,e){f.expand(false,true,function(h){var g;h.ensureVisible();if(c[0]&&c[0]!==""){for(g=0;g<h.childNodes.length;g=g+1){if(h.childNodes[g].text===c[0]){c! .shift();b(h.childNodes[g],e)}}}else{for(g=0;g<h.childNodes.length;g=g+1){if(h.childNodes[g].text===a){h.childNodes[g].ensureVisible();h.childNodes[g].ui.highlight();e.treeAllFiles.fireEvent("dblclick",h.childNodes[g])}}}})}b(this.treeAllFilesRoot,this)},rejectPatch:function(f,d,a,e,g,c){function b(h){if(h==="yes"){var i=Ext.MessageBox.wait("Please, wait...");Ext.Ajax.request({scope:c,url:"../php/controler.php",params:{task:"after-patch-reject",PatchUniqID:e},success:function(){this.storePendingPatch.remove(this.storePendingPatch.getAt(g));this.storePendingPatch.fireEvent("add",this.storePendingPatch);Ext.getCmp("main-panel").remove("PP-"+f);i.hide()}})}}Ext.MessageBox.confirm("Confirm","This action will <b>reject</b> this patch, send an email to his author and close this tab.",b,c)},saveFileViaPatch:function(e,c,a,d,g,b){function f(h){if(h==="yes"){Ext.getCmp("PP-PATCH-PANEL-btn-save-"+e).disable();Ext.getCmp("PP-PATCH-"+e).isModified=false;Ext.getCmp("PP-PATCH-PANEL-"+e).! setTitle(Ext.getCmp("PP-PATCH-PANEL-"+e).originTitle);Ext.getCmp("PP-" +e).setTitle(Ext.getCmp("PP-"+e).originTitle);var i=Ext.MessageBox.wait("Saving data...");Ext.Ajax.request({scope:b,url:"../php/controler.php",params:{task:"save-file",filePath:c,fileName:a,fileLang:"all",fileContent:Ext.getCmp("PP-PATCH-"+e).getCode()},success:function(k,j){var l=Ext.util.JSON.decode(k.responseText);if(l.success){this.addToPendingCommit(c,a);this.storePendingPatch.remove(this.storePendingPatch.getAt(g));this.storePendingPatch.fireEvent("add",this.storePendingPatch);Ext.Ajax.request({scope:b,url:"../php/controler.php",params:{task:"after-patch-accept",PatchUniqID:d}});i.hide();Ext.getCmp("main-panel").remove("PP-"+e)}}})}}Ext.MessageBox.confirm("Confirm","This action will accept this patch, send an email to his author, save the file and close this tab.",f,b)},saveEnFile:function(e,c,a,d,g,b){Ext.getCmp(d+"-EN-PANEL-btn-save-"+e).disable();Ext.getCmp(d+"-"+e).isModifiedEn=false;Ext.getCmp(d+"-EN-PANEL-"+e).setTitle(Ext.getCmp(d+"-EN-PANEL-"+e).originTitle);if! (!Ext.getCmp(d+"-"+e).isModifiedEn&&!Ext.getCmp(d+"-"+e).isModifiedLang){Ext.getCmp(d+"-"+e).setTitle(Ext.getCmp(d+"-"+e).originTitle)}var f=Ext.MessageBox.wait("Saving data...");Ext.Ajax.request({scope:b,url:"../php/controler.php",params:{task:"save-file",filePath:c,fileName:a,fileLang:"en",fileContent:Ext.getCmp(d+"-EN-"+e).getCode()},success:function(i,h){var j=Ext.util.JSON.decode(i.responseText);if(j.success){if(d==="FNU"){this.storeFilesNeedUpdate.getAt(g).set("en_revision","1."+j.en_revision);this.storeFilesNeedUpdate.getAt(g).set("needcommit",true)}if(d==="FE"){this.storeFilesError.getAt(g).set("needcommit",true)}if(d==="FNR"){this.storeFilesNeedReviewed.getAt(g).set("needcommit",true)}this.addToPendingCommit("en"+c,a);f.hide()}}})},savePatch:function(d,g,a,c,h,i){var b,f,e;if(d==="en"){b="-EN"}else{if(d==="all"){b=""}else{b="-LANG"}}if(i.userLoggin!=="cvsread"){f=i.userLoggin+"@php.net"}e=new Ext.Window({title:"Do you want to be alerted ?",iconCls:"patchAlert",widt! h:350,height:150,resizable:false,modal:true,autoScroll:true,bodyStyle: "padding: 5px;",layout:"form",labelWidth:50,items:[{xtype:"panel",baseCls:"x-plain",bodyStyle:"padding-bottom: 10px;",html:"If you want to be notified when your patch will be dealt with, thank you to leave an email address below."},{xtype:"textfield",fieldLabel:"Email",name:"patch-email-alert",anchor:"100%",value:f}],buttons:[{text:"Save",handler:function(){var j,k;j=this.ownerCt.items.items[1].getValue();k=Ext.MessageBox.wait("Saving data as a patch...");e.close();if(d!=="all"){Ext.getCmp(h+b+"-PANEL-btn-saveas-"+g).disable();Ext.getCmp(h+b+"-"+g).isModifiedLang=false;Ext.getCmp(h+b+"-PANEL-"+g).setTitle(Ext.getCmp(h+b+"-PANEL-"+g).originTitle);Ext.getCmp(h+"-"+g).setTitle(Ext.getCmp(h+"-"+g).originTitle)}else{Ext.getCmp("AF-PANEL-btn-saveas-"+g).disable();Ext.getCmp("AF-FILE-"+g).isModified=false;Ext.getCmp("AF-PANEL-"+g).setTitle(Ext.getCmp("AF-PANEL-"+g).originTitle);Ext.getCmp("AF-"+g).setTitle(Ext.getCmp("AF-"+g).originTitle)}Ext.Ajax.request({scope:i,url:"../php/contr! oler.php",params:{task:"save-file",filePath:a,fileName:c,fileLang:d,fileContent:(d!=="all")?Ext.getCmp(h+b+"-"+g).getCode():Ext.getCmp("AF-FILE-"+g).getCode(),type:"patch",emailAlert:j},success:function(m,l){var n=Ext.util.JSON.decode(m.responseText);if(n.success){if(d!=="all"){this.addToPendingPatch(d+a,c,n.uniqID)}else{this.addToPendingPatch(a,c,n.uniqID)}k.hide()}}})}},{text:"Cancel",handler:function(){e.close()}}]});e.show()},saveLangFile:function(f,d,b,e,g,c){function a(h){if(h==="no"){Ext.getCmp(e+"-LANG-PANEL-btn-save-"+f).disable();Ext.getCmp(e+"-"+f).isModifiedLang=false;Ext.getCmp(e+"-LANG-PANEL-"+f).setTitle(Ext.getCmp(e+"-LANG-PANEL-"+f).originTitle);if(!Ext.getCmp(e+"-"+f).isModifiedEn&&!Ext.getCmp(e+"-"+f).isModifiedLang){Ext.getCmp(e+"-"+f).setTitle(Ext.getCmp(e+"-"+f).originTitle)}var i=Ext.MessageBox.wait("Saving data...");Ext.Ajax.request({scope:this,url:"../php/controler.php",params:{task:"save-file",filePath:d,fileName:b,fileLang:this.userLang,fileConten! t:Ext.getCmp(e+"-LANG-"+f).getCode()},success:function(k,j){var l=Ext. util.JSON.decode(k.responseText);if(l.success){if(e==="FE"){this.storeFilesError.getAt(g).set("needcommit",true);this.storeFilesError.getAt(g).set("maintainer",l.maintainer)}if(e==="FNU"){this.storeFilesNeedUpdate.getAt(g).set("revision","1."+l.new_revision);this.storeFilesNeedUpdate.getAt(g).set("needcommit",true);this.storeFilesNeedUpdate.getAt(g).set("maintainer",l.maintainer)}if(e==="FNR"){this.storeFilesNeedReviewed.getAt(g).set("needcommit",true);this.storeFilesNeedReviewed.getAt(g).set("maintainer",l.maintainer);this.storeFilesNeedReviewed.getAt(g).set("reviewed",l.reviewed)}this.addToPendingCommit(this.userLang+d,b);i.hide()}}})}else{if(h==="yes"){Ext.getBody().mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Checking for error. Please, wait...');Ext.getCmp(e+"-LANG-PANEL-btn-save-"+f).disable();Ext.getCmp(e+"-"+f).isModifiedLang=false;Ext.getCmp(e+"-LANG-PANEL-"+f).setTitle(Ext.getCmp(e+"-LANG-PANEL-"+f).originTitle);if(!Ext.getCmp(e+"-"+f).isMod! ifiedEn&&!Ext.getCmp(e+"-"+f).isModifiedLang){Ext.getCmp(e+"-"+f).setTitle(Ext.getCmp(e+"-"+f).originTitle)}Ext.Ajax.request({scope:this,url:"../php/controler.php",params:{task:"check-file-error",FilePath:d,FileName:b,FileLang:this.userLang,FileContent:Ext.getCmp(e+"-LANG-"+f).getCode()},success:function(k,j){Ext.getBody().unmask();var l=Ext.util.JSON.decode(k.responseText);if(l.success){if(l.error&&l.error_first!=="-No error-"){Ext.getCmp("main-panel").add({closable:true,title:"Error in "+b,iconCls:"FilesError",id:"FE-help-"+f,autoScroll:true,autoLoad:"/error_type.php?dir="+d+"&file="+b});Ext.getCmp("main-panel").setActiveTab("FE-help-"+f);this.storeFilesError.reload()}else{Ext.MessageBox.show({title:"Check for errors",msg:"There is no error.",buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.INFO})}Ext.Ajax.request({scope:this,url:"../php/controler.php",params:{task:"save-file",filePath:d,fileName:b,fileLang:this.userLang,fileContent:Ext.getCmp(e+"-LANG-"+f).getCode()},succes! s:function(n,m){var p=Ext.util.JSON.decode(n.responseText);if(p.succes s){if(e==="FE"){this.storeFilesError.getAt(g).set("needcommit",true);this.storeFilesError.getAt(g).set("maintainer",p.maintainer)}if(e==="FNU"){this.storeFilesNeedUpdate.getAt(g).set("revision","1."+p.new_revision);this.storeFilesNeedUpdate.getAt(g).set("needcommit",true);this.storeFilesNeedUpdate.getAt(g).set("maintainer",p.maintainer)}if(e==="FNR"){this.storeFilesNeedReviewed.getAt(g).set("needcommit",true);this.storeFilesNeedReviewed.getAt(g).set("maintainer",p.maintainer);this.storeFilesNeedReviewed.getAt(g).set("reviewed",p.reviewed)}this.addToPendingCommit(this.userLang+d,b)}}});if(e==="FE"){Ext.getCmp(e+"-error-type-"+f).setSrc("/error_type.php?dir="+d+"&file="+b+"&nocache="+new Date().getTime())}}}})}}}Ext.MessageBox.show({scope:c,title:"Confirm",msg:"Do you want to check for error before saving ?",icon:Ext.MessageBox.INFO,buttons:Ext.MessageBox.YESNOCANCEL,fn:a})},getFile:function(e,d,a,c,b){Ext.get(c+e).mask('<img src="/img/loading.gif" style="vertical-align: middl! e;" /> Loading...');Ext.Ajax.request({scope:this,url:"../php/controler.php",params:{task:"get-file",FilePath:d,FileName:a},success:function(h,g){var i,f;i=Ext.util.JSON.decode(h.responseText);if(i.success){Ext.getCmp(b+e).setCode(i.content);Ext.get(c+e).unmask();if(c==="FE-LANG-PANEL-"||c==="FNR-LANG-PANEL-"||c==="FNR-EN-PANEL-"||c==="AF-PANEL-"){f=Ext.getCmp(c+e).getSize();f.height=f.height+1;Ext.getCmp(c+e).setSize(f);Ext.getCmp(c+e).fireEvent("resize")}}},callback:function(){if(this.filePendingOpen[0]){this.filePendingOpen.shift();if(this.filePendingOpen[0]){if(this.filePendingOpen[0][0]){this.openFile(this.filePendingOpen[0][0],this.filePendingOpen[0][1])}}}}})},addToPendingPatch:function(b,a,e){var d,c;d=new Date();c=new this.storePendingPatch.recordType({id:Ext.id("",""),path:b,name:a,by:this.userLoggin,uniqID:e,date:d.format("Y-m-d H:i:s")});this.storePendingPatch.insert(0,c)},addToPendingCommit:function(d,a){var c,e,b;c=false;this.storePendingCommit.each(function(f)! {if(f.data.path===d&&f.data.name===a){c=true}});if(!c){e=new Date();b= new this.storePendingCommit.recordType({id:Ext.id("",""),path:d,name:a,by:this.userLoggin,date:e.format("Y-m-d H:i:s")});this.storePendingCommit.insert(0,b)}},rendererNumUptodate:function(a){if(a==="0"){return}else{return'<span style="color:green; font-weight: bold;">'+a+"</span>"}},rendererNumCritical:function(a){if(a==="0"){return}else{return'<span style="color:red; font-weight: bold;">'+a+"</span>"}},rendererTotalTranslator:function(a,c,b){return a?((a===0||a>1)?"("+a+" Translators)":"(1 Translator)"):""},rendererSum:function(a){return(a==="0")?"":a},NewTabBugs:function(a,b,c){Ext.getCmp("main-panel").add({xtype:"iframepanel",id:"mifp_bugs_"+a,title:"Loading...",tabTip:c,iconCls:"iconBugs",loadMask:true,defaultSrc:b,listeners:{documentloaded:function(d){d.ownerCt.setTitle(Ext.util.Format.substr(c,0,20)+"...")}}});Ext.getCmp("main-panel").setActiveTab("mifp_bugs_"+a)},NewTabMailing:function(a,c,b){Ext.getCmp("main-panel").add({xtype:"iframepanel",id:"mifp_"+a,title:"Loadin! g...",tabTip:b,iconCls:"home-mailing-title",loadMask:true,defaultSrc:c,listeners:{documentloaded:function(d){d.ownerCt.setTitle(Ext.util.Format.substr(b,0,20)+"...")}}});Ext.getCmp("main-panel").setActiveTab("mifp_"+a)},winDiff:function(d,b,c,a){Ext.getBody().mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Finding the diff. Please, wait...');Ext.Ajax.request({url:"./php/controler.php",params:{task:"get-diff2",FilePath:d,FileName:b,Rev1:c,Rev2:a},success:function(f){var g,e;g=Ext.util.JSON.decode(f.responseText);if(g.success){Ext.getBody().unmask();e=new Ext.Window({title:"Diff between "+c+" & "+a,width:650,height:350,resizable:false,modal:true,autoScroll:true,bodyStyle:"background-color: white; padding: 5px;",html:'<div class="diff-content">'+g.content+"</div>",buttons:[{text:"Close",handler:function(){e.close()}}]});e.show()}},failure:function(){}})},removeTabEvent:function(d,e){var b,c,f,a;a=e.id.split("-");if((a[0]==="FE"||a[0]==="FNU"||a[0]==="FNR"|! |a[0]==="PP")&&a[1]!=="help"){if(a[0]==="FE"){b=Ext.getCmp("FE-"+a[1]) ..isModifiedLang}if(a[0]==="FNU"){b=Ext.getCmp("FNU-"+a[1]).isModifiedLang}if(a[0]==="FNR"){b=Ext.getCmp("FNR-"+a[1]).isModifiedLang}if(a[0]==="FE"){c=Ext.getCmp("FE-"+a[1]).isModifiedEn}if(a[0]==="FNU"){c=Ext.getCmp("FNU-"+a[1]).isModifiedEn}if(a[0]==="FNR"){c=Ext.getCmp("FNR-"+a[1]).isModifiedEn}if(a[0]==="PP"){f=Ext.getCmp("PP-PATCH-"+a[1]).isModified}if(c||b||f){Ext.Msg.show({scope:this,title:"Confirm",msg:"This file has been modified without being saved.<br/>Do you really want to close?",buttons:Ext.Msg.YESNO,icon:Ext.Msg.QUESTION,fn:function(g,h){if(g==="yes"){d.un("beforeremove",this.removeTabEvent,this);d.remove(e);d.addListener("beforeremove",this.removeTabEvent,this)}}})}else{return true}return false}else{return true}},WinCommit:function(i,h,e){var f,c,g,a,b,d;c=Ext.get("acc-need-update");if(!f){f=new Ext.Window({scope:this,id:"winCvsCommit",title:"CVS commit",closable:false,layout:"form",width:400,height:480,resizable:false,modal:true,bodyStyle:"padding:5px 5px 0",! labelAlign:"top",items:[{xtype:"checktreepanel",id:"tree-panel",anchor:"100%",height:180,autoScroll:true,rootVisible:false,root:{text:"root",expanded:true,children:[]}},{scope:this,xtype:"combo",fieldLabel:"Older messages",editable:false,name:"first2",anchor:"100%",store:this.storeCommitLogMessage,triggerAction:"all",tpl:'<tpl for="."><div class="x-combo-list-item">{[values.text.split("\n").join("<br/>")]}</div></tpl>',valueField:"id",displayField:"text",listeners:{scope:this,render:function(){this.storeCommitLogMessage.load()},select:function(l,j,k){Ext.getCmp("form-commit-message-log").setValue(j.data.text)}}},{xtype:"textarea",id:"form-commit-message-log",fieldLabel:"Log message",name:"first3",anchor:"100%",height:150,value:""}],tools:[{scope:this,id:"gear",qtip:"Configure this tools",handler:function(){var m,k,l;function j(n){return n.split("\n").join("<br/>")}m=new Ext.form.TextArea({grow:true,growMin:120});k=new Ext.grid.ColumnModel([new Ext.grid.RowNumberer(),{id:"Gr! idManageLog",header:"Log Message",dataIndex:"text",renderer:j,editor:n ew Ext.Editor(m,{shadow:false,autoSize:true,listeners:{scope:this,complete:function(p,q,o){var n=p.record.data.id;Ext.Ajax.request({scope:this,url:"../php/controler.php",params:{task:"save-LogMessage",messID:n,mess:q},success:function(s,r){var t=Ext.util.JSON.decode(s.responseText);if(t.success){this.storeCommitLogMessage.getById(n).commit()}}})}}})}]);l=new Ext.Window({title:"Manage Log Message",iconCls:"winManageLog",width:650,height:350,layout:"fit",resizable:false,modal:true,autoScroll:true,html:'<div class="diff-content"></div>',items:[{xtype:"editorgrid",store:this.storeCommitLogMessage,loadMask:true,cm:k,sm:new Ext.grid.RowSelectionModel({singleSelect:true}),autoExpandColumn:"GridManageLog",listeners:{scope:this,rowcontextmenu:function(n,q,o){o.stopEvent();n.getSelectionModel().selectRow(q);var p=new Ext.menu.Menu({items:[{text:"Delete this Log Message",iconCls:"iconDelete",scope:this,handler:function(){Ext.Ajax.request({scope:this,url:"../php/controler.php",params:{t! ask:"delete-LogMessage",messID:this.storeCommitLogMessage.getAt(q).data.id},success:function(s,r){var t=Ext.util.JSON.decode(s.responseText);if(t.success){this.storeCommitLogMessage.remove(this.storeCommitLogMessage.getAt(q))}}})}}]});p.showAt(o.getXY())}}}],buttons:[{text:"Close",handler:function(){l.close()}}],listeners:{scope:this,close:function(){this.storeCommitLogMessage.reload()}}});l.show()}}],buttons:[{scope:this,text:"Submit",id:"win-commit-btn-submit",handler:function(){var j,n,q,s,k,l,o=[],r,p="",m;if(this.userLoggin==="cvsread"){f.close();Ext.MessageBox.show({title:"Cvsread restriction",msg:"You are logging in with Cvsread account.<br><br>You can't commit anything with this account.",icon:Ext.MessageBox.INFO,buttons:Ext.MessageBox.OK});return}j=Ext.getCmp("tree-panel").getValue();n=[];for(m=0;m<j.length;m=m+1){q=Ext.getCmp("tree-panel").getNodeById(j[m]).attributes;s="FE-"+Ext.util.md5("FE-"+q.FilePath+q.FileName);k="FNU-"+Ext.util.md5("FNU-"+q.FilePath+q.FileN! ame);l="FNR-"+Ext.util.md5("FNR-"+q.FilePath+q.FileName);if(Ext.getCmp ("main-panel").findById(s)||Ext.getCmp("main-panel").findById(k)||Ext.getCmp("main-panel").findById(l)){if(Ext.getCmp("main-panel").findById(s)){r=s}if(Ext.getCmp("main-panel").findById(k)){r=k}if(Ext.getCmp("main-panel").findById(l)){r=l}o[0]=r;o[1]=q.FileName;n.push(o)}}if(n.length>0){for(m=0;m<n.length;m=m+1){p+=n[m][1]+"<br>"}Ext.MessageBox.show({scope:this,title:"Warning",msg:"There is "+n.length+" file"+((n.length>1)?"s":"")+" to close before commit.<br><br>"+p+"<br><br>Would you like I close it for you ?",icon:Ext.MessageBox.INFO,buttons:Ext.MessageBox.YESNOCANCEL,fn:function(t){if(t==="yes"){for(m=0;m<n.length;m=m+1){Ext.getCmp("main-panel").remove(n[m][0])}this.WinCommitLastStep(j,this)}else{return}}})}else{this.WinCommitLastStep(j,this)}return}},{text:"Close",id:"win-commit-btn-close",handler:function(){f.close()}}]})}f.show(c);if(i){a=this.storePendingCommit.getAt(h).data.path;b=this.storePendingCommit.getAt(h).data.name;g=Ext.util.md5(a+b);d=new Ext.tree.TreeNode! ({id:"need-commit-"+g,text:a+b,FilePath:a,FileName:b,leaf:true,checked:true,uiProvider:Ext.ux.tree.CheckTreeNodeUI});Ext.getCmp("tree-panel").getRootNode().appendChild(d)}else{this.storePendingCommit.each(function(j){if(e&&e==="by me"&&j.data.by!==this.userLoggin){}else{a=j.data.path;b=j.data.name;g=Ext.util.md5(a+b);d=new Ext.tree.TreeNode({id:"need-commit-"+g,text:a+b,FilePath:a,FileName:b,leaf:true,checked:true,uiProvider:Ext.ux.tree.CheckTreeNodeUI});Ext.getCmp("tree-panel").getRootNode().appendChild(d)}},this)}},WinCommitLastStep:function(g,d){Ext.getBody().mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Please, wait until commit...');var a=[],f,c,e,b;for(b=0;b<g.length;b=b+1){f=Ext.getCmp("tree-panel").getNodeById(g[b]);c=[];c[0]=f.attributes.FilePath;c[1]=f.attributes.FileName;a.push(c)}e=Ext.getCmp("form-commit-message-log").getValue();Ext.getCmp("winCvsCommit").close();Ext.Ajax.request({url:"../php/controler.php",params:{task:"cvs-commit",nodes! :Ext.util.JSON.encode(a),logMessage:e},success:function(i){var j,h;j=E xt.util.JSON.decode(i.responseText);if(j.success){Ext.getBody().unmask();h=new Ext.Window({title:"Status",width:450,height:350,resizable:false,modal:true,autoScroll:true,bodyStyle:"background-color: white; padding: 5px;",html:j.mess.join("<br>"),buttons:[{text:"Close",handler:function(){h.close()}}]});h.show();Ext.Ajax.request({url:"../php/controler.php",params:{task:"on-succes-commit",nodes:Ext.util.JSON.encode(a),logMessage:e},success:function(k){d.storeFilesError.reload();d.storeFilesNeedReviewed.reload();d.storeFilesNeedUpdate.reload();d.storePendingCommit.reload();d.storeTranslators.reload();d.storeSummary.reload()}})}else{}}})},WinUpdate:function(){var e,d;function c(f){f.TaskPing.cancel();Ext.get("wizard-step-1").replaceClass("wizard-step-before","wizard-step-working");Ext.get("wizard-step-1.1").replaceClass("wizard-wait","wizard-show");Ext.Ajax.request({scope:f,url:"../php/controler.php",params:{task:"update-repo"},success:function(g){var h=Ext.util.JSON.decode(g.res! ponseText);if(h.success){Ext.get("wizard-step-1").replaceClass("wizard-step-working","wizard-step-done");Ext.get("wizard-step-1.1").replaceClass("wizard-show","wizard-wait");b(f)}},failure:function(){function h(){Ext.Ajax.request({scope:f,url:"../php/controler.php",params:{task:"check-lock-file",lockFile:"lock_update_repository"},success:function(i){var j=Ext.util.JSON.decode(i.responseText);if(!j.success){Ext.get("wizard-step-1").replaceClass("wizard-step-working","wizard-step-done");Ext.get("wizard-step-1.1").replaceClass("wizard-show","wizard-wait");b(this)}else{g.delay(5000)}},failure:function(){g.delay(5000)}})}var g=new Ext.util.DelayedTask(function(){h()});g.delay(5000)}})}function b(f){Ext.get("wizard-step-2").replaceClass("wizard-step-before","wizard-step-working");Ext.Ajax.request({scope:f,url:"../php/controler.php",params:{task:"apply-tools"},success:function(g){var h=Ext.util.JSON.decode(g.responseText);if(h.success){Ext.get("wizard-step-2").replaceClass("wizard! -step-working","wizard-step-done");a(this)}},failure:function(){functi on h(){Ext.Ajax.request({scope:f,url:"../php/controler.php",params:{task:"check-lock-file",lockFile:"lock_apply_tools"},success:function(i){var j=Ext.util.JSON.decode(i.responseText);if(!j.success){Ext.get("wizard-step-2").replaceClass("wizard-step-working","wizard-step-done");a(this)}else{g.delay(5000)}},failure:function(){g.delay(5000)}})}var g=new Ext.util.DelayedTask(function(){h()});g.delay(5000)}})}function a(f){Ext.get("wizard-step-3").replaceClass("wizard-step-before","wizard-step-working");f.storeFilesNeedUpdate.reload();f.storeTranslators.reload();f.storeFilesError.reload();Ext.get("wizard-step-3").replaceClass("wizard-step-working","wizard-step-done");Ext.getCmp("btn-start-refresh").setIconClass("finishRefresh");Ext.getCmp("btn-start-refresh").setText("Finish !");Ext.getCmp("btn-start-refresh").setHandler(function(){e.close()});Ext.getCmp("btn-start-refresh").enable();f.TaskPing.delay(30000);e.tools.close.setVisible(true)}d=Ext.get("acc-need-update");if(!e){e=new ! Ext.Window({title:"Refresh all data",layout:"form",width:300,height:200,resizable:false,modal:true,bodyStyle:"padding:15px 15px 0",iconCls:"refresh",html:'<div id="wizard-step-1" class="wizard-step-before">Update all files from Cvs</div><div id="wizard-step-1.1" class="wizard-wait">This may take time. Thank you for your patience...</div><div id="wizard-step-2" class="wizard-step-before">Apply all tools</div><div id="wizard-step-3" class="wizard-step-before">Reload data</div>',buttons:[{scope:this,text:"Start",id:"btn-start-refresh",iconCls:"startRefresh",handler:function(){Ext.getCmp("btn-start-refresh").disable();e.tools.close.setVisible(false);c(this)}}]})}e.show(d)},WinCheckBuild:function(){var c,a;a=Ext.get("acc-need-update");function b(d){Ext.Ajax.request({scope:d,url:"./php/controler.php",params:{task:"get-logfile",file:"log_check_build"},success:function(f){var g,e;g=Ext.util.JSON.decode(f.responseText);if(g.success){this.TaskPing.delay(30000);e=new Ext.Window({title! :"Status",width:450,height:350,resizable:false,modal:true,autoScroll:t rue,bodyStyle:"background-color: white; padding: 5px;",html:g.mess,buttons:[{text:"Close",handler:function(){e.close()}}]});e.show()}}})}if(!c){c=new Ext.Window({title:"Check Build",iconCls:"checkBuild",layout:"form",width:350,height:200,resizable:false,modal:true,bodyStyle:"padding:5px 5px 0",labelAlign:"top",buttons:[{scope:this,text:"Go !",id:"win-check-build-btn-submit",handler:function(){var d=Ext.getCmp("option-xml-details").checked;c.close();Ext.getBody().mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Please, wait until the build is checked...');this.TaskPing.cancel();Ext.Ajax.request({scope:this,url:"./php/controler.php",params:{task:"check-build",xmlDetails:d},success:function(e){var f=Ext.util.JSON.decode(e.responseText);if(f.success){Ext.getBody().unmask();b(this)}},failure:function(g){function e(){Ext.Ajax.request({url:"../php/controler.php",params:{task:"check-lock-file",lockFile:"lock_check_build"},success:function(h){var i=Ext.util.JSON.d! ecode(h.responseText);if(!i.success){Ext.getBody().unmask();b()}else{f.delay(5000)}},failure:function(){f.delay(5000)}})}var f=new Ext.util.DelayedTask(function(){e()});f.delay(5000)}})}}],items:[{xtype:"panel",baseCls:"x-plain",bodyStyle:"padding:5px 5px 0",html:"You're about to check the build via this command :<br/><br/>/usr/bin/php configure.php --with-lang="+this.userLang+"<br><br>",modal:false},{xtype:"checkbox",hideLabel:true,checked:false,boxLabel:"Enable detailed XML error messages",name:"option-xml-details",id:"option-xml-details"}]})}c.show(a)},WinConf:function(){var a,c,e,d,b;if(!a){b=new Ext.XTemplate('<tpl for=".">','<div class="thumb-wrap" id="tplMenu-{id}">','<div class="thumb"><img src="/img/{img}" title=""></div>',"<span>{label}</span></div>","</tpl>");b.compile();d=[["1","go-home.png","Main"],["2","edit-redo.png",'Module "Files Need Update"'],["3","dialog-cancel.png",'Module "Files with Error"'],["4","document-properties.png",'Module "Files need Reviewed"! '],["5","view-media-playlist.png",'Module "Pending Patch"']];e=new Ext ..data.SimpleStore({id:0,fields:[{name:"id"},{name:"img"},{name:"label"}]});e.loadData(d);c=new Ext.DataView({tpl:b,singleSelect:true,overClass:"x-view-over",itemSelector:"div.thumb-wrap",store:e,listeners:{selectionchange:function(f,g){var h=f.getSelectedRecords();Ext.getCmp("confCard").layout.setActiveItem("conf-card-"+h[0].data.id)}}});a=new Ext.Window({scope:this,layout:"border",width:550,height:400,iconCls:"iconConf",modal:true,title:"Configuration",plain:true,closeAction:"hide",listeners:{show:function(){c.select(c.getNode(0))}},items:[{scope:this,region:"west",width:190,id:"confMenu",autoScroll:true,items:c},{scope:this,layout:"slide",region:"center",id:"confCard",width:375,frame:true,activeItem:0,bbar:new Ext.StatusBar({defaultText:"All changes take effect immediately",defaultIconCls:"confStatusBar"}),items:[{scope:this,id:"conf-card-1",xtype:"form",bodyStyle:"padding: 10px;",items:[{xtype:"fieldset",title:"Themes",autoHeight:true,defaults:{hideLabel:true},items:[{xty! pe:"combo",store:new Ext.data.SimpleStore({fields:["themeFile",{name:"themeName",type:"string"}],data:[["/themes/black/css/xtheme-black.css","Black"],["xtheme-default.css","Default"],["/themes/darkgray/css/xtheme-darkgray.css","DarkGray"],["/extjs/resources/css/xtheme-gray.css","Gray"],["/themes/gray-extend/css/xtheme-gray-extend.css","Gray Extend"],["/themes/indigo/css/xtheme-indigo.css","Indigo"],["/themes/midnight/css/xtheme-midnight.css","Midnight"],["/themes/olive/css/xtheme-olive.css","Olive"],["/themes/purple/css/xtheme-purple.css","Purple"],["/extjs/resources/css/xtheme-slate.css","Slate"],["/themes/silverCherry/css/xtheme-silverCherry.css","SilverCherry"]]}),valueField:"themeFile",displayField:"themeName",triggerAction:"all",mode:"local",forceSelection:true,editable:false,fieldLabel:"fieldlabel",value:this.userConf.conf_theme,listeners:{scope:this,select:function(h,f,g){Ext.util.CSS.swapStyleSheet("appTheme",h.getValue());this.confUpdate("conf_theme",h.getValue())}! }}]}]},{scope:this,id:"conf-card-2",xtype:"form",bodyStyle:"padding: 1 0px;",items:[{xtype:"fieldset",title:"Diff view",autoHeight:true,defaults:{hideLabel:true},defaultType:"radio",items:[{scope:this,checked:(this.userConf.conf_needupdate_diff==="using-viewvc")?true:false,boxLabel:"Using ViewVc from php web site",name:"conf_needupdate_diff",inputValue:"using-viewvc",listeners:{scope:this,check:function(g){if(g.checked){this.confUpdate("conf_needupdate_diff",g.getRawValue())}}}},{checked:(this.userConf.conf_needupdate_diff==="using-exec")?true:false,boxLabel:"Using diff -kk -u command line",name:"conf_needupdate_diff",inputValue:"using-exec",listeners:{scope:this,check:function(g){if(g.checked){this.confUpdate("conf_needupdate_diff",g.getRawValue())}}}}]},{xtype:"fieldset",title:"Editor",autoHeight:true,defaults:{hideLabel:true},defaultType:"checkbox",items:[{scope:this,checked:(this.userConf.conf_needupdate_scrollbars==="true")?true:false,boxLabel:"Synchronize scroll bars",name:"conf_needupdate_scrollbars",listeners:{scope:this,check:function(! g){this.confUpdate("conf_needupdate_scrollbars",g.getValue())}}}]}]},{id:"conf-card-3",xtype:"form",bodyStyle:"padding: 10px;",items:[{xtype:"fieldset",title:"Error type",autoHeight:true,defaults:{hideLabel:true},defaultType:"checkbox",items:[{scope:this,checked:(this.userConf.conf_error_skipnbliteraltag==="true")?true:false,boxLabel:"Skip nbLiteralTag error",name:"conf_error_skipnbliteraltag",listeners:{scope:this,check:function(g){this.confUpdate("conf_error_skipnbliteraltag",g.getValue())}}}]},{xtype:"fieldset",title:"Editor",autoHeight:true,defaults:{hideLabel:true},defaultType:"checkbox",items:[{scope:this,checked:(this.userConf.conf_error_scrollbars==="true")?true:false,boxLabel:"Synchronize scroll bars",name:"conf_error_scrollbars",listeners:{scope:this,check:function(g){this.confUpdate("conf_error_scrollbars",g.getValue())}}}]}]},{id:"conf-card-4",xtype:"form",bodyStyle:"padding: 10px;",items:[{xtype:"fieldset",title:"Editor",autoHeight:true,defaults:{hideLabel:true! },defaultType:"checkbox",items:[{scope:this,checked:(this.userConf.con f_reviewed_scrollbars==="true")?true:false,boxLabel:"Synchronize scroll bars",name:"conf_reviewed_scrollbars",listeners:{scope:this,check:function(g){this.confUpdate("conf_reviewed_scrollbars",g.getValue())}}}]}]},{id:"conf-card-5",xtype:"form",bodyStyle:"padding: 10px;",items:[{xtype:"fieldset",title:"Editor",autoHeight:true,defaults:{hideLabel:true},defaultType:"checkbox",items:[{scope:this,checked:(this.userConf.conf_patch_scrollbars==="true")?true:false,boxLabel:"Synchronize scroll bars",name:"conf_patch_scrollbars",listeners:{scope:this,check:function(g){this.confUpdate("conf_patch_scrollbars",g.getValue())}}}]}]}]}],buttons:[{text:"Close",handler:function(){a.hide()}}]})}a.show(Ext.get("winconf-btn"))},confUpdate:function(b,a){Ext.Ajax.request({scope:this,url:"../php/controler.php",params:{task:"conf-update",item:b,value:a},success:function(c){if(b==="conf_needupdate_diff"){this.userConf.conf_needupdate_diff=a}if(b==="conf_needupdate_scrollbars"){this.userConf.conf_nee! dupdate_scrollbars=""+a+""}if(b==="conf_error_skipnbliteraltag"){this.userConf.conf_error_skipnbliteraltag=""+a+"";this.storeFilesError.reload()}if(b==="conf_error_scrollbars"){this.userConf.conf_error_scrollbars=""+a+""}if(b==="conf_reviewed_scrollbars"){this.userConf.conf_reviewed_scrollbars=""+a+""}if(b==="conf_patch_scrollbars"){this.userConf.conf_patch_scrollbars=""+a+""}}})},WinAbout:function(){var a;if(!a){a=new Ext.Window({layout:"fit",width:515,height:320,iconCls:"iconHelp",modal:true,title:"About "+this.appName,closeAction:"hide",plain:true,bodyStyle:"color:#000",items:new Ext.TabPanel({autoTabs:true,activeTab:0,border:false,defaults:{autoScroll:true},items:[{title:"About",html:'<div id="phd-oe-about"><img src="/img/logo.png" alt="'+this.appName+'" /></div><div id="phd-oe-about-info">'+this.appName+" ver "+this.appVer+' (c) 2008-2009, Yannick Torrèss - <a href="mailto:yannick@php.net">yannick@php.net</a></div>'},{title:"Credits",bodyStyle:"padding:15px",htm! l:'<div id="phd-oe-credit"><ul><li><a href="http://extjs.com" target=" _blank">ExtJs Team</a><div class="phd-oe-credit-info">Javascript FrameWork</div></li><li><a href="http://marijn.haverbeke.nl/codemirror/" target="_blank">CodeMirror</a><div class="phd-oe-credit-info">Code editor</div></li><li><a href="http://famfamfam.com" target="_blank">famfamfam.com</a><div class="phd-oe-credit-info">Icon pack</div></li></ul></div>'},{title:"License",autoLoad:{url:"/license_LGPL_v2.txt"}}]}),buttons:[{text:"Close",handler:function(){a.hide()}}]})}a.show(Ext.get("winabout-btn"))},sendEmail:function(b,a){var c,d;c=new Ext.form.FormPanel({baseCls:"x-plain",labelWidth:55,url:"save-form.php",defaultType:"textfield",items:[{fieldLabel:"Send To",name:"to",readOnly:true,anchor:"100%",value:'"'+b+'" <'+a+">"},{fieldLabel:"Subject",name:"subject",anchor:"100%"},{xtype:"textarea",hideLabel:true,name:"msg",anchor:"100% -53"}]});d=new Ext.Window({title:"Send an email",width:500,height:300,minWidth:300,minHeight:200,layout:"fit",plain:true,bodyStyle:"padding:5px;",butt! onAlign:"center",items:c,iconCls:"iconSendEmail",buttons:[{text:"Send",handler:function(){var e=c.getForm().getValues();Ext.Ajax.request({url:"./php/controler.php",params:{task:"send-email",to:e.to,subject:e.subject,msg:e.msg},success:function(f){var g=Ext.util.JSON.decode(f.responseText);if(g.success){d.close();Ext.MessageBox.alert("Status","Email sent to "+b+" with success!")}},failure:function(){}})}},{text:"Cancel",handler:function(){d.close()}}]});d.show()},drawInterface:function(){var j,l,a,c,h,g,f,i,e,k,b,d;this.TaskPing=new Ext.util.DelayedTask(function(){Ext.Ajax.request({url:"./php/controler.php",params:{task:"ping"},success:function(m){if(m.responseText!=="pong"){window.location.href="/login.php"}},failure:function(){window.location.href="/login.php"}});this.TaskPing.delay(30000)},this);this.TaskPing.delay(30000);j=new Ext.grid.GridPanel({store:this.storeFilesError,loadMask:true,columns:[{id:"name",header:"Files",sortable:true,dataIndex:"name"},{header:"Maintaine! r",width:45,sortable:true,dataIndex:"maintainer"},{header:"Type",width :45,sortable:true,dataIndex:"type"},{header:"Path",dataIndex:"path",hidden:true}],view:new Ext.grid.GroupingView({emptyText:'<div style="text-align: center;">No files</div>',forceFit:true,groupTextTpl:'{[values.rs[0].data["path"]]} ({[values.rs.length]} {[values.rs.length > 1 ? "Files" : "File"]})',getRowClass:function(m,p,o,n){if(m.data.needcommit){return"file-need-commit"}}}),autoExpandColumn:"name",bodyBorder:false,listeners:{scope:this,render:function(m){j.view.refresh()},rowdblclick:function(o,y,u){var n,p,v,t,w,m,s,r,q,z,x;n=this.storeFilesError.getAt(y).data.path;p=this.storeFilesError.getAt(y).data.name;v=Ext.util.md5("FE-"+this.userLang+n+p);t=this.storeFilesError.getAt(y).data.needcommit;if(!Ext.getCmp("main-panel").findById("FE-"+v)){w=[];this.storeFilesError.each(function(A){if(A.data.path===n&&A.data.name===p){if(!w[A.data.type]){w.push(A.data.type)}}});m=new Ext.data.Store({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controler.php"}),baseParams:{task:! "get-log",Path:this.userLang+n,File:p},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"revision",mapping:"revision"},{name:"date",mapping:"date",type:"date",dateFormat:"Y/m/d H:i:s"},{name:"author",mapping:"author"},{name:"content",mapping:"content"}])});m.setDefaultSort("date","desc");s=new Ext.data.Store({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controler.php"}),baseParams:{task:"get-log",Path:"en"+n,File:p},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"revision",mapping:"revision"},{name:"date",mapping:"date",type:"date",dateFormat:"Y/m/d H:i:s"},{name:"author",mapping:"author"},{name:"content",mapping:"content"}])});s.setDefaultSort("date","desc");r=new Ext.grid.CheckboxSelectionModel({singleSelect:false,width:22,header:"",listeners:{beforerowselect:function(B){var A=B.getCount();if(A===2){return false}},rowselect:function(B){var A! =B.getCount();if(A===2){Ext.getCmp("FE-PANEL-btn-logLang-"+v).enable() ;Ext.get("FE-PANEL-btn-logLang-"+v).frame("3F8538")}else{Ext.getCmp("FE-PANEL-btn-logLang-"+v).disable()}},rowdeselect:function(B){var A=B.getCount();if(A===2){Ext.getCmp("FE-PANEL-btn-logLang-"+v).enable();Ext.get("FE-PANEL-btn-logLang-"+v).frame("3F8538")}else{Ext.getCmp("FE-PANEL-btn-logLang-"+v).disable()}}}});q=new Ext.grid.GridPanel({store:m,loadMask:true,columns:[r,{id:"id",header:"Rev.",width:40,sortable:false,dataIndex:"revision"},{header:"Content",width:130,sortable:true,dataIndex:"content"},{header:"By",width:50,sortable:true,dataIndex:"author"},{header:"Date",width:85,sortable:true,dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y/m/d, H:i")}],autoHeight:true,autoExpandColumn:"content",bodyBorder:false,sm:r,view:new Ext.grid.GridView({forceFit:true}),tbar:[{scope:this,tooltip:"<b>View</b> the diff",iconCls:"iconViewDiff",id:"FE-PANEL-btn-logLang-"+v,disabled:true,handler:function(){var C,B,A;C=r.getSelections();B=C[0].data.revision;A=C[1].data.revision;th! is.winDiff(this.userLang+n,p,B,A)}}]});z=new Ext.grid.CheckboxSelectionModel({singleSelect:false,width:22,header:"",listeners:{beforerowselect:function(B){var A=B.getCount();if(A===2){return false}},rowselect:function(B){var A=B.getCount();if(A===2){Ext.getCmp("FE-PANEL-btn-logEn-"+v).enable();Ext.get("FE-PANEL-btn-logEn-"+v).frame("3F8538")}else{Ext.getCmp("FE-PANEL-btn-logEn-"+v).disable()}},rowdeselect:function(B){var A=B.getCount();if(A===2){Ext.getCmp("FE-PANEL-btn-logEn-"+v).enable();Ext.get("FE-PANEL-btn-logEn-"+v).frame("3F8538")}else{Ext.getCmp("FE-PANEL-btn-logEn-"+v).disable()}}}});x=new Ext.grid.GridPanel({store:s,loadMask:true,columns:[z,{id:"id",header:"Rev.",width:40,sortable:false,dataIndex:"revision"},{header:"Content",width:130,sortable:true,dataIndex:"content"},{header:"By",width:50,sortable:true,dataIndex:"author"},{header:"Date",width:85,sortable:true,dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y/m/d, H:i")}],autoHeight:true,autoExpandColumn! :"content",bodyBorder:false,sm:z,view:new Ext.grid.GridView({forceFit: true}),tbar:[{scope:this,tooltip:"<b>View</b> the diff",iconCls:"iconViewDiff",id:"FE-PANEL-btn-logEn-"+v,disabled:true,handler:function(){var C,B,A;C=z.getSelections();B=C[0].data.revision;A=C[1].data.revision;this.winDiff("en"+n,p,B,A)}}]});Ext.getCmp("main-panel").add({closable:true,title:p,originTitle:p,tabTip:"File with error : in "+n,iconCls:"iconTabError",id:"FE-"+v,isModifiedLang:false,isModifiedEn:false,layout:"border",defaults:{collapsible:true,split:true},items:[{xtype:"panel",layout:"fit",region:"north",title:"Error description",id:"FE-error-desc-"+v,height:150,collapsed:true,items:{xtype:"iframepanel",id:"FE-error-type-"+v,loadMask:true,defaultSrc:"/error_type.php?dir="+n+"&file="+p}},{region:"west",xtype:"panel",layout:"fit",bodyBorder:false,title:"CvsLog",collapsed:true,width:375,items:{xtype:"tabpanel",activeTab:0,tabPosition:"bottom",defaults:{autoScroll:true},items:[{layout:"fit",title:this.userLang,items:[q]},{layout:"fit",title:"En",items:[x]}]}},{title:t! his.userLang+" File: "+n+p,originTitle:this.userLang+" File: "+n+p,collapsible:false,id:"FE-LANG-PANEL-"+v,region:"center",xtype:"form",height:"auto",width:"auto",items:[{xtype:"codemirror",id:"FE-LANG-"+v,listeners:{scope:this,initialize:function(A){this.getFile(v,this.userLang+n,p,"FE-LANG-PANEL-","FE-LANG-")},cmcursormove:function(){var A=Ext.util.JSON.decode(Ext.getCmp("FE-LANG-"+v).getCursorPosition());Ext.get("FE-LANG-status-line-"+v).dom.innerHTML=A.line;Ext.get("FE-LANG-status-col-"+v).dom.innerHTML=A.caracter},cmchange:function(D,B,C){var A=Ext.util.JSON.decode(Ext.getCmp("FE-LANG-"+v).getCursorPosition());Ext.get("FE-LANG-status-line-"+v).dom.innerHTML=A.line;Ext.get("FE-LANG-status-col-"+v).dom.innerHTML=A.caracter;if(D!==27&&D!==33&&D!==34&&D!==37&&D!==38&&D!==39&&D!==40&&D!==17&&D!==16&&D!==67){if(!Ext.getCmp("FE-"+v).isModifiedLang){Ext.getCmp("FE-LANG-PANEL-"+v).setTitle(Ext.getCmp("FE-LANG-PANEL-"+v).originTitle+' <span style="color:#ff0000; font-weight: bol! d;">[modified]</span>');Ext.getCmp("FE-"+v).setTitle(Ext.getCmp("FE-"+ v).originTitle+' <t style="color:#ff0000; font-weight: bold;">*</t>');Ext.getCmp("FE-LANG-PANEL-btn-save-"+v).enable();Ext.get("FE-LANG-PANEL-btn-save-"+v).frame("3F8538");Ext.getCmp("FE-LANG-PANEL-btn-saveas-"+v).enable();Ext.get("FE-LANG-PANEL-btn-saveas-"+v).frame("3F8538");Ext.getCmp("FE-"+v).isModifiedLang=true}}},cmscroll:function(A){if(this.userConf.conf_error_scrollbars==="true"){Ext.getCmp("FE-EN-"+v).scrollTo(A)}}}}],bbar:[{scope:this,xtype:"checkbox",hideLabel:true,checked:(this.userConf.conf_error_scrollbars==="true")?true:false,boxLabel:"Synchronize scroll bars",name:"conf_error_scrollbars",listeners:{scope:this,check:function(A){this.confUpdate("conf_error_scrollbars",A.getValue())},render:function(A){Ext.DomHelper.insertHtml("beforeBegin",A.el.dom,'<div style="display: inline;" class="x-statusbar"><span class="x-status-text-panel">Line: <span id="FE-LANG-status-line-'+v+'">-</span></span> <span class="x-status-text-panel">Col: <span id="FE-LANG-stat! us-col-'+v+'">-</span></span></div> ')}}}],tbar:[{scope:this,tooltip:"<b>Save</b> this file",iconCls:"saveFile",id:"FE-LANG-PANEL-btn-save-"+v,disabled:true,handler:function(){this.saveLangFile(v,n,p,"FE",y,this)}},{scope:this,tooltip:"<b>Save as</b> a patch",iconCls:"saveAsFile",id:"FE-LANG-PANEL-btn-saveas-"+v,disabled:true,handler:function(){this.savePatch(this.userLang,v,n,p,"FE",this)}},"->",{tooltip:"<b>Re-indent</b> all this file",iconCls:"iconIndent",handler:function(){Ext.getCmp("FE-LANG-"+v).reIndentAll()}}]},{title:"En File: "+n+p,originTitle:"En File: "+n+p,collapsible:false,id:"FE-EN-PANEL-"+v,region:"east",xtype:"form",height:"auto",width:575,items:[{xtype:"codemirror",id:"FE-EN-"+v,listeners:{scope:this,initialize:function(A){this.getFile(v,"en"+n,p,"FE-EN-PANEL-","FE-EN-")},cmchange:function(D,B,C){var A=Ext.util.JSON.decode(Ext.getCmp("FE-EN-"+v).getCursorPosition());Ext.get("FE-EN-status-line-"+v).dom.innerHTML=A.line;Ext.get("FE-EN-status-col-"! +v).dom.innerHTML=A.caracter;if(D!==27&&D!==33&&D!==34&&D!==37&&D!==38 &&D!==39&&D!==40&&D!==17&&D!==16&&D!==67){if(!Ext.getCmp("FE-"+v).isModifiedEn){Ext.getCmp("FE-EN-PANEL-"+v).setTitle(Ext.getCmp("FE-EN-PANEL-"+v).originTitle+' <span style="color:#ff0000; font-weight: bold;">[modified]</span>');Ext.getCmp("FE-"+v).setTitle(Ext.getCmp("FE-"+v).originTitle+' <t style="color:#ff0000; font-weight: bold;">*</t>');Ext.getCmp("FE-EN-PANEL-btn-save-"+v).enable();Ext.get("FE-EN-PANEL-btn-save-"+v).frame("3F8538");Ext.getCmp("FE-EN-PANEL-btn-saveas-"+v).enable();Ext.get("FE-EN-PANEL-btn-saveas-"+v).frame("3F8538");Ext.getCmp("FE-"+v).isModifiedEn=true}}},cmscroll:function(A){if(this.userConf.conf_error_scrollbars==="true"){Ext.getCmp("FE-LANG-"+v).scrollTo(A)}},cmcursormove:function(B){var A=Ext.util.JSON.decode(Ext.getCmp("FE-EN-"+v).getCursorPosition());Ext.get("FE-EN-status-line-"+v).dom.innerHTML=A.line;Ext.get("FE-EN-status-col-"+v).dom.innerHTML=A.caracter}}}],bbar:[{scope:this,xtype:"panel",height:21,baseCls:"",bodyStyle:"padding-top:5px;",htm! l:'<div style="display: inline;" class="x-statusbar"><span class="x-status-text-panel">Line: <span id="FE-EN-status-line-'+v+'">-</span></span> <span class="x-status-text-panel">Col: <span id="FE-EN-status-col-'+v+'">-</span></span></div> '}],tbar:[{scope:this,tooltip:"<b>Save</b> this file",iconCls:"saveFile",id:"FE-EN-PANEL-btn-save-"+v,disabled:true,handler:function(){this.saveEnFile(v,n,p,"FE",y,this)}},{scope:this,tooltip:"<b>Save as</b> a patch",iconCls:"saveAsFile",id:"FE-EN-PANEL-btn-saveas-"+v,disabled:true,handler:function(){this.savePatch("en",v,n,p,"FE",this)}},"->",{tooltip:"<b>Re-indent</b> all this file",iconCls:"iconIndent",handler:function(){Ext.getCmp("FE-EN-"+v).reIndentAll()}}]}]});Ext.getCmp("main-panel").setActiveTab("FE-"+v);if(Ext.getCmp("FE-"+v).getLayout().north.collapsedEl){Ext.getCmp("FE-"+v).getLayout().north.collapsedEl.addClass("x-layout-collapsed-east-error-desc")}}else{Ext.getCmp("main-panel").setActiveTab("FE-"+v)}},ro! wcontextmenu:function(o,t,r){var p,m,q,n="",s;o.getSelectionModel().se lectRow(t);p=this.storeFilesError.getAt(t).data.path;m=this.storeFilesError.getAt(t).data.name;q=Ext.util.md5("FE-"+p+m);if(this.storeFilesError.getAt(t).data.needcommit){n={text:"View Diff",iconCls:"iconViewDiff",scope:this,handler:function(){Ext.getCmp("main-panel").add({xtype:"panel",id:"diff_panel_"+t,title:"Diff",tabTip:"Diff",closable:true,autoScroll:true,iconCls:"iconTabLink",html:'<div id="diff_content_'+t+'" class="diff-content"></div>'});Ext.getCmp("main-panel").setActiveTab("diff_panel_"+t);Ext.get("diff_panel_"+t).mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Please, Wait...');Ext.Ajax.request({scope:this,url:"./php/controler.php",params:{task:"get-diff",FilePath:this.userLang+p,FileName:m},success:function(u){var v=Ext.util.JSON.decode(u.responseText);if(v.success){Ext.get("diff_content_"+t).dom.innerHTML=v.content;Ext.get("diff_panel_"+t).unmask()}},failure:function(){}})}}}s=new Ext.menu.Menu({items:[{text:"<b>Edit in a new Tab</b>",icon! Cls:"FilesError",scope:this,handler:function(){j.fireEvent("rowdblclick",o,t,r)}},n,"-",{text:"About error type",iconCls:"iconHelp",scope:this,handler:function(){Ext.getCmp("main-panel").add({closable:true,title:"About error type",iconCls:"iconHelp",id:"FE-help-"+q,autoScroll:true,autoLoad:"/error_type.php"});Ext.getCmp("main-panel").setActiveTab("FE-help-"+q)}}]});s.showAt(r.getXY())}}});l=new Ext.grid.GridPanel({store:this.storeFilesNeedUpdate,loadMask:true,columns:[{id:"name",header:"Files",sortable:true,dataIndex:"name"},{header:"EN revision",width:45,sortable:true,dataIndex:"en_revision"},{header:Ext.util.Format.uppercase(this.userLang)+" revision",width:45,sortable:true,dataIndex:"revision"},{header:"Maintainer",width:45,sortable:true,dataIndex:"maintainer"},{header:"Path",dataIndex:"path",hidden:true}],view:new Ext.grid.GroupingView({forceFit:true,groupTextTpl:'{[values.rs[0].data["path"]]} ({[values.rs.length]} {[values.rs.length > 1 ? "Files" : "File"]})',getRowCla! ss:function(m,p,o,n){if(m.data.needcommit){return"file-need-commit"}if (m.data.isCritical){return"file-critical"}},emptyText:'<div style="text-align: center;">No Files</div>'}),autoExpandColumn:"name",bodyBorder:false,listeners:{scope:this,rowcontextmenu:function(o,s,q){var p,m,n="",r;p=this.storeFilesNeedUpdate.getAt(s).data.path;m=this.storeFilesNeedUpdate.getAt(s).data.name;o.getSelectionModel().selectRow(s);if(this.storeFilesNeedUpdate.getAt(s).data.needcommit){n={text:"View Diff",iconCls:"iconViewDiff",scope:this,handler:function(){Ext.getCmp("main-panel").add({xtype:"panel",id:"diff_panel_"+s,title:"Diff",tabTip:"Diff",closable:true,autoScroll:true,iconCls:"iconTabLink",html:'<div id="diff_content_'+s+'" class="diff-content"></div>'});Ext.getCmp("main-panel").setActiveTab("diff_panel_"+s);Ext.get("diff_panel_"+s).mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Please, Wait...');Ext.Ajax.request({url:"./php/controler.php",params:{task:"get-diff",FilePath:this.userLang+p,FileName:m},success:function(t){var u=Ext.util.JS! ON.decode(t.responseText);if(u.success){Ext.get("diff_content_"+s).dom.innerHTML=u.content;Ext.get("diff_panel_"+s).unmask()}},failure:function(){}})}}}r=new Ext.menu.Menu({items:[{text:"<b>Edit in a new Tab</b>",iconCls:"iconTabNeedUpdate",scope:this,handler:function(){l.fireEvent("rowdblclick",o,s,q)}},n]});q.stopEvent();r.showAt(q.getXY())},rowdblclick:function(o,x,v){var n,p,z,y,t,u,m,s,r,q,B,w,A;n=this.storeFilesNeedUpdate.getAt(x).data.path;p=this.storeFilesNeedUpdate.getAt(x).data.name;z=this.storeFilesNeedUpdate.getAt(x).data.en_revision;y=this.storeFilesNeedUpdate.getAt(x).data.revision;t=this.storeFilesNeedUpdate.getAt(x).data.needcommit;u=Ext.util.md5("FNU-"+this.userLang+n+p);if(!Ext.getCmp("main-panel").findById("FNU-"+u)){m=new Ext.data.Store({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controler.php"}),baseParams:{task:"get-log",Path:this.userLang+n,File:p},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",map! ping:"id"},{name:"revision",mapping:"revision"},{name:"date",mapping:" date",type:"date",dateFormat:"Y/m/d H:i:s"},{name:"author",mapping:"author"},{name:"content",mapping:"content"}])});m.setDefaultSort("date","desc");s=new Ext.data.Store({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controler.php"}),baseParams:{task:"get-log",Path:"en"+n,File:p},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"revision",mapping:"revision"},{name:"date",mapping:"date",type:"date",dateFormat:"Y/m/d H:i:s"},{name:"author",mapping:"author"},{name:"content",mapping:"content"}])});s.setDefaultSort("date","desc");r=new Ext.grid.CheckboxSelectionModel({singleSelect:false,width:22,header:"",listeners:{beforerowselect:function(D){var C=D.getCount();if(C===2){return false}},rowselect:function(D){var C=D.getCount();if(C===2){Ext.getCmp("FNU-PANEL-btn-logLang-"+u).enable();Ext.get("FNU-PANEL-btn-logLang-"+u).frame("3F8538")}else{Ext.getCmp("FNU-PANEL-btn-logLang-"+u).disable()}},rowdeselect:function(D)! {var C=D.getCount();if(C===2){Ext.getCmp("FNU-PANEL-btn-logLang-"+u).enable();Ext.get("FNU-PANEL-btn-logLang-"+u).frame("3F8538")}else{Ext.getCmp("FNU-PANEL-btn-logLang-"+u).disable()}}}});q=new Ext.grid.GridPanel({store:m,loadMask:true,columns:[r,{id:"id",header:"Rev.",width:40,sortable:false,dataIndex:"revision"},{header:"Content",width:130,sortable:true,dataIndex:"content"},{header:"By",width:50,sortable:true,dataIndex:"author"},{header:"Date",width:85,sortable:true,dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y/m/d, H:i")}],autoHeight:true,autoExpandColumn:"content",bodyBorder:false,sm:r,view:new Ext.grid.GridView({forceFit:true}),tbar:[{scope:this,tooltip:"<b>View</b> the diff",iconCls:"iconViewDiff",id:"FNU-PANEL-btn-logLang-"+u,disabled:true,handler:function(){var E,D,C;E=r.getSelections();D=E[0].data.revision;C=E[1].data.revision;this.winDiff(this.userLang+n,p,D,C)}}]});B=new Ext.grid.CheckboxSelectionModel({singleSelect:false,width:22,header:"",listeners! :{beforerowselect:function(D){var C=D.getCount();if(C===2){return fals e}},rowselect:function(D){var C=D.getCount();if(C===2){Ext.getCmp("FNU-PANEL-btn-logEn-"+u).enable();Ext.get("FNU-PANEL-btn-logEn-"+u).frame("3F8538")}else{Ext.getCmp("FNU-PANEL-btn-logEn-"+u).disable()}},rowdeselect:function(D){var C=D.getCount();if(C===2){Ext.getCmp("FNU-PANEL-btn-logEn-"+u).enable();Ext.get("FNU-PANEL-btn-logEn-"+u).frame("3F8538")}else{Ext.getCmp("FNU-PANEL-btn-logEn-"+u).disable()}}}});w=new Ext.grid.GridPanel({store:s,loadMask:true,columns:[B,{id:"id",header:"Rev.",width:40,sortable:false,dataIndex:"revision"},{header:"Content",width:130,sortable:true,dataIndex:"content"},{header:"By",width:50,sortable:true,dataIndex:"author"},{header:"Date",width:85,sortable:true,dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y/m/d, H:i")}],autoHeight:true,autoExpandColumn:"content",bodyBorder:false,sm:B,view:new Ext.grid.GridView({forceFit:true}),tbar:[{scope:this,tooltip:"<b>View</b> the diff",iconCls:"iconViewDiff",id:"FNU-PANEL-btn-logEn-"+u,disabled:true! ,handler:function(){var E,D,C;E=B.getSelections();D=E[0].data.revision;C=E[1].data.revision;this.winDiff("en"+n,p,D,C)}}]});if(this.userConf.conf_needupdate_diff==="using-viewvc"){A={xtype:"panel",layout:"fit",region:"north",title:"Diff From cvs",height:150,collapsed:true,items:{xtype:"iframepanel",id:"FNU-diff-"+u,loadMask:true,defaultSrc:"http://cvs.php.net/viewvc.cgi/phpdoc/en"+n+p+"?r1="+y+"&r2="+z}}}else{if(this.userConf.conf_needupdate_diff==="using-exec"){A={xtype:"panel",layout:"fit",region:"north",title:"Diff From cvs",height:150,autoScroll:true,collapsed:true,html:'<div id="FNU-diff-'+u+'" class="diff-content"></div>',listeners:{render:function(){Ext.Ajax.request({url:"./php/controler.php",params:{task:"get-diff2",FilePath:"en"+n,FileName:p,Rev2:y,Rev1:z},success:function(C){var D=Ext.util.JSON.decode(C.responseText);if(D.success){Ext.get("FNU-diff-"+u).dom.innerHTML=D.content}},failure:function(){}})}}}}}Ext.getCmp("main-panel").add({closable:true,title:p,originT! itle:p,tabTip:"Need Update : in "+n,iconCls:"iconTabNeedUpdate",id:"FN U-"+u,isModifiedLang:false,isModifiedEn:false,layout:"border",defaults:{collapsible:true,split:true},items:[A,{region:"west",xtype:"panel",layout:"fit",bodyBorder:false,title:"CvsLog",collapsed:true,width:375,items:{xtype:"tabpanel",activeTab:0,tabPosition:"bottom",defaults:{autoScroll:true},items:[{layout:"fit",title:this.userLang,items:[q]},{layout:"fit",title:"En",items:[w]}]}},{scope:this,title:this.userLang+" File: "+n+p,originTitle:this.userLang+" File: "+n+p,collapsible:false,id:"FNU-LANG-PANEL-"+u,region:"center",xtype:"form",height:"auto",width:"auto",items:[{xtype:"codemirror",id:"FNU-LANG-"+u,listeners:{scope:this,initialize:function(){this.getFile(u,this.userLang+n,p,"FNU-LANG-PANEL-","FNU-LANG-")},cmcursormove:function(){var C=Ext.util.JSON.decode(Ext.getCmp("FNU-LANG-"+u).getCursorPosition());Ext.get("FNU-LANG-status-line-"+u).dom.innerHTML=C.line;Ext.get("FNU-LANG-status-col-"+u).dom.innerHTML=C.caracter},cmchange:function(F,D,E){var C=Ext.util.JSON.decode(Ext! .getCmp("FNU-LANG-"+u).getCursorPosition());Ext.get("FNU-LANG-status-line-"+u).dom.innerHTML=C.line;Ext.get("FNU-LANG-status-col-"+u).dom.innerHTML=C.caracter;if(F!==27&&F!==33&&F!==34&&F!==37&&F!==38&&F!==39&&F!==40&&F!==17&&F!==16&&F!==67){if(!Ext.getCmp("FNU-"+u).isModifiedLang){Ext.getCmp("FNU-LANG-PANEL-"+u).setTitle(Ext.getCmp("FNU-LANG-PANEL-"+u).originTitle+' <span style="color:#ff0000; font-weight: bold;">[modified]</span>');Ext.getCmp("FNU-"+u).setTitle(Ext.getCmp("FNU-"+u).originTitle+' <t style="color:#ff0000; font-weight: bold;">*</t>');Ext.getCmp("FNU-LANG-PANEL-btn-save-"+u).enable();Ext.get("FNU-LANG-PANEL-btn-save-"+u).frame("3F8538");Ext.getCmp("FNU-LANG-PANEL-btn-saveas-"+u).enable();Ext.get("FNU-LANG-PANEL-btn-saveas-"+u).frame("3F8538");Ext.getCmp("FNU-"+u).isModifiedLang=true}}},cmscroll:function(C){if(this.userConf.conf_needupdate_scrollbars==="true"){Ext.getCmp("FNU-EN-"+u).scrollTo(C)}}}}],bbar:[{scope:this,xtype:"checkbox",hideLabel:true,checked:(t! his.userConf.conf_needupdate_scrollbars==="true")?true:false,boxLabel: "Synchronize scroll bars",name:"conf_needupdate_scrollbars",listeners:{scope:this,check:function(C){this.confUpdate("conf_needupdate_scrollbars",C.getValue())},render:function(C){Ext.DomHelper.insertHtml("beforeBegin",C.el.dom,'<div style="display: inline;" class="x-statusbar"><span class="x-status-text-panel">Line: <span id="FNU-LANG-status-line-'+u+'">-</span></span> <span class="x-status-text-panel">Col: <span id="FNU-LANG-status-col-'+u+'">-</span></span></div> ')}}}],tbar:[{scope:this,tooltip:"<b>Save</b> this file",iconCls:"saveFile",id:"FNU-LANG-PANEL-btn-save-"+u,disabled:true,handler:function(){this.saveLangFile(u,n,p,"FNU",x,this)}},{scope:this,tooltip:"<b>Save as</b> a patch",iconCls:"saveAsFile",id:"FNU-LANG-PANEL-btn-saveas-"+u,disabled:true,handler:function(){this.savePatch(this.userLang,u,n,p,"FNU",this)}},"->",{tooltip:"<b>Re-indent</b> all this file",iconCls:"iconIndent",handler:function(){Ext.getCmp("FNU-LANG-"+u).reIndentAll()}},{tool! tip:"Insert <b>Reviewed</b> tag",text:"Reviewed tag",iconCls:"iconInsertCode",handler:function(){Ext.getCmp("FNU-LANG-"+u).insertIntoLine(2,"end","\n<!-- Reviewed: no -->");Ext.getCmp("FNU-LANG-"+u).focus()}},{tooltip:"Insert <b>Revcheck</b> tag",text:"Rev tag",iconCls:"iconInsertCode",handler:function(){Ext.getCmp("FNU-LANG-"+u).insertIntoLine(2,"end","\n<!-- EN-Revision: 1.XX Maintainer: "+this.userLoggin+" Status: ready -->");Ext.getCmp("FNU-LANG-"+u).focus()}}]},{title:"En File: "+n+p,originTitle:"En File: "+n+p,collapsible:false,id:"FNU-EN-PANEL-"+u,region:"east",xtype:"form",height:"auto",width:575,items:[{xtype:"codemirror",id:"FNU-EN-"+u,listeners:{scope:this,initialize:function(){this.getFile(u,"en"+n,p,"FNU-EN-PANEL-","FNU-EN-")},cmchange:function(F,D,E){var C=Ext.util.JSON.decode(Ext.getCmp("FNU-EN-"+u).getCursorPosition());Ext.get("FNU-EN-status-line-"+u).dom.innerHTML=C.line;Ext.get("FNU-EN-status-col-"+u).dom.innerHTML=C.caracter;if(F!==27&&F!==33&&F!==34&&F!=! =37&&F!==38&&F!==39&&F!==40&&F!==17&&F!==16&&F!==67){if(!Ext.getCmp("F NU-"+u).isModifiedEn){Ext.getCmp("FNU-EN-PANEL-"+u).setTitle(Ext.getCmp("FNU-EN-PANEL-"+u).originTitle+' <span style="color:#ff0000; font-weight: bold;">[modified]</span>');Ext.getCmp("FNU-"+u).setTitle(Ext.getCmp("FNU-"+u).originTitle+' <t style="color:#ff0000; font-weight: bold;">*</t>');Ext.getCmp("FNU-EN-PANEL-btn-save-"+u).enable();Ext.get("FNU-EN-PANEL-btn-save-"+u).frame("3F8538");Ext.getCmp("FNU-EN-PANEL-btn-saveas-"+u).enable();Ext.get("FNU-EN-PANEL-btn-saveas-"+u).frame("3F8538");Ext.getCmp("FNU-"+u).isModifiedEn=true}}},cmscroll:function(C){if(this.userConf.conf_needupdate_scrollbars==="true"){Ext.getCmp("FNU-LANG-"+u).scrollTo(C)}},cmcursormove:function(D){var C=Ext.util.JSON.decode(Ext.getCmp("FNU-EN-"+u).getCursorPosition());Ext.get("FNU-EN-status-line-"+u).dom.innerHTML=C.line;Ext.get("FNU-EN-status-col-"+u).dom.innerHTML=C.caracter}}}],bbar:[{scope:this,xtype:"panel",height:21,baseCls:"",bodyStyle:"padding-top:5px;",html:'<div style="display: inline;" class="! x-statusbar"><span class="x-status-text-panel">Line: <span id="FNU-EN-status-line-'+u+'">-</span></span> <span class="x-status-text-panel">Col: <span id="FNU-EN-status-col-'+u+'">-</span></span></div> '}],tbar:[{scope:this,tooltip:"<b>Save</b> this file",iconCls:"saveFile",id:"FNU-EN-PANEL-btn-save-"+u,disabled:true,handler:function(){this.saveEnFile(u,n,p,"FNU",x,this)}},{scope:this,tooltip:"<b>Save as</b> a patch",iconCls:"saveAsFile",id:"FNU-EN-PANEL-btn-saveas-"+u,disabled:true,handler:function(){this.savePatch("en",u,n,p,"FNU",this)}},"->",{tooltip:"<b>Re-indent</b> all this file",iconCls:"iconIndent",handler:function(){Ext.getCmp("FNU-EN-"+u).reIndentAll()}}]}]});Ext.getCmp("main-panel").setActiveTab("FNU-"+u)}else{Ext.getCmp("main-panel").setActiveTab("FNU-"+u)}}}});a=new Ext.grid.GridPanel({store:this.storePendingPatch,loadMask:true,columns:[{id:"name",header:"Files",sortable:true,dataIndex:"name"},{header:"Posted by",width:45,sortable:true,dat! aIndex:"by"},{header:"Date",width:45,sortable:true,dataIndex:"date"},{ header:"Path",dataIndex:"path",hidden:true}],view:new Ext.grid.GroupingView({forceFit:true,groupTextTpl:'{[values.rs[0].data["path"]]} ({[values.rs.length]} {[values.rs.length > 1 ? "Files" : "File"]})',emptyText:'<div style="text-align: center;">No pending Patch</div>'}),autoExpandColumn:"name",bodyBorder:false,listeners:{scope:this,rowcontextmenu:function(n,t,r){var o,m,p,q,s;o=this.storePendingPatch.getAt(t).data.path;m=this.storePendingPatch.getAt(t).data.name;p=this.storePendingPatch.getAt(t).data.uniqID;q=Ext.util.md5("PP-"+p+o+m);n.getSelectionModel().selectRow(t);s=new Ext.menu.Menu({items:[{text:"<b>Edit in a new Tab</b>",iconCls:"PendingPatch",scope:this,handler:function(){a.fireEvent("rowdblclick",n,t,r)}},"-",{text:"Reject this patch",iconCls:"iconPageDelete",scope:this,handler:function(){this.rejectPatch(q,o,m,p,t,this)}}]});s.showAt(r.getXY())},rowdblclick:function(n,u,s){var m,o,v,t,r,q,p;m=this.storePendingPatch.getAt(u).data.path;o=this.storePendingPatch.get! At(u).data.name;v=this.storePendingPatch.getAt(u).data.uniqID;t=Ext.util.md5("PP-"+v+m+o);if(!Ext.getCmp("main-panel").findById("FE-"+t)){r=new Ext.data.Store({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controler.php"}),baseParams:{task:"get-log",Path:m,File:o},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"revision",mapping:"revision"},{name:"date",mapping:"date",type:"date",dateFormat:"Y/m/d H:i:s"},{name:"author",mapping:"author"},{name:"content",mapping:"content"}])});r.setDefaultSort("date","desc");q=new Ext.grid.CheckboxSelectionModel({singleSelect:false,width:22,header:"",listeners:{beforerowselect:function(x){var w=x.getCount();if(w===2){return false}},rowselect:function(x){var w=x.getCount();if(w===2){Ext.getCmp("PP-PANEL-btn-log-"+t).enable();Ext.get("PP-PANEL-btn-log-"+t).frame("3F8538")}else{Ext.getCmp("PP-PANEL-btn-log-"+t).disable()}},rowdeselect:function(x){var w=x.getCount();if(w===2)! {Ext.getCmp("PP-PANEL-btn-log-"+t).enable();Ext.get("PP-PANEL-btn-log- "+t).frame("3F8538")}else{Ext.getCmp("PP-PANEL-btn-log-"+t).disable()}}}});p=new Ext.grid.GridPanel({store:r,loadMask:true,columns:[q,{id:"id",header:"Rev.",width:40,sortable:false,dataIndex:"revision"},{header:"Content",width:130,sortable:true,dataIndex:"content"},{header:"By",width:50,sortable:true,dataIndex:"author"},{header:"Date",width:85,sortable:true,dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y/m/d, H:i")}],autoHeight:true,autoExpandColumn:"content",bodyBorder:false,sm:q,view:new Ext.grid.GridView({forceFit:true}),tbar:[{scope:this,tooltip:"<b>View</b> the diff",iconCls:"iconViewDiff",id:"PP-PANEL-btn-log-"+t,disabled:true,handler:function(){var y,x,w;y=q.getSelections();x=y[0].data.revision;w=y[1].data.revision;this.winDiff(m,o,x,w)}}]});Ext.getCmp("main-panel").add({closable:true,title:o,originTitle:o,tabTip:"Patch for "+m+o,iconCls:"PendingPatch",id:"PP-"+t,layout:"border",defaults:{collapsible:true,split:true},items:[{xtype:"panel",layout:"fit",region! :"north",title:"Patch content",id:"PP-patch-desc-"+t,height:150,autoScroll:true,collapsed:true,html:'<div id="diff_content_'+t+'" class="diff-content"></div>',listeners:{render:function(){Ext.Ajax.request({scope:this,url:"./php/controler.php",params:{task:"get-diff",FilePath:m,FileName:o,type:"patch",uniqID:v},success:function(w){var x=Ext.util.JSON.decode(w.responseText);if(x.success){Ext.get("diff_content_"+t).dom.innerHTML=x.content}},failure:function(){}})}}},{region:"west",xtype:"panel",layout:"fit",bodyBorder:false,title:"CvsLog",collapsed:true,width:375,items:{xtype:"tabpanel",activeTab:0,tabPosition:"bottom",defaults:{autoScroll:true},items:[{layout:"fit",title:"Log",items:[p]}]}},{title:"Proposed Patch for "+m+o,originTitle:"Proposed Patch for "+m+o,collapsible:false,id:"PP-PATCH-PANEL-"+t,region:"center",xtype:"form",height:"auto",width:"auto",items:[{xtype:"codemirror",id:"PP-PATCH-"+t,isModified:false,listeners:{scope:this,initialize:function(w){this.getFile(t,m! ,o+"."+v+".patch","PP-PATCH-PANEL-","PP-PATCH-")},cmcursormove:functio n(){var w=Ext.util.JSON.decode(Ext.getCmp("PP-PATCH-"+t).getCursorPosition());Ext.get("PP-PATCH-status-line-"+t).dom.innerHTML=w.line;Ext.get("PP-PATCH-status-col-"+t).dom.innerHTML=w.caracter},cmchange:function(z,x,y){var w=Ext.util.JSON.decode(Ext.getCmp("PP-PATCH-"+t).getCursorPosition());Ext.get("PP-PATCH-status-line-"+t).dom.innerHTML=w.line;Ext.get("PP-PATCH-status-col-"+t).dom.innerHTML=w.caracter;if(z!==27&&z!==33&&z!==34&&z!==37&&z!==38&&z!==39&&z!==40&&z!==17&&z!==16&&z!==67){if(!Ext.getCmp("PP-PATCH-"+t).isModified){Ext.getCmp("PP-PATCH-PANEL-"+t).setTitle(Ext.getCmp("PP-PATCH-PANEL-"+t).originTitle+' <span style="color:#ff0000; font-weight: bold;">[modified]</span>');Ext.getCmp("PP-"+t).setTitle(Ext.getCmp("PP-"+t).originTitle+' <t style="color:#ff0000; font-weight: bold;">*</t>');Ext.getCmp("PP-PATCH-"+t).isModified=true}}},cmscroll:function(w){if(this.userConf.conf_patch_scrollbars==="true"){Ext.getCmp("PP-ORIGIN-"+t).scrollTo(w)}}}}],bbar:[{scope:this,xtype:"c! heckbox",hideLabel:true,checked:(this.userConf.conf_patch_scrollbars==="true")?true:false,boxLabel:"Synchronize scroll bars",name:"conf_patch_scrollbars",listeners:{scope:this,check:function(w){this.confUpdate("conf_patch_scrollbars",w.getValue())},render:function(w){Ext.DomHelper.insertHtml("beforeBegin",w.el.dom,'<div style="display: inline;" class="x-statusbar"><span class="x-status-text-panel">Line: <span id="PP-PATCH-status-line-'+t+'">-</span></span> <span class="x-status-text-panel">Col: <span id="PP-PATCH-status-col-'+t+'">-</span></span></div> ')}}}],tbar:[{scope:this,tooltip:"<b>Accept</b> this patch and <b>Save</b> the file",iconCls:"saveFile",id:"PP-PATCH-PANEL-btn-save-"+t,handler:function(){this.saveFileViaPatch(t,m,o,v,u,this)}},{scope:this,tooltip:"<b>Reject</b> this patch",iconCls:"iconPageDelete",id:"PP-PATCH-PANEL-btn-reject-"+t,handler:function(){this.rejectPatch(t,m,o,v,u,this)}},"->",{tooltip:"<b>Re-indent</b> all this file",iconC! ls:"iconIndent",handler:function(){Ext.getCmp("PP-PATCH-"+t).reIndentA ll()}}]},{title:"Original File: "+m+o,originTitle:"Original File: "+m+o,collapsible:false,id:"PP-ORIGIN-PANEL-"+t,region:"east",xtype:"form",height:"auto",width:575,items:[{xtype:"codemirror",id:"PP-ORIGIN-"+t,readOnly:true,listeners:{scope:this,initialize:function(w){this.getFile(t,m,o,"PP-ORIGIN-PANEL-","PP-ORIGIN-")},cmscroll:function(w){if(this.userConf.conf_patch_scrollbars==="true"){Ext.getCmp("PP-PATCH-"+t).scrollTo(w)}},cmcursormove:function(x){var w=Ext.util.JSON.decode(Ext.getCmp("PP-ORIGIN-"+t).getCursorPosition());Ext.get("PP-ORIGIN-status-line-"+t).dom.innerHTML=w.line;Ext.get("PP-ORIGIN-status-col-"+t).dom.innerHTML=w.caracter}}}],bbar:[{scope:this,xtype:"panel",height:21,baseCls:"",bodyStyle:"padding-top:5px;",html:'<div style="display: inline;" class="x-statusbar"><span class="x-status-text-panel">Line: <span id="PP-ORIGIN-status-line-'+t+'">-</span></span> <span class="x-status-text-panel">Col: <span id="PP-ORIGIN-status-col-'+t+'">-</span></span>! </div> '}],tbar:[{}]}]});Ext.getCmp("main-panel").setActiveTab("PP-"+t);if(Ext.getCmp("PP-"+t).getLayout().north.collapsedEl){Ext.getCmp("PP-"+t).getLayout().north.collapsedEl.addClass("x-layout-collapsed-east-patch-desc")}}}}});c=new Ext.grid.GridPanel({store:this.storePendingCommit,loadMask:true,columns:[{id:"name",header:"Files",sortable:true,dataIndex:"name"},{header:"Modified by",width:45,sortable:true,dataIndex:"by"},{header:"Date",width:45,sortable:true,dataIndex:"date"},{header:"Path",dataIndex:"path",hidden:true}],view:new Ext.grid.GroupingView({forceFit:true,groupTextTpl:'{[values.rs[0].data["path"]]} ({[values.rs.length]} {[values.rs.length > 1 ? "Files" : "File"]})',emptyText:'<div style="text-align: center;">No pending for Commit</div>'}),autoExpandColumn:"name",bodyBorder:false,listeners:{scope:this,rowcontextmenu:function(n,r,p){var o,m,q;o=this.storePendingCommit.getAt(r).data.path;m=this.storePendingCommit.getAt(r).data.name;n.getSelectionModel()! .selectRow(r);q=new Ext.menu.Menu({items:[{text:"<b>Edit in a new Tab< /b>",iconCls:"PendingCommit",scope:this,handler:function(){c.fireEvent("rowdblclick",n,r,p)}},"-",{text:"View Diff",iconCls:"iconViewDiff",scope:this,handler:function(){Ext.getCmp("main-panel").add({xtype:"panel",id:"diff_panel_"+r,title:"Diff",tabTip:"Diff",closable:true,autoScroll:true,iconCls:"iconTabLink",html:'<div id="diff_content_'+r+'" class="diff-content"></div>'});Ext.getCmp("main-panel").setActiveTab("diff_panel_"+r);Ext.get("diff_panel_"+r).mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Please, Wait...');Ext.Ajax.request({url:"./php/controler.php",params:{task:"get-diff",FilePath:o,FileName:m},success:function(s){var t=Ext.util.JSON.decode(s.responseText);if(t.success){Ext.get("diff_content_"+r).dom.innerHTML=t.content;Ext.get("diff_panel_"+r).unmask()}},failure:function(){}})}},{text:"Download the diff as a patch",iconCls:"iconCommitFileCvs",scope:this,handler:function(){window.location.href="./dl_Patch.php?FilePath="+o+"&FileName="+m}},"-"! ,{text:"Clear this change",iconCls:"iconPageDelete",scope:this,handler:function(){function s(t){if(t==="yes"){if(Ext.getCmp("main-panel").findById("FNU-"+Ext.util.md5("FNU-"+o+m))){Ext.getCmp("main-panel").remove("FNU-"+Ext.util.md5("FNU-"+o+m))}Ext.Ajax.request({scope:this,url:"./php/controler.php",params:{task:"clear-local-change",FilePath:o,FileName:m},success:function(u){var v=Ext.util.JSON.decode(u.responseText);if(v.success){this.storeFilesNeedUpdate.reload();this.storeFilesError.reload();this.storeFilesNeedReviewed.reload();this.storePendingCommit.remove(this.storePendingCommit.getAt(r));this.storePendingCommit.fireEvent("add",this.storePendingCommit)}},failure:function(){}})}}Ext.MessageBox.confirm("Confirm","This action will clear your local modification and take back this file from his original stats.<br/>You need confirm.",s,this)}},"-",{text:"Commit...",iconCls:"iconCommitFileCvs",scope:this,menu:new Ext.menu.Menu({items:[{text:"...this file",iconCls:"iconCommit! FileCvs",scope:this,handler:function(){this.WinCommit(true,r)}},{text: "...all files modified by me",iconCls:"iconCommitFileCvs",scope:this,handler:function(){this.WinCommit(false,"","by me")}},{text:"...all files modified",iconCls:"iconCommitFileCvs",scope:this,handler:function(){this.WinCommit(false)}}]})}]});q.showAt(p.getXY())},rowdblclick:function(n,q,p){var o,m;o=this.storePendingCommit.getAt(q).data.path;m=this.storePendingCommit.getAt(q).data.name;this.openFile(o,m)}}});h=new Ext.grid.GridPanel({store:this.storeFilesNeedReviewed,loadMask:true,columns:[{id:"name",header:"Files",sortable:true,dataIndex:"name"},{header:"Reviewed",width:45,sortable:true,dataIndex:"reviewed"},{header:"Maintainer",width:45,sortable:true,dataIndex:"maintainer"},{header:"Path",dataIndex:"path",hidden:true}],view:new Ext.grid.GroupingView({forceFit:true,groupTextTpl:'{[values.rs[0].data["path"]]} ({[values.rs.length]} {[values.rs.length > 1 ? "Files" : "File"]})',getRowClass:function(m,p,o,n){if(m.data.needcommit){return"file-need-commit"}},emptyText:'<div style! ="text-align: center;">No files</div>'}),autoExpandColumn:"name",bodyBorder:false,listeners:{scope:this,rowcontextmenu:function(n,t,r){var m,p,s,o="",v="",u,q;n.getSelectionModel().selectRow(t);m=this.storeFilesNeedReviewed.getAt(t).data.path;p=this.storeFilesNeedReviewed.getAt(t).data.name;s=Ext.util.md5("FNR-"+this.userLang+m+p);if(this.storeFilesNeedReviewed.getAt(t).data.needcommit){o={text:"View Diff",iconCls:"iconViewDiff",scope:this,handler:function(){Ext.getCmp("main-panel").add({xtype:"panel",id:"diff_panel_"+t,title:"Diff",tabTip:"Diff",closable:true,autoScroll:true,iconCls:"iconTabLink",html:'<div id="diff_content_'+t+'" class="diff-content"></div>'});Ext.getCmp("main-panel").setActiveTab("diff_panel_"+t);Ext.get("diff_panel_"+t).mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Please, Wait...');Ext.Ajax.request({scope:this,url:"./php/controler.php",params:{task:"get-diff",FilePath:this.userLang+m,FileName:p},success:function(w){var x=Ext.util! .JSON.decode(w.responseText);if(x.success){Ext.get("diff_content_"+t). dom.innerHTML=x.content;Ext.get("diff_panel_"+t).unmask()}},failure:function(){}})}}}u=m.split("/");if(u[1]==="reference"){v={text:"Open all files about "+u[2]+" extension",iconCls:"iconViewDiff",scope:this,handler:function(){Ext.getBody().mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Open all files about '+u[2]+" extension. Please, wait...");Ext.Ajax.request({scope:this,url:"../php/controler.php",params:{task:"all-files-about-extension",ExtName:u[2]},success:function(y,x){var z,w;z=Ext.util.JSON.decode(y.responseText);this.filePendingOpen=[];for(w=0;w<z.files.length;w=w+1){this.filePendingOpen[w]=[this.userLang+z.files[w].path,z.files[w].name]}this.openFile(this.filePendingOpen[0][0],this.filePendingOpen[0][1]);Ext.getBody().unmask()}})}}}q=new Ext.menu.Menu({scope:this,items:[{text:"<b>Edit in a new Tab</b>",iconCls:"FilesNeedReviewed",scope:this,handler:function(){h.fireEvent("rowdblclick",n,t,r)}},o,"-",v]});r.stopEvent();q.showAt(r.getXY())},rowdb! lclick:function(o,y,v){var n,p,s,u,w,m,t,r,q,z,x;n=this.storeFilesNeedReviewed.getAt(y).data.path;p=this.storeFilesNeedReviewed.getAt(y).data.name;s=this.storeFilesNeedReviewed.getAt(y).data.reviewed;u=this.storeFilesNeedReviewed.getAt(y).data.needcommit;w=Ext.util.md5("FNR-"+this.userLang+n+p);if(!Ext.getCmp("main-panel").findById("FNR-"+w)){m=new Ext.data.Store({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controler.php"}),baseParams:{task:"get-log",Path:this.userLang+n,File:p},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"revision",mapping:"revision"},{name:"date",mapping:"date",type:"date",dateFormat:"Y/m/d H:i:s"},{name:"author",mapping:"author"},{name:"content",mapping:"content"}])});m.setDefaultSort("date","desc");t=new Ext.data.Store({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controler.php"}),baseParams:{task:"get-log",Path:"en"+n,File:p},reader:new Ext.data.JsonReader({root:"Items! ",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"re vision",mapping:"revision"},{name:"date",mapping:"date",type:"date",dateFormat:"Y/m/d H:i:s"},{name:"author",mapping:"author"},{name:"content",mapping:"content"}])});t.setDefaultSort("date","desc");r=new Ext.grid.CheckboxSelectionModel({singleSelect:false,width:22,header:"",listeners:{beforerowselect:function(B){var A=B.getCount();if(A===2){return false}},rowselect:function(B){var A=B.getCount();if(A===2){Ext.getCmp("FNR-PANEL-btn-logLang-"+w).enable();Ext.get("FNR-PANEL-btn-logLang-"+w).frame("3F8538")}else{Ext.getCmp("FNR-PANEL-btn-logLang-"+w).disable()}},rowdeselect:function(B){var A=B.getCount();if(A===2){Ext.getCmp("FNR-PANEL-btn-logLang-"+w).enable();Ext.get("FNR-PANEL-btn-logLang-"+w).frame("3F8538")}else{Ext.getCmp("FNR-PANEL-btn-logLang-"+w).disable()}}}});q=new Ext.grid.GridPanel({store:m,loadMask:true,columns:[r,{id:"id",header:"Rev.",width:40,sortable:false,dataIndex:"revision"},{header:"Content",width:130,sortable:true,dataIndex:"content"},{header:"By",width:50! ,sortable:true,dataIndex:"author"},{header:"Date",width:85,sortable:true,dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y/m/d, H:i")}],autoHeight:true,autoExpandColumn:"content",bodyBorder:false,sm:r,view:new Ext.grid.GridView({forceFit:true}),tbar:[{scope:this,tooltip:"<b>View</b> the diff",iconCls:"iconViewDiff",id:"FNR-PANEL-btn-logLang-"+w,disabled:true,handler:function(){var C,B,A;C=r.getSelections();B=C[0].data.revision;A=C[1].data.revision;this.winDiff(this.userLang+n,p,B,A)}}]});z=new Ext.grid.CheckboxSelectionModel({singleSelect:false,width:22,header:"",listeners:{beforerowselect:function(B){var A=B.getCount();if(A===2){return false}},rowselect:function(B){var A=B.getCount();if(A===2){Ext.getCmp("FNR-PANEL-btn-logEn-"+w).enable();Ext.get("FNR-PANEL-btn-logEn-"+w).frame("3F8538")}else{Ext.getCmp("FNR-PANEL-btn-logEn-"+w).disable()}},rowdeselect:function(B){var A=B.getCount();if(A===2){Ext.getCmp("FNR-PANEL-btn-logEn-"+w).enable();Ext.get("FNR-PANEL-btn-logE! n-"+w).frame("3F8538")}else{Ext.getCmp("FNR-PANEL-btn-logEn-"+w).disab le()}}}});x=new Ext.grid.GridPanel({store:t,loadMask:true,columns:[z,{id:"id",header:"Rev.",width:40,sortable:false,dataIndex:"revision"},{header:"Content",width:130,sortable:true,dataIndex:"content"},{header:"By",width:50,sortable:true,dataIndex:"author"},{header:"Date",width:85,sortable:true,dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y/m/d, H:i")}],autoHeight:true,autoExpandColumn:"content",bodyBorder:false,sm:z,view:new Ext.grid.GridView({forceFit:true}),tbar:[{scope:this,tooltip:"<b>View</b> the diff",iconCls:"iconViewDiff",id:"FNR-PANEL-btn-logEn-"+w,disabled:true,handler:function(){var C,B,A;C=z.getSelections();B=C[0].data.revision;A=C[1].data.revision;this.winDiff("en"+n,p,B,A)}}]});Ext.getCmp("main-panel").add({closable:true,title:p,originTitle:p,tabTip:"Need Reviewed : in "+n,iconCls:"iconTabNeedReviewed",id:"FNR-"+w,isModifiedLang:false,isModifiedEn:false,layout:"border",defaults:{collapsible:true,split:true},items:[{region:"west",xtype:"panel",layout:! "fit",bodyBorder:false,title:"CvsLog",collapsed:true,width:375,items:{xtype:"tabpanel",activeTab:0,tabPosition:"bottom",defaults:{autoScroll:true},items:[{layout:"fit",title:this.userLang,items:[q]},{layout:"fit",title:"En",items:[x]}]}},{title:this.userLang+" File: "+n+p,originTitle:this.userLang+" File: "+n+p,collapsible:false,id:"FNR-LANG-PANEL-"+w,region:"center",xtype:"form",height:"auto",width:"auto",items:[{xtype:"codemirror",id:"FNR-LANG-"+w,listeners:{scope:this,initialize:function(){this.getFile(w,this.userLang+n,p,"FNR-LANG-PANEL-","FNR-LANG-")},cmcursormove:function(B){var A=Ext.util.JSON.decode(Ext.getCmp("FNR-LANG-"+w).getCursorPosition());Ext.get("FNR-LANG-status-line-"+w).dom.innerHTML=A.line;Ext.get("FNR-LANG-status-col-"+w).dom.innerHTML=A.caracter},cmchange:function(D,B,C){var A=Ext.util.JSON.decode(Ext.getCmp("FNR-LANG-"+w).getCursorPosition());Ext.get("FNR-LANG-status-line-"+w).dom.innerHTML=A.line;Ext.get("FNR-LANG-status-col-"+w).dom.innerHTML=A.carac! ter;if(D!==27&&D!==33&&D!==34&&D!==37&&D!==38&&D!==39&&D!==40&&D!==17& &D!==16&&D!==67){if(!Ext.getCmp("FNR-"+w).isModifiedLang){Ext.getCmp("FNR-LANG-PANEL-"+w).setTitle(Ext.getCmp("FNR-LANG-PANEL-"+w).originTitle+' <span style="color:#ff0000; font-weight: bold;">[modified]</span>');Ext.getCmp("FNR-"+w).setTitle(Ext.getCmp("FNR-"+w).originTitle+' <t style="color:#ff0000; font-weight: bold;">*</t>');Ext.getCmp("FNR-LANG-PANEL-btn-save-"+w).enable();Ext.get("FNR-LANG-PANEL-btn-save-"+w).frame("3F8538");Ext.getCmp("FNR-LANG-PANEL-btn-saveas-"+w).enable();Ext.get("FNR-LANG-PANEL-btn-saveas-"+w).frame("3F8538");Ext.getCmp("FNR-"+w).isModifiedLang=true}}},cmscroll:function(A){if(this.userConf.conf_reviewed_scrollbars==="true"){Ext.getCmp("FNR-EN-"+w).scrollTo(A)}}}}],bbar:[{scope:this,xtype:"checkbox",hideLabel:true,checked:(this.userConf.conf_reviewed_scrollbars==="true")?true:false,boxLabel:"Synchronize scroll bars",name:"conf_reviewed_scrollbars",listeners:{scope:this,check:function(A){this.confUpdate("conf_reviewed_scrollbars",A.getValue())},rend! er:function(A){Ext.DomHelper.insertHtml("beforeBegin",A.el.dom,'<div style="display: inline;" class="x-statusbar"><span class="x-status-text-panel">Line: <span id="FNR-LANG-status-line-'+w+'">-</span></span> <span class="x-status-text-panel">Col: <span id="FNR-LANG-status-col-'+w+'">-</span></span></div> ')}}}],tbar:[{scope:this,tooltip:"<b>Save</b> this file",iconCls:"saveFile",id:"FNR-LANG-PANEL-btn-save-"+w,disabled:true,handler:function(){this.saveLangFile(w,n,p,"FNR",y,this)}},{scope:this,tooltip:"<b>Save as</b> a patch",iconCls:"saveAsFile",id:"FNR-LANG-PANEL-btn-saveas-"+w,disabled:true,handler:function(){this.savePatch(this.userLang,w,n,p,"FNR",this)}},"->",{tooltip:"<b>Re-indent</b> all this file",iconCls:"iconIndent",handler:function(){Ext.getCmp("FNR-LANG-"+w).reIndentAll()}},{tooltip:"Insert <b>Reviewed</b> tag",text:"Reviewed tag",iconCls:"iconInsertCode",handler:function(){Ext.getCmp("FNR-LANG-"+w).insertIntoLine(2,"end","\n<!-- Reviewed:! no -->");Ext.getCmp("FNR-LANG-"+w).focus()}},{tooltip:"Insert <b>Revc heck</b> tag",text:"Rev tag",iconCls:"iconInsertCode",handler:function(){Ext.getCmp("FNR-LANG-"+w).insertIntoLine(2,"end","\n<!-- EN-Revision: 1.XX Maintainer: "+this.userLoggin+" Status: ready -->");Ext.getCmp("FNR-LANG-"+w).focus()}}]},{title:"En File: "+n+p,originTitle:"En File: "+n+p,collapsible:false,id:"FNR-EN-PANEL-"+w,region:"east",xtype:"form",height:"auto",width:575,items:[{xtype:"codemirror",id:"FNR-EN-"+w,listeners:{scope:this,initialize:function(){this.getFile(w,"en"+n,p,"FNR-EN-PANEL-","FNR-EN-")},cmchange:function(D,B,C){var A=Ext.util.JSON.decode(Ext.getCmp("FNR-EN-"+w).getCursorPosition());Ext.get("FNR-EN-status-line-"+w).dom.innerHTML=A.line;Ext.get("FNR-EN-status-col-"+w).dom.innerHTML=A.caracter;if(D!==27&&D!==33&&D!==34&&D!==37&&D!==38&&D!==39&&D!==40&&D!==17&&D!==16&&D!==67){if(!Ext.getCmp("FNR-"+w).isModifiedEn){Ext.getCmp("FNR-EN-PANEL-"+w).setTitle(Ext.getCmp("FNR-EN-PANEL-"+w).originTitle+' <span style="color:#ff0000; font-weight: bold;">[modified]<! /span>');Ext.getCmp("FNR-"+w).setTitle(Ext.getCmp("FNR-"+w).originTitle+' <t style="color:#ff0000; font-weight: bold;">*</t>');Ext.getCmp("FNR-EN-PANEL-btn-save-"+w).enable();Ext.get("FNR-EN-PANEL-btn-save-"+w).frame("3F8538");Ext.getCmp("FNR-EN-PANEL-btn-saveas-"+w).enable();Ext.get("FNR-EN-PANEL-btn-saveas-"+w).frame("3F8538");Ext.getCmp("FNR-"+w).isModifiedEn=true}}},cmscroll:function(A){if(this.userConf.conf_reviewed_scrollbars==="true"){Ext.getCmp("FNR-LANG-"+w).scrollTo(A)}},cmcursormove:function(B){var A=Ext.util.JSON.decode(Ext.getCmp("FNR-EN-"+w).getCursorPosition());Ext.get("FNR-EN-status-line-"+w).dom.innerHTML=A.line;Ext.get("FNR-EN-status-col-"+w).dom.innerHTML=A.caracter}}}],bbar:[{scope:this,xtype:"panel",height:21,baseCls:"",bodyStyle:"padding-top:5px;",html:'<div style="display: inline;" class="x-statusbar"><span class="x-status-text-panel">Line: <span id="FNR-EN-status-line-'+w+'">-</span></span> <span class="x-status-text-panel">Col: <span id="! FNR-EN-status-col-'+w+'">-</span></span></div> '}],tbar:[{s cope:this,tooltip:"<b>Save</b> this file",iconCls:"saveFile",id:"FNR-EN-PANEL-btn-save-"+w,disabled:true,handler:function(){this.saveEnFile(w,n,p,"FNR",y,this)}},{scope:this,tooltip:"<b>Save as</b> a patch",iconCls:"saveAsFile",id:"FNR-EN-PANEL-btn-saveas-"+w,disabled:true,handler:function(){this.savePatch("en",w,n,p,"FNR",this)}},"->",{tooltip:"<b>Re-indent</b> all this file",iconCls:"iconIndent",handler:function(){Ext.getCmp("FNR-EN-"+w).reIndentAll()}}]}]});Ext.getCmp("main-panel").setActiveTab("FNR-"+w)}else{Ext.getCmp("main-panel").setActiveTab("FNR-"+w)}}}});g=new Ext.grid.GridPanel({title:"Summary",iconCls:"flag-"+this.userLang,store:this.storeSummary,loadMask:true,columns:[new Ext.grid.RowNumberer(),{id:"StatusType",header:"File status type",width:180,sortable:true,dataIndex:"libel"},{header:"Number of files",width:110,sortable:true,dataIndex:"nbFiles"},{header:"Percent of files",width:110,sortable:true,dataIndex:"percentFiles"},{header:"Size of files (kB)",width:110! ,sortable:true,dataIndex:"sizeFiles"},{header:"Percent of size",width:110,sortable:true,dataIndex:"percentSize"}],autoScroll:true,height:400,width:800,view:new Ext.grid.GridView({getRowClass:function(m,p,o,n){if(m.data.id===1){return"summary_1"}if(m.data.id===2){return"summary_2"}if(m.data.id===3){return"summary_3"}if(m.data.id===4){return"summary_4"}if(m.data.id===5){return"summary_5"}}}),listeners:{scope:this,render:function(m){m.store.load()}}});f=new Ext.grid.GridPanel({title:"Translators",iconCls:"iconTranslator",store:this.storeTranslators,loadMask:true,columns:[new Ext.grid.RowNumberer(),{id:"GridTransName",header:"Name",sortable:true,dataIndex:"name",summaryType:"count",summaryRenderer:this.rendererTotalTranslator},{header:"Email",width:110,sortable:true,dataIndex:"email"},{header:"Nick",width:70,sortable:true,dataIndex:"nick"},{header:"Cvs",width:45,sortable:true,dataIndex:"cvs"},{header:"UptoDate",width:60,sortable:true,renderer:this.rendererNumUptodate,dataIndex:! "uptodate",summaryType:"sum"},{header:"Old",width:45,sortable:true,ren derer:this.rendererSum,dataIndex:"old",summaryType:"sum"},{header:"Critical",width:60,sortable:true,renderer:this.rendererNumCritical,dataIndex:"critical",summaryType:"sum"},{header:"Sum",width:50,sortable:true,renderer:this.rendererSum,dataIndex:"sum",summaryType:"sum"}],plugins:[new Ext.ux.grid.GridSummary()],autoScroll:true,autoExpandColumn:"GridTransName",height:400,width:800,listeners:{scope:this,render:function(){this.storeTranslators.load()},rowdblclick:function(o,q,p){var m,n;o.getSelectionModel().selectRow(q);m=this.storeTranslators.getAt(q).data.email;n=this.storeTranslators.getAt(q).data.name;this.sendEmail(n,m)},rowcontextmenu:function(o,r,p){var m,n,q;o.getSelectionModel().selectRow(r);m=this.storeTranslators.getAt(r).data.email;n=this.storeTranslators.getAt(r).data.name;q=new Ext.menu.Menu({id:"submenu",items:[{scope:this,text:"<b>Send an email to "+n+"</b>",iconCls:"iconSendEmail",handler:function(){this.sendEmail(n,m)}},"-",{scope:this,text:"Send an email to ! the doc-"+this.userLang+"@lists.php.net",iconCls:"iconSendEmail",handler:function(){this.sendEmail("Php Doc Team "+this.userLang,"doc-"+this.userLang+"@lists.php.net")}}]});q.showAt(p.getXY())}}});i=new Ext.grid.GridPanel({store:this.storeMailing,title:"Mails from doc-"+this.userLang,iconCls:"home-mailing-title",loadMask:true,columns:[new Ext.grid.RowNumberer(),{id:"GridMailingTitle",header:"Title",sortable:true,dataIndex:"title"},{header:"By",width:110,sortable:true,dataIndex:"description"},{header:"Date",width:140,sortable:true,dataIndex:"pubDate",renderer:Ext.util.Format.dateRenderer("Y/m/d, H:i")}],autoScroll:true,height:400,width:800,autoExpandColumn:"GridMailingTitle",sm:new Ext.grid.RowSelectionModel({singleSelect:true}),tbar:[{scope:this,tooltip:"Refresh this grid",iconCls:"refresh",handler:function(){this.storeMailing.reload()}}],listeners:{scope:this,render:function(){this.storeMailing.load()},rowcontextmenu:function(m,p,n){var o;m.getSelectionModel().selectRow(p)! ;o=new Ext.menu.Menu({id:"submenu",items:[{text:"<b>Open in a new Tab< /b>",iconCls:"openInTab",scope:this,handler:function(){i.fireEvent("rowdblclick",m,p,n)}},"-",{text:"Refresh this grid",iconCls:"refresh",scope:this,handler:function(){this.storeMailing.reload()}}]});o.showAt(n.getXY())},rowdblclick:function(n,r,p){var m,q,o;m=this.storeMailing.getAt(r).data.pubDate;q=this.storeMailing.getAt(r).data.link;o=this.storeMailing.getAt(r).data.title;this.NewTabMailing(m,q,o)}}});e=new Ext.grid.GridPanel({store:this.storeBugs,title:"Open bugs for doc-"+this.userLang,iconCls:"iconBugs",loadMask:true,columns:[{id:"GridBugTitle",header:"Title",sortable:true,dataIndex:"title"}],stripeRows:true,autoHeight:true,viewConfig:{emptyText:"No open Bugs",forceFit:true,enableRowBody:true,getRowClass:function(m,q,o,n){o.body='<p class="bug-desc">'+m.data.description+"</p>";return"x-grid3-row-expanded"}},autoExpandColumn:"GridBugTitle",sm:new Ext.grid.RowSelectionModel({singleSelect:true}),width:800,tbar:[{scope:this,tooltip:"Refresh this grid",iconCls:"refresh",h! andler:function(){this.storeBugs.reload()}}],listeners:{scope:this,render:function(){this.storeBugs.load()},rowcontextmenu:function(m,p,n){var o;m.getSelectionModel().selectRow(p);o=new Ext.menu.Menu({id:"submenu",items:[{text:"<b>Open in a new Tab</b>",iconCls:"openInTab",scope:this,handler:function(){e.fireEvent("rowdblclick",m,p,n)}},"-",{text:"Refresh this grid",iconCls:"refresh",scope:this,handler:function(){this.storeBugs.reload()}}]});o.showAt(n.getXY())},rowdblclick:function(o,r,q){var m,n,p;m=this.storeBugs.getAt(r).data.id;n=this.storeBugs.getAt(r).data.link;p=this.storeBugs.getAt(r).data.title;this.NewTabBugs(m,n,p)}}});k={title:"Graphics",layout:"fit",autoHeight:true,iconCls:"home-graphic-title",html:'<div align="center" id="graph_container" style="width: 530px; height: 302px"><img id="graph_picture" src="" height="300"></div>',listeners:{afterlayout:function(){var m,o,n;m=Ext.get("graph_picture");o=Ext.get("graph_container");m.setVisibilityMode(Ext.Element.VISI! BILITY);n=new Ext.LoadMask(o);m.on("load",function(){m.stopFx();n.hide ();m.fadeIn({duration:2})});n.show();m.hide();m.dom.src="/php/image_info.php"}}};this.treeAllFiles=new Ext.tree.TreePanel({animate:true,autoScroll:true,useArrows:true,loader:new Ext.tree.TreeLoader({dataUrl:"./php/controler.php",baseParams:{task:"getAllFiles"}}),enableDD:false,containerScroll:true,bodyBorder:false,listeners:{scope:this,dblclick:function(q,v){var n,m,w,y,u,r,p,o,s,x;if(q.attributes.type==="file"){n=q.attributes.text;m=q.attributes.id;w=Ext.util.md5("AF-"+m+n);if(!Ext.getCmp("main-panel").findById("AF-"+w)){y=m.split("/");y.shift();y.shift();y.pop();m=y.join("/")+"/";u="xml";if(q.attributes.extension==="xml"){u="xml"}if(q.attributes.extension==="html"){u="html"}if(q.attributes.extension==="php"){u="php"}r=new Ext.data.Store({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controler.php"}),baseParams:{task:"get-log",Path:m,File:n},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"revision",mappi! ng:"revision"},{name:"date",mapping:"date",type:"date",dateFormat:"Y/m/d H:i:s"},{name:"author",mapping:"author"},{name:"content",mapping:"content"}])});r.setDefaultSort("date","desc");p=new Ext.grid.CheckboxSelectionModel({singleSelect:false,width:22,header:"",listeners:{beforerowselect:function(z){var t=z.getCount();if(t===2){return false}},rowselect:function(z){var t=z.getCount();if(t===2){Ext.getCmp("AF-PANEL-btn-log-"+w).enable();Ext.get("AF-PANEL-btn-log-"+w).frame("3F8538")}else{Ext.getCmp("AF-PANEL-btn-log-"+w).disable()}},rowdeselect:function(z){var t=z.getCount();if(t===2){Ext.getCmp("AF-PANEL-btn-log-"+w).enable();Ext.get("AF-PANEL-btn-log-"+w).frame("3F8538")}else{Ext.getCmp("AF-PANEL-btn-log-"+w).disable()}}}});o=new Ext.grid.GridPanel({store:r,id:"AF-PANEL-log-"+w,loadMask:true,columns:[p,{id:"id",header:"Rev.",width:40,sortable:false,dataIndex:"revision"},{header:"Content",width:130,sortable:true,dataIndex:"content"},{header:"By",width:50,sortable:true,dataIn! dex:"author"},{header:"Date",width:85,sortable:true,dataIndex:"date",r enderer:Ext.util.Format.dateRenderer("Y/m/d, H:i")}],autoHeight:true,autoExpandColumn:"content",bodyBorder:false,sm:p,view:new Ext.grid.GridView({forceFit:true}),tbar:[{scope:this,tooltip:"<b>View</b> the diff",iconCls:"iconViewDiff",id:"AF-PANEL-btn-log-"+w,disabled:true,handler:function(){var A,z,t;A=p.getSelections();z=A[0].data.revision;t=A[1].data.revision;this.winDiff(m,n,z,t)}}]});s={region:"west",xtype:"panel",layout:"fit",bodyBorder:false,title:"CvsLog",collapsed:true,width:375,items:{scope:this,xtype:"tabpanel",activeTab:0,tabPosition:"bottom",defaults:{autoScroll:true},items:[{layout:"fit",title:"Log",items:[o]}]}};x={title:"File: "+m+n,originTitle:"File: "+m+n,collapsible:false,id:"AF-PANEL-"+w,region:"center",xtype:"form",height:"auto",width:"auto",items:[{xtype:"codemirror",id:"AF-FILE-"+w,isModified:false,parser:u,listeners:{scope:this,initialize:function(){this.getFile(w,m,n,"AF-PANEL-","AF-FILE-")},cmchange:function(B,z,A){var t=Ext.util.JSON.decode(Ext.getC! mp("AF-FILE-"+w).getCursorPosition());Ext.get("AF-status-line-"+w).dom.innerHTML=t.line;Ext.get("AF-status-col-"+w).dom.innerHTML=t.caracter;if(B!==27&&B!==33&&B!==34&&B!==37&&B!==38&&B!==39&&B!==40&&B!==17&&B!==16&&B!==67){if(!Ext.getCmp("AF-FILE-"+w).isModified){Ext.getCmp("AF-PANEL-"+w).setTitle(Ext.getCmp("AF-PANEL-"+w).originTitle+' <span style="color:#ff0000; font-weight: bold;">[modified]</span>');Ext.getCmp("AF-"+w).setTitle(Ext.getCmp("AF-"+w).originTitle+' <t style="color:#ff0000; font-weight: bold;">*</t>');Ext.getCmp("AF-PANEL-btn-save-"+w).enable();Ext.get("AF-PANEL-btn-save-"+w).frame("3F8538");Ext.getCmp("AF-PANEL-btn-saveas-"+w).enable();Ext.get("AF-PANEL-btn-saveas-"+w).frame("3F8538");Ext.getCmp("AF-FILE-"+w).isModified=true}}},cmcursormove:function(){var t=Ext.util.JSON.decode(Ext.getCmp("AF-FILE-"+w).getCursorPosition());Ext.get("AF-status-line-"+w).dom.innerHTML=t.line;Ext.get("AF-status-col-"+w).dom.innerHTML=t.caracter}}}],bbar:[{scope:this,xtype:"pan! el",height:21,baseCls:"",bodyStyle:"padding-top:5px;",html:'<div style ="display: inline;" class="x-statusbar"><span class="x-status-text-panel">Line: <span id="AF-status-line-'+w+'">-</span></span> <span class="x-status-text-panel">Col: <span id="AF-status-col-'+w+'">-</span></span></div> '}],tbar:[{scope:this,tooltip:"<b>Save</b> this file",iconCls:"saveFile",id:"AF-PANEL-btn-save-"+w,disabled:true,handler:function(){Ext.getCmp("AF-PANEL-btn-save-"+w).disable();Ext.getCmp("AF-FILE-"+w).isModified=false;Ext.getCmp("AF-PANEL-"+w).setTitle(Ext.getCmp("AF-PANEL-"+w).originTitle);Ext.getCmp("AF-"+w).setTitle(Ext.getCmp("AF-"+w).originTitle);var t=Ext.MessageBox.wait("Saving data...");Ext.Ajax.request({scope:this,url:"../php/controler.php",params:{task:"save-file",filePath:m,fileName:n,fileLang:"all",fileContent:Ext.getCmp("AF-FILE-"+w).getCode()},success:function(A,z){var B=Ext.util.JSON.decode(A.responseText);if(B.success){this.addToPendingCommit(m,n);t.hide()}}})}},{scope:this,tooltip:"<b>Save as</b> a patch",iconCls:"saveA! sFile",id:"AF-PANEL-btn-saveas-"+w,disabled:true,handler:function(){this.savePatch("all",w,m,n,"AF",this)}},"->",{tooltip:"<b>Re-indent</b> all this file",iconCls:"iconIndent",handler:function(){Ext.getCmp("AF-FILE-"+w).reIndentAll()}}]};if(q.attributes.extension==="gif"||q.attributes.extension==="png"){x={xtype:"panel",layout:"fit",bodyStyle:"padding:5px 5px 0",html:'<img src="/data/'+this.userLoggin+"/phpdoc-"+this.userLang+m+'" />'};s={}}Ext.getCmp("main-panel").add({closable:true,title:n,originTitle:n,tabTip:"in "+m,iconCls:"AllFiles",id:"AF-"+w,layout:"border",defaults:{collapsible:true,split:true},items:[x,s]});Ext.getCmp("main-panel").setActiveTab("AF-"+w)}else{Ext.getCmp("main-panel").setActiveTab("AF-"+w)}}}}});this.treeSort=new Ext.tree.TreeSorter(this.treeAllFiles,{folderSort:true});this.treeAllFilesRoot=new Ext.tree.AsyncTreeNode({text:"Repository",draggable:false,id:"/"});this.treeAllFiles.setRootNode(this.treeAllFilesRoot);b=new Ext.menu.Menu({id:"mainMenu",it! ems:[{scope:this,text:"Refresh all data",iconCls:"refresh",tooltip:"<b >Refresh all data</b><br>Cvs update & apply all tools",handler:this.WinUpdate},{scope:this,text:"Check Build",iconCls:"checkBuild",tooltip:"<b>Check your build</b> using configure.php script",handler:this.WinCheckBuild},"-",{scope:this,text:"Configure",iconCls:"iconConf",tooltip:"<b>Configure</b> this tool",id:"winconf-btn",handler:this.WinConf},"-",{scope:this,text:"Erase my personal data",iconCls:"iconErasePersonalData",tooltip:"<b>Log out</b>",handler:function(){Ext.MessageBox.confirm("Confirm","This action will erase your personal data. All content about this account will be deleted definitively. Are you sure you want to do that ?",function(m){if(m==="yes"){Ext.getBody().mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Please, wait...');Ext.Ajax.request({url:"./php/controler.php",params:{task:"erase-personal-data"},success:function(n){Ext.getBody().unmask();var p=Ext.util.JSON.decode(n.responseText);if(p.success){Ext.MessageBox.show({title:"Thanks !",! msg:"Thank you for using this application !",icon:Ext.MessageBox.INFO,buttons:Ext.MessageBox.OK,fn:function(){window.location.href="/logout.php"}})}}})}})}},"-",{text:"Log out",iconCls:"iconLogOut",tooltip:"<b>Log out</b>",handler:function(){Ext.MessageBox.confirm("Confirm","Are you sure you want to logout?",function(m){if(m==="yes"){window.location.href="/logout.php"}})}},"-",{scope:this,text:"About",iconCls:"iconHelp",tooltip:"<b>About</b><br/>"+this.appName,id:"winabout-btn",handler:function(){this.WinAbout()}}]});d=new Ext.Viewport({layout:"border",items:[{region:"north",html:'<h1 class="x-panel-header"><img src="/img/mini_php.png" style="vertical-align: middle;" /> '+this.appName+"</h1>",autoHeight:true,border:false,margins:"0 0 5 0"},{region:"west",collapsible:true,collapseMode:"mini",animate:true,split:true,layout:"fit",width:300,autoScroll:true,items:[{layout:"accordion",animate:true,bodyBorder:false,border:false,tbar:[{text:"Main Menu",iconCls:"MainMenu"! ,menu:b}],items:[{title:'Files Need Update - <em id="acc-need-update-n b">0</em>',id:"acc-need-update",layout:"fit",iconCls:"FilesNeedUpdate",items:[l],collapsed:true},{title:'Error in current translation - <em id="acc-error-nb">0</em>',id:"acc-error",layout:"fit",iconCls:"FilesError",items:[j],collapsed:true},{title:'Files Need Reviewed - <em id="acc-need-reviewed-nb">0</em>',id:"acc-need-reviewed",layout:"fit",iconCls:"FilesNeedReviewed",items:[h],collapsed:true},{title:"All files",id:"acc-all-files",layout:"fit",iconCls:"AllFiles",items:[this.treeAllFiles],collapsed:true},{title:'Pending for commit - <em id="acc-pendingCommit-nb">0</em>',id:"acc-need-pendingCommit",layout:"fit",iconCls:"PendingCommit",items:[c],collapsed:true},{title:'Pending Patch - <em id="acc-pendingPatch-nb">0</em>',id:"acc-need-pendingPatch",layout:"fit",iconCls:"PendingPatch",items:[a],collapsed:true}]}]},{region:"center",xtype:"tabpanel",id:"main-panel",activeTab:0,enableTabScroll:true,plugins:new Ext.ux.TabCloseMenu(),listeners:{scope:this,beforeremove:this.removeTab! Event},items:[{title:"Home",baseCls:"MainInfoTabPanel",xtype:"panel",autoScroll:true,id:"MainInfoTabPanel",plain:true,items:[{xtype:"panel",border:false,html:'<div class="res-block"><div class="res-block-inner"><h3>Connected as <em>'+this.userLoggin+"</em></h3></div></div>"},{xtype:"tabpanel",activeTab:0,plain:true,autoScroll:true,height:400,border:false,defaults:{border:true},items:[g,f,i,e,k]}]}]}]})}}}();Ext.EventManager.onDocumentReady(phpDoc.init,phpDoc,true); \ No newline at end of file +var phpDoc=function(){Ext.QuickTips.init();Ext.BLANK_IMAGE_URL="/extjs/resources/images/default/s.gif";return{TaskPing:"",storeCommitLogMessage:"",storeFilesError:"",storeFilesNeedUpdate:"",storeFilesNeedReviewed:"",storePendingCommit:"",storePendingPatch:"",storeMailing:"",storeBugs:"",storeTranslators:"",storeSummary:"",userLoggin:"",userLang:"",appName:"PhpDocumentation Online Editor",appVer:"0.2",userConf:{conf_needupdate_diff:"using-exec",conf_needupdate_scrollbars:true,conf_error_skipnbliteraltag:true,conf_error_scrollbars:true,conf_reviewed_scrollbars:true,conf_patch_scrollbars:true,conf_theme:"xtheme-default.css"},treeAllFiles:"",treeSort:"",treeAllFilesRoot:"",filePendingOpen:"",init:function(){Ext.getBody().on("contextmenu",function(a){a.stopEvent()},this);Ext.Ajax.request({scope:this,url:"./php/controller.php",params:{task:"get-conf"},success:function(a){var b=Ext.util.JSON.decode(a.responseText);if(b.success){this.userLoggin=b.mess.userLoggin;this.userLang=b.mes! s.userLang;this.userConf.conf_needupdate_diff=b.mess.userConf.conf_needupdate_diff;this.userConf.conf_needupdate_scrollbars=b.mess.userConf.conf_needupdate_scrollbars;this.userConf.conf_error_skipnbliteraltag=b.mess.userConf.conf_error_skipnbliteraltag;this.userConf.conf_error_scrollbars=b.mess.userConf.conf_error_scrollbars;this.userConf.conf_reviewed_scrollbars=b.mess.userConf.conf_reviewed_scrollbars;this.userConf.conf_theme=b.mess.userConf.conf_theme;Ext.util.CSS.swapStyleSheet("appTheme",this.userConf.conf_theme);this.loadDataStore();this.drawInterface()}}})},loadDataStore:function(){this.storeCommitLogMessage=new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:"/php/controller.php"}),baseParams:{task:"get-commit-log-message"},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"text",mapping:"text"}])});this.storeFilesError=new Ext.data.GroupingStore({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/cont! roller.php"}),baseParams:{task:"GetFilesError"},reader:new Ext.data.Js onReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"path",mapping:"path"},{name:"name",mapping:"name"},{name:"maintainer",mapping:"maintainer"},{name:"type",mapping:"type"},{name:"value_en",mapping:"value_en"},{name:"value_lang",mapping:"value_lang"},{name:"needcommit",mapping:"needcommit"}]),sortInfo:{field:"path",direction:"ASC"},groupField:"path",listeners:{datachanged:function(a){Ext.getDom("acc-error-nb").innerHTML=a.getCount()}}});this.storeFilesNeedUpdate=new Ext.data.GroupingStore({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controller.php"}),baseParams:{task:"GetFilesNeedUpdate"},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"path",mapping:"path"},{name:"name",mapping:"name"},{name:"revision",mapping:"revision"},{name:"en_revision",mapping:"en_revision"},{name:"maintainer",mapping:"maintainer"},{name:"needcommit",mapping:"needcommit"},{name:"isCritical",map! ping:"isCritical"}]),sortInfo:{field:"path",direction:"ASC"},groupField:"path",listeners:{datachanged:function(a){Ext.getDom("acc-need-update-nb").innerHTML=a.getCount()}}});this.storePendingCommit=new Ext.data.GroupingStore({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controller.php"}),baseParams:{task:"GetFilesPendingCommit"},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"path",mapping:"path"},{name:"name",mapping:"name"},{name:"by",mapping:"by"},{name:"date",mapping:"date"}]),sortInfo:{field:"path",direction:"ASC"},groupField:"path",listeners:{datachanged:function(a){Ext.getDom("acc-pendingCommit-nb").innerHTML=a.getCount()},add:function(a){Ext.getDom("acc-pendingCommit-nb").innerHTML=a.getCount()}}});this.storePendingPatch=new Ext.data.GroupingStore({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controller.php"}),baseParams:{task:"GetFilesPendingPatch"},reader:new Ext.data.JsonReader({root! :"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{n ame:"path",mapping:"path"},{name:"name",mapping:"name"},{name:"by",mapping:"by"},{name:"uniqID",mapping:"uniqID"},{name:"date",mapping:"date"}]),sortInfo:{field:"path",direction:"ASC"},groupField:"path",listeners:{datachanged:function(a){Ext.getDom("acc-pendingPatch-nb").innerHTML=a.getCount()},add:function(a){Ext.getDom("acc-pendingPatch-nb").innerHTML=a.getCount()}}});this.storeFilesNeedReviewed=new Ext.data.GroupingStore({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controller.php"}),baseParams:{task:"GetFilesNeedReviewed"},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"path",mapping:"path"},{name:"name",mapping:"name"},{name:"reviewed",mapping:"reviewed"},{name:"maintainer",mapping:"maintainer"},{name:"needcommit",mapping:"needcommit"}]),sortInfo:{field:"path",direction:"ASC"},groupField:"path",listeners:{datachanged:function(a){Ext.getDom("acc-need-reviewed-nb").innerHTML=a.getCount()}}});this.stor! eMailing=new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:"/php/controller.php"}),baseParams:{task:"get-mailing-info"},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"title",mapping:"title"},{name:"link",mapping:"link"},{name:"description",mapping:"description"},{name:"pubDate",mapping:"pubDate",type:"date",dateFormat:"Y/m/d H:i:s"}])});this.storeMailing.setDefaultSort("pubDate","desc");this.storeBugs=new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:"/php/controller.php"}),baseParams:{task:"get-open-bugs"},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"title",mapping:"title"},{name:"link",mapping:"link"},{name:"description",mapping:"description"}])});this.storeTranslators=new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:"/php/controller.php"}),baseParams:{task:"get-translator-info"},reader:new Ext.data.JsonReader({root:"Items",totalPr! operty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"name",mappi ng:"name"},{name:"email",mapping:"mail"},{name:"nick",mapping:"nick"},{name:"cvs",mapping:"cvs"},{name:"uptodate",mapping:"uptodate",type:"int"},{name:"old",mapping:"old",type:"int"},{name:"critical",mapping:"critical",type:"int"},{name:"sum",mapping:"sum",type:"int"}])});this.storeTranslators.setDefaultSort("nick","asc");this.storeSummary=new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:"/php/controller.php"}),baseParams:{task:"get-summary-info"},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"libel",mapping:"libel"},{name:"nbFiles",mapping:"nbFiles"},{name:"percentFiles",mapping:"percentFiles"},{name:"sizeFiles",mapping:"sizeFiles"},{name:"percentSize",mapping:"percentSize"}])})},openFile:function(d,a){Ext.getCmp("acc-all-files").expand();var c=d.split("/");function b(f,e){f.expand(false,true,function(h){var g;h.ensureVisible();if(c[0]&&c[0]!==""){for(g=0;g<h.childNodes.length;g=g+1){if(h.childNodes[g].tex! t===c[0]){c.shift();b(h.childNodes[g],e)}}}else{for(g=0;g<h.childNodes.length;g=g+1){if(h.childNodes[g].text===a){h.childNodes[g].ensureVisible();h.childNodes[g].ui.highlight();e.treeAllFiles.fireEvent("dblclick",h.childNodes[g])}}}})}b(this.treeAllFilesRoot,this)},rejectPatch:function(f,d,a,e,g,c){function b(h){if(h==="yes"){var i=Ext.MessageBox.wait("Please, wait...");Ext.Ajax.request({scope:c,url:"../php/controller.php",params:{task:"after-patch-reject",PatchUniqID:e},success:function(){this.storePendingPatch.remove(this.storePendingPatch.getAt(g));this.storePendingPatch.fireEvent("add",this.storePendingPatch);Ext.getCmp("main-panel").remove("PP-"+f);i.hide()}})}}Ext.MessageBox.confirm("Confirm","This action will <b>reject</b> this patch, send an email to his author and close this tab.",b,c)},saveFileViaPatch:function(e,c,a,d,g,b){function f(h){if(h==="yes"){Ext.getCmp("PP-PATCH-PANEL-btn-save-"+e).disable();Ext.getCmp("PP-PATCH-"+e).isModified=false;Ext.getCmp("PP-PATCH! -PANEL-"+e).setTitle(Ext.getCmp("PP-PATCH-PANEL-"+e).originTitle);Ext. getCmp("PP-"+e).setTitle(Ext.getCmp("PP-"+e).originTitle);var i=Ext.MessageBox.wait("Saving data...");Ext.Ajax.request({scope:b,url:"../php/controller.php",params:{task:"save-file",filePath:c,fileName:a,fileLang:"all",fileContent:Ext.getCmp("PP-PATCH-"+e).getCode()},success:function(k,j){var l=Ext.util.JSON.decode(k.responseText);if(l.success){this.addToPendingCommit(c,a);this.storePendingPatch.remove(this.storePendingPatch.getAt(g));this.storePendingPatch.fireEvent("add",this.storePendingPatch);Ext.Ajax.request({scope:b,url:"../php/controller.php",params:{task:"after-patch-accept",PatchUniqID:d}});i.hide();Ext.getCmp("main-panel").remove("PP-"+e)}}})}}Ext.MessageBox.confirm("Confirm","This action will accept this patch, send an email to his author, save the file and close this tab.",f,b)},saveEnFile:function(e,c,a,d,g,b){Ext.getCmp(d+"-EN-PANEL-btn-save-"+e).disable();Ext.getCmp(d+"-"+e).isModifiedEn=false;Ext.getCmp(d+"-EN-PANEL-"+e).setTitle(Ext.getCmp(d+"-EN-PANEL-"+e).o! riginTitle);if(!Ext.getCmp(d+"-"+e).isModifiedEn&&!Ext.getCmp(d+"-"+e).isModifiedLang){Ext.getCmp(d+"-"+e).setTitle(Ext.getCmp(d+"-"+e).originTitle)}var f=Ext.MessageBox.wait("Saving data...");Ext.Ajax.request({scope:b,url:"../php/controller.php",params:{task:"save-file",filePath:c,fileName:a,fileLang:"en",fileContent:Ext.getCmp(d+"-EN-"+e).getCode()},success:function(i,h){var j=Ext.util.JSON.decode(i.responseText);if(j.success){if(d==="FNU"){this.storeFilesNeedUpdate.getAt(g).set("en_revision","1."+j.en_revision);this.storeFilesNeedUpdate.getAt(g).set("needcommit",true)}if(d==="FE"){this.storeFilesError.getAt(g).set("needcommit",true)}if(d==="FNR"){this.storeFilesNeedReviewed.getAt(g).set("needcommit",true)}this.addToPendingCommit("en"+c,a);f.hide()}}})},savePatch:function(d,g,a,c,h,i){var b,f,e;if(d==="en"){b="-EN"}else{if(d==="all"){b=""}else{b="-LANG"}}if(i.userLoggin!=="cvsread"){f=i.userLoggin+"@php.net"}e=new Ext.Window({title:"Do you want to be alerted ?",iconCls:"p! atchAlert",width:350,height:150,resizable:false,modal:true,autoScroll: true,bodyStyle:"padding: 5px;",layout:"form",labelWidth:50,items:[{xtype:"panel",baseCls:"x-plain",bodyStyle:"padding-bottom: 10px;",html:"If you want to be notified when your patch will be dealt with, thank you to leave an email address below."},{xtype:"textfield",fieldLabel:"Email",name:"patch-email-alert",anchor:"100%",value:f}],buttons:[{text:"Save",handler:function(){var j,k;j=this.ownerCt.items.items[1].getValue();k=Ext.MessageBox.wait("Saving data as a patch...");e.close();if(d!=="all"){Ext.getCmp(h+b+"-PANEL-btn-saveas-"+g).disable();Ext.getCmp(h+b+"-"+g).isModifiedLang=false;Ext.getCmp(h+b+"-PANEL-"+g).setTitle(Ext.getCmp(h+b+"-PANEL-"+g).originTitle);Ext.getCmp(h+"-"+g).setTitle(Ext.getCmp(h+"-"+g).originTitle)}else{Ext.getCmp("AF-PANEL-btn-saveas-"+g).disable();Ext.getCmp("AF-FILE-"+g).isModified=false;Ext.getCmp("AF-PANEL-"+g).setTitle(Ext.getCmp("AF-PANEL-"+g).originTitle);Ext.getCmp("AF-"+g).setTitle(Ext.getCmp("AF-"+g).originTitle)}Ext.Ajax.request({scope:i,ur! l:"../php/controller.php",params:{task:"save-file",filePath:a,fileName:c,fileLang:d,fileContent:(d!=="all")?Ext.getCmp(h+b+"-"+g).getCode():Ext.getCmp("AF-FILE-"+g).getCode(),type:"patch",emailAlert:j},success:function(m,l){var n=Ext.util.JSON.decode(m.responseText);if(n.success){if(d!=="all"){this.addToPendingPatch(d+a,c,n.uniqID)}else{this.addToPendingPatch(a,c,n.uniqID)}k.hide()}}})}},{text:"Cancel",handler:function(){e.close()}}]});e.show()},saveLangFile:function(f,d,b,e,g,c){function a(h){if(h==="no"){Ext.getCmp(e+"-LANG-PANEL-btn-save-"+f).disable();Ext.getCmp(e+"-"+f).isModifiedLang=false;Ext.getCmp(e+"-LANG-PANEL-"+f).setTitle(Ext.getCmp(e+"-LANG-PANEL-"+f).originTitle);if(!Ext.getCmp(e+"-"+f).isModifiedEn&&!Ext.getCmp(e+"-"+f).isModifiedLang){Ext.getCmp(e+"-"+f).setTitle(Ext.getCmp(e+"-"+f).originTitle)}var i=Ext.MessageBox.wait("Saving data...");Ext.Ajax.request({scope:this,url:"../php/controller.php",params:{task:"save-file",filePath:d,fileName:b,fileLang:this.us! erLang,fileContent:Ext.getCmp(e+"-LANG-"+f).getCode()},success:functio n(k,j){var l=Ext.util.JSON.decode(k.responseText);if(l.success){if(e==="FE"){this.storeFilesError.getAt(g).set("needcommit",true);this.storeFilesError.getAt(g).set("maintainer",l.maintainer)}if(e==="FNU"){this.storeFilesNeedUpdate.getAt(g).set("revision","1."+l.new_revision);this.storeFilesNeedUpdate.getAt(g).set("needcommit",true);this.storeFilesNeedUpdate.getAt(g).set("maintainer",l.maintainer)}if(e==="FNR"){this.storeFilesNeedReviewed.getAt(g).set("needcommit",true);this.storeFilesNeedReviewed.getAt(g).set("maintainer",l.maintainer);this.storeFilesNeedReviewed.getAt(g).set("reviewed",l.reviewed)}this.addToPendingCommit(this.userLang+d,b);i.hide()}}})}else{if(h==="yes"){Ext.getBody().mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Checking for error. Please, wait...');Ext.getCmp(e+"-LANG-PANEL-btn-save-"+f).disable();Ext.getCmp(e+"-"+f).isModifiedLang=false;Ext.getCmp(e+"-LANG-PANEL-"+f).setTitle(Ext.getCmp(e+"-LANG-PANEL-"+f).originTitle);if(!Ext.getC! mp(e+"-"+f).isModifiedEn&&!Ext.getCmp(e+"-"+f).isModifiedLang){Ext.getCmp(e+"-"+f).setTitle(Ext.getCmp(e+"-"+f).originTitle)}Ext.Ajax.request({scope:this,url:"../php/controller.php",params:{task:"check-file-error",FilePath:d,FileName:b,FileLang:this.userLang,FileContent:Ext.getCmp(e+"-LANG-"+f).getCode()},success:function(k,j){Ext.getBody().unmask();var l=Ext.util.JSON.decode(k.responseText);if(l.success){if(l.error&&l.error_first!=="-No error-"){Ext.getCmp("main-panel").add({closable:true,title:"Error in "+b,iconCls:"FilesError",id:"FE-help-"+f,autoScroll:true,autoLoad:"/error_type.php?dir="+d+"&file="+b});Ext.getCmp("main-panel").setActiveTab("FE-help-"+f);this.storeFilesError.reload()}else{Ext.MessageBox.show({title:"Check for errors",msg:"There is no error.",buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.INFO})}Ext.Ajax.request({scope:this,url:"../php/controller.php",params:{task:"save-file",filePath:d,fileName:b,fileLang:this.userLang,fileContent:Ext.getCmp(e+"-LANG-"+f! ).getCode()},success:function(n,m){var p=Ext.util.JSON.decode(n.respon seText);if(p.success){if(e==="FE"){this.storeFilesError.getAt(g).set("needcommit",true);this.storeFilesError.getAt(g).set("maintainer",p.maintainer)}if(e==="FNU"){this.storeFilesNeedUpdate.getAt(g).set("revision","1."+p.new_revision);this.storeFilesNeedUpdate.getAt(g).set("needcommit",true);this.storeFilesNeedUpdate.getAt(g).set("maintainer",p.maintainer)}if(e==="FNR"){this.storeFilesNeedReviewed.getAt(g).set("needcommit",true);this.storeFilesNeedReviewed.getAt(g).set("maintainer",p.maintainer);this.storeFilesNeedReviewed.getAt(g).set("reviewed",p.reviewed)}this.addToPendingCommit(this.userLang+d,b)}}});if(e==="FE"){Ext.getCmp(e+"-error-type-"+f).setSrc("/error_type.php?dir="+d+"&file="+b+"&nocache="+new Date().getTime())}}}})}}}Ext.MessageBox.show({scope:c,title:"Confirm",msg:"Do you want to check for error before saving ?",icon:Ext.MessageBox.INFO,buttons:Ext.MessageBox.YESNOCANCEL,fn:a})},getFile:function(e,d,a,c,b){Ext.get(c+e).mask('<img src="/img/loading.gif" style="ve! rtical-align: middle;" /> Loading...');Ext.Ajax.request({scope:this,url:"../php/controller.php",params:{task:"get-file",FilePath:d,FileName:a},success:function(h,g){var i,f;i=Ext.util.JSON.decode(h.responseText);if(i.success){Ext.getCmp(b+e).setCode(i.content);Ext.get(c+e).unmask();if(c==="FE-LANG-PANEL-"||c==="FNR-LANG-PANEL-"||c==="FNR-EN-PANEL-"||c==="AF-PANEL-"){f=Ext.getCmp(c+e).getSize();f.height=f.height+1;Ext.getCmp(c+e).setSize(f);Ext.getCmp(c+e).fireEvent("resize")}}},callback:function(){if(this.filePendingOpen[0]){this.filePendingOpen.shift();if(this.filePendingOpen[0]){if(this.filePendingOpen[0][0]){this.openFile(this.filePendingOpen[0][0],this.filePendingOpen[0][1])}}}}})},addToPendingPatch:function(b,a,e){var d,c;d=new Date();c=new this.storePendingPatch.recordType({id:Ext.id("",""),path:b,name:a,by:this.userLoggin,uniqID:e,date:d.format("Y-m-d H:i:s")});this.storePendingPatch.insert(0,c)},addToPendingCommit:function(d,a){var c,e,b;c=false;this.storePendingCom! mit.each(function(f){if(f.data.path===d&&f.data.name===a){c=true}});if (!c){e=new Date();b=new this.storePendingCommit.recordType({id:Ext.id("",""),path:d,name:a,by:this.userLoggin,date:e.format("Y-m-d H:i:s")});this.storePendingCommit.insert(0,b)}},rendererNumUptodate:function(a){if(a==="0"){return}else{return'<span style="color:green; font-weight: bold;">'+a+"</span>"}},rendererNumCritical:function(a){if(a==="0"){return}else{return'<span style="color:red; font-weight: bold;">'+a+"</span>"}},rendererTotalTranslator:function(a,c,b){return a?((a===0||a>1)?"("+a+" Translators)":"(1 Translator)"):""},rendererSum:function(a){return(a==="0")?"":a},NewTabBugs:function(a,b,c){Ext.getCmp("main-panel").add({xtype:"iframepanel",id:"mifp_bugs_"+a,title:"Loading...",tabTip:c,iconCls:"iconBugs",loadMask:true,defaultSrc:b,listeners:{documentloaded:function(d){d.ownerCt.setTitle(Ext.util.Format.substr(c,0,20)+"...")}}});Ext.getCmp("main-panel").setActiveTab("mifp_bugs_"+a)},NewTabMailing:function(a,c,b){Ext.getCmp("main-panel").add({xtype:"iframepanel",id:"mi! fp_"+a,title:"Loading...",tabTip:b,iconCls:"home-mailing-title",loadMask:true,defaultSrc:c,listeners:{documentloaded:function(d){d.ownerCt.setTitle(Ext.util.Format.substr(b,0,20)+"...")}}});Ext.getCmp("main-panel").setActiveTab("mifp_"+a)},winDiff:function(d,b,c,a){Ext.getBody().mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Finding the diff. Please, wait...');Ext.Ajax.request({url:"./php/controller.php",params:{task:"get-diff2",FilePath:d,FileName:b,Rev1:c,Rev2:a},success:function(f){var g,e;g=Ext.util.JSON.decode(f.responseText);if(g.success){Ext.getBody().unmask();e=new Ext.Window({title:"Diff between "+c+" & "+a,width:650,height:350,resizable:false,modal:true,autoScroll:true,bodyStyle:"background-color: white; padding: 5px;",html:'<div class="diff-content">'+g.content+"</div>",buttons:[{text:"Close",handler:function(){e.close()}}]});e.show()}},failure:function(){}})},removeTabEvent:function(d,e){var b,c,f,a;a=e.id.split("-");if((a[0]==="FE"||a[0]==! ="FNU"||a[0]==="FNR"||a[0]==="PP")&&a[1]!=="help"){if(a[0]==="FE"){b=E xt.getCmp("FE-"+a[1]).isModifiedLang}if(a[0]==="FNU"){b=Ext.getCmp("FNU-"+a[1]).isModifiedLang}if(a[0]==="FNR"){b=Ext.getCmp("FNR-"+a[1]).isModifiedLang}if(a[0]==="FE"){c=Ext.getCmp("FE-"+a[1]).isModifiedEn}if(a[0]==="FNU"){c=Ext.getCmp("FNU-"+a[1]).isModifiedEn}if(a[0]==="FNR"){c=Ext.getCmp("FNR-"+a[1]).isModifiedEn}if(a[0]==="PP"){f=Ext.getCmp("PP-PATCH-"+a[1]).isModified}if(c||b||f){Ext.Msg.show({scope:this,title:"Confirm",msg:"This file has been modified without being saved.<br/>Do you really want to close?",buttons:Ext.Msg.YESNO,icon:Ext.Msg.QUESTION,fn:function(g,h){if(g==="yes"){d.un("beforeremove",this.removeTabEvent,this);d.remove(e);d.addListener("beforeremove",this.removeTabEvent,this)}}})}else{return true}return false}else{return true}},WinCommit:function(i,h,e){var f,c,g,a,b,d;c=Ext.get("acc-need-update");if(!f){f=new Ext.Window({scope:this,id:"winCvsCommit",title:"CVS commit",closable:false,layout:"form",width:400,height:480,resizable:false,modal:true,bodyStyle! :"padding:5px 5px 0",labelAlign:"top",items:[{xtype:"checktreepanel",id:"tree-panel",anchor:"100%",height:180,autoScroll:true,rootVisible:false,root:{text:"root",expanded:true,children:[]}},{scope:this,xtype:"combo",fieldLabel:"Older messages",editable:false,name:"first2",anchor:"100%",store:this.storeCommitLogMessage,triggerAction:"all",tpl:'<tpl for="."><div class="x-combo-list-item">{[values.text.split("\n").join("<br/>")]}</div></tpl>',valueField:"id",displayField:"text",listeners:{scope:this,render:function(){this.storeCommitLogMessage.load()},select:function(l,j,k){Ext.getCmp("form-commit-message-log").setValue(j.data.text)}}},{xtype:"textarea",id:"form-commit-message-log",fieldLabel:"Log message",name:"first3",anchor:"100%",height:150,value:""}],tools:[{scope:this,id:"gear",qtip:"Configure this tools",handler:function(){var m,k,l;function j(n){return n.split("\n").join("<br/>")}m=new Ext.form.TextArea({grow:true,growMin:120});k=new Ext.grid.ColumnModel([new Ext.grid.! RowNumberer(),{id:"GridManageLog",header:"Log Message",dataIndex:"text ",renderer:j,editor:new Ext.Editor(m,{shadow:false,autoSize:true,listeners:{scope:this,complete:function(p,q,o){var n=p.record.data.id;Ext.Ajax.request({scope:this,url:"../php/controller.php",params:{task:"save-LogMessage",messID:n,mess:q},success:function(s,r){var t=Ext.util.JSON.decode(s.responseText);if(t.success){this.storeCommitLogMessage.getById(n).commit()}}})}}})}]);l=new Ext.Window({title:"Manage Log Message",iconCls:"winManageLog",width:650,height:350,layout:"fit",resizable:false,modal:true,autoScroll:true,html:'<div class="diff-content"></div>',items:[{xtype:"editorgrid",store:this.storeCommitLogMessage,loadMask:true,cm:k,sm:new Ext.grid.RowSelectionModel({singleSelect:true}),autoExpandColumn:"GridManageLog",listeners:{scope:this,rowcontextmenu:function(n,q,o){o.stopEvent();n.getSelectionModel().selectRow(q);var p=new Ext.menu.Menu({items:[{text:"Delete this Log Message",iconCls:"iconDelete",scope:this,handler:function(){Ext.Ajax.request({scope:this,url:"../php/co! ntroller.php",params:{task:"delete-LogMessage",messID:this.storeCommitLogMessage.getAt(q).data.id},success:function(s,r){var t=Ext.util.JSON.decode(s.responseText);if(t.success){this.storeCommitLogMessage.remove(this.storeCommitLogMessage.getAt(q))}}})}}]});p.showAt(o.getXY())}}}],buttons:[{text:"Close",handler:function(){l.close()}}],listeners:{scope:this,close:function(){this.storeCommitLogMessage.reload()}}});l.show()}}],buttons:[{scope:this,text:"Submit",id:"win-commit-btn-submit",handler:function(){var j,n,q,s,k,l,o=[],r,p="",m;if(this.userLoggin==="cvsread"){f.close();Ext.MessageBox.show({title:"Cvsread restriction",msg:"You are logging in with Cvsread account.<br><br>You can't commit anything with this account.",icon:Ext.MessageBox.INFO,buttons:Ext.MessageBox.OK});return}j=Ext.getCmp("tree-panel").getValue();n=[];for(m=0;m<j.length;m=m+1){q=Ext.getCmp("tree-panel").getNodeById(j[m]).attributes;s="FE-"+Ext.util.md5("FE-"+q.FilePath+q.FileName);k="FNU-"+Ext.util.md5("F! NU-"+q.FilePath+q.FileName);l="FNR-"+Ext.util.md5("FNR-"+q.FilePath+q. FileName);if(Ext.getCmp("main-panel").findById(s)||Ext.getCmp("main-panel").findById(k)||Ext.getCmp("main-panel").findById(l)){if(Ext.getCmp("main-panel").findById(s)){r=s}if(Ext.getCmp("main-panel").findById(k)){r=k}if(Ext.getCmp("main-panel").findById(l)){r=l}o[0]=r;o[1]=q.FileName;n.push(o)}}if(n.length>0){for(m=0;m<n.length;m=m+1){p+=n[m][1]+"<br>"}Ext.MessageBox.show({scope:this,title:"Warning",msg:"There is "+n.length+" file"+((n.length>1)?"s":"")+" to close before commit.<br><br>"+p+"<br><br>Would you like I close it for you ?",icon:Ext.MessageBox.INFO,buttons:Ext.MessageBox.YESNOCANCEL,fn:function(t){if(t==="yes"){for(m=0;m<n.length;m=m+1){Ext.getCmp("main-panel").remove(n[m][0])}this.WinCommitLastStep(j,this)}else{return}}})}else{this.WinCommitLastStep(j,this)}return}},{text:"Close",id:"win-commit-btn-close",handler:function(){f.close()}}]})}f.show(c);if(i){a=this.storePendingCommit.getAt(h).data.path;b=this.storePendingCommit.getAt(h).data.name;g=Ext.util.md5(a+b);! d=new Ext.tree.TreeNode({id:"need-commit-"+g,text:a+b,FilePath:a,FileName:b,leaf:true,checked:true,uiProvider:Ext.ux.tree.CheckTreeNodeUI});Ext.getCmp("tree-panel").getRootNode().appendChild(d)}else{this.storePendingCommit.each(function(j){if(e&&e==="by me"&&j.data.by!==this.userLoggin){}else{a=j.data.path;b=j.data.name;g=Ext.util.md5(a+b);d=new Ext.tree.TreeNode({id:"need-commit-"+g,text:a+b,FilePath:a,FileName:b,leaf:true,checked:true,uiProvider:Ext.ux.tree.CheckTreeNodeUI});Ext.getCmp("tree-panel").getRootNode().appendChild(d)}},this)}},WinCommitLastStep:function(g,d){Ext.getBody().mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Please, wait until commit...');var a=[],f,c,e,b;for(b=0;b<g.length;b=b+1){f=Ext.getCmp("tree-panel").getNodeById(g[b]);c=[];c[0]=f.attributes.FilePath;c[1]=f.attributes.FileName;a.push(c)}e=Ext.getCmp("form-commit-message-log").getValue();Ext.getCmp("winCvsCommit").close();Ext.Ajax.request({url:"../php/controller.php",params:! {task:"cvs-commit",nodes:Ext.util.JSON.encode(a),logMessage:e},success :function(i){var j,h;j=Ext.util.JSON.decode(i.responseText);if(j.success){Ext.getBody().unmask();h=new Ext.Window({title:"Status",width:450,height:350,resizable:false,modal:true,autoScroll:true,bodyStyle:"background-color: white; padding: 5px;",html:j.mess.join("<br>"),buttons:[{text:"Close",handler:function(){h.close()}}]});h.show();Ext.Ajax.request({url:"../php/controller.php",params:{task:"on-succes-commit",nodes:Ext.util.JSON.encode(a),logMessage:e},success:function(k){d.storeFilesError.reload();d.storeFilesNeedReviewed.reload();d.storeFilesNeedUpdate.reload();d.storePendingCommit.reload();d.storeTranslators.reload();d.storeSummary.reload()}})}else{}}})},WinUpdate:function(){var e,d;function c(f){f.TaskPing.cancel();Ext.get("wizard-step-1").replaceClass("wizard-step-before","wizard-step-working");Ext.get("wizard-step-1.1").replaceClass("wizard-wait","wizard-show");Ext.Ajax.request({scope:f,url:"../php/controller.php",params:{task:"update-repo"},success:function(g){var h=! Ext.util.JSON.decode(g.responseText);if(h.success){Ext.get("wizard-step-1").replaceClass("wizard-step-working","wizard-step-done");Ext.get("wizard-step-1.1").replaceClass("wizard-show","wizard-wait");b(f)}},failure:function(){function h(){Ext.Ajax.request({scope:f,url:"../php/controller.php",params:{task:"check-lock-file",lockFile:"lock_update_repository"},success:function(i){var j=Ext.util.JSON.decode(i.responseText);if(!j.success){Ext.get("wizard-step-1").replaceClass("wizard-step-working","wizard-step-done");Ext.get("wizard-step-1.1").replaceClass("wizard-show","wizard-wait");b(this)}else{g.delay(5000)}},failure:function(){g.delay(5000)}})}var g=new Ext.util.DelayedTask(function(){h()});g.delay(5000)}})}function b(f){Ext.get("wizard-step-2").replaceClass("wizard-step-before","wizard-step-working");Ext.Ajax.request({scope:f,url:"../php/controller.php",params:{task:"apply-tools"},success:function(g){var h=Ext.util.JSON.decode(g.responseText);if(h.success){Ext.get("wizard-s! tep-2").replaceClass("wizard-step-working","wizard-step-done");a(this) }},failure:function(){function h(){Ext.Ajax.request({scope:f,url:"../php/controller.php",params:{task:"check-lock-file",lockFile:"lock_apply_tools"},success:function(i){var j=Ext.util.JSON.decode(i.responseText);if(!j.success){Ext.get("wizard-step-2").replaceClass("wizard-step-working","wizard-step-done");a(this)}else{g.delay(5000)}},failure:function(){g.delay(5000)}})}var g=new Ext.util.DelayedTask(function(){h()});g.delay(5000)}})}function a(f){Ext.get("wizard-step-3").replaceClass("wizard-step-before","wizard-step-working");f.storeFilesNeedUpdate.reload();f.storeTranslators.reload();f.storeFilesError.reload();Ext.get("wizard-step-3").replaceClass("wizard-step-working","wizard-step-done");Ext.getCmp("btn-start-refresh").setIconClass("finishRefresh");Ext.getCmp("btn-start-refresh").setText("Finish !");Ext.getCmp("btn-start-refresh").setHandler(function(){e.close()});Ext.getCmp("btn-start-refresh").enable();f.TaskPing.delay(30000);e.tools.close.setVisible(true)}d=Ext.get("ac! c-need-update");if(!e){e=new Ext.Window({title:"Refresh all data",layout:"form",width:300,height:200,resizable:false,modal:true,bodyStyle:"padding:15px 15px 0",iconCls:"refresh",html:'<div id="wizard-step-1" class="wizard-step-before">Update all files from Cvs</div><div id="wizard-step-1.1" class="wizard-wait">This may take time. Thank you for your patience...</div><div id="wizard-step-2" class="wizard-step-before">Apply all tools</div><div id="wizard-step-3" class="wizard-step-before">Reload data</div>',buttons:[{scope:this,text:"Start",id:"btn-start-refresh",iconCls:"startRefresh",handler:function(){Ext.getCmp("btn-start-refresh").disable();e.tools.close.setVisible(false);c(this)}}]})}e.show(d)},WinCheckBuild:function(){var c,a;a=Ext.get("acc-need-update");function b(d){Ext.Ajax.request({scope:d,url:"./php/controller.php",params:{task:"get-logfile",file:"log_check_build"},success:function(f){var g,e;g=Ext.util.JSON.decode(f.responseText);if(g.success){this.TaskPing.delay(! 30000);e=new Ext.Window({title:"Status",width:450,height:350,resizable :false,modal:true,autoScroll:true,bodyStyle:"background-color: white; padding: 5px;",html:g.mess,buttons:[{text:"Close",handler:function(){e.close()}}]});e.show()}}})}if(!c){c=new Ext.Window({title:"Check Build",iconCls:"checkBuild",layout:"form",width:350,height:200,resizable:false,modal:true,bodyStyle:"padding:5px 5px 0",labelAlign:"top",buttons:[{scope:this,text:"Go !",id:"win-check-build-btn-submit",handler:function(){var d=Ext.getCmp("option-xml-details").checked;c.close();Ext.getBody().mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Please, wait until the build is checked...');this.TaskPing.cancel();Ext.Ajax.request({scope:this,url:"./php/controller.php",params:{task:"check-build",xmlDetails:d},success:function(e){var f=Ext.util.JSON.decode(e.responseText);if(f.success){Ext.getBody().unmask();b(this)}},failure:function(g){function e(){Ext.Ajax.request({url:"../php/controller.php",params:{task:"check-lock-file",lockFile:"lock_check_build"},success:f! unction(h){var i=Ext.util.JSON.decode(h.responseText);if(!i.success){Ext.getBody().unmask();b()}else{f.delay(5000)}},failure:function(){f.delay(5000)}})}var f=new Ext.util.DelayedTask(function(){e()});f.delay(5000)}})}}],items:[{xtype:"panel",baseCls:"x-plain",bodyStyle:"padding:5px 5px 0",html:"You're about to check the build via this command :<br/><br/>/usr/bin/php configure.php --with-lang="+this.userLang+"<br><br>",modal:false},{xtype:"checkbox",hideLabel:true,checked:false,boxLabel:"Enable detailed XML error messages",name:"option-xml-details",id:"option-xml-details"}]})}c.show(a)},WinConf:function(){var a,c,e,d,b;if(!a){b=new Ext.XTemplate('<tpl for=".">','<div class="thumb-wrap" id="tplMenu-{id}">','<div class="thumb"><img src="/img/{img}" title=""></div>',"<span>{label}</span></div>","</tpl>");b.compile();d=[["1","go-home.png","Main"],["2","edit-redo.png",'Module "Files Need Update"'],["3","dialog-cancel.png",'Module "Files with Error"'],["4","document-properties.pn! g",'Module "Files need Reviewed"'],["5","view-media-playlist.png",'Mod ule "Pending Patch"']];e=new Ext.data.SimpleStore({id:0,fields:[{name:"id"},{name:"img"},{name:"label"}]});e.loadData(d);c=new Ext.DataView({tpl:b,singleSelect:true,overClass:"x-view-over",itemSelector:"div.thumb-wrap",store:e,listeners:{selectionchange:function(f,g){var h=f.getSelectedRecords();Ext.getCmp("confCard").layout.setActiveItem("conf-card-"+h[0].data.id)}}});a=new Ext.Window({scope:this,layout:"border",width:550,height:400,iconCls:"iconConf",modal:true,title:"Configuration",plain:true,closeAction:"hide",listeners:{show:function(){c.select(c.getNode(0))}},items:[{scope:this,region:"west",width:190,id:"confMenu",autoScroll:true,items:c},{scope:this,layout:"slide",region:"center",id:"confCard",width:375,frame:true,activeItem:0,bbar:new Ext.StatusBar({defaultText:"All changes take effect immediately",defaultIconCls:"confStatusBar"}),items:[{scope:this,id:"conf-card-1",xtype:"form",bodyStyle:"padding: 10px;",items:[{xtype:"fieldset",title:"Themes",autoHeight:true,defau! lts:{hideLabel:true},items:[{xtype:"combo",store:new Ext.data.SimpleStore({fields:["themeFile",{name:"themeName",type:"string"}],data:[["/themes/black/css/xtheme-black.css","Black"],["xtheme-default.css","Default"],["/themes/darkgray/css/xtheme-darkgray.css","DarkGray"],["/extjs/resources/css/xtheme-gray.css","Gray"],["/themes/gray-extend/css/xtheme-gray-extend.css","Gray Extend"],["/themes/indigo/css/xtheme-indigo.css","Indigo"],["/themes/midnight/css/xtheme-midnight.css","Midnight"],["/themes/olive/css/xtheme-olive.css","Olive"],["/themes/purple/css/xtheme-purple.css","Purple"],["/extjs/resources/css/xtheme-slate.css","Slate"],["/themes/silverCherry/css/xtheme-silverCherry.css","SilverCherry"]]}),valueField:"themeFile",displayField:"themeName",triggerAction:"all",mode:"local",forceSelection:true,editable:false,fieldLabel:"fieldlabel",value:this.userConf.conf_theme,listeners:{scope:this,select:function(h,f,g){Ext.util.CSS.swapStyleSheet("appTheme",h.getValue());this.confUp! date("conf_theme",h.getValue())}}}]}]},{scope:this,id:"conf-card-2",xt ype:"form",bodyStyle:"padding: 10px;",items:[{xtype:"fieldset",title:"Diff view",autoHeight:true,defaults:{hideLabel:true},defaultType:"radio",items:[{scope:this,checked:(this.userConf.conf_needupdate_diff==="using-viewvc")?true:false,boxLabel:"Using ViewVc from php web site",name:"conf_needupdate_diff",inputValue:"using-viewvc",listeners:{scope:this,check:function(g){if(g.checked){this.confUpdate("conf_needupdate_diff",g.getRawValue())}}}},{checked:(this.userConf.conf_needupdate_diff==="using-exec")?true:false,boxLabel:"Using diff -kk -u command line",name:"conf_needupdate_diff",inputValue:"using-exec",listeners:{scope:this,check:function(g){if(g.checked){this.confUpdate("conf_needupdate_diff",g.getRawValue())}}}}]},{xtype:"fieldset",title:"Editor",autoHeight:true,defaults:{hideLabel:true},defaultType:"checkbox",items:[{scope:this,checked:(this.userConf.conf_needupdate_scrollbars==="true")?true:false,boxLabel:"Synchronize scroll bars",name:"conf_needupdate_scrollbars",liste! ners:{scope:this,check:function(g){this.confUpdate("conf_needupdate_scrollbars",g.getValue())}}}]}]},{id:"conf-card-3",xtype:"form",bodyStyle:"padding: 10px;",items:[{xtype:"fieldset",title:"Error type",autoHeight:true,defaults:{hideLabel:true},defaultType:"checkbox",items:[{scope:this,checked:(this.userConf.conf_error_skipnbliteraltag==="true")?true:false,boxLabel:"Skip nbLiteralTag error",name:"conf_error_skipnbliteraltag",listeners:{scope:this,check:function(g){this.confUpdate("conf_error_skipnbliteraltag",g.getValue())}}}]},{xtype:"fieldset",title:"Editor",autoHeight:true,defaults:{hideLabel:true},defaultType:"checkbox",items:[{scope:this,checked:(this.userConf.conf_error_scrollbars==="true")?true:false,boxLabel:"Synchronize scroll bars",name:"conf_error_scrollbars",listeners:{scope:this,check:function(g){this.confUpdate("conf_error_scrollbars",g.getValue())}}}]}]},{id:"conf-card-4",xtype:"form",bodyStyle:"padding: 10px;",items:[{xtype:"fieldset",title:"Editor",autoHeig! ht:true,defaults:{hideLabel:true},defaultType:"checkbox",items:[{scope :this,checked:(this.userConf.conf_reviewed_scrollbars==="true")?true:false,boxLabel:"Synchronize scroll bars",name:"conf_reviewed_scrollbars",listeners:{scope:this,check:function(g){this.confUpdate("conf_reviewed_scrollbars",g.getValue())}}}]}]},{id:"conf-card-5",xtype:"form",bodyStyle:"padding: 10px;",items:[{xtype:"fieldset",title:"Editor",autoHeight:true,defaults:{hideLabel:true},defaultType:"checkbox",items:[{scope:this,checked:(this.userConf.conf_patch_scrollbars==="true")?true:false,boxLabel:"Synchronize scroll bars",name:"conf_patch_scrollbars",listeners:{scope:this,check:function(g){this.confUpdate("conf_patch_scrollbars",g.getValue())}}}]}]}]}],buttons:[{text:"Close",handler:function(){a.hide()}}]})}a.show(Ext.get("winconf-btn"))},confUpdate:function(b,a){Ext.Ajax.request({scope:this,url:"../php/controller.php",params:{task:"conf-update",item:b,value:a},success:function(c){if(b==="conf_needupdate_diff"){this.userConf.conf_needupdate_diff=a}if(b==="conf_needupdate_sc! rollbars"){this.userConf.conf_needupdate_scrollbars=""+a+""}if(b==="conf_error_skipnbliteraltag"){this.userConf.conf_error_skipnbliteraltag=""+a+"";this.storeFilesError.reload()}if(b==="conf_error_scrollbars"){this.userConf.conf_error_scrollbars=""+a+""}if(b==="conf_reviewed_scrollbars"){this.userConf.conf_reviewed_scrollbars=""+a+""}if(b==="conf_patch_scrollbars"){this.userConf.conf_patch_scrollbars=""+a+""}}})},WinAbout:function(){var a;if(!a){a=new Ext.Window({layout:"fit",width:515,height:320,iconCls:"iconHelp",modal:true,title:"About "+this.appName,closeAction:"hide",plain:true,bodyStyle:"color:#000",items:new Ext.TabPanel({autoTabs:true,activeTab:0,border:false,defaults:{autoScroll:true},items:[{title:"About",html:'<div id="phd-oe-about"><img src="/img/logo.png" alt="'+this.appName+'" /></div><div id="phd-oe-about-info">'+this.appName+" ver "+this.appVer+' (c) 2008-2009, Yannick Torrèss - <a href="mailto:yannick@php.net">yannick@php.net</a></div>'},{title:"Cred! its",bodyStyle:"padding:15px",html:'<div id="phd-oe-credit"><ul><li><a href="http://extjs.com" target="_blank">ExtJs Team</a><div class="phd-oe-credit-info">Javascript FrameWork</div></li><li><a href="http://marijn.haverbeke.nl/codemirror/" target="_blank">CodeMirror</a><div class="phd-oe-credit-info">Code editor</div></li><li><a href="http://famfamfam.com" target="_blank">famfamfam.com</a><div class="phd-oe-credit-info">Icon pack</div></li></ul></div>'},{title:"License",autoLoad:{url:"/license_LGPL_v2.txt"}}]}),buttons:[{text:"Close",handler:function(){a.hide()}}]})}a.show(Ext.get("winabout-btn"))},sendEmail:function(b,a){var c,d;c=new Ext.form.FormPanel({baseCls:"x-plain",labelWidth:55,url:"save-form.php",defaultType:"textfield",items:[{fieldLabel:"Send To",name:"to",readOnly:true,anchor:"100%",value:'"'+b+'" <'+a+">"},{fieldLabel:"Subject",name:"subject",anchor:"100%"},{xtype:"textarea",hideLabel:true,name:"msg",anchor:"100% -53"}]});d=new Ext.Window({title:"Send an email",width:500,height:300,minWidth:300,minHeight:200,layout:"fit",plain:t! rue,bodyStyle:"padding:5px;",buttonAlign:"center",items:c,iconCls:"iconSendEmail",buttons:[{text:"Send",handler:function(){var e=c.getForm().getValues();Ext.Ajax.request({url:"./php/controller.php",params:{task:"send-email",to:e.to,subject:e.subject,msg:e.msg},success:function(f){var g=Ext.util.JSON.decode(f.responseText);if(g.success){d.close();Ext.MessageBox.alert("Status","Email sent to "+b+" with success!")}},failure:function(){}})}},{text:"Cancel",handler:function(){d.close()}}]});d.show()},drawInterface:function(){var j,l,a,c,h,g,f,i,e,k,b,d;this.TaskPing=new Ext.util.DelayedTask(function(){Ext.Ajax.request({url:"./php/controller.php",params:{task:"ping"},success:function(m){if(m.responseText!=="pong"){window.location.href="/login.php"}},failure:function(){window.location.href="/login.php"}});this.TaskPing.delay(30000)},this);this.TaskPing.delay(30000);j=new Ext.grid.GridPanel({store:this.storeFilesError,loadMask:true,columns:[{id:"name",header:"Files",sortable:true,d! ataIndex:"name"},{header:"Maintainer",width:45,sortable:true,dataIndex :"maintainer"},{header:"Type",width:45,sortable:true,dataIndex:"type"},{header:"Path",dataIndex:"path",hidden:true}],view:new Ext.grid.GroupingView({emptyText:'<div style="text-align: center;">No files</div>',forceFit:true,groupTextTpl:'{[values.rs[0].data["path"]]} ({[values.rs.length]} {[values.rs.length > 1 ? "Files" : "File"]})',getRowClass:function(m,p,o,n){if(m.data.needcommit){return"file-need-commit"}}}),autoExpandColumn:"name",bodyBorder:false,listeners:{scope:this,render:function(m){j.view.refresh()},rowdblclick:function(o,y,u){var n,p,v,t,w,m,s,r,q,z,x;n=this.storeFilesError.getAt(y).data.path;p=this.storeFilesError.getAt(y).data.name;v=Ext.util.md5("FE-"+this.userLang+n+p);t=this.storeFilesError.getAt(y).data.needcommit;if(!Ext.getCmp("main-panel").findById("FE-"+v)){w=[];this.storeFilesError.each(function(A){if(A.data.path===n&&A.data.name===p){if(!w[A.data.type]){w.push(A.data.type)}}});m=new Ext.data.Store({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php! /controller.php"}),baseParams:{task:"get-log",Path:this.userLang+n,File:p},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"revision",mapping:"revision"},{name:"date",mapping:"date",type:"date",dateFormat:"Y/m/d H:i:s"},{name:"author",mapping:"author"},{name:"content",mapping:"content"}])});m.setDefaultSort("date","desc");s=new Ext.data.Store({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controller.php"}),baseParams:{task:"get-log",Path:"en"+n,File:p},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"revision",mapping:"revision"},{name:"date",mapping:"date",type:"date",dateFormat:"Y/m/d H:i:s"},{name:"author",mapping:"author"},{name:"content",mapping:"content"}])});s.setDefaultSort("date","desc");r=new Ext.grid.CheckboxSelectionModel({singleSelect:false,width:22,header:"",listeners:{beforerowselect:function(B){var A=B.getCount();if(A===2){retur! n false}},rowselect:function(B){var A=B.getCount();if(A===2){Ext.getCm p("FE-PANEL-btn-logLang-"+v).enable();Ext.get("FE-PANEL-btn-logLang-"+v).frame("3F8538")}else{Ext.getCmp("FE-PANEL-btn-logLang-"+v).disable()}},rowdeselect:function(B){var A=B.getCount();if(A===2){Ext.getCmp("FE-PANEL-btn-logLang-"+v).enable();Ext.get("FE-PANEL-btn-logLang-"+v).frame("3F8538")}else{Ext.getCmp("FE-PANEL-btn-logLang-"+v).disable()}}}});q=new Ext.grid.GridPanel({store:m,loadMask:true,columns:[r,{id:"id",header:"Rev.",width:40,sortable:false,dataIndex:"revision"},{header:"Content",width:130,sortable:true,dataIndex:"content"},{header:"By",width:50,sortable:true,dataIndex:"author"},{header:"Date",width:85,sortable:true,dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y/m/d, H:i")}],autoHeight:true,autoExpandColumn:"content",bodyBorder:false,sm:r,view:new Ext.grid.GridView({forceFit:true}),tbar:[{scope:this,tooltip:"<b>View</b> the diff",iconCls:"iconViewDiff",id:"FE-PANEL-btn-logLang-"+v,disabled:true,handler:function(){var C,B,A;C=r.getSelections();B=C[0].! data.revision;A=C[1].data.revision;this.winDiff(this.userLang+n,p,B,A)}}]});z=new Ext.grid.CheckboxSelectionModel({singleSelect:false,width:22,header:"",listeners:{beforerowselect:function(B){var A=B.getCount();if(A===2){return false}},rowselect:function(B){var A=B.getCount();if(A===2){Ext.getCmp("FE-PANEL-btn-logEn-"+v).enable();Ext.get("FE-PANEL-btn-logEn-"+v).frame("3F8538")}else{Ext.getCmp("FE-PANEL-btn-logEn-"+v).disable()}},rowdeselect:function(B){var A=B.getCount();if(A===2){Ext.getCmp("FE-PANEL-btn-logEn-"+v).enable();Ext.get("FE-PANEL-btn-logEn-"+v).frame("3F8538")}else{Ext.getCmp("FE-PANEL-btn-logEn-"+v).disable()}}}});x=new Ext.grid.GridPanel({store:s,loadMask:true,columns:[z,{id:"id",header:"Rev.",width:40,sortable:false,dataIndex:"revision"},{header:"Content",width:130,sortable:true,dataIndex:"content"},{header:"By",width:50,sortable:true,dataIndex:"author"},{header:"Date",width:85,sortable:true,dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y/m/d, H:i! ")}],autoHeight:true,autoExpandColumn:"content",bodyBorder:false,sm:z, view:new Ext.grid.GridView({forceFit:true}),tbar:[{scope:this,tooltip:"<b>View</b> the diff",iconCls:"iconViewDiff",id:"FE-PANEL-btn-logEn-"+v,disabled:true,handler:function(){var C,B,A;C=z.getSelections();B=C[0].data.revision;A=C[1].data.revision;this.winDiff("en"+n,p,B,A)}}]});Ext.getCmp("main-panel").add({closable:true,title:p,originTitle:p,tabTip:"File with error : in "+n,iconCls:"iconTabError",id:"FE-"+v,isModifiedLang:false,isModifiedEn:false,layout:"border",defaults:{collapsible:true,split:true},items:[{xtype:"panel",layout:"fit",region:"north",title:"Error description",id:"FE-error-desc-"+v,height:150,collapsed:true,items:{xtype:"iframepanel",id:"FE-error-type-"+v,loadMask:true,defaultSrc:"/error_type.php?dir="+n+"&file="+p}},{region:"west",xtype:"panel",layout:"fit",bodyBorder:false,title:"CvsLog",collapsed:true,width:375,items:{xtype:"tabpanel",activeTab:0,tabPosition:"bottom",defaults:{autoScroll:true},items:[{layout:"fit",title:this.userLang,items:[q]},{layout:"f! it",title:"En",items:[x]}]}},{title:this.userLang+" File: "+n+p,originTitle:this.userLang+" File: "+n+p,collapsible:false,id:"FE-LANG-PANEL-"+v,region:"center",xtype:"form",height:"auto",width:"auto",items:[{xtype:"codemirror",id:"FE-LANG-"+v,listeners:{scope:this,initialize:function(A){this.getFile(v,this.userLang+n,p,"FE-LANG-PANEL-","FE-LANG-")},cmcursormove:function(){var A=Ext.util.JSON.decode(Ext.getCmp("FE-LANG-"+v).getCursorPosition());Ext.get("FE-LANG-status-line-"+v).dom.innerHTML=A.line;Ext.get("FE-LANG-status-col-"+v).dom.innerHTML=A.caracter},cmchange:function(D,B,C){var A=Ext.util.JSON.decode(Ext.getCmp("FE-LANG-"+v).getCursorPosition());Ext.get("FE-LANG-status-line-"+v).dom.innerHTML=A.line;Ext.get("FE-LANG-status-col-"+v).dom.innerHTML=A.caracter;if(D!==27&&D!==33&&D!==34&&D!==37&&D!==38&&D!==39&&D!==40&&D!==17&&D!==16&&D!==67){if(!Ext.getCmp("FE-"+v).isModifiedLang){Ext.getCmp("FE-LANG-PANEL-"+v).setTitle(Ext.getCmp("FE-LANG-PANEL-"+v).originTitle+' <span s! tyle="color:#ff0000; font-weight: bold;">[modified]</span>');Ext.getCm p("FE-"+v).setTitle(Ext.getCmp("FE-"+v).originTitle+' <t style="color:#ff0000; font-weight: bold;">*</t>');Ext.getCmp("FE-LANG-PANEL-btn-save-"+v).enable();Ext.get("FE-LANG-PANEL-btn-save-"+v).frame("3F8538");Ext.getCmp("FE-LANG-PANEL-btn-saveas-"+v).enable();Ext.get("FE-LANG-PANEL-btn-saveas-"+v).frame("3F8538");Ext.getCmp("FE-"+v).isModifiedLang=true}}},cmscroll:function(A){if(this.userConf.conf_error_scrollbars==="true"){Ext.getCmp("FE-EN-"+v).scrollTo(A)}}}}],bbar:[{scope:this,xtype:"checkbox",hideLabel:true,checked:(this.userConf.conf_error_scrollbars==="true")?true:false,boxLabel:"Synchronize scroll bars",name:"conf_error_scrollbars",listeners:{scope:this,check:function(A){this.confUpdate("conf_error_scrollbars",A.getValue())},render:function(A){Ext.DomHelper.insertHtml("beforeBegin",A.el.dom,'<div style="display: inline;" class="x-statusbar"><span class="x-status-text-panel">Line: <span id="FE-LANG-status-line-'+v+'">-</span></span> <span class="x-status-te! xt-panel">Col: <span id="FE-LANG-status-col-'+v+'">-</span></span></div> ')}}}],tbar:[{scope:this,tooltip:"<b>Save</b> this file",iconCls:"saveFile",id:"FE-LANG-PANEL-btn-save-"+v,disabled:true,handler:function(){this.saveLangFile(v,n,p,"FE",y,this)}},{scope:this,tooltip:"<b>Save as</b> a patch",iconCls:"saveAsFile",id:"FE-LANG-PANEL-btn-saveas-"+v,disabled:true,handler:function(){this.savePatch(this.userLang,v,n,p,"FE",this)}},"->",{tooltip:"<b>Re-indent</b> all this file",iconCls:"iconIndent",handler:function(){Ext.getCmp("FE-LANG-"+v).reIndentAll()}}]},{title:"En File: "+n+p,originTitle:"En File: "+n+p,collapsible:false,id:"FE-EN-PANEL-"+v,region:"east",xtype:"form",height:"auto",width:575,items:[{xtype:"codemirror",id:"FE-EN-"+v,listeners:{scope:this,initialize:function(A){this.getFile(v,"en"+n,p,"FE-EN-PANEL-","FE-EN-")},cmchange:function(D,B,C){var A=Ext.util.JSON.decode(Ext.getCmp("FE-EN-"+v).getCursorPosition());Ext.get("FE-EN-status-line-"+v).dom.innerHT! ML=A.line;Ext.get("FE-EN-status-col-"+v).dom.innerHTML=A.caracter;if(D !==27&&D!==33&&D!==34&&D!==37&&D!==38&&D!==39&&D!==40&&D!==17&&D!==16&&D!==67){if(!Ext.getCmp("FE-"+v).isModifiedEn){Ext.getCmp("FE-EN-PANEL-"+v).setTitle(Ext.getCmp("FE-EN-PANEL-"+v).originTitle+' <span style="color:#ff0000; font-weight: bold;">[modified]</span>');Ext.getCmp("FE-"+v).setTitle(Ext.getCmp("FE-"+v).originTitle+' <t style="color:#ff0000; font-weight: bold;">*</t>');Ext.getCmp("FE-EN-PANEL-btn-save-"+v).enable();Ext.get("FE-EN-PANEL-btn-save-"+v).frame("3F8538");Ext.getCmp("FE-EN-PANEL-btn-saveas-"+v).enable();Ext.get("FE-EN-PANEL-btn-saveas-"+v).frame("3F8538");Ext.getCmp("FE-"+v).isModifiedEn=true}}},cmscroll:function(A){if(this.userConf.conf_error_scrollbars==="true"){Ext.getCmp("FE-LANG-"+v).scrollTo(A)}},cmcursormove:function(B){var A=Ext.util.JSON.decode(Ext.getCmp("FE-EN-"+v).getCursorPosition());Ext.get("FE-EN-status-line-"+v).dom.innerHTML=A.line;Ext.get("FE-EN-status-col-"+v).dom.innerHTML=A.caracter}}}],bbar:[{scope:this,xtype:"panel",height:21,baseCl! s:"",bodyStyle:"padding-top:5px;",html:'<div style="display: inline;" class="x-statusbar"><span class="x-status-text-panel">Line: <span id="FE-EN-status-line-'+v+'">-</span></span> <span class="x-status-text-panel">Col: <span id="FE-EN-status-col-'+v+'">-</span></span></div> '}],tbar:[{scope:this,tooltip:"<b>Save</b> this file",iconCls:"saveFile",id:"FE-EN-PANEL-btn-save-"+v,disabled:true,handler:function(){this.saveEnFile(v,n,p,"FE",y,this)}},{scope:this,tooltip:"<b>Save as</b> a patch",iconCls:"saveAsFile",id:"FE-EN-PANEL-btn-saveas-"+v,disabled:true,handler:function(){this.savePatch("en",v,n,p,"FE",this)}},"->",{tooltip:"<b>Re-indent</b> all this file",iconCls:"iconIndent",handler:function(){Ext.getCmp("FE-EN-"+v).reIndentAll()}}]}]});Ext.getCmp("main-panel").setActiveTab("FE-"+v);if(Ext.getCmp("FE-"+v).getLayout().north.collapsedEl){Ext.getCmp("FE-"+v).getLayout().north.collapsedEl.addClass("x-layout-collapsed-east-error-desc")}}else{Ext.getCmp("ma! in-panel").setActiveTab("FE-"+v)}},rowcontextmenu:function(o,t,r){var p,m,q,n="",s;o.getSelectionModel().selectRow(t);p=this.storeFilesError.getAt(t).data.path;m=this.storeFilesError.getAt(t).data.name;q=Ext.util.md5("FE-"+p+m);if(this.storeFilesError.getAt(t).data.needcommit){n={text:"View Diff",iconCls:"iconViewDiff",scope:this,handler:function(){Ext.getCmp("main-panel").add({xtype:"panel",id:"diff_panel_"+t,title:"Diff",tabTip:"Diff",closable:true,autoScroll:true,iconCls:"iconTabLink",html:'<div id="diff_content_'+t+'" class="diff-content"></div>'});Ext.getCmp("main-panel").setActiveTab("diff_panel_"+t);Ext.get("diff_panel_"+t).mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Please, Wait...');Ext.Ajax.request({scope:this,url:"./php/controller.php",params:{task:"get-diff",FilePath:this.userLang+p,FileName:m},success:function(u){var v=Ext.util.JSON.decode(u.responseText);if(v.success){Ext.get("diff_content_"+t).dom.innerHTML=v.content;Ext.get("diff_panel_"+t).unmask()}},failure:function(){}})}}}s=new Ext.menu.Menu({items:! [{text:"<b>Edit in a new Tab</b>",iconCls:"FilesError",scope:this,handler:function(){j.fireEvent("rowdblclick",o,t,r)}},n,"-",{text:"About error type",iconCls:"iconHelp",scope:this,handler:function(){Ext.getCmp("main-panel").add({closable:true,title:"About error type",iconCls:"iconHelp",id:"FE-help-"+q,autoScroll:true,autoLoad:"/error_type.php"});Ext.getCmp("main-panel").setActiveTab("FE-help-"+q)}}]});s.showAt(r.getXY())}}});l=new Ext.grid.GridPanel({store:this.storeFilesNeedUpdate,loadMask:true,columns:[{id:"name",header:"Files",sortable:true,dataIndex:"name"},{header:"EN revision",width:45,sortable:true,dataIndex:"en_revision"},{header:Ext.util.Format.uppercase(this.userLang)+" revision",width:45,sortable:true,dataIndex:"revision"},{header:"Maintainer",width:45,sortable:true,dataIndex:"maintainer"},{header:"Path",dataIndex:"path",hidden:true}],view:new Ext.grid.GroupingView({forceFit:true,groupTextTpl:'{[values.rs[0].data["path"]]} ({[values.rs.length]} {[values.rs.lengt! h > 1 ? "Files" : "File"]})',getRowClass:function(m,p,o,n){if(m.data.n eedcommit){return"file-need-commit"}if(m.data.isCritical){return"file-critical"}},emptyText:'<div style="text-align: center;">No Files</div>'}),autoExpandColumn:"name",bodyBorder:false,listeners:{scope:this,rowcontextmenu:function(o,s,q){var p,m,n="",r;p=this.storeFilesNeedUpdate.getAt(s).data.path;m=this.storeFilesNeedUpdate.getAt(s).data.name;o.getSelectionModel().selectRow(s);if(this.storeFilesNeedUpdate.getAt(s).data.needcommit){n={text:"View Diff",iconCls:"iconViewDiff",scope:this,handler:function(){Ext.getCmp("main-panel").add({xtype:"panel",id:"diff_panel_"+s,title:"Diff",tabTip:"Diff",closable:true,autoScroll:true,iconCls:"iconTabLink",html:'<div id="diff_content_'+s+'" class="diff-content"></div>'});Ext.getCmp("main-panel").setActiveTab("diff_panel_"+s);Ext.get("diff_panel_"+s).mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Please, Wait...');Ext.Ajax.request({url:"./php/controller.php",params:{task:"get-diff",FilePath:this.userLang+p,FileName:m! },success:function(t){var u=Ext.util.JSON.decode(t.responseText);if(u.success){Ext.get("diff_content_"+s).dom.innerHTML=u.content;Ext.get("diff_panel_"+s).unmask()}},failure:function(){}})}}}r=new Ext.menu.Menu({items:[{text:"<b>Edit in a new Tab</b>",iconCls:"iconTabNeedUpdate",scope:this,handler:function(){l.fireEvent("rowdblclick",o,s,q)}},n]});q.stopEvent();r.showAt(q.getXY())},rowdblclick:function(o,x,v){var n,p,z,y,t,u,m,s,r,q,B,w,A;n=this.storeFilesNeedUpdate.getAt(x).data.path;p=this.storeFilesNeedUpdate.getAt(x).data.name;z=this.storeFilesNeedUpdate.getAt(x).data.en_revision;y=this.storeFilesNeedUpdate.getAt(x).data.revision;t=this.storeFilesNeedUpdate.getAt(x).data.needcommit;u=Ext.util.md5("FNU-"+this.userLang+n+p);if(!Ext.getCmp("main-panel").findById("FNU-"+u)){m=new Ext.data.Store({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controller.php"}),baseParams:{task:"get-log",Path:this.userLang+n,File:p},reader:new Ext.data.JsonReader({root:"Items",totalPro! perty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"revision",ma pping:"revision"},{name:"date",mapping:"date",type:"date",dateFormat:"Y/m/d H:i:s"},{name:"author",mapping:"author"},{name:"content",mapping:"content"}])});m.setDefaultSort("date","desc");s=new Ext.data.Store({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controller.php"}),baseParams:{task:"get-log",Path:"en"+n,File:p},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"revision",mapping:"revision"},{name:"date",mapping:"date",type:"date",dateFormat:"Y/m/d H:i:s"},{name:"author",mapping:"author"},{name:"content",mapping:"content"}])});s.setDefaultSort("date","desc");r=new Ext.grid.CheckboxSelectionModel({singleSelect:false,width:22,header:"",listeners:{beforerowselect:function(D){var C=D.getCount();if(C===2){return false}},rowselect:function(D){var C=D.getCount();if(C===2){Ext.getCmp("FNU-PANEL-btn-logLang-"+u).enable();Ext.get("FNU-PANEL-btn-logLang-"+u).frame("3F8538")}else{Ext.getCmp("FNU-PANEL-btn-logLang! -"+u).disable()}},rowdeselect:function(D){var C=D.getCount();if(C===2){Ext.getCmp("FNU-PANEL-btn-logLang-"+u).enable();Ext.get("FNU-PANEL-btn-logLang-"+u).frame("3F8538")}else{Ext.getCmp("FNU-PANEL-btn-logLang-"+u).disable()}}}});q=new Ext.grid.GridPanel({store:m,loadMask:true,columns:[r,{id:"id",header:"Rev.",width:40,sortable:false,dataIndex:"revision"},{header:"Content",width:130,sortable:true,dataIndex:"content"},{header:"By",width:50,sortable:true,dataIndex:"author"},{header:"Date",width:85,sortable:true,dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y/m/d, H:i")}],autoHeight:true,autoExpandColumn:"content",bodyBorder:false,sm:r,view:new Ext.grid.GridView({forceFit:true}),tbar:[{scope:this,tooltip:"<b>View</b> the diff",iconCls:"iconViewDiff",id:"FNU-PANEL-btn-logLang-"+u,disabled:true,handler:function(){var E,D,C;E=r.getSelections();D=E[0].data.revision;C=E[1].data.revision;this.winDiff(this.userLang+n,p,D,C)}}]});B=new Ext.grid.CheckboxSelectionModel({single! Select:false,width:22,header:"",listeners:{beforerowselect:function(D) {var C=D.getCount();if(C===2){return false}},rowselect:function(D){var C=D.getCount();if(C===2){Ext.getCmp("FNU-PANEL-btn-logEn-"+u).enable();Ext.get("FNU-PANEL-btn-logEn-"+u).frame("3F8538")}else{Ext.getCmp("FNU-PANEL-btn-logEn-"+u).disable()}},rowdeselect:function(D){var C=D.getCount();if(C===2){Ext.getCmp("FNU-PANEL-btn-logEn-"+u).enable();Ext.get("FNU-PANEL-btn-logEn-"+u).frame("3F8538")}else{Ext.getCmp("FNU-PANEL-btn-logEn-"+u).disable()}}}});w=new Ext.grid.GridPanel({store:s,loadMask:true,columns:[B,{id:"id",header:"Rev.",width:40,sortable:false,dataIndex:"revision"},{header:"Content",width:130,sortable:true,dataIndex:"content"},{header:"By",width:50,sortable:true,dataIndex:"author"},{header:"Date",width:85,sortable:true,dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y/m/d, H:i")}],autoHeight:true,autoExpandColumn:"content",bodyBorder:false,sm:B,view:new Ext.grid.GridView({forceFit:true}),tbar:[{scope:this,tooltip:"<b>View</b> the diff",iconCls:"iconViewDiff",! id:"FNU-PANEL-btn-logEn-"+u,disabled:true,handler:function(){var E,D,C;E=B.getSelections();D=E[0].data.revision;C=E[1].data.revision;this.winDiff("en"+n,p,D,C)}}]});if(this.userConf.conf_needupdate_diff==="using-viewvc"){A={xtype:"panel",layout:"fit",region:"north",title:"Diff From cvs",height:150,collapsed:true,items:{xtype:"iframepanel",id:"FNU-diff-"+u,loadMask:true,defaultSrc:"http://cvs.php.net/viewvc.cgi/phpdoc/en"+n+p+"?r1="+y+"&r2="+z}}}else{if(this.userConf.conf_needupdate_diff==="using-exec"){A={xtype:"panel",layout:"fit",region:"north",title:"Diff From cvs",height:150,autoScroll:true,collapsed:true,html:'<div id="FNU-diff-'+u+'" class="diff-content"></div>',listeners:{render:function(){Ext.Ajax.request({url:"./php/controller.php",params:{task:"get-diff2",FilePath:"en"+n,FileName:p,Rev2:y,Rev1:z},success:function(C){var D=Ext.util.JSON.decode(C.responseText);if(D.success){Ext.get("FNU-diff-"+u).dom.innerHTML=D.content}},failure:function(){}})}}}}}Ext.getCmp("main-! panel").add({closable:true,title:p,originTitle:p,tabTip:"Need Update : in "+n,iconCls:"iconTabNeedUpdate",id:"FNU-"+u,isModifiedLang:false,isModifiedEn:false,layout:"border",defaults:{collapsible:true,split:true},items:[A,{region:"west",xtype:"panel",layout:"fit",bodyBorder:false,title:"CvsLog",collapsed:true,width:375,items:{xtype:"tabpanel",activeTab:0,tabPosition:"bottom",defaults:{autoScroll:true},items:[{layout:"fit",title:this.userLang,items:[q]},{layout:"fit",title:"En",items:[w]}]}},{scope:this,title:this.userLang+" File: "+n+p,originTitle:this.userLang+" File: "+n+p,collapsible:false,id:"FNU-LANG-PANEL-"+u,region:"center",xtype:"form",height:"auto",width:"auto",items:[{xtype:"codemirror",id:"FNU-LANG-"+u,listeners:{scope:this,initialize:function(){this.getFile(u,this.userLang+n,p,"FNU-LANG-PANEL-","FNU-LANG-")},cmcursormove:function(){var C=Ext.util.JSON.decode(Ext.getCmp("FNU-LANG-"+u).getCursorPosition());Ext.get("FNU-LANG-status-line-"+u).dom.innerHTML=C.line;Ext.get("FNU-LANG-status-col-"+u).dom.innerHTML=C.caracter},cmchange:func! tion(F,D,E){var C=Ext.util.JSON.decode(Ext.getCmp("FNU-LANG-"+u).getCursorPosition());Ext.get("FNU-LANG-status-line-"+u).dom.innerHTML=C.line;Ext.get("FNU-LANG-status-col-"+u).dom.innerHTML=C.caracter;if(F!==27&&F!==33&&F!==34&&F!==37&&F!==38&&F!==39&&F!==40&&F!==17&&F!==16&&F!==67){if(!Ext.getCmp("FNU-"+u).isModifiedLang){Ext.getCmp("FNU-LANG-PANEL-"+u).setTitle(Ext.getCmp("FNU-LANG-PANEL-"+u).originTitle+' <span style="color:#ff0000; font-weight: bold;">[modified]</span>');Ext.getCmp("FNU-"+u).setTitle(Ext.getCmp("FNU-"+u).originTitle+' <t style="color:#ff0000; font-weight: bold;">*</t>');Ext.getCmp("FNU-LANG-PANEL-btn-save-"+u).enable();Ext.get("FNU-LANG-PANEL-btn-save-"+u).frame("3F8538");Ext.getCmp("FNU-LANG-PANEL-btn-saveas-"+u).enable();Ext.get("FNU-LANG-PANEL-btn-saveas-"+u).frame("3F8538");Ext.getCmp("FNU-"+u).isModifiedLang=true}}},cmscroll:function(C){if(this.userConf.conf_needupdate_scrollbars==="true"){Ext.getCmp("FNU-EN-"+u).scrollTo(C)}}}}],bbar:[{scope:this,! xtype:"checkbox",hideLabel:true,checked:(this.userConf.conf_needupdate _scrollbars==="true")?true:false,boxLabel:"Synchronize scroll bars",name:"conf_needupdate_scrollbars",listeners:{scope:this,check:function(C){this.confUpdate("conf_needupdate_scrollbars",C.getValue())},render:function(C){Ext.DomHelper.insertHtml("beforeBegin",C.el.dom,'<div style="display: inline;" class="x-statusbar"><span class="x-status-text-panel">Line: <span id="FNU-LANG-status-line-'+u+'">-</span></span> <span class="x-status-text-panel">Col: <span id="FNU-LANG-status-col-'+u+'">-</span></span></div> ')}}}],tbar:[{scope:this,tooltip:"<b>Save</b> this file",iconCls:"saveFile",id:"FNU-LANG-PANEL-btn-save-"+u,disabled:true,handler:function(){this.saveLangFile(u,n,p,"FNU",x,this)}},{scope:this,tooltip:"<b>Save as</b> a patch",iconCls:"saveAsFile",id:"FNU-LANG-PANEL-btn-saveas-"+u,disabled:true,handler:function(){this.savePatch(this.userLang,u,n,p,"FNU",this)}},"->",{tooltip:"<b>Re-indent</b> all this file",iconCls:"iconIndent",handler:function(){Ext.g! etCmp("FNU-LANG-"+u).reIndentAll()}},{tooltip:"Insert <b>Reviewed</b> tag",text:"Reviewed tag",iconCls:"iconInsertCode",handler:function(){Ext.getCmp("FNU-LANG-"+u).insertIntoLine(2,"end","\n<!-- Reviewed: no -->");Ext.getCmp("FNU-LANG-"+u).focus()}},{tooltip:"Insert <b>Revcheck</b> tag",text:"Rev tag",iconCls:"iconInsertCode",handler:function(){Ext.getCmp("FNU-LANG-"+u).insertIntoLine(2,"end","\n<!-- EN-Revision: 1.XX Maintainer: "+this.userLoggin+" Status: ready -->");Ext.getCmp("FNU-LANG-"+u).focus()}}]},{title:"En File: "+n+p,originTitle:"En File: "+n+p,collapsible:false,id:"FNU-EN-PANEL-"+u,region:"east",xtype:"form",height:"auto",width:575,items:[{xtype:"codemirror",id:"FNU-EN-"+u,listeners:{scope:this,initialize:function(){this.getFile(u,"en"+n,p,"FNU-EN-PANEL-","FNU-EN-")},cmchange:function(F,D,E){var C=Ext.util.JSON.decode(Ext.getCmp("FNU-EN-"+u).getCursorPosition());Ext.get("FNU-EN-status-line-"+u).dom.innerHTML=C.line;Ext.get("FNU-EN-status-col-"+u).dom.innerHTML! =C.caracter;if(F!==27&&F!==33&&F!==34&&F!==37&&F!==38&&F!==39&&F!==40& &F!==17&&F!==16&&F!==67){if(!Ext.getCmp("FNU-"+u).isModifiedEn){Ext.getCmp("FNU-EN-PANEL-"+u).setTitle(Ext.getCmp("FNU-EN-PANEL-"+u).originTitle+' <span style="color:#ff0000; font-weight: bold;">[modified]</span>');Ext.getCmp("FNU-"+u).setTitle(Ext.getCmp("FNU-"+u).originTitle+' <t style="color:#ff0000; font-weight: bold;">*</t>');Ext.getCmp("FNU-EN-PANEL-btn-save-"+u).enable();Ext.get("FNU-EN-PANEL-btn-save-"+u).frame("3F8538");Ext.getCmp("FNU-EN-PANEL-btn-saveas-"+u).enable();Ext.get("FNU-EN-PANEL-btn-saveas-"+u).frame("3F8538");Ext.getCmp("FNU-"+u).isModifiedEn=true}}},cmscroll:function(C){if(this.userConf.conf_needupdate_scrollbars==="true"){Ext.getCmp("FNU-LANG-"+u).scrollTo(C)}},cmcursormove:function(D){var C=Ext.util.JSON.decode(Ext.getCmp("FNU-EN-"+u).getCursorPosition());Ext.get("FNU-EN-status-line-"+u).dom.innerHTML=C.line;Ext.get("FNU-EN-status-col-"+u).dom.innerHTML=C.caracter}}}],bbar:[{scope:this,xtype:"panel",height:21,baseCls:"",bodyStyle:"padding-top:5px;",h! tml:'<div style="display: inline;" class="x-statusbar"><span class="x-status-text-panel">Line: <span id="FNU-EN-status-line-'+u+'">-</span></span> <span class="x-status-text-panel">Col: <span id="FNU-EN-status-col-'+u+'">-</span></span></div> '}],tbar:[{scope:this,tooltip:"<b>Save</b> this file",iconCls:"saveFile",id:"FNU-EN-PANEL-btn-save-"+u,disabled:true,handler:function(){this.saveEnFile(u,n,p,"FNU",x,this)}},{scope:this,tooltip:"<b>Save as</b> a patch",iconCls:"saveAsFile",id:"FNU-EN-PANEL-btn-saveas-"+u,disabled:true,handler:function(){this.savePatch("en",u,n,p,"FNU",this)}},"->",{tooltip:"<b>Re-indent</b> all this file",iconCls:"iconIndent",handler:function(){Ext.getCmp("FNU-EN-"+u).reIndentAll()}}]}]});Ext.getCmp("main-panel").setActiveTab("FNU-"+u)}else{Ext.getCmp("main-panel").setActiveTab("FNU-"+u)}}}});a=new Ext.grid.GridPanel({store:this.storePendingPatch,loadMask:true,columns:[{id:"name",header:"Files",sortable:true,dataIndex:"name"},{hea! der:"Posted by",width:45,sortable:true,dataIndex:"by"},{header:"Date", width:45,sortable:true,dataIndex:"date"},{header:"Path",dataIndex:"path",hidden:true}],view:new Ext.grid.GroupingView({forceFit:true,groupTextTpl:'{[values.rs[0].data["path"]]} ({[values.rs.length]} {[values.rs.length > 1 ? "Files" : "File"]})',emptyText:'<div style="text-align: center;">No pending Patch</div>'}),autoExpandColumn:"name",bodyBorder:false,listeners:{scope:this,rowcontextmenu:function(n,t,r){var o,m,p,q,s;o=this.storePendingPatch.getAt(t).data.path;m=this.storePendingPatch.getAt(t).data.name;p=this.storePendingPatch.getAt(t).data.uniqID;q=Ext.util.md5("PP-"+p+o+m);n.getSelectionModel().selectRow(t);s=new Ext.menu.Menu({items:[{text:"<b>Edit in a new Tab</b>",iconCls:"PendingPatch",scope:this,handler:function(){a.fireEvent("rowdblclick",n,t,r)}},"-",{text:"Reject this patch",iconCls:"iconPageDelete",scope:this,handler:function(){this.rejectPatch(q,o,m,p,t,this)}}]});s.showAt(r.getXY())},rowdblclick:function(n,u,s){var m,o,v,t,r,q,p;m=this.storePendingPatch.getAt! (u).data.path;o=this.storePendingPatch.getAt(u).data.name;v=this.storePendingPatch.getAt(u).data.uniqID;t=Ext.util.md5("PP-"+v+m+o);if(!Ext.getCmp("main-panel").findById("FE-"+t)){r=new Ext.data.Store({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controller.php"}),baseParams:{task:"get-log",Path:m,File:o},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"revision",mapping:"revision"},{name:"date",mapping:"date",type:"date",dateFormat:"Y/m/d H:i:s"},{name:"author",mapping:"author"},{name:"content",mapping:"content"}])});r.setDefaultSort("date","desc");q=new Ext.grid.CheckboxSelectionModel({singleSelect:false,width:22,header:"",listeners:{beforerowselect:function(x){var w=x.getCount();if(w===2){return false}},rowselect:function(x){var w=x.getCount();if(w===2){Ext.getCmp("PP-PANEL-btn-log-"+t).enable();Ext.get("PP-PANEL-btn-log-"+t).frame("3F8538")}else{Ext.getCmp("PP-PANEL-btn-log-"+t).disable()}},rowdesele! ct:function(x){var w=x.getCount();if(w===2){Ext.getCmp("PP-PANEL-btn-l og-"+t).enable();Ext.get("PP-PANEL-btn-log-"+t).frame("3F8538")}else{Ext.getCmp("PP-PANEL-btn-log-"+t).disable()}}}});p=new Ext.grid.GridPanel({store:r,loadMask:true,columns:[q,{id:"id",header:"Rev.",width:40,sortable:false,dataIndex:"revision"},{header:"Content",width:130,sortable:true,dataIndex:"content"},{header:"By",width:50,sortable:true,dataIndex:"author"},{header:"Date",width:85,sortable:true,dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y/m/d, H:i")}],autoHeight:true,autoExpandColumn:"content",bodyBorder:false,sm:q,view:new Ext.grid.GridView({forceFit:true}),tbar:[{scope:this,tooltip:"<b>View</b> the diff",iconCls:"iconViewDiff",id:"PP-PANEL-btn-log-"+t,disabled:true,handler:function(){var y,x,w;y=q.getSelections();x=y[0].data.revision;w=y[1].data.revision;this.winDiff(m,o,x,w)}}]});Ext.getCmp("main-panel").add({closable:true,title:o,originTitle:o,tabTip:"Patch for "+m+o,iconCls:"PendingPatch",id:"PP-"+t,layout:"border",defaults:{collapsible:true,split:true! },items:[{xtype:"panel",layout:"fit",region:"north",title:"Patch content",id:"PP-patch-desc-"+t,height:150,autoScroll:true,collapsed:true,html:'<div id="diff_content_'+t+'" class="diff-content"></div>',listeners:{render:function(){Ext.Ajax.request({scope:this,url:"./php/controller.php",params:{task:"get-diff",FilePath:m,FileName:o,type:"patch",uniqID:v},success:function(w){var x=Ext.util.JSON.decode(w.responseText);if(x.success){Ext.get("diff_content_"+t).dom.innerHTML=x.content}},failure:function(){}})}}},{region:"west",xtype:"panel",layout:"fit",bodyBorder:false,title:"CvsLog",collapsed:true,width:375,items:{xtype:"tabpanel",activeTab:0,tabPosition:"bottom",defaults:{autoScroll:true},items:[{layout:"fit",title:"Log",items:[p]}]}},{title:"Proposed Patch for "+m+o,originTitle:"Proposed Patch for "+m+o,collapsible:false,id:"PP-PATCH-PANEL-"+t,region:"center",xtype:"form",height:"auto",width:"auto",items:[{xtype:"codemirror",id:"PP-PATCH-"+t,isModified:false,listeners:{scope:! this,initialize:function(w){this.getFile(t,m,o+"."+v+".patch","PP-PATC H-PANEL-","PP-PATCH-")},cmcursormove:function(){var w=Ext.util.JSON.decode(Ext.getCmp("PP-PATCH-"+t).getCursorPosition());Ext.get("PP-PATCH-status-line-"+t).dom.innerHTML=w.line;Ext.get("PP-PATCH-status-col-"+t).dom.innerHTML=w.caracter},cmchange:function(z,x,y){var w=Ext.util.JSON.decode(Ext.getCmp("PP-PATCH-"+t).getCursorPosition());Ext.get("PP-PATCH-status-line-"+t).dom.innerHTML=w.line;Ext.get("PP-PATCH-status-col-"+t).dom.innerHTML=w.caracter;if(z!==27&&z!==33&&z!==34&&z!==37&&z!==38&&z!==39&&z!==40&&z!==17&&z!==16&&z!==67){if(!Ext.getCmp("PP-PATCH-"+t).isModified){Ext.getCmp("PP-PATCH-PANEL-"+t).setTitle(Ext.getCmp("PP-PATCH-PANEL-"+t).originTitle+' <span style="color:#ff0000; font-weight: bold;">[modified]</span>');Ext.getCmp("PP-"+t).setTitle(Ext.getCmp("PP-"+t).originTitle+' <t style="color:#ff0000; font-weight: bold;">*</t>');Ext.getCmp("PP-PATCH-"+t).isModified=true}}},cmscroll:function(w){if(this.userConf.conf_patch_scrollbars==="true"){Ext.getCmp("PP-ORIGIN-"+t)! .scrollTo(w)}}}}],bbar:[{scope:this,xtype:"checkbox",hideLabel:true,checked:(this.userConf.conf_patch_scrollbars==="true")?true:false,boxLabel:"Synchronize scroll bars",name:"conf_patch_scrollbars",listeners:{scope:this,check:function(w){this.confUpdate("conf_patch_scrollbars",w.getValue())},render:function(w){Ext.DomHelper.insertHtml("beforeBegin",w.el.dom,'<div style="display: inline;" class="x-statusbar"><span class="x-status-text-panel">Line: <span id="PP-PATCH-status-line-'+t+'">-</span></span> <span class="x-status-text-panel">Col: <span id="PP-PATCH-status-col-'+t+'">-</span></span></div> ')}}}],tbar:[{scope:this,tooltip:"<b>Accept</b> this patch and <b>Save</b> the file",iconCls:"saveFile",id:"PP-PATCH-PANEL-btn-save-"+t,handler:function(){this.saveFileViaPatch(t,m,o,v,u,this)}},{scope:this,tooltip:"<b>Reject</b> this patch",iconCls:"iconPageDelete",id:"PP-PATCH-PANEL-btn-reject-"+t,handler:function(){this.rejectPatch(t,m,o,v,u,this)}},"->",{to! oltip:"<b>Re-indent</b> all this file",iconCls:"iconIndent",handler:fu nction(){Ext.getCmp("PP-PATCH-"+t).reIndentAll()}}]},{title:"Original File: "+m+o,originTitle:"Original File: "+m+o,collapsible:false,id:"PP-ORIGIN-PANEL-"+t,region:"east",xtype:"form",height:"auto",width:575,items:[{xtype:"codemirror",id:"PP-ORIGIN-"+t,readOnly:true,listeners:{scope:this,initialize:function(w){this.getFile(t,m,o,"PP-ORIGIN-PANEL-","PP-ORIGIN-")},cmscroll:function(w){if(this.userConf.conf_patch_scrollbars==="true"){Ext.getCmp("PP-PATCH-"+t).scrollTo(w)}},cmcursormove:function(x){var w=Ext.util.JSON.decode(Ext.getCmp("PP-ORIGIN-"+t).getCursorPosition());Ext.get("PP-ORIGIN-status-line-"+t).dom.innerHTML=w.line;Ext.get("PP-ORIGIN-status-col-"+t).dom.innerHTML=w.caracter}}}],bbar:[{scope:this,xtype:"panel",height:21,baseCls:"",bodyStyle:"padding-top:5px;",html:'<div style="display: inline;" class="x-statusbar"><span class="x-status-text-panel">Line: <span id="PP-ORIGIN-status-line-'+t+'">-</span></span> <span class="x-status-text-panel">Col: <span id=! "PP-ORIGIN-status-col-'+t+'">-</span></span></div> '}],tbar:[{}]}]});Ext.getCmp("main-panel").setActiveTab("PP-"+t);if(Ext.getCmp("PP-"+t).getLayout().north.collapsedEl){Ext.getCmp("PP-"+t).getLayout().north.collapsedEl.addClass("x-layout-collapsed-east-patch-desc")}}}}});c=new Ext.grid.GridPanel({store:this.storePendingCommit,loadMask:true,columns:[{id:"name",header:"Files",sortable:true,dataIndex:"name"},{header:"Modified by",width:45,sortable:true,dataIndex:"by"},{header:"Date",width:45,sortable:true,dataIndex:"date"},{header:"Path",dataIndex:"path",hidden:true}],view:new Ext.grid.GroupingView({forceFit:true,groupTextTpl:'{[values.rs[0].data["path"]]} ({[values.rs.length]} {[values.rs.length > 1 ? "Files" : "File"]})',emptyText:'<div style="text-align: center;">No pending for Commit</div>'}),autoExpandColumn:"name",bodyBorder:false,listeners:{scope:this,rowcontextmenu:function(n,r,p){var o,m,q;o=this.storePendingCommit.getAt(r).data.path;m=this.storePendingCom! mit.getAt(r).data.name;n.getSelectionModel().selectRow(r);q=new Ext.me nu.Menu({items:[{text:"<b>Edit in a new Tab</b>",iconCls:"PendingCommit",scope:this,handler:function(){c.fireEvent("rowdblclick",n,r,p)}},"-",{text:"View Diff",iconCls:"iconViewDiff",scope:this,handler:function(){Ext.getCmp("main-panel").add({xtype:"panel",id:"diff_panel_"+r,title:"Diff",tabTip:"Diff",closable:true,autoScroll:true,iconCls:"iconTabLink",html:'<div id="diff_content_'+r+'" class="diff-content"></div>'});Ext.getCmp("main-panel").setActiveTab("diff_panel_"+r);Ext.get("diff_panel_"+r).mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Please, Wait...');Ext.Ajax.request({url:"./php/controller.php",params:{task:"get-diff",FilePath:o,FileName:m},success:function(s){var t=Ext.util.JSON.decode(s.responseText);if(t.success){Ext.get("diff_content_"+r).dom.innerHTML=t.content;Ext.get("diff_panel_"+r).unmask()}},failure:function(){}})}},{text:"Download the diff as a patch",iconCls:"iconCommitFileCvs",scope:this,handler:function(){window.location.href="./d! l_Patch.php?FilePath="+o+"&FileName="+m}},"-",{text:"Clear this change",iconCls:"iconPageDelete",scope:this,handler:function(){function s(t){if(t==="yes"){if(Ext.getCmp("main-panel").findById("FNU-"+Ext.util.md5("FNU-"+o+m))){Ext.getCmp("main-panel").remove("FNU-"+Ext.util.md5("FNU-"+o+m))}Ext.Ajax.request({scope:this,url:"./php/controller.php",params:{task:"clear-local-change",FilePath:o,FileName:m},success:function(u){var v=Ext.util.JSON.decode(u.responseText);if(v.success){this.storeFilesNeedUpdate.reload();this.storeFilesError.reload();this.storeFilesNeedReviewed.reload();this.storePendingCommit.remove(this.storePendingCommit.getAt(r));this.storePendingCommit.fireEvent("add",this.storePendingCommit)}},failure:function(){}})}}Ext.MessageBox.confirm("Confirm","This action will clear your local modification and take back this file from his original stats.<br/>You need confirm.",s,this)}},"-",{text:"Commit...",iconCls:"iconCommitFileCvs",scope:this,menu:new Ext.menu.Menu({i! tems:[{text:"...this file",iconCls:"iconCommitFileCvs",scope:this,hand ler:function(){this.WinCommit(true,r)}},{text:"...all files modified by me",iconCls:"iconCommitFileCvs",scope:this,handler:function(){this.WinCommit(false,"","by me")}},{text:"...all files modified",iconCls:"iconCommitFileCvs",scope:this,handler:function(){this.WinCommit(false)}}]})}]});q.showAt(p.getXY())},rowdblclick:function(n,q,p){var o,m;o=this.storePendingCommit.getAt(q).data.path;m=this.storePendingCommit.getAt(q).data.name;this.openFile(o,m)}}});h=new Ext.grid.GridPanel({store:this.storeFilesNeedReviewed,loadMask:true,columns:[{id:"name",header:"Files",sortable:true,dataIndex:"name"},{header:"Reviewed",width:45,sortable:true,dataIndex:"reviewed"},{header:"Maintainer",width:45,sortable:true,dataIndex:"maintainer"},{header:"Path",dataIndex:"path",hidden:true}],view:new Ext.grid.GroupingView({forceFit:true,groupTextTpl:'{[values.rs[0].data["path"]]} ({[values.rs.length]} {[values.rs.length > 1 ? "Files" : "File"]})',getRowClass:function(m,p,o,n){if(m.data.needcommit){re! turn"file-need-commit"}},emptyText:'<div style="text-align: center;">No files</div>'}),autoExpandColumn:"name",bodyBorder:false,listeners:{scope:this,rowcontextmenu:function(n,t,r){var m,p,s,o="",v="",u,q;n.getSelectionModel().selectRow(t);m=this.storeFilesNeedReviewed.getAt(t).data.path;p=this.storeFilesNeedReviewed.getAt(t).data.name;s=Ext.util.md5("FNR-"+this.userLang+m+p);if(this.storeFilesNeedReviewed.getAt(t).data.needcommit){o={text:"View Diff",iconCls:"iconViewDiff",scope:this,handler:function(){Ext.getCmp("main-panel").add({xtype:"panel",id:"diff_panel_"+t,title:"Diff",tabTip:"Diff",closable:true,autoScroll:true,iconCls:"iconTabLink",html:'<div id="diff_content_'+t+'" class="diff-content"></div>'});Ext.getCmp("main-panel").setActiveTab("diff_panel_"+t);Ext.get("diff_panel_"+t).mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Please, Wait...');Ext.Ajax.request({scope:this,url:"./php/controller.php",params:{task:"get-diff",FilePath:this.userLang+m! ,FileName:p},success:function(w){var x=Ext.util.JSON.decode(w.response Text);if(x.success){Ext.get("diff_content_"+t).dom.innerHTML=x.content;Ext.get("diff_panel_"+t).unmask()}},failure:function(){}})}}}u=m.split("/");if(u[1]==="reference"){v={text:"Open all files about "+u[2]+" extension",iconCls:"iconViewDiff",scope:this,handler:function(){Ext.getBody().mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Open all files about '+u[2]+" extension. Please, wait...");Ext.Ajax.request({scope:this,url:"../php/controller.php",params:{task:"all-files-about-extension",ExtName:u[2]},success:function(y,x){var z,w;z=Ext.util.JSON.decode(y.responseText);this.filePendingOpen=[];for(w=0;w<z.files.length;w=w+1){this.filePendingOpen[w]=[this.userLang+z.files[w].path,z.files[w].name]}this.openFile(this.filePendingOpen[0][0],this.filePendingOpen[0][1]);Ext.getBody().unmask()}})}}}q=new Ext.menu.Menu({scope:this,items:[{text:"<b>Edit in a new Tab</b>",iconCls:"FilesNeedReviewed",scope:this,handler:function(){h.fireEvent("rowdblclick",n,t,r)}},o,"! -",v]});r.stopEvent();q.showAt(r.getXY())},rowdblclick:function(o,y,v){var n,p,s,u,w,m,t,r,q,z,x;n=this.storeFilesNeedReviewed.getAt(y).data.path;p=this.storeFilesNeedReviewed.getAt(y).data.name;s=this.storeFilesNeedReviewed.getAt(y).data.reviewed;u=this.storeFilesNeedReviewed.getAt(y).data.needcommit;w=Ext.util.md5("FNR-"+this.userLang+n+p);if(!Ext.getCmp("main-panel").findById("FNR-"+w)){m=new Ext.data.Store({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controller.php"}),baseParams:{task:"get-log",Path:this.userLang+n,File:p},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"id"},[{name:"id",mapping:"id"},{name:"revision",mapping:"revision"},{name:"date",mapping:"date",type:"date",dateFormat:"Y/m/d H:i:s"},{name:"author",mapping:"author"},{name:"content",mapping:"content"}])});m.setDefaultSort("date","desc");t=new Ext.data.Store({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controller.php"}),baseParams:{task:"get-log",Path:"en"+n,F! ile:p},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbI tems",id:"id"},[{name:"id",mapping:"id"},{name:"revision",mapping:"revision"},{name:"date",mapping:"date",type:"date",dateFormat:"Y/m/d H:i:s"},{name:"author",mapping:"author"},{name:"content",mapping:"content"}])});t.setDefaultSort("date","desc");r=new Ext.grid.CheckboxSelectionModel({singleSelect:false,width:22,header:"",listeners:{beforerowselect:function(B){var A=B.getCount();if(A===2){return false}},rowselect:function(B){var A=B.getCount();if(A===2){Ext.getCmp("FNR-PANEL-btn-logLang-"+w).enable();Ext.get("FNR-PANEL-btn-logLang-"+w).frame("3F8538")}else{Ext.getCmp("FNR-PANEL-btn-logLang-"+w).disable()}},rowdeselect:function(B){var A=B.getCount();if(A===2){Ext.getCmp("FNR-PANEL-btn-logLang-"+w).enable();Ext.get("FNR-PANEL-btn-logLang-"+w).frame("3F8538")}else{Ext.getCmp("FNR-PANEL-btn-logLang-"+w).disable()}}}});q=new Ext.grid.GridPanel({store:m,loadMask:true,columns:[r,{id:"id",header:"Rev.",width:40,sortable:false,dataIndex:"revision"},{header:"Content",width:130,sortab! le:true,dataIndex:"content"},{header:"By",width:50,sortable:true,dataIndex:"author"},{header:"Date",width:85,sortable:true,dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y/m/d, H:i")}],autoHeight:true,autoExpandColumn:"content",bodyBorder:false,sm:r,view:new Ext.grid.GridView({forceFit:true}),tbar:[{scope:this,tooltip:"<b>View</b> the diff",iconCls:"iconViewDiff",id:"FNR-PANEL-btn-logLang-"+w,disabled:true,handler:function(){var C,B,A;C=r.getSelections();B=C[0].data.revision;A=C[1].data.revision;this.winDiff(this.userLang+n,p,B,A)}}]});z=new Ext.grid.CheckboxSelectionModel({singleSelect:false,width:22,header:"",listeners:{beforerowselect:function(B){var A=B.getCount();if(A===2){return false}},rowselect:function(B){var A=B.getCount();if(A===2){Ext.getCmp("FNR-PANEL-btn-logEn-"+w).enable();Ext.get("FNR-PANEL-btn-logEn-"+w).frame("3F8538")}else{Ext.getCmp("FNR-PANEL-btn-logEn-"+w).disable()}},rowdeselect:function(B){var A=B.getCount();if(A===2){Ext.getCmp("FNR-PANEL-b! tn-logEn-"+w).enable();Ext.get("FNR-PANEL-btn-logEn-"+w).frame("3F8538 ")}else{Ext.getCmp("FNR-PANEL-btn-logEn-"+w).disable()}}}});x=new Ext.grid.GridPanel({store:t,loadMask:true,columns:[z,{id:"id",header:"Rev.",width:40,sortable:false,dataIndex:"revision"},{header:"Content",width:130,sortable:true,dataIndex:"content"},{header:"By",width:50,sortable:true,dataIndex:"author"},{header:"Date",width:85,sortable:true,dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y/m/d, H:i")}],autoHeight:true,autoExpandColumn:"content",bodyBorder:false,sm:z,view:new Ext.grid.GridView({forceFit:true}),tbar:[{scope:this,tooltip:"<b>View</b> the diff",iconCls:"iconViewDiff",id:"FNR-PANEL-btn-logEn-"+w,disabled:true,handler:function(){var C,B,A;C=z.getSelections();B=C[0].data.revision;A=C[1].data.revision;this.winDiff("en"+n,p,B,A)}}]});Ext.getCmp("main-panel").add({closable:true,title:p,originTitle:p,tabTip:"Need Reviewed : in "+n,iconCls:"iconTabNeedReviewed",id:"FNR-"+w,isModifiedLang:false,isModifiedEn:false,layout:"border",defaults:{collapsible:true,split! :true},items:[{region:"west",xtype:"panel",layout:"fit",bodyBorder:false,title:"CvsLog",collapsed:true,width:375,items:{xtype:"tabpanel",activeTab:0,tabPosition:"bottom",defaults:{autoScroll:true},items:[{layout:"fit",title:this.userLang,items:[q]},{layout:"fit",title:"En",items:[x]}]}},{title:this.userLang+" File: "+n+p,originTitle:this.userLang+" File: "+n+p,collapsible:false,id:"FNR-LANG-PANEL-"+w,region:"center",xtype:"form",height:"auto",width:"auto",items:[{xtype:"codemirror",id:"FNR-LANG-"+w,listeners:{scope:this,initialize:function(){this.getFile(w,this.userLang+n,p,"FNR-LANG-PANEL-","FNR-LANG-")},cmcursormove:function(B){var A=Ext.util.JSON.decode(Ext.getCmp("FNR-LANG-"+w).getCursorPosition());Ext.get("FNR-LANG-status-line-"+w).dom.innerHTML=A.line;Ext.get("FNR-LANG-status-col-"+w).dom.innerHTML=A.caracter},cmchange:function(D,B,C){var A=Ext.util.JSON.decode(Ext.getCmp("FNR-LANG-"+w).getCursorPosition());Ext.get("FNR-LANG-status-line-"+w).dom.innerHTML=A.line;Ext.g! et("FNR-LANG-status-col-"+w).dom.innerHTML=A.caracter;if(D!==27&&D!==3 3&&D!==34&&D!==37&&D!==38&&D!==39&&D!==40&&D!==17&&D!==16&&D!==67){if(!Ext.getCmp("FNR-"+w).isModifiedLang){Ext.getCmp("FNR-LANG-PANEL-"+w).setTitle(Ext.getCmp("FNR-LANG-PANEL-"+w).originTitle+' <span style="color:#ff0000; font-weight: bold;">[modified]</span>');Ext.getCmp("FNR-"+w).setTitle(Ext.getCmp("FNR-"+w).originTitle+' <t style="color:#ff0000; font-weight: bold;">*</t>');Ext.getCmp("FNR-LANG-PANEL-btn-save-"+w).enable();Ext.get("FNR-LANG-PANEL-btn-save-"+w).frame("3F8538");Ext.getCmp("FNR-LANG-PANEL-btn-saveas-"+w).enable();Ext.get("FNR-LANG-PANEL-btn-saveas-"+w).frame("3F8538");Ext.getCmp("FNR-"+w).isModifiedLang=true}}},cmscroll:function(A){if(this.userConf.conf_reviewed_scrollbars==="true"){Ext.getCmp("FNR-EN-"+w).scrollTo(A)}}}}],bbar:[{scope:this,xtype:"checkbox",hideLabel:true,checked:(this.userConf.conf_reviewed_scrollbars==="true")?true:false,boxLabel:"Synchronize scroll bars",name:"conf_reviewed_scrollbars",listeners:{scope:this,check:function(A){this.confUpd! ate("conf_reviewed_scrollbars",A.getValue())},render:function(A){Ext.DomHelper.insertHtml("beforeBegin",A.el.dom,'<div style="display: inline;" class="x-statusbar"><span class="x-status-text-panel">Line: <span id="FNR-LANG-status-line-'+w+'">-</span></span> <span class="x-status-text-panel">Col: <span id="FNR-LANG-status-col-'+w+'">-</span></span></div> ')}}}],tbar:[{scope:this,tooltip:"<b>Save</b> this file",iconCls:"saveFile",id:"FNR-LANG-PANEL-btn-save-"+w,disabled:true,handler:function(){this.saveLangFile(w,n,p,"FNR",y,this)}},{scope:this,tooltip:"<b>Save as</b> a patch",iconCls:"saveAsFile",id:"FNR-LANG-PANEL-btn-saveas-"+w,disabled:true,handler:function(){this.savePatch(this.userLang,w,n,p,"FNR",this)}},"->",{tooltip:"<b>Re-indent</b> all this file",iconCls:"iconIndent",handler:function(){Ext.getCmp("FNR-LANG-"+w).reIndentAll()}},{tooltip:"Insert <b>Reviewed</b> tag",text:"Reviewed tag",iconCls:"iconInsertCode",handler:function(){Ext.getCmp("FNR-! LANG-"+w).insertIntoLine(2,"end","\n<!-- Reviewed: no -->");Ext.getCmp ("FNR-LANG-"+w).focus()}},{tooltip:"Insert <b>Revcheck</b> tag",text:"Rev tag",iconCls:"iconInsertCode",handler:function(){Ext.getCmp("FNR-LANG-"+w).insertIntoLine(2,"end","\n<!-- EN-Revision: 1.XX Maintainer: "+this.userLoggin+" Status: ready -->");Ext.getCmp("FNR-LANG-"+w).focus()}}]},{title:"En File: "+n+p,originTitle:"En File: "+n+p,collapsible:false,id:"FNR-EN-PANEL-"+w,region:"east",xtype:"form",height:"auto",width:575,items:[{xtype:"codemirror",id:"FNR-EN-"+w,listeners:{scope:this,initialize:function(){this.getFile(w,"en"+n,p,"FNR-EN-PANEL-","FNR-EN-")},cmchange:function(D,B,C){var A=Ext.util.JSON.decode(Ext.getCmp("FNR-EN-"+w).getCursorPosition());Ext.get("FNR-EN-status-line-"+w).dom.innerHTML=A.line;Ext.get("FNR-EN-status-col-"+w).dom.innerHTML=A.caracter;if(D!==27&&D!==33&&D!==34&&D!==37&&D!==38&&D!==39&&D!==40&&D!==17&&D!==16&&D!==67){if(!Ext.getCmp("FNR-"+w).isModifiedEn){Ext.getCmp("FNR-EN-PANEL-"+w).setTitle(Ext.getCmp("FNR-EN-PANEL-"+w).originTitle+' <span sty! le="color:#ff0000; font-weight: bold;">[modified]</span>');Ext.getCmp("FNR-"+w).setTitle(Ext.getCmp("FNR-"+w).originTitle+' <t style="color:#ff0000; font-weight: bold;">*</t>');Ext.getCmp("FNR-EN-PANEL-btn-save-"+w).enable();Ext.get("FNR-EN-PANEL-btn-save-"+w).frame("3F8538");Ext.getCmp("FNR-EN-PANEL-btn-saveas-"+w).enable();Ext.get("FNR-EN-PANEL-btn-saveas-"+w).frame("3F8538");Ext.getCmp("FNR-"+w).isModifiedEn=true}}},cmscroll:function(A){if(this.userConf.conf_reviewed_scrollbars==="true"){Ext.getCmp("FNR-LANG-"+w).scrollTo(A)}},cmcursormove:function(B){var A=Ext.util.JSON.decode(Ext.getCmp("FNR-EN-"+w).getCursorPosition());Ext.get("FNR-EN-status-line-"+w).dom.innerHTML=A.line;Ext.get("FNR-EN-status-col-"+w).dom.innerHTML=A.caracter}}}],bbar:[{scope:this,xtype:"panel",height:21,baseCls:"",bodyStyle:"padding-top:5px;",html:'<div style="display: inline;" class="x-statusbar"><span class="x-status-text-panel">Line: <span id="FNR-EN-status-line-'+w+'">-</span></span>  ! ;<span class="x-status-text-panel">Col: <span id="FNR-EN-status-col-'+ w+'">-</span></span></div> '}],tbar:[{scope:this,tooltip:"<b>Save</b> this file",iconCls:"saveFile",id:"FNR-EN-PANEL-btn-save-"+w,disabled:true,handler:function(){this.saveEnFile(w,n,p,"FNR",y,this)}},{scope:this,tooltip:"<b>Save as</b> a patch",iconCls:"saveAsFile",id:"FNR-EN-PANEL-btn-saveas-"+w,disabled:true,handler:function(){this.savePatch("en",w,n,p,"FNR",this)}},"->",{tooltip:"<b>Re-indent</b> all this file",iconCls:"iconIndent",handler:function(){Ext.getCmp("FNR-EN-"+w).reIndentAll()}}]}]});Ext.getCmp("main-panel").setActiveTab("FNR-"+w)}else{Ext.getCmp("main-panel").setActiveTab("FNR-"+w)}}}});g=new Ext.grid.GridPanel({title:"Summary",iconCls:"flag-"+this.userLang,store:this.storeSummary,loadMask:true,columns:[new Ext.grid.RowNumberer(),{id:"StatusType",header:"File status type",width:180,sortable:true,dataIndex:"libel"},{header:"Number of files",width:110,sortable:true,dataIndex:"nbFiles"},{header:"Percent of files",width:110,sortable:true,dataIndex:"per! centFiles"},{header:"Size of files (kB)",width:110,sortable:true,dataIndex:"sizeFiles"},{header:"Percent of size",width:110,sortable:true,dataIndex:"percentSize"}],autoScroll:true,height:400,width:800,view:new Ext.grid.GridView({getRowClass:function(m,p,o,n){if(m.data.id===1){return"summary_1"}if(m.data.id===2){return"summary_2"}if(m.data.id===3){return"summary_3"}if(m.data.id===4){return"summary_4"}if(m.data.id===5){return"summary_5"}}}),listeners:{scope:this,render:function(m){m.store.load()}}});f=new Ext.grid.GridPanel({title:"Translators",iconCls:"iconTranslator",store:this.storeTranslators,loadMask:true,columns:[new Ext.grid.RowNumberer(),{id:"GridTransName",header:"Name",sortable:true,dataIndex:"name",summaryType:"count",summaryRenderer:this.rendererTotalTranslator},{header:"Email",width:110,sortable:true,dataIndex:"email"},{header:"Nick",width:70,sortable:true,dataIndex:"nick"},{header:"Cvs",width:45,sortable:true,dataIndex:"cvs"},{header:"UptoDate",width:60,sortable! :true,renderer:this.rendererNumUptodate,dataIndex:"uptodate",summaryTy pe:"sum"},{header:"Old",width:45,sortable:true,renderer:this.rendererSum,dataIndex:"old",summaryType:"sum"},{header:"Critical",width:60,sortable:true,renderer:this.rendererNumCritical,dataIndex:"critical",summaryType:"sum"},{header:"Sum",width:50,sortable:true,renderer:this.rendererSum,dataIndex:"sum",summaryType:"sum"}],plugins:[new Ext.ux.grid.GridSummary()],autoScroll:true,autoExpandColumn:"GridTransName",height:400,width:800,listeners:{scope:this,render:function(){this.storeTranslators.load()},rowdblclick:function(o,q,p){var m,n;o.getSelectionModel().selectRow(q);m=this.storeTranslators.getAt(q).data.email;n=this.storeTranslators.getAt(q).data.name;this.sendEmail(n,m)},rowcontextmenu:function(o,r,p){var m,n,q;o.getSelectionModel().selectRow(r);m=this.storeTranslators.getAt(r).data.email;n=this.storeTranslators.getAt(r).data.name;q=new Ext.menu.Menu({id:"submenu",items:[{scope:this,text:"<b>Send an email to "+n+"</b>",iconCls:"iconSendEmail",handler:function(){this.sendEm! ail(n,m)}},"-",{scope:this,text:"Send an email to the doc-"+this.userLang+"@lists.php.net",iconCls:"iconSendEmail",handler:function(){this.sendEmail("Php Doc Team "+this.userLang,"doc-"+this.userLang+"@lists.php.net")}}]});q.showAt(p.getXY())}}});i=new Ext.grid.GridPanel({store:this.storeMailing,title:"Mails from doc-"+this.userLang,iconCls:"home-mailing-title",loadMask:true,columns:[new Ext.grid.RowNumberer(),{id:"GridMailingTitle",header:"Title",sortable:true,dataIndex:"title"},{header:"By",width:110,sortable:true,dataIndex:"description"},{header:"Date",width:140,sortable:true,dataIndex:"pubDate",renderer:Ext.util.Format.dateRenderer("Y/m/d, H:i")}],autoScroll:true,height:400,width:800,autoExpandColumn:"GridMailingTitle",sm:new Ext.grid.RowSelectionModel({singleSelect:true}),tbar:[{scope:this,tooltip:"Refresh this grid",iconCls:"refresh",handler:function(){this.storeMailing.reload()}}],listeners:{scope:this,render:function(){this.storeMailing.load()},rowcontextmenu:functi! on(m,p,n){var o;m.getSelectionModel().selectRow(p);o=new Ext.menu.Menu ({id:"submenu",items:[{text:"<b>Open in a new Tab</b>",iconCls:"openInTab",scope:this,handler:function(){i.fireEvent("rowdblclick",m,p,n)}},"-",{text:"Refresh this grid",iconCls:"refresh",scope:this,handler:function(){this.storeMailing.reload()}}]});o.showAt(n.getXY())},rowdblclick:function(n,r,p){var m,q,o;m=this.storeMailing.getAt(r).data.pubDate;q=this.storeMailing.getAt(r).data.link;o=this.storeMailing.getAt(r).data.title;this.NewTabMailing(m,q,o)}}});e=new Ext.grid.GridPanel({store:this.storeBugs,title:"Open bugs for doc-"+this.userLang,iconCls:"iconBugs",loadMask:true,columns:[{id:"GridBugTitle",header:"Title",sortable:true,dataIndex:"title"}],stripeRows:true,autoHeight:true,viewConfig:{emptyText:"No open Bugs",forceFit:true,enableRowBody:true,getRowClass:function(m,q,o,n){o.body='<p class="bug-desc">'+m.data.description+"</p>";return"x-grid3-row-expanded"}},autoExpandColumn:"GridBugTitle",sm:new Ext.grid.RowSelectionModel({singleSelect:true}),width:800,tbar:[{scope:th! is,tooltip:"Refresh this grid",iconCls:"refresh",handler:function(){this.storeBugs.reload()}}],listeners:{scope:this,render:function(){this.storeBugs.load()},rowcontextmenu:function(m,p,n){var o;m.getSelectionModel().selectRow(p);o=new Ext.menu.Menu({id:"submenu",items:[{text:"<b>Open in a new Tab</b>",iconCls:"openInTab",scope:this,handler:function(){e.fireEvent("rowdblclick",m,p,n)}},"-",{text:"Refresh this grid",iconCls:"refresh",scope:this,handler:function(){this.storeBugs.reload()}}]});o.showAt(n.getXY())},rowdblclick:function(o,r,q){var m,n,p;m=this.storeBugs.getAt(r).data.id;n=this.storeBugs.getAt(r).data.link;p=this.storeBugs.getAt(r).data.title;this.NewTabBugs(m,n,p)}}});k={title:"Graphics",layout:"fit",autoHeight:true,iconCls:"home-graphic-title",html:'<div align="center" id="graph_container" style="width: 530px; height: 302px"><img id="graph_picture" src="" height="300"></div>',listeners:{afterlayout:function(){var m,o,n;m=Ext.get("graph_picture");o=Ext.get("grap! h_container");m.setVisibilityMode(Ext.Element.VISIBILITY);n=new Ext.Lo adMask(o);m.on("load",function(){m.stopFx();n.hide();m.fadeIn({duration:2})});n.show();m.hide();m.dom.src="/php/image_info.php"}}};this.treeAllFiles=new Ext.tree.TreePanel({animate:true,autoScroll:true,useArrows:true,loader:new Ext.tree.TreeLoader({dataUrl:"./php/controller.php",baseParams:{task:"getAllFiles"}}),enableDD:false,containerScroll:true,bodyBorder:false,listeners:{scope:this,dblclick:function(q,v){var n,m,w,y,u,r,p,o,s,x;if(q.attributes.type==="file"){n=q.attributes.text;m=q.attributes.id;w=Ext.util.md5("AF-"+m+n);if(!Ext.getCmp("main-panel").findById("AF-"+w)){y=m.split("/");y.shift();y.shift();y.pop();m=y.join("/")+"/";u="xml";if(q.attributes.extension==="xml"){u="xml"}if(q.attributes.extension==="html"){u="html"}if(q.attributes.extension==="php"){u="php"}r=new Ext.data.Store({autoLoad:true,proxy:new Ext.data.HttpProxy({url:"/php/controller.php"}),baseParams:{task:"get-log",Path:m,File:n},reader:new Ext.data.JsonReader({root:"Items",totalProperty:"nbItems",id:"i! d"},[{name:"id",mapping:"id"},{name:"revision",mapping:"revision"},{name:"date",mapping:"date",type:"date",dateFormat:"Y/m/d H:i:s"},{name:"author",mapping:"author"},{name:"content",mapping:"content"}])});r.setDefaultSort("date","desc");p=new Ext.grid.CheckboxSelectionModel({singleSelect:false,width:22,header:"",listeners:{beforerowselect:function(z){var t=z.getCount();if(t===2){return false}},rowselect:function(z){var t=z.getCount();if(t===2){Ext.getCmp("AF-PANEL-btn-log-"+w).enable();Ext.get("AF-PANEL-btn-log-"+w).frame("3F8538")}else{Ext.getCmp("AF-PANEL-btn-log-"+w).disable()}},rowdeselect:function(z){var t=z.getCount();if(t===2){Ext.getCmp("AF-PANEL-btn-log-"+w).enable();Ext.get("AF-PANEL-btn-log-"+w).frame("3F8538")}else{Ext.getCmp("AF-PANEL-btn-log-"+w).disable()}}}});o=new Ext.grid.GridPanel({store:r,id:"AF-PANEL-log-"+w,loadMask:true,columns:[p,{id:"id",header:"Rev.",width:40,sortable:false,dataIndex:"revision"},{header:"Content",width:130,sortable:true,dataIndex:"! content"},{header:"By",width:50,sortable:true,dataIndex:"author"},{hea der:"Date",width:85,sortable:true,dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y/m/d, H:i")}],autoHeight:true,autoExpandColumn:"content",bodyBorder:false,sm:p,view:new Ext.grid.GridView({forceFit:true}),tbar:[{scope:this,tooltip:"<b>View</b> the diff",iconCls:"iconViewDiff",id:"AF-PANEL-btn-log-"+w,disabled:true,handler:function(){var A,z,t;A=p.getSelections();z=A[0].data.revision;t=A[1].data.revision;this.winDiff(m,n,z,t)}}]});s={region:"west",xtype:"panel",layout:"fit",bodyBorder:false,title:"CvsLog",collapsed:true,width:375,items:{scope:this,xtype:"tabpanel",activeTab:0,tabPosition:"bottom",defaults:{autoScroll:true},items:[{layout:"fit",title:"Log",items:[o]}]}};x={title:"File: "+m+n,originTitle:"File: "+m+n,collapsible:false,id:"AF-PANEL-"+w,region:"center",xtype:"form",height:"auto",width:"auto",items:[{xtype:"codemirror",id:"AF-FILE-"+w,isModified:false,parser:u,listeners:{scope:this,initialize:function(){this.getFile(w,m,n,"AF-PANEL-","AF-FILE-")},cmchange! :function(B,z,A){var t=Ext.util.JSON.decode(Ext.getCmp("AF-FILE-"+w).getCursorPosition());Ext.get("AF-status-line-"+w).dom.innerHTML=t.line;Ext.get("AF-status-col-"+w).dom.innerHTML=t.caracter;if(B!==27&&B!==33&&B!==34&&B!==37&&B!==38&&B!==39&&B!==40&&B!==17&&B!==16&&B!==67){if(!Ext.getCmp("AF-FILE-"+w).isModified){Ext.getCmp("AF-PANEL-"+w).setTitle(Ext.getCmp("AF-PANEL-"+w).originTitle+' <span style="color:#ff0000; font-weight: bold;">[modified]</span>');Ext.getCmp("AF-"+w).setTitle(Ext.getCmp("AF-"+w).originTitle+' <t style="color:#ff0000; font-weight: bold;">*</t>');Ext.getCmp("AF-PANEL-btn-save-"+w).enable();Ext.get("AF-PANEL-btn-save-"+w).frame("3F8538");Ext.getCmp("AF-PANEL-btn-saveas-"+w).enable();Ext.get("AF-PANEL-btn-saveas-"+w).frame("3F8538");Ext.getCmp("AF-FILE-"+w).isModified=true}}},cmcursormove:function(){var t=Ext.util.JSON.decode(Ext.getCmp("AF-FILE-"+w).getCursorPosition());Ext.get("AF-status-line-"+w).dom.innerHTML=t.line;Ext.get("AF-status-col-"+w).dom.i! nnerHTML=t.caracter}}}],bbar:[{scope:this,xtype:"panel",height:21,base Cls:"",bodyStyle:"padding-top:5px;",html:'<div style="display: inline;" class="x-statusbar"><span class="x-status-text-panel">Line: <span id="AF-status-line-'+w+'">-</span></span> <span class="x-status-text-panel">Col: <span id="AF-status-col-'+w+'">-</span></span></div> '}],tbar:[{scope:this,tooltip:"<b>Save</b> this file",iconCls:"saveFile",id:"AF-PANEL-btn-save-"+w,disabled:true,handler:function(){Ext.getCmp("AF-PANEL-btn-save-"+w).disable();Ext.getCmp("AF-FILE-"+w).isModified=false;Ext.getCmp("AF-PANEL-"+w).setTitle(Ext.getCmp("AF-PANEL-"+w).originTitle);Ext.getCmp("AF-"+w).setTitle(Ext.getCmp("AF-"+w).originTitle);var t=Ext.MessageBox.wait("Saving data...");Ext.Ajax.request({scope:this,url:"../php/controller.php",params:{task:"save-file",filePath:m,fileName:n,fileLang:"all",fileContent:Ext.getCmp("AF-FILE-"+w).getCode()},success:function(A,z){var B=Ext.util.JSON.decode(A.responseText);if(B.success){this.addToPendingCommit(m,n);t.hide()}}})}},{scope! :this,tooltip:"<b>Save as</b> a patch",iconCls:"saveAsFile",id:"AF-PANEL-btn-saveas-"+w,disabled:true,handler:function(){this.savePatch("all",w,m,n,"AF",this)}},"->",{tooltip:"<b>Re-indent</b> all this file",iconCls:"iconIndent",handler:function(){Ext.getCmp("AF-FILE-"+w).reIndentAll()}}]};if(q.attributes.extension==="gif"||q.attributes.extension==="png"){x={xtype:"panel",layout:"fit",bodyStyle:"padding:5px 5px 0",html:'<img src="/data/'+this.userLoggin+"/phpdoc-"+this.userLang+m+'" />'};s={}}Ext.getCmp("main-panel").add({closable:true,title:n,originTitle:n,tabTip:"in "+m,iconCls:"AllFiles",id:"AF-"+w,layout:"border",defaults:{collapsible:true,split:true},items:[x,s]});Ext.getCmp("main-panel").setActiveTab("AF-"+w)}else{Ext.getCmp("main-panel").setActiveTab("AF-"+w)}}}}});this.treeSort=new Ext.tree.TreeSorter(this.treeAllFiles,{folderSort:true});this.treeAllFilesRoot=new Ext.tree.AsyncTreeNode({text:"Repository",draggable:false,id:"/"});this.treeAllFiles.setRootNode(this.tr! eeAllFilesRoot);b=new Ext.menu.Menu({id:"mainMenu",items:[{scope:this, text:"Refresh all data",iconCls:"refresh",tooltip:"<b>Refresh all data</b><br>Cvs update & apply all tools",handler:this.WinUpdate},{scope:this,text:"Check Build",iconCls:"checkBuild",tooltip:"<b>Check your build</b> using configure.php script",handler:this.WinCheckBuild},"-",{scope:this,text:"Configure",iconCls:"iconConf",tooltip:"<b>Configure</b> this tool",id:"winconf-btn",handler:this.WinConf},"-",{scope:this,text:"Erase my personal data",iconCls:"iconErasePersonalData",tooltip:"<b>Log out</b>",handler:function(){Ext.MessageBox.confirm("Confirm","This action will erase your personal data. All content about this account will be deleted definitively. Are you sure you want to do that ?",function(m){if(m==="yes"){Ext.getBody().mask('<img src="/img/loading.gif" style="vertical-align: middle;" /> Please, wait...');Ext.Ajax.request({url:"./php/controller.php",params:{task:"erase-personal-data"},success:function(n){Ext.getBody().unmask();var p=Ext.util.JSON.decode(n.responseText! );if(p.success){Ext.MessageBox.show({title:"Thanks !",msg:"Thank you for using this application !",icon:Ext.MessageBox.INFO,buttons:Ext.MessageBox.OK,fn:function(){window.location.href="/logout.php"}})}}})}})}},"-",{text:"Log out",iconCls:"iconLogOut",tooltip:"<b>Log out</b>",handler:function(){Ext.MessageBox.confirm("Confirm","Are you sure you want to logout?",function(m){if(m==="yes"){window.location.href="/logout.php"}})}},"-",{scope:this,text:"About",iconCls:"iconHelp",tooltip:"<b>About</b><br/>"+this.appName,id:"winabout-btn",handler:function(){this.WinAbout()}}]});d=new Ext.Viewport({layout:"border",items:[{region:"north",html:'<h1 class="x-panel-header"><img src="/img/mini_php.png" style="vertical-align: middle;" /> '+this.appName+"</h1>",autoHeight:true,border:false,margins:"0 0 5 0"},{region:"west",collapsible:true,collapseMode:"mini",animate:true,split:true,layout:"fit",width:300,autoScroll:true,items:[{layout:"accordion",animate:true,bodyBorder:false,b! order:false,tbar:[{text:"Main Menu",iconCls:"MainMenu",menu:b}],items: [{title:'Files Need Update - <em id="acc-need-update-nb">0</em>',id:"acc-need-update",layout:"fit",iconCls:"FilesNeedUpdate",items:[l],collapsed:true},{title:'Error in current translation - <em id="acc-error-nb">0</em>',id:"acc-error",layout:"fit",iconCls:"FilesError",items:[j],collapsed:true},{title:'Files Need Reviewed - <em id="acc-need-reviewed-nb">0</em>',id:"acc-need-reviewed",layout:"fit",iconCls:"FilesNeedReviewed",items:[h],collapsed:true},{title:"All files",id:"acc-all-files",layout:"fit",iconCls:"AllFiles",items:[this.treeAllFiles],collapsed:true},{title:'Pending for commit - <em id="acc-pendingCommit-nb">0</em>',id:"acc-need-pendingCommit",layout:"fit",iconCls:"PendingCommit",items:[c],collapsed:true},{title:'Pending Patch - <em id="acc-pendingPatch-nb">0</em>',id:"acc-need-pendingPatch",layout:"fit",iconCls:"PendingPatch",items:[a],collapsed:true}]}]},{region:"center",xtype:"tabpanel",id:"main-panel",activeTab:0,enableTabScroll:true,plugins:new Ext.ux.TabCloseMe! nu(),listeners:{scope:this,beforeremove:this.removeTabEvent},items:[{title:"Home",baseCls:"MainInfoTabPanel",xtype:"panel",autoScroll:true,id:"MainInfoTabPanel",plain:true,items:[{xtype:"panel",border:false,html:'<div class="res-block"><div class="res-block-inner"><h3>Connected as <em>'+this.userLoggin+"</em></h3></div></div>"},{xtype:"tabpanel",activeTab:0,plain:true,autoScroll:true,height:400,border:false,defaults:{border:true},items:[g,f,i,e,k]}]}]}]})}}}();Ext.EventManager.onDocumentReady(phpDoc.init,phpDoc,true); http://cvs.php.net/viewvc.cgi/doc-editor/php/class.php?r1=1.3&r2=1.4&diff_format=u Index: doc-editor/php/class.php diff -u doc-editor/php/class.php:1.3 doc-editor/php/class.php:1.4 --- doc-editor/php/class.php:1.3 Sat Mar 28 23:53:29 2009 +++ doc-editor/php/class.php Sun Mar 29 02:44:06 2009 @@ -57,25 +57,25 @@ function __construct() { // Database settings - $_MysqlServ='localhost'; - $_MysqlUser='root'; - $_MysqlMdp='xxxxxxx'; - $_MysqlDB='doc-editor'; + $_MysqlServ = 'localhost'; + $_MysqlUser = 'root'; + $_MysqlMdp = 'xxxxxxx'; + $_MysqlDB = 'doc-editor'; // Connection MySqli try { $this->db = new mysqli($_MysqlServ, $_MysqlUser, $_MysqlMdp, $_MysqlDB); - if(mysqli_connect_errno()){ + if (mysqli_connect_errno()) { throw new Exception('connect databases faild!'); } } - catch (Exception $e){ - echo $e->getMessage(); + catch (Exception $e) { + echo $e->getMessage(); exit; } // - $this->availableLanguage = Array('ar','pt_BR','bg','zh','hk','tw','cs','da','nl','fi','fr','de','el','he','hu','it','ja','kr','no','fa','pl','pt','ro','ru', 'se','sk','sl','es','sv','tr'); + $this->availableLanguage = array('ar','pt_BR','bg','zh','hk','tw','cs','da','nl','fi','fr','de','el','he','hu','it','ja','kr','no','fa','pl','pt','ro','ru', 'se','sk','sl','es','sv','tr'); // $this->cvsDoc = $_SERVER["DOCUMENT_ROOT"].$this->dataPath."phpdoc-all/"; @@ -88,15 +88,17 @@ function checkoutRepository() { + $lock_file = $_SERVER["DOCUMENT_ROOT"].$this->dataPath.".lock_checkout_repository"; + // We place a lock file to test if checkout is finish - touch($_SERVER["DOCUMENT_ROOT"].$this->dataPath.".lock_checkout_repository"); + touch($lock_file); // We exec the checkout $cmd = "cd ".$_SERVER["DOCUMENT_ROOT"].$this->dataPath."; cvs -d :pserver:cvsread:phpfi@cvs.php.net:/repository login; cvs -d :pserver:cvsread:phpfi@cvs.php.net:/repository checkout phpdoc-all;"; exec($cmd); // We remove the lock file - unlink($_SERVER["DOCUMENT_ROOT"].$this->dataPath.".lock_checkout_repository"); + unlink($lock_file); } @@ -108,8 +110,6 @@ * @return Nothing. */ function rev_do_revcheck( $dir = '', $idDir ) { - static $id = 1; - if ($dh = opendir($this->cvsDoc . 'en/' . $dir)) { $entriesDir = array(); @@ -158,7 +158,7 @@ // $this->Check_doc() ? is this dir is /reference/*/functions/ ? $tmp = explode('/', $dir); - if( isset($tmp[1]) && isset($tmp[3]) && $tmp[1] == 'reference' && $tmp[3] == 'functions' ) { + if (isset($tmp[1]) && isset($tmp[3]) && $tmp[1] == 'reference' && $tmp[3] == 'functions' ) { $check_doc = $this->check_doc($infoEN['content']); @@ -180,12 +180,12 @@ $s = "INSERT INTO files (lang, xmlid, dir, path, name, revision, size, mdate, maintainer, status, check_oldstyle, check_undoc, check_roleerror, check_badorder, check_noseealso, check_noreturnvalues, check_noparameters, check_noexamples,check_noerrors) VALUES ('en', $xmlid, '$idDir', '$dir/', '$file', $en_revision, $en_size,$en_date, NULL, NULL, ".$check_doc['check_oldstyle'].", ".$check_doc['check_undoc'].", ".$check_doc['check_roleerror'].", ".$check_doc['check_badorder'].", ".$check_doc['check_noseealso'].", ".$check_doc['check_noreturnvalues'].", ".$check_doc['check_noparameters'].", ".$check_doc['check_noexamples'].", ".$check_doc['check_noerrors'].")"; - $this->db->query($s) or die('erreur:'.$this->db->error); + $this->db->query($s) or die('Error: '.$this->db->error); reset($this->availableLanguage); // Do for all language - while( list(, $lang) = each($this->availableLanguage)) { + while (list(, $lang) = each($this->availableLanguage)) { $path = $this->cvsDoc . $lang . $dir . '/' . $file; @@ -225,16 +225,16 @@ $status )"; - $this->db->query($s) or die('erreur:'.$this->db->error); + $this->db->query($s) or die('Error: '.$this->db->error); // Check for error in this file ONLY if this file is uptodate - if( $revision == $en_revision ) { + if ($revision == $en_revision ) { $error = $this->tools_error_check_all($infoLANG['content'], $infoEN['content']); - if( count($error) > 0 ) { $this->tools_error_log($lang, $dir.'/', $file, $error, $maintainer); } + if (count($error) > 0 ) { $this->tools_error_log($lang, $dir.'/', $file, $error, $maintainer); } } } else { - $this->db->query("INSERT INTO files (lang, dir, path, name, revision, size, mdate, maintainer, status) VALUES ('".$lang."', '$idDir', '$dir/', '$file', NULL, NULL, NULL, NULL, NULL);") or die('erreur:'.$this->db->error); + $this->db->query("INSERT INTO files (lang, dir, path, name, revision, size, mdate, maintainer, status) VALUES ('".$lang."', '$idDir', '$dir/', '$file', NULL, NULL, NULL, NULL, NULL);") or die('Error: '.$this->db->error); } } @@ -253,7 +253,7 @@ $path = $this->cvsDoc . 'en/' . $dir . '/' . $Edir; - $this->db->query("INSERT INTO dirs (parentDir, name) VALUES (" . $idDir . ", '$Edir');") or die('erreur:'.$this->db->error); + $this->db->query("INSERT INTO dirs (parentDir, name) VALUES (" . $idDir . ", '$Edir');") or die('Error: '.$this->db->error); $last_id = $this->db->insert_id; $this->rev_do_revcheck($dir . '/' . $Edir, $last_id); @@ -277,8 +277,8 @@ /** * Log into this application. - * @param $cvsLogin The login use to identify this user into Cvs Php server. - * @param $cvsPasswd The password, in plain text, to identify this user into Cvs Php server. + * @param $cvsLogin The login use to identify this user into PHP CVS server. + * @param $cvsPasswd The password, in plain text, to identify this user into PHP CVS server. * @param $lang The language we want to access. * @return An associated array. */ @@ -291,7 +291,7 @@ $r = $this->db->query($s) or die($this->db->error); $n = $r->num_rows; - if( $n == 0 ) { + if ($n == 0 ) { // No match $this->cvsLogin = $cvsLogin; @@ -301,13 +301,13 @@ $s = 'SELECT * FROM users WHERE cvs_login=\''.$cvsLogin.'\''; $r = $this->db->query($s) or die($this->db->error); $n = $r->num_rows; - if( $n == 0 ) { + if ($n == 0 ) { //User unknow from this server for now. // Is a valid cvs user ? $r = $this->cvsLoggingIn(); - if( $r === TRUE ) { + if ($r === TRUE ) { // We register this new valid user $userID = $this->register_user(); @@ -317,7 +317,7 @@ $_SESSION['cvsLogin'] = $this->cvsLogin; $_SESSION['cvsPasswd'] = $this->cvsPasswd; $_SESSION['lang'] = $this->cvsLang; - $_SESSION['userConf'] = Array( + $_SESSION['userConf'] = array( "conf_needupdate_diff" => 'using-exec', "conf_needupdate_scrollbars" => 'true', "conf_error_skipnbliteraltag" => 'true', @@ -329,7 +329,7 @@ $return['state'] = TRUE; - } elseif( $r == 'Bad password') { + } elseif ($r == 'Bad password') { $return['state'] = FALSE; $return['msg'] = 'Bad cvs password'; } else { @@ -352,7 +352,7 @@ $this->cvsLogin = $cvsLogin; $this->cvsPasswd = $cvsPasswd; $this->cvsLang = $lang; - $this->userConf = Array( + $this->userConf = array( "conf_needupdate_diff" => $a->conf_needupdate_diff, "conf_needupdate_scrollbars" => $a->conf_needupdate_scrollbars, "conf_error_skipnbliteraltag" => $a->conf_error_skipnbliteraltag, @@ -394,13 +394,13 @@ */ function isLogged() { - if( isset($_SESSION['userID']) ) { + if (isset($_SESSION['userID'])) { $this->userID = $_SESSION['userID']; $this->cvsLogin = $_SESSION['cvsLogin']; $this->cvsPasswd = $_SESSION['cvsPasswd']; $this->cvsLang = $_SESSION['lang']; - $this->userConf = ( isset($_SESSION['userConf']) ) ? $_SESSION['userConf'] : Array( + $this->userConf = ( isset($_SESSION['userConf']) ) ? $_SESSION['userConf'] : array( "conf_needupdate_diff" => 'using-exec', "conf_needupdate_scrollbars" => 'true', "conf_error_skipnbliteraltag" => 'true', @@ -418,12 +418,15 @@ } /** - * Register a new valid user on this application. - * Warning : Actually, we store the cvs password in plain text into the database to use it later. No others solution for now... + * Register a new valid user on the application. + * + * @todo The CVS password is stored in plain text into the database for later use. We need to find something better + * @return int The database insert id */ - function register_user() { - $s = 'INSERT INTO users (`cvs_login`, `cvs_passwd`) VALUES (\''.$this->cvsLogin.'\',\''.$this->cvsPasswd.'\')'; - $r = $this->db->query($s) or die($this->db->error); + function register_user() + { + $s = sprintf('INSERT INTO users (`cvs_login`, `cvs_passwd`) VALUES ("%s", "%s")', $this->cvsLogin, $this->cvsPasswd); + $this->db->query($s) or die($this->db->error); return $this->db->insert_id; } @@ -444,18 +447,14 @@ } /** - * Test if a lock file exist. + * Tells whether the lock file exist + * * @param $lockFile The name of the lock file we want to test. - * @return TRUE if the lock file exist, FALSE otherwise. + * @return TRUE if the lock file exists, FALSE otherwise. */ - function lockFileCheck($lockFile) { - - if( is_file($_SERVER["DOCUMENT_ROOT"].$this->dataPath."/.".$lockFile) ) { - return TRUE; - } else { - return FALSE; - } - + function lockFileCheck($lockFile) + { + return is_file($_SERVER["DOCUMENT_ROOT"].$this->dataPath."/.".$lockFile); } /** @@ -478,45 +477,56 @@ /** * CleanUp the dataBase before an Update. + * * @see updateRepository */ - function cleanUp() { - + function cleanUp() + { // We cleanUp the database before update Cvs and apply again all tools - $s = 'TRUNCATE TABLE dirs'; - $this->db->query($s) or die($this->db->error); - $s = 'TRUNCATE TABLE files'; - $this->db->query($s) or die($this->db->error); - $s = 'TRUNCATE TABLE translators'; - $this->db->query($s) or die($this->db->error); - $s = 'TRUNCATE TABLE errorfiles'; - $this->db->query($s) or die($this->db->error); - + foreach (array('dirs', 'files', 'translators', 'errorfiles') as $table) { + $this->db->query(sprintf('TRUNCATE TABLE %s', $table)) or die($this->db->error); + } } /** - * Use to encode Cvs Password when we try to identify the user into Cvs Php Server. + * Use to encode Cvs Password when we try to identify the user into PHP CVS Server. * @param $pass The password to encode. * @param $letter The password to encode. * @return TRUE if the lock file is present, FALSE otherwise. */ function encodeCvsPass($pass, $letter) { - define('CVS_AUTH_CODES', "0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 114, 120, 53, 79, 96, 109, 72, 108, 70, 64, 76, 67, 116, 74, 68, 87, 111, 52, 75, 119, 49, 34, 82, 81, 95, 65, 112, 86, 118, 110, 122, 105, 41, 57, 83, 43, 46, 102, 40, 89, 38, 103, 45, 50, 42, 123, 91, 35, 125, 55, 54, 66, 124, 126, 59, 47, 92, 71, 115, 78, 88, 107, 106, 56, 36, 121, 117, 104, 101, 100, 69, 73, 99, 63, 94, 93, 39, 37, 61, 48, 58, 113, 32, 90, 44, 98, 60, 51, 33, 97, 62, 77, 84, 80, 85, 223, 225, 216, 187, 166, 229, 189, 222, 188, 141, 249, 148, 200, 184, 136, 248, 190, 199, 170, 181, 204, 138, 232, 218, 183, 255, 234, 220, 247, 213, 203, 226, 193, 174, 172, 228, 252, 217, 201, 131, 230, 197, 211, 145, 238, 161, 179, 160, 212, 207, 221, 254, 173, 202, 146, 224, 151, 140, 196, 205, 130, 135, 133, 143, 246, 192, 159, 244, 239, 185, 168, 215, 144, 139, 165, 180, 157, 147, 186, 214, 176, 227, 231, 219, 169, 175,! 156, 206, 198, 129, 164, 150, 210, 154, 177, 134, 127, 182, 128, 158, 208, 162, 132, 167, 209, 149, 241, 153, 251, 237, 236, 171, 195, 243, 233, 253, 240, 194, 250, 191, 155, 142, 137, 245, 235, 163, 242, 178, 152" ); + static $code = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 114, 120, 53, 79, 96, 109, 72, 108, 70, 64, 76, 67, 116, 74, 68, + 87, 111, 52, 75, 119, 49, 34, 82, 81, 95, 65, 112, 86, 118, 110, 122, + 105, 41, 57, 83, 43, 46, 102, 40, 89, 38, 103, 45, 50, 42, 123, 91, + 35, 125, 55, 54, 66, 124, 126, 59, 47, 92, 71, 115, 78, 88, 107, 106, + 56, 36, 121, 117, 104, 101, 100, 69, 73, 99, 63, 94, 93, 39, 37, 61, + 48, 58, 113, 32, 90, 44, 98, 60, 51, 33, 97, 62, 77, 84, 80, 85, 223, + 225, 216, 187, 166, 229, 189, 222, 188, 141, 249, 148, 200, 184, 136, + 248, 190, 199, 170, 181, 204, 138, 232, 218, 183, 255, 234, 220, 247, + 213, 203, 226, 193, 174, 172, 228, 252, 217, 201, 131, 230, 197, 211, + 145, 238, 161, 179, 160, 212, 207, 221, 254, 173, 202, 146, 224, 151, + 140, 196, 205, 130, 135, 133, 143, 246, 192, 159, 244, 239, 185, 168, + 215, 144, 139, 165, 180, 157, 147, 186, 214, 176, 227, 231, 219, 169, + 175, 156, 206, 198, 129, 164, 150, 210, 154, 177, 134, 127, 182, 128, + 158, 208, 162, 132, 167, 209, 149, 241, 153, 251, 237, 236, 171, 195, + 243, 233, 253, 240, 194, 250, 191, 155, 142, 137, 245, 235, 163, 242, + 178, 152); - $code = explode(", ",CVS_AUTH_CODES); - $f=$letter; - for($i=0; $i < strlen($pass); $i++) - $f .=chr( $code[ ord($pass[$i]) ] ); - return $f; + for ($i = 0; $i < strlen($pass); $i++) { + $letter .= chr($code[ord($pass[$i])]); + } + return $letter; } /** - * Loggin into Cvs Php Server. + * Loggin into PHP CVS Server. * @return TRUE if the loggin success, error message otherwise. */ function cvsLoggingIn() { - $fp = fsockopen( "cvs.php.net", 2401,$e,$errorstr); + $fp = fsockopen("cvs.php.net", 2401); fwrite($fp, "BEGIN AUTH REQUEST\n"); fwrite($fp, "/repository\n"); fwrite($fp, $this->cvsLogin."\n"); @@ -526,13 +536,13 @@ $r = fread($fp,1024); - if ( trim($r) != "I LOVE YOU" ) { - if ( trim($r) == "I HATE YOU") { - return "Bad password"; + if (trim($r) != 'I LOVE YOU') { + if (trim($r) == 'I HATE YOU') { + return 'Bad password'; } else { return $r; } - }else { + } else { return TRUE; } @@ -548,6 +558,7 @@ $cmd = 'cd '.$this->cvsDoc.$Path.'; cvs log '.$File; + $output = array(); exec($cmd, $output); $output = implode("\n", $output); @@ -556,36 +567,39 @@ $part = explode("----------------------------", $output); - for( $i=1; $i < count($part); $i++ ) { + for ($i=1; $i < count($part); $i++ ) { $final[$i-1]['id'] = $i; $final[$i-1]['raw'] = $part[$i]; // Get revision - preg_match("/revision (.*?)\n/e", $part[$i], $out); + $out = array(); + preg_match('/revision (.*?)\n/e', $part[$i], $out); $final[$i-1]['revision'] = $out[1]; // Get date - preg_match("/date: (.*?);/e", $part[$i], $out); + $out = array(); + preg_match('/date: (.*?);/e', $part[$i], $out); $final[$i-1]['date'] = $out[1]; // Get user - preg_match("/author: (.*?);/e", $part[$i], $out); + $out = array(); + preg_match('/author: (.*?);/e', $part[$i], $out); $final[$i-1]['author'] = $out[1]; //Get content $content = explode("\n", $part[$i]); - if( substr($content[3], 0, 9) == 'branches:' ) { $j=4; } + if (substr($content[3], 0, 9) == 'branches:' ) { $j=4; } else { $j=3; } $final[$i-1]['content'] = ''; - for( $h=$j; $h < count($content); $h++) { + for ($h=$j; $h < count($content); $h++) { $final[$i-1]['content'] .= $content[$h]."\n"; } - $final[$i-1]['content'] = str_replace("\n", "<br/>", trim($final[$i-1]['content'])); + $final[$i-1]['content'] = str_replace("\n", '<br/>', trim($final[$i-1]['content'])); } return $final; @@ -605,7 +619,8 @@ foreach ($tags_attrs as $attrib_list) { // Get attr name and values - preg_match_all("!(.+)=\\s*([\"'])\\s*(.+)\\2!U", $attrib_list, $attribs); + $attribs = array(); + preg_match_all('!(.+)=\\s*(["\'])\\s*(.+)\\2!U', $attrib_list, $attribs); // Assign all attributes to one associative array $attrib_array = array(); @@ -620,7 +635,6 @@ } function rev_check_old_files($dir = '') { - static $id = 1; if ($dh = opendir($this->cvsDoc . $this->cvsLang . $dir)) { @@ -653,27 +667,20 @@ } // Files first - if (sizeof($entriesFiles) > 0 ) { - + if (!empty($entriesFiles)) { foreach($entriesFiles as $file) { - $path_en = $this->cvsDoc . 'en/' . $dir . '/' . $file; $path = $this->cvsDoc . $this->cvsLang . $dir . '/' . $file; - if( !@is_file($path_en) ) { - + if (!@is_file($path_en)) { $size = intval(filesize($path) / 1024); - $this->db->query("INSERT INTO old_files (lang, dir, file, size, userID) VALUES ('$lang', '$dir', '$file', '$size', ".$this->userID.");") or die('erreur:'.$mysqli->error); - + $this->db->query("INSERT INTO old_files (lang, dir, file, size, userID) VALUES ('$lang', '$dir', '$file', '$size', ".$this->userID.");") or die('Error: '.$this->db->error); } } } // Directories.. - if (sizeof($entriesDir) > 0) { - - reset($entriesDir); - + if (!empty($entriesDir)) { foreach ($entriesDir as $Edir) { $this->rev_check_old_files($dir . '/' . $Edir); } @@ -689,7 +696,7 @@ function rev_parse_translation() { reset($this->availableLanguage); - while( list(, $lang) = each($this->availableLanguage)) { + while (list(, $lang) = each($this->availableLanguage)) { // Path to find translation.xml file, set default values, // in case we can't find the translation file @@ -698,14 +705,14 @@ if (file_exists($translation_xml)) { // Else go on, and load in the file, replacing all // space type chars with one space - $txml = join("", file($translation_xml)); - $txml = preg_replace("/\\s+/", " ", $txml); + $txml = preg_replace('/\\s+/', ' ', join('', file($translation_xml))); } if (isset($txml)) { // Find all persons matching the pattern - if (preg_match_all("!<person (.+)/\\s?>!U", $txml, $matches)) { + $matches = array(); + if (preg_match_all('!<person (.+)/\\s?>!U', $txml, $matches)) { $default = array('cvs' => 'n/a', 'nick' => 'n/a', 'editor' => 'n/a', 'email' => 'n/a', 'name' => 'n/a'); $persons = $this->rev_parse_attr_string($matches[1]); @@ -713,7 +720,7 @@ foreach ($persons as $person) { - if( $charset == 'utf-8' ) { + if ($charset == 'utf-8' ) { $name = utf8_decode($person['name']); } else { $name = $person['name']; @@ -735,25 +742,16 @@ function get_modified_files() { // Get Modified Files - - $s = 'SELECT * FROM `pendingCommit` WHERE `lang`=\''.$this->cvsLang.'\' OR `lang`=\'en\''; + $s = sprintf('SELECT id, dir AS path, name, CONCAT("1.", revision) AS revision, + CONCAT("1.", en_revision) AS en_revision, maintainer, reviewed FROM `pendingCommit` WHERE + `lang`="%s" OR lang="en"', $this->cvsLang); + $r = $this->db->query($s) or die($this->db->error); - $nb = $r->num_rows; $node = array(); - while( $a = $r->fetch_object() ) { - - $node[$a->lang.$a->path.$a->name] = array( - "id" => $a->id, - "dir" => $a->path, - "name" => $a->name, - "revision" => '1.'.$a->revision, - "en_revision" => '1.'.$a->en_revision, - "maintainer" => $a->maintainer, - "reviewed" => $a->reviewed - ); - + while ($a = $r->fetch_assoc()) { + $node[$a->lang.$a->path.$a->name] = $a; } return $node; @@ -769,7 +767,7 @@ // Get Files Need Commit $ModifiedFiles = $this->get_modified_files(); - if( $_SESSION['userConf']['conf_error_skipnbliteraltag'] == 'true' ) { + if ($_SESSION['userConf']['conf_error_skipnbliteraltag'] == 'true' ) { $type = ' type != \'nbLiteralTags\' AND '; } else { $type = ''; @@ -782,17 +780,17 @@ $alreadyNode = array(); - while( $a = $r->fetch_object() ) { + while ($a = $r->fetch_object()) { - if( !isset($alreadyNode[$a->path.$a->name]) ) { + if (!isset($alreadyNode[$a->path.$a->name])) { - if( isset($ModifiedFiles[$this->cvsLang.$a->path.$a->name]) || isset($ModifiedFiles['en'.$a->path.$a->name]) ) { + if (isset($ModifiedFiles[$this->cvsLang.$a->path.$a->name]) || isset($ModifiedFiles['en'.$a->path.$a->name])) { - if(isset($ModifiedFiles['en'.$a->path.$a->name])) { + if (isset($ModifiedFiles['en'.$a->path.$a->name])) { $new_maintainer = $a->maintainer; } - if(isset($ModifiedFiles[$this->cvsLang.$a->path.$a->name])) { + if (isset($ModifiedFiles[$this->cvsLang.$a->path.$a->name])) { $new_maintainer = $ModifiedFiles[$this->cvsLang.$a->path.$a->name]['maintainer']; } @@ -827,7 +825,7 @@ } - return Array('nb'=>$nb, 'node'=>$node); + return array('nb'=>$nb, 'node'=>$node); } @@ -846,17 +844,17 @@ $node = array(); - while( $a = $r->fetch_object() ) { + while ($a = $r->fetch_object()) { - if( isset($ModifiedFiles[$this->cvsLang.$a->path.$a->name]) || isset($ModifiedFiles['en'.$a->path.$a->name]) ) { + if (isset($ModifiedFiles[$this->cvsLang.$a->path.$a->name]) || isset($ModifiedFiles['en'.$a->path.$a->name])) { - if(isset($ModifiedFiles['en'.$a->path.$a->name])) { + if (isset($ModifiedFiles['en'.$a->path.$a->name])) { $new_en_revision = $ModifiedFiles['en'.$a->path.$a->name]['revision']; $new_revision = '1.'.$a->revision; $new_maintainer = $a->maintainer; } - if(isset($ModifiedFiles[$this->cvsLang.$a->path.$a->name])) { + if (isset($ModifiedFiles[$this->cvsLang.$a->path.$a->name])) { $new_en_revision = '1.'.$a->en_revision; $new_revision = $ModifiedFiles[$this->cvsLang.$a->path.$a->name]['en_revision']; $new_maintainer = $ModifiedFiles[$this->cvsLang.$a->path.$a->name]['maintainer']; @@ -885,7 +883,7 @@ ); } } - return Array('nb'=>$nb, 'node'=>$node); + return array('nb'=>$nb, 'node'=>$node); } /** @@ -901,18 +899,18 @@ $r = $this->db->query($s); $nb = $r->num_rows; - $node=Array(); + $node=array(); - while( $a = $r->fetch_object() ) { + while ($a = $r->fetch_object()) { - if( isset($ModifiedFiles[$this->cvsLang.$a->path.$a->name]) || isset($ModifiedFiles['en'.$a->path.$a->name]) ) { + if (isset($ModifiedFiles[$this->cvsLang.$a->path.$a->name]) || isset($ModifiedFiles['en'.$a->path.$a->name])) { - if(isset($ModifiedFiles['en'.$a->path.$a->name])) { + if (isset($ModifiedFiles['en'.$a->path.$a->name])) { $new_reviewed = $a->reviewed; $new_maintainer = $a->maintainer; } - if(isset($ModifiedFiles[$this->cvsLang.$a->path.$a->name])) { + if (isset($ModifiedFiles[$this->cvsLang.$a->path.$a->name])) { $new_reviewed = $ModifiedFiles[$this->cvsLang.$a->path.$a->name]['reviewed']; $new_maintainer = $ModifiedFiles[$this->cvsLang.$a->path.$a->name]['maintainer']; } @@ -936,7 +934,7 @@ ); } } - return Array('nb'=>$nb, 'node'=>$node); + return array('nb'=>$nb, 'node'=>$node); } /** @@ -951,7 +949,7 @@ $node = array(); - while( $a = $r->fetch_object() ) { + while ($a = $r->fetch_object()) { $node[] = array( "id" => $a->id, @@ -964,7 +962,7 @@ } - return Array('nb'=>$nb, 'node'=>$node); + return array('nb'=>$nb, 'node'=>$node); } /** @@ -979,7 +977,7 @@ $node = array(); - while( $a = $r->fetch_object() ) { + while ($a = $r->fetch_object()) { $node[] = array( "id" => $a->id, @@ -991,7 +989,7 @@ } - return Array('nb'=>$nb, 'node'=>$node); + return array('nb'=>$nb, 'node'=>$node); } /** @@ -1000,15 +998,7 @@ */ function get_translators() { - $sql = 'SELECT - id, - nick, - name, - mail, - cvs - FROM - translators - WHERE lang="' . $this->cvsLang . '"'; + $sql = sprintf('SELECT id, nick, name, mail, cvs FROM translators WHERE lang="%s"', $this->cvsLang); $persons = array(); $result = $this->db->query($sql) or die($this->db->error); @@ -1061,7 +1051,7 @@ $nbFiles[1] = $uptodate[1]+$old[1]+$critical[1]+$withoutRevTag[1]+$missFiles[1]; - $summary=array(); + $summary = array(); $summary[0]['id'] = 1; $summary[0]['libel'] = 'Up to date files'; @@ -1426,25 +1416,23 @@ */ function get_last_mailing() { - if( $this->cvsLang != 'en' ) { - $url = 'http://news.php.net/group.php?group=php.doc.'.strtolower(str_replace('_', '-', $this->cvsLang)).'&format=rss'; - } else { - $url = 'http://news.php.net/group.php?group=php.doc&format=rss'; - } + $url = 'http://news.php.net/group.php?format=rss&group=php.doc'; - $r = file_get_contents($url); + if ($this->cvsLang != 'en') { + $url .= '.' . strtolower(str_replace('_', '-', $this->cvsLang)); + } - $xml = new SimpleXMLElement($r); + $xml = new SimpleXMLElement(file_get_contents($url)); $channel = $xml->channel; - $i=0; + $i = 0; foreach ($channel->item as $item) { $result[$i]['id'] = $i; $result[$i]['title'] = (string) $item->title; $result[$i]['description'] = preg_replace('/(<a href[^>]+">)([^>]+)(<\/a>)/', "$2", (string) $item->description); $result[$i]['link'] = (string) $item->link; - $result[$i]['pubDate'] = date("Y/m/d H:i:s", strtotime((string) $item->pubDate)); + $result[$i]['pubDate'] = date('Y/m/d H:i:s', strtotime((string) $item->pubDate)); $i++; } return $result; @@ -1470,15 +1458,16 @@ $title = (string) $item->title; $description = $item->description; - if( strstr($title, '['.strtoupper($this->cvsLang).']')) { + if (strstr($title, '['.strtoupper($this->cvsLang).']')) { $result[$i]['id'] = $i; $result[$i]['title'] = $title; - if( strstr($description, "Reproduce code:")) { - preg_match_all("/Description:\s*?------------(.*?)Reproduce code:/s", $description, $match); + $match = array(); + if (strstr($description, "Reproduce code:")) { + preg_match_all('/Description:\s*?------------(.*?)Reproduce code:/s', $description, $match); } else { - preg_match_all("/Description:\s*?------------(.*)/s", $description, $match); + preg_match_all('/Description:\s*?------------(.*)/s', $description, $match); } $result[$i]['description'] = (isset($match[1][0])) ? highlight_string(trim($match[1][0]), true) : ''; @@ -1498,18 +1487,19 @@ */ function getFileEncoding($file, $mode) { - if( $mode == 'file' ) { + if ($mode == 'file' ) { $txml = file_get_contents($file); } else { $txml = $file; } - $txml = preg_replace("/\\s+/", " ", $txml); + $txml = preg_replace('/\\s+/', ' ', $txml); - preg_match("!<\?xml(.+)\?>!U", $txml, $match); + $match = array(); + preg_match('!<\?xml(.+)\?>!U', $txml, $match); $xmlinfo = $this->rev_parse_attr_string($match); - $charset = (isset($xmlinfo[1]["encoding"])) ? strtolower($xmlinfo[1]["encoding"]) : 'iso-8859-1'; + $charset = (isset($xmlinfo[1]['encoding'])) ? strtolower($xmlinfo[1]['encoding']) : 'iso-8859-1'; return $charset; } @@ -1528,10 +1518,10 @@ $file = $FilePath.$FileName; - // Is this file have been modified ? + // Is this file modified ? $ModifiedFiles = $this->get_modified_files(); - if( isset($ModifiedFiles[$file]) ) { $extension = '.new'; } + if (isset($ModifiedFiles[$file])) { $extension = '.new'; } else { $extension = ''; } $file = $this->cvsDoc.$file.$extension; @@ -1555,7 +1545,7 @@ */ function saveFile($FilePath, $content, $lang, $type, $uniqID='') { - if( $type == 'file' ) { $ext = '.new'; } + if ($type == 'file' ) { $ext = '.new'; } else { $ext = '.'.$uniqID.'.patch'; } // Security @@ -1587,7 +1577,7 @@ $nb = $r->num_rows; // We insert or update the pendingCommit table - if( $nb == 0 ) { + if ($nb == 0 ) { $s = 'INSERT into pendingCommit (`lang`, `path`, `name`, `revision`, `en_revision`, `reviewed`, `maintainer`, `modified_by`, `date`) VALUES (\''.$lang.'\', \''.$FilePath.'\', \''.$FileName.'\', \''.$revision.'\', \''.$en_revision.'\', \''.$reviewed.'\', \''.$maintainer.'\', \''.$this->cvsLogin.'\', now())'; $this->db->query($s) or die($this->db->error); $fileID = $this->db->insert_id; @@ -1602,6 +1592,7 @@ /** * Register a new patch, into the database. + * @todo FIXME: Do we really want to return $uniqId and not $fileID ? If so, $fileId definition may be removed * @param $lang The lang. * @param $FilePath The path for the file. * @param $FileName The name of the file. @@ -1629,13 +1620,15 @@ $info = array('rev'=>0, 'en-rev'=>0, 'maintainer'=>'NULL', 'reviewed'=>'NULL', 'status'=>'NULL', 'xmlid'=>'NULL', 'content'=>$content); // Cvs tag - preg_match("/<!-- .Revision: \d+\.(\d+) . -->/", $content, $match); + $match = array(); + preg_match('/<!-- .Revision: \d+\.(\d+) . -->/', $content, $match); if (!empty($match)) { $info['rev'] = $match[1]; } //Rev tag - preg_match("/<!--\s*EN-Revision:\s*\d+\.(\d+)\s*Maintainer:\s*(\\S*)\s*Status:\s*(.+)\s*-->/U", $content, $match); + $match = array(); + preg_match('/<!--\s*EN-Revision:\s*\d+\.(\d+)\s*Maintainer:\s*(\\S*)\s*Status:\s*(.+)\s*-->/U', $content, $match); if (!empty($match)) { $info['en-rev'] = $match[1]; $info['maintainer'] = $match[2]; @@ -1643,17 +1636,17 @@ } // Reviewed tag - if( preg_match("/<!--\s*Reviewed:\s*(.*?)*-->/Ui", $content, $match) ) { + $match = array(); + if (preg_match('/<!--\s*Reviewed:\s*(.*?)*-->/Ui', $content, $match)) { $info['reviewed'] = trim($match[1]); } // All xmlid - if( preg_match_all("/xml:id=\"(.*?)\"/", $content, $match) ) { + $match = array(); + if (preg_match_all('/xml:id="(.*?)"/', $content, $match)) { $info['xmlid'] = implode('|',$match[1]); } - - return $info; } @@ -1693,6 +1686,7 @@ $cmd = 'cd '.$this->cvsDoc.$path.'; diff -uN '.$file.' '.$file.'.new'; + $output = array(); exec($cmd, $output); return implode("\r\n",$output); @@ -1710,17 +1704,18 @@ $cmd = 'cd '.$this->cvsDoc.$path.'; cvs diff -kk -u -r '.$rev2.' -r '.$rev1.' '.$file; + $output = array(); exec($cmd, $output); - $output = join("\n", $output); + $output = htmlentities(join("\n", $output)); - $output = htmlentities($output); + $match = array(); - preg_match_all("/@@(.*?)@@(.[^@@]*)/s", $output,$match); + preg_match_all('/@@(.*?)@@(.[^@@]*)/s', $output, $match); $diff = array(); - for( $i=0; $i < count($match[1]); $i++ ) { + for ($i = 0; $i < count($match[1]); $i++ ) { $diff[$i]['line'] = $match[1][$i]; $diff[$i]['content'] = $match[2][$i]; @@ -1729,7 +1724,7 @@ $return = '<table class="code">'; - for( $i=0; $i < count($diff); $i++ ) { + for ($i = 0; $i < count($diff); $i++ ) { // Line $return .= ' @@ -1741,13 +1736,21 @@ // Content $tmp = explode("\n", trim($diff[$i]['content'])); - for( $j=0; $j < count($tmp); $j++ ) { + for ($j=0; $j < count($tmp); $j++ ) { $tmp[$j] = str_replace(" ", " ", $tmp[$j]); - - if( substr($tmp[$j], 0, 1) == "+" ) $class = 'ins'; - else if( substr($tmp[$j], 0, 1) == "-" ) $class = 'del'; - else $class = ''; + switch (substr($tmp[$j], 0, 1)) { + case '+': + $class = 'ins'; + break; + case '-': + $class = 'del'; + break; + + default: + $class = ''; + break; + } $return .= ' <tr> @@ -1778,13 +1781,13 @@ * Each time we commit, we store in DB the commit message to be use later. This method get all this message from DB. * @return An indexed array of commit message. */ - function getCommitLogMessage() { - - $result=array(); + function getCommitLogMessage() + { + $result = array(); - $s = 'SELECT id, text FROM commitMessage WHERE userID=\''.$this->userID.'\''; + $s = sprintf('SELECT id, text FROM commitMessage WHERE userID="%s"', $this->userID); $r = $this->db->query($s); - while( $a = $r->fetch_assoc() ) { + while ($a = $r->fetch_assoc()) { $result[] = $a; } @@ -1797,12 +1800,11 @@ * @param $output The output message. * @return Nothing. */ - function saveOutputLogFile($file, $output) { - - $fp = fopen($this->cvsDoc.'../.'.$file, 'w'); + function saveOutputLogFile($file, $output) + { + $fp = fopen($this->cvsDoc . '../.' . $file, 'w'); fwrite($fp, implode("<br>",$output)); fclose($fp); - } /** @@ -1811,7 +1813,7 @@ * @return $content The content. */ function getOutputLogFile($file) { - return file_get_contents($this->cvsDoc.'../.'.$file); + return file_get_contents($this->cvsDoc . '../.' . $file); } /** @@ -1821,16 +1823,17 @@ */ function checkBuild($enable_xml_details='false') { - if( $enable_xml_details == 'true' ) { + if ($enable_xml_details == 'true' ) { $cmd = 'cd '.$this->cvsDoc.';/usr/bin/php configure.php --with-lang='.$this->cvsLang.' --disable-segfault-error --enable-xml-details;'; } else { $cmd = 'cd '.$this->cvsDoc.';/usr/bin/php configure.php --with-lang='.$this->cvsLang.' --disable-segfault-error;'; } + $output = array(); exec($cmd, $output); //Format the outPut - $output = str_replace("Warning", "<span style=\"color: #FF0000; font-weight: bold;\">Warning</span>", $output); + $output = str_replace("Warning", '<span style="color: #FF0000; font-weight: bold;">Warning</span>', $output); return $output; } @@ -1866,7 +1869,7 @@ @unlink($doc); // We need check for error in this file - $anode[0] = Array( 0 => $path, 1 => $file, 2 => $lang); + $anode[0] = array( 0 => $path, 1 => $file, 2 => $lang); $error = $this->updateFilesError($anode, 'nocommit'); // We need reload original lang_revision @@ -1879,7 +1882,7 @@ $info['maintainer'] = $a->maintainer; $info['reviewed'] = $a->reviewed; - if( isset($error['first']) ) { + if (isset($error['first'])) { $info['errorState'] = true; $info['errorFirst'] = $error['first']; } else { @@ -1902,7 +1905,7 @@ $files = ''; - for( $i=0; $i < count($anode); $i++ ) { + for ($i = 0; $i < count($anode); $i++ ) { // We need move .new file into the real file @unlink( $this->cvsDoc.$anode[$i][0].$anode[$i][1]); @@ -1913,10 +1916,11 @@ } // Escape single quote - $log = str_replace("'", "\'", $log); + $log = str_replace("'", "\\'", $log); // First, login into Cvs $cmd = 'export CVS_PASSFILE='.$_SERVER["DOCUMENT_ROOT"].$this->dataPath.'.cvspass && cd '.$this->cvsDoc.' && cvs -d :pserver:'.$this->cvsLogin.':'.$this->cvsPasswd.'@cvs.php.net:/repository login && cvs -d :pserver:'.$this->cvsLogin.':'.$this->cvsPasswd.'@cvs.php.net:/repository -f commit -l -m \''.$log.'\' '.$files; + $output = array(); exec($cmd, $output); $this->debug('commit cmd : '.$cmd); @@ -1944,7 +1948,7 @@ */ function updateRev($anode) { - for( $i=0; $i < count($anode); $i++ ) { + for ($i = 0; $i < count($anode); $i++ ) { $t = explode("/", $anode[$i][0]); @@ -1955,7 +1959,7 @@ $FileName = $anode[$i][1]; //En file ? - if( $FileLang == 'en' ) { + if ($FileLang == 'en' ) { $path = $this->cvsDoc.'en/'.$FilePath.$FileName; $content = file_get_contents($path); @@ -2040,24 +2044,23 @@ */ function updateFilesError($anode, $action='commit', $lang_content='', $en_content='') { - for( $i=0; $i < count($anode); $i++ ) { + for ($i = 0; $i < count($anode); $i++) { - $FileLang = $anode[$i][2]; $FilePath = $anode[$i][0]; $FileName = $anode[$i][1]; + $FileLang = $anode[$i][2]; // Remove all row in errorfiles tables $s = 'DELETE FROM errorfiles WHERE lang=\''.$FileLang.'\' AND path=\''.$FilePath.'\' AND name=\''.$FileName.'\''; $this->db->query($s) or die($this->db->error.'|'.$s); - if( $lang_content == '' ) { + if ($lang_content == '' ) { // Do tools_error on this file $en_content = file_get_contents($this->cvsDoc.'en'.$FilePath.$FileName); $lang_content = file_get_contents($this->cvsDoc.$FileLang.$FilePath.$FileName); $info = $this->getInfoFromFile($this->cvsDoc.$FileLang.$FilePath.$FileName); - } else { $info = $this->getInfoFromContent($lang_content); } @@ -2066,20 +2069,25 @@ $error = $this->tools_error_check_all($lang_content, $en_content); - if( count($error) > 0 ) { + if (count($error)) { $this->tools_error_log($FileLang, $FilePath, $FileName, $error, $maintainer); - } elseif( $action != 'commit' ) { + } elseif ($action != 'commit' ) { // Case if there is no error but this file isn't commit now. We must stay it in DB for commit later // Build empty error - $error[0] = Array( "value_en" => "-", "value_lang" => "-", "type" => "-No error-" ); + $error[0] = array( 'value_en' => '-', 'value_lang' => '-', 'type' => '-No error-' ); $this->tools_error_log($FileLang, $FilePath, $FileName, $error, $maintainer); } - if( $i == 0 && $action != 'commit' ) { - if( count($error) > 0 ) { $return['state'] = true; $return['first'] = $error[0]['type']; } - else { $return['state'] = false; $return['first']='';} + if ($i == 0 && $action != 'commit' ) { + if (count($error)) { + $return['state'] = true; + $return['first'] = $error[0]['type']; + } else { + $return['state'] = false; + $return['first'] = ''; + } return $return; } @@ -2094,7 +2102,7 @@ */ function removeNeedCommit($anode) { - for( $i=0; $i < count($anode); $i++ ) { + for ($i = 0; $i < count($anode); $i++ ) { $t = explode("/", $anode[$i][0]); @@ -2121,7 +2129,7 @@ function debug($mess) { - $mess = '['.date("d/m:Y � H:i:s").'] by '.$this->cvsLogin.' : '.$mess."\n"; + $mess = '['.date("d/m:Y H:i:s").'] by '.$this->cvsLogin.' : '.$mess."\n"; $fp = fopen($this->cvsDoc.'../.debug', 'a+'); fwrite($fp, $mess); @@ -2140,7 +2148,7 @@ $r = $this->db->query($s) or die($this->db->error); $nb = $r->num_rows; - if( $nb == 0 ) { + if ($nb == 0 ) { $s = 'INSERT INTO commitMessage (`text`,`userID`) VALUES (\''.$this->db->real_escape_string($logMessage).'\', \''.$this->userID.'\')'; $this->db->query($s) or die($this->db->error); } @@ -2164,14 +2172,10 @@ /* Methods to check error in a translation */ - function tools_error_start() { - $dir = $this->cvsDoc.$this->cvsLang."/"; - $this->tools_error_do('/'); - } - - - function tools_error_do($dir) { + function tools_error_do($dir) + { + static $ignoredDirs = array('.', '..', 'CVS'); $heredir = $this->cvsDoc.$this->cvsLang.$dir; $en_dir = str_replace("/".$this->cvsLang."/", "/en/", $heredir); @@ -2187,8 +2191,9 @@ // If we found a file with one or two point as a name, // or a CVS directory, skip the file - if (preg_match("/^\.{1,2}/",$file) || $file == 'CVS') - continue; + if (in_array($file, $ignoredDirs)) { + continue; + } // JUST TEMPORARY TILL THE <TRANSLATION>/REFERENCE/FUNCTIONS.XML - ISSUE IS CLARIFIED // If we found a file functions.xml in the @@ -2227,7 +2232,7 @@ foreach ($files as $file) { - if( is_file($heredir.$file) && is_file($en_dir.$file) ) { + if (is_file($heredir.$file) && is_file($en_dir.$file)) { $infoLANG = $this->getInfoFromFile($heredir.$file); $infoEN = $this->getInfoFromFile($en_dir.$file); @@ -2236,11 +2241,11 @@ continue; } - if( $infoLANG['en-rev'] == $infoEN['rev'] ) { + if ($infoLANG['en-rev'] == $infoEN['rev'] ) { $error = $this->tools_error_check_all($infoLANG['content'], $infoEN['content']); - if( count($error) > 0 ) { $this->tools_error_log($dir, $file, $error, $infoLANG['maintainer']); } + if (count($error) > 0 ) { $this->tools_error_log($dir, $file, $error, $infoLANG['maintainer']); } } } else { @@ -2258,7 +2263,7 @@ // this dir and subdirectories [if any] return; - } // tools_error_start() function end + } // tools_error_do() function end function tools_error_getInfo($path, $name) { @@ -2274,114 +2279,122 @@ $r = $this->db->query($s); - $return = ''; + $return = array(); - while( $a = $r->fetch_object()) { - - if( isset($return[$a->type]['error']) ) { - $i=count($return[$a->type]['error']); + while ($record = $r->fetch_object()) { + if (isset($return[$record->type]['error'])) { + $i = count($return[$record->type]['error']); } else { - $i=0; + $i = 0; } - - $return[$a->type]['error'][$i]['value_en'] = $a->value_en; - $return[$a->type]['error'][$i]['value_lang'] = $a->value_lang; + $return[$record->type]['error'][$i]['value_en'] = $record->value_en; + $return[$record->type]['error'][$i]['value_lang'] = $record->value_lang; } return $return; } - function tools_error_log($lang, $path, $name, $error, $maintainer) { - for( $i=0; $i < count($error); $i++) { - $s = 'INSERT INTO errorfiles (`lang`, `path`, `name`, `maintainer`, `value_en`,`value_lang`,`type`) VALUES - (\''.$lang.'\', \''.$path.'\',\''.$name.'\','.$maintainer.',\''.$this->db->real_escape_string($error[$i]['value_en']).'\',\''.$this->db->real_escape_string($error[$i]['value_lang']).'\',\''.$error[$i]['type'].'\')'; - $this->db->query($s) or die($this->db->error.'<hr><pre>'.$s.'</pre>'); + function tools_error_log($lang, $path, $name, $errors, $maintainer) + { + + $sql = 'INSERT INTO errorfiles (`lang`, `path`, `name`, `maintainer`, `value_en`,`value_lang`,`type`) VALUES'; + $pattern = ' ("%s", "%s", "%s", "%s", "%s", "%s", "%s"),'; + + //(\''.$lang.'\', \''.$path.'\',\''.$name.'\','.$maintainer.',\''.$this->db->real_escape_string($error[$i]['value_en']).'\',\''.$this->db->real_escape_string($error[$i]['value_lang']).'\',\''.$error[$i]['type'].'\')'; + + foreach ($errors as $error) { + $sql .= sprintf($pattern, $lang, $path, $name, $maintainer, $this->db->real_escape_string($error['value_en']), + $this->db->real_escape_string($error['value_lang']), $error['type']); } + + $sql = substr($sql, 0, -1); + $this->db->query($sql) or die($this->db->error.'<hr/><pre>'.$sql.'</pre>'); + } function tools_error_check_all($lang_content, $en_content) { // We remove comment in EN and lang content - $lang_content = preg_replace("/<!--(.*?)?-->/s", "", $lang_content); - $en_content = preg_replace("/<!--(.*?)?-->/s", "", $en_content); + $lang_content = preg_replace('/<!--(.*?)?-->/s', '', $lang_content); + $en_content = preg_replace('/<!--(.*?)?-->/s', '', $en_content); $result_error = array(); $r = $this->tools_error_check_methodsynopsis($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_nbMemberInSeeAlso($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_nbElInTable($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } // Get user pref - if( isset($_SESSION['userConf']['conf_error_skipnbliteraltag']) && $_SESSION['userConf']['conf_error_skipnbliteraltag'] == 'false' ) { + if (isset($_SESSION['userConf']['conf_error_skipnbliteraltag']) && $_SESSION['userConf']['conf_error_skipnbliteraltag'] == 'false' ) { $r = $this->tools_error_check_nbLiteralTag($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } } $r = $this->tools_error_check_nbParaTag($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_nbNoteTag($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_nbChapterTag($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_classsynopsis($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_nbCdataTags($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_spaceOrPeriodRefpurposeTags($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_attributRefsec1Tags($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_attributRefentryTags($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_attributReferenceTags($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_attributVarlistentryTags($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_attributSectionTags($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_attributPrefaceTags($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_attributBookTags($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_attributSect1Tags($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_attributQandaentryTags($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_attributLinkTags($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_attributAppendixTags($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } $r = $this->tools_error_check_attributChapterTags($lang_content, $en_content); - if( is_array($r) ) { array_push($result_error, $r); } + if (is_array($r)) { array_push($result_error, $r); } - $return = Array(); + $return = array(); for($i=0;$i<count($result_error);$i++){ - for( $j=0;$j<count($result_error[$i]);$j++){ + for ($j=0;$j<count($result_error[$i]);$j++){ array_push($return, $result_error[$i][$j]); } } @@ -2392,78 +2405,55 @@ function tools_error_check_attributChapterTags($lang_content, $en_content) { // attributs in chapter tags - $result_error = FALSE; - - $en_chapter = array(); - preg_match_all("/<chapter\s*?xml:id=\"(.*?)\"\s*?(xmlns=\"(.*?)\")?\s*?(xmlns:xlink=\"(.*?)\"\s*?)?(version=\"(.*?)\"\s*?)?>/s", $en_content, $match); - $en_chapter["xmlid"] = $match[1]; - $en_chapter["xmlns"] = $match[3]; - $en_chapter["xmlnsxlink"] = $match[5]; - $en_chapter["version"] = $match[7]; - - $lang_chapter = array(); - preg_match_all("/<chapter\s*?xml:id=\"(.*?)\"\s*?(xmlns=\"(.*?)\")?\s*?(xmlns:xlink=\"(.*?)\"\s*?)?(version=\"(.*?)\"\s*?)?>/s", $lang_content, $match); - $lang_chapter["xmlid"] = $match[1]; - $lang_chapter["xmlns"] = $match[3]; - $lang_chapter["xmlnsxlink"] = $match[5]; - $lang_chapter["version"] = $match[7]; - - for( $i=0; $i < count($en_chapter["xmlid"]); $i ++ ) { - - if( !isset($en_chapter["xmlid"][$i]) ) { $en_chapter["xmlid"][$i] = ''; } - if( !isset($lang_chapter["xmlid"][$i]) ) { $lang_chapter["xmlid"][$i] = ''; } - - if( $en_chapter["xmlid"][$i] != $lang_chapter["xmlid"][$i] ) { - $result_error[] = array( - "value_en" => $en_chapter["xmlid"][$i], - "value_lang" => $lang_chapter["xmlid"][$i], - "type" => "attributXmlIdChapter" - ); - - } - } - - for( $i=0; $i < count($en_chapter["xmlns"]); $i ++ ) { + $result_error = array(); - if( !isset($en_chapter["xmlns"][$i]) ) { $en_chapter["xmlns"][$i] = ''; } - if( !isset($lang_chapter["xmlns"][$i]) ) { $lang_chapter["xmlns"][$i] = ''; } + $reg = '/<chapter\s*?xml:id="(.*?)"\s*?(xmlns="(.*?)")?\s*?(xmlns:xlink="(.*?)"\s*?)?(version="(.*?)"\s*?)?>/s'; - if( $en_chapter["xmlns"][$i] != $lang_chapter["xmlns"][$i] ) { - $result_error[] = array( - "value_en" => $en_chapter["xmlns"][$i], - "value_lang" => $lang_chapter["xmlns"][$i], - "type" => "attributXmlNsChapter" - ); - } + $en_chapter = array(); + $match = array(); + if (preg_match_all($reg, $en_content, $match)) { + $en_chapter['xmlid'] = $match[1]; + $en_chapter['xmlns'] = $match[3]; + $en_chapter['xmlnsxlink'] = $match[5]; + $en_chapter['version'] = $match[7]; } - for( $i=0; $i < count($en_chapter["xmlnsxlink"]); $i ++ ) { + $lang_chapter = array(); + $match = array(); + if (preg_match_all($reg, $lang_content, $match)) { + $lang_chapter['xmlid'] = $match[1]; + $lang_chapter['xmlns'] = $match[3]; + $lang_chapter['xmlnsxlink'] = $match[5]; + $lang_chapter['version'] = $match[7]; + } + + $properties = array( + 'xmlid' => 'XmlId', + 'xmlns' => 'XmlNs', + 'xmlnsxlink' => 'XmlXlink', + 'version' => 'Version', + ); + + foreach ($properties as $property => $label) { + for ($i = 0; $i < count($en_chapter[$property]); $i++) { + if (!isset($en_chapter[$property][$i])) { + $en_chapter[$property][$i] = ''; + } + if (!isset($lang_chapter[$property][$i])) { + $lang_chapter[$property][$i] = ''; + } - if( !isset($en_chapter["xmlnsxlink"][$i]) ) { $en_chapter["xmlnsxlink"][$i] = ''; } - if( !isset($lang_chapter["xmlnsxlink"][$i]) ) { $lang_chapter["xmlnsxlink"][$i] = ''; } + if ($en_chapter[$property][$i] != $lang_chapter[$property][$i] ) { + $result_error[] = array( + 'value_en' => $en_chapter[$property][$i], + 'value_lang' => $lang_chapter[$property][$i], + 'type' => 'attribut' . $label . 'Chapter', + ); - if( $en_chapter["xmlnsxlink"][$i] != $lang_chapter["xmlnsxlink"][$i] ) { - $result_error[] = array( - "value_en" => $en_chapter["xmlnsxlink"][$i], - "value_lang" => $lang_chapter["xmlnsxlink"][$i], - "type" => "attributXmlXlinkChapter" - ); + } } } - for( $i=0; $i < count($en_chapter["version"]); $i ++ ) { - - if( !isset($en_chapter["version"][$i]) ) { $en_chapter["version"][$i] = ''; } - if( !isset($lang_chapter["version"][$i]) ) { $lang_chapter["version"][$i] = ''; } - - if( $en_chapter["version"][$i] != $lang_chapter["version"][$i] ) { - $result_error[] = array( - "value_en" => $en_chapter["version"][$i], - "value_lang" => $lang_chapter["version"][$i], - "type" => "attributVersionChapter" - ); - } - } return $result_error; } @@ -2472,62 +2462,45 @@ // attributs in appendix tags $result_error = FALSE; - $en_appendix = array(); - preg_match_all("/<appendix\s*?xml:id=\"(.*?)\"\s*?(xmlns=\"(.*?)\")?\s*?(xmlns:xlink=\"(.*?)\"\s*?)?>/s", $en_content, $match); + $reg = '/<appendix\s*?xml:id="(.*?)"\s*?(xmlns="(.*?)")?\s*?(xmlns:xlink="(.*?)"\s*?)?>/s'; + + $match = $en_appendix = array(); + preg_match_all($reg, $en_content, $match); $en_appendix["xmlid"] = $match[1]; $en_appendix["xmlns"] = $match[3]; $en_appendix["xmlnsxlink"] = $match[5]; - $lang_appendix = array(); - preg_match_all("/<appendix\s*?xml:id=\"(.*?)\"\s*?(xmlns=\"(.*?)\")?\s*?(xmlns:xlink=\"(.*?)\"\s*?)?>/s", $lang_content, $match); - $lang_appendix["xmlid"] = $match[1]; - $lang_appendix["xmlns"] = $match[3]; - $lang_appendix["xmlnsxlink"] = $match[5]; + $match = $lang_appendix = array(); + preg_match_all($reg, $lang_content, $match); + $lang_appendix['xmlid'] = $match[1]; + $lang_appendix['xmlns'] = $match[3]; + $lang_appendix['xmlnsxlink'] = $match[5]; - for( $i=0; $i < count($en_appendix["xmlid"]); $i ++ ) { - if( !isset($en_appendix["xmlid"][$i]) ) { $en_appendix["xmlid"][$i] = ''; } - if( !isset($lang_appendix["xmlid"][$i]) ) { $lang_appendix["xmlid"][$i] = ''; } + $properties = array( + 'xmlid' => 'XmlId', + 'xmlns' => 'XmlNs', + 'xmlnsxlink' => 'XmlXlink', + ); - if( $en_appendix["xmlid"][$i] != $lang_appendix["xmlid"][$i] ) { - $result_error[] = array( - "value_en" => $en_appendix["xmlid"][$i], - "value_lang" => $lang_appendix["xmlid"][$i], - "type" => "attributXmlIdAppendix" - ); + foreach ($properties as $property => $label) { - } - } - - for( $i=0; $i < count($en_appendix["xmlns"]); $i ++ ) { + for ($i = 0; $i < count($en_appendix[$property]); $i++) { - if( !isset($en_appendix["xmlns"][$i]) ) { $en_appendix["xmlns"][$i] = ''; } - if( !isset($lang_appendix["xmlns"][$i]) ) { $lang_appendix["xmlns"][$i] = ''; } + if (!isset($en_appendix[$property][$i])) { $en_appendix[$property][$i] = ''; } + if (!isset($lang_appendix[$property][$i])) { $lang_appendix[$property][$i] = ''; } - if( $en_appendix["xmlns"][$i] != $lang_appendix["xmlns"][$i] ) { - $result_error[] = array( - "value_en" => $en_appendix["xmlns"][$i], - "value_lang" => $lang_appendix["xmlns"][$i], - "type" => "attributXmlNsAppendix" - ); + if ($en_appendix[$property][$i] != $lang_appendix[$property][$i] ) { + $result_error[] = array( + 'value_en' => $en_appendix[$property][$i], + 'value_lang' => $lang_appendix[$property][$i], + 'type' => 'attribut' . $label . 'Appendix', + ); + } } } - for( $i=0; $i < count($en_appendix["xmlnsxlink"]); $i ++ ) { - - if( !isset($en_appendix["xmlnsxlink"][$i]) ) { $en_appendix["xmlnsxlink"][$i] = ''; } - if( !isset($lang_appendix["xmlnsxlink"][$i]) ) { $lang_appendix["xmlnsxlink"][$i] = ''; } - - if( $en_appendix["xmlnsxlink"][$i] != $lang_appendix["xmlnsxlink"][$i] ) { - $result_error[] = array( - "value_en" => $en_appendix["xmlnsxlink"][$i], - "value_lang" => $lang_appendix["xmlnsxlink"][$i], - "type" => "attributXmlXlinkAppendix" - ); - - } - } return $result_error; } @@ -2536,24 +2509,32 @@ // attributs in qandaentry tags $result_error = FALSE; - $en_qandaentry = array(); - preg_match_all("/<qandaentry\s*?xml:id=\"(.*?)\"\s*?>/s", $en_content, $match); - $en_qandaentry = $match[1]; + $reg = '/<qandaentry\s*?xml:id="(.*?)"\s*?>/s'; - $lang_qandaentry = array(); - preg_match_all("/<qandaentry\s*?xml:id=\"(.*?)\"\s*?>/s", $lang_content, $match); - $lang_qandaentry = $match[1]; + $match = $en_qandaentry = array(); + if (preg_match_all($reg, $en_content, $match)) { + $en_qandaentry = $match[1]; + } - for( $i=0; $i < count($en_qandaentry); $i ++ ) { + $match = $lang_qandaentry = array(); + if (preg_match_all($reg, $lang_content, $match)) { + $lang_qandaentry = $match[1]; + } - if( !isset($en_qandaentry[$i]) ) { $en_qandaentry[$i] = ''; } - if( !isset($lang_qandaentry[$i]) ) { $lang_qandaentry[$i] = ''; } + for ($i = 0; $i < count($en_qandaentry); $i++) { - if( $en_qandaentry[$i] != $lang_qandaentry[$i] ) { + if (!isset($en_qandaentry[$i])) { + $en_qandaentry[$i] = ''; + } + if (!isset($lang_qandaentry[$i])) { + $lang_qandaentry[$i] = ''; + } + + if ($en_qandaentry[$i] != $lang_qandaentry[$i] ) { $result_error[] = array( - "value_en" => $en_qandaentry[$i], - "value_lang" => $lang_qandaentry[$i], - "type" => "attributXmlIdQandaentry" + 'value_en' => $en_qandaentry[$i], + 'value_lang' => $lang_qandaentry[$i], + 'type' => 'attributXmlIdQandaentry' ); } @@ -2566,20 +2547,20 @@ // attributs in Link tags $result_error = FALSE; - $en_xlink = array(); - preg_match_all("/<link\s*?xlink:href=\"(.*?)\">/s", $en_content, $match); + $match = $en_xlink = array(); + preg_match_all('/<link\s*?xlink:href="(.*?)">/s', $en_content, $match); $en_xlink = $match[1]; - $lang_xlink = array(); - preg_match_all("/<link\s*?xlink:href=\"(.*?)\">/s", $lang_content, $match); + $match = $lang_xlink = array(); + preg_match_all('/<link\s*?xlink:href="(.*?)">/s', $lang_content, $match); $lang_xlink = $match[1]; - for( $i=0; $i < count($en_xlink); $i ++ ) { + for ($i = 0; $i < count($en_xlink); $i++) { - if( !isset($en_xlink[$i]) ) { $en_xlink[$i] = ''; } - if( !isset($lang_xlink[$i]) ) { $lang_xlink[$i] = ''; } + if (!isset($en_xlink[$i]) ) { $en_xlink[$i] = ''; } + if (!isset($lang_xlink[$i])) { $lang_xlink[$i] = ''; } - if( $en_xlink[$i] != $lang_xlink[$i] ) { + if ($en_xlink[$i] != $lang_xlink[$i] ) { $result_error[] = array( "value_en" => $en_xlink[$i], "value_lang" => $lang_xlink[$i], @@ -2590,16 +2571,22 @@ } $en_linkend = array(); - preg_match_all("/<link\s*?linkend=(\"|')(.*?)(\"|')\s*?>/s", $en_content, $match); - $en_linkend = $match[2]; + $match = array(); + if (preg_match_all('/<link\s*?linkend=("|\')(.*?)("|\')\s*?>/s', $en_content, $match)) { + $en_linkend = $match[2]; + } $lang_linkend = array(); - preg_match_all("/<link\s*?linkend=(\"|')(.*?)(\"|')\s*?>/s", $lang_content, $match); - $lang_linkend = $match[2]; + $match = array(); + if (preg_match_all('/<link\s*?linkend=("|\')(.*?)("|\')\s*?>/s', $lang_content, $match)) { + $lang_linkend = $match[2]; + } - for( $i=0; $i < count($en_linkend); $i ++ ) { - if( !isset($lang_linkend[$i]) ) { $lang_linkend[$i] = ''; } - if( $en_linkend[$i] != $lang_linkend[$i] ) { + for ($i = 0; $i <count($en_linkend); $i++) { + if (!isset($lang_linkend[$i])) { + $lang_linkend[$i] = ''; + } + if ($en_linkend[$i] != $lang_linkend[$i]) { $result_error[] = array( "value_en" => $en_linkend[$i], "value_lang" => $lang_linkend[$i], @@ -2617,19 +2604,21 @@ $result_error = FALSE; $en_sect1 = array(); - preg_match_all("/<sect1\s*?xml:id=\"(.*?)\"\s*?(xmlns=\"(.*?)\")?\s*?(xmlns:xlink=\"(.*?)\"\s*?)?>/s", $en_content, $match); + $match = array(); + preg_match_all('/<sect1\s*?xml:id="(.*?)"\s*?(xmlns="(.*?)")?\s*?(xmlns:xlink="(.*?)"\s*?)?>/s', $en_content, $match); $en_sect1["xmlid"] = $match[1]; $en_sect1["xmlns"] = $match[3]; $en_sect1["xmlnsxlink"] = $match[5]; $lang_sect1 = array(); - preg_match_all("/<sect1\s*?xml:id=\"(.*?)\"\s*?(xmlns=\"(.*?)\")?\s*?(xmlns:xlink=\"(.*?)\"\s*?)?>/s", $lang_content, $match); + $match = array(); + preg_match_all('/<sect1\s*?xml:id="(.*?)"\s*?(xmlns="(.*?)")?\s*?(xmlns:xlink="(.*?)"\s*?)?>/s', $lang_content, $match); $lang_sect1["xmlid"] = $match[1]; $lang_sect1["xmlns"] = $match[3]; $lang_sect1["xmlnsxlink"] = $match[5]; - for( $i=0; $i < count($en_sect1["xmlid"]); $i ++ ) { - if( isset($lang_sect1["xmlid"][$i]) && $en_sect1["xmlid"][$i] != $lang_sect1["xmlid"][$i] ) { + for ($i = 0; $i < count($en_sect1["xmlid"]); $i++) { + if (isset($lang_sect1["xmlid"][$i]) && $en_sect1["xmlid"][$i] != $lang_sect1["xmlid"][$i] ) { $result_error[] = array( "value_en" => $en_sect1["xmlid"][$i], "value_lang" => $lang_sect1["xmlid"][$i], @@ -2638,8 +2627,8 @@ } } - for( $i=0; $i < count($en_sect1["xmlns"]); $i ++ ) { - if( isset($lang_sect1["xmlns"][$i]) && $en_sect1["xmlns"][$i] != $lang_sect1["xmlns"][$i] ) { + for ($i = 0; $i < count($en_sect1["xmlns"]); $i++) { + if (isset($lang_sect1["xmlns"][$i]) && $en_sect1["xmlns"][$i] != $lang_sect1["xmlns"][$i] ) { $result_error[] = array( "value_en" => $en_sect1["xmlns"][$i], "value_lang" => $lang_sect1["xmlns"][$i], @@ -2648,8 +2637,8 @@ } } - for( $i=0; $i < count($en_sect1["xmlnsxlink"]); $i ++ ) { - if( isset($lang_sect1["xmlnsxlink"][$i]) && $en_sect1["xmlnsxlink"][$i] != $lang_sect1["xmlnsxlink"][$i] ) { + for ($i = 0; $i < count($en_sect1["xmlnsxlink"]); $i++) { + if (isset($lang_sect1["xmlnsxlink"][$i]) && $en_sect1["xmlnsxlink"][$i] != $lang_sect1["xmlnsxlink"][$i] ) { $result_error[] = array( "value_en" => $en_sect1["xmlnsxlink"][$i], "value_lang" => $lang_sect1["xmlnsxlink"][$i], @@ -2666,20 +2655,20 @@ // attributs in Book tags $result_error = FALSE; - $en_book = array(); - preg_match_all("/<book\s*?xml:id=\"(.*?)\"\s*?(xmlns=\"(.*?)\")?\s*?(xmlns:xlink=\"(.*?)\"\s*?)?>/s", $en_content, $match); + $en_book = $match = array(); + preg_match_all('/<book\s*?xml:id="(.*?)"\s*?(xmlns="(.*?)")?\s*?(xmlns:xlink="(.*?)"\s*?)?>/s', $en_content, $match); $en_book["xmlid"] = $match[1]; $en_book["xmlns"] = $match[3]; $en_book["xmlnsxlink"] = $match[5]; - $lang_book = array(); - preg_match_all("/<book\s*?xml:id=\"(.*?)\"\s*?(xmlns=\"(.*?)\")?\s*?(xmlns:xlink=\"(.*?)\"\s*?)?>/s", $lang_content, $match); + $lang_book = $match = array(); + preg_match_all('/<book\s*?xml:id="(.*?)"\s*?(xmlns="(.*?)")?\s*?(xmlns:xlink="(.*?)"\s*?)?>/s', $lang_content, $match); $lang_book["xmlid"] = $match[1]; $lang_book["xmlns"] = $match[3]; $lang_book["xmlnsxlink"] = $match[5]; - for( $i=0; $i < count($en_book["xmlid"]); $i ++ ) { - if( $en_book["xmlid"][$i] != $lang_book["xmlid"][$i] ) { + for ($i = 0; $i < count($en_book["xmlid"]); $i++) { + if ($en_book["xmlid"][$i] != $lang_book["xmlid"][$i] ) { $result_error[] = array( "value_en" => $en_book["xmlid"][$i], "value_lang" => $lang_book["xmlid"][$i], @@ -2689,8 +2678,8 @@ } } - for( $i=0; $i < count($en_book["xmlns"]); $i ++ ) { - if( $en_book["xmlns"][$i] != $lang_book["xmlns"][$i] ) { + for ($i = 0; $i < count($en_book["xmlns"]); $i++) { + if ($en_book["xmlns"][$i] != $lang_book["xmlns"][$i] ) { $result_error[] = array( "value_en" => $en_book["xmlns"][$i], "value_lang" => $lang_book["xmlns"][$i], @@ -2700,8 +2689,8 @@ } } - for( $i=0; $i < count($en_book["xmlnsxlink"]); $i ++ ) { - if( $en_book["xmlnsxlink"][$i] != $lang_book["xmlnsxlink"][$i] ) { + for ($i = 0; $i < count($en_book["xmlnsxlink"]); $i++) { + if ($en_book["xmlnsxlink"][$i] != $lang_book["xmlnsxlink"][$i] ) { $result_error[] = array( "value_en" => $en_book["xmlnsxlink"][$i], "value_lang" => $lang_book["xmlnsxlink"][$i], @@ -2715,48 +2704,39 @@ function tools_error_check_attributPrefaceTags($lang_content, $en_content) { // attributs in Preface tags - $result_error = FALSE; - - $en_preface = array(); - preg_match_all("/<preface\s*?xml:id=\"(.*?)\"\s*?(xmlns=\"(.*?)\")?\s*?(xmlns:xlink=\"(.*?)\"\s*?)?>/s", $en_content, $match); - $en_preface["xmlid"] = $match[1]; - $en_preface["xmlns"] = $match[3]; - $en_preface["xmlnsxlink"] = $match[5]; - - $lang_preface = array(); - preg_match_all("/<preface\s*?xml:id=\"(.*?)\"\s*?(xmlns=\"(.*?)\")?\s*?(xmlns:xlink=\"(.*?)\"\s*?)?>/s", $lang_content, $match); - $lang_preface["xmlid"] = $match[1]; - $lang_preface["xmlns"] = $match[3]; - $lang_preface["xmlnsxlink"] = $match[5]; - - for( $i=0; $i < count($en_preface["xmlid"]); $i ++ ) { - if( $en_preface["xmlid"][$i] != $lang_preface["xmlid"][$i] ) { - $result_error[] = array( - "value_en" => $en_preface["xmlid"][$i], - "value_lang" => $lang_preface["xmlid"][$i], - "type" => "attributXmlIdPreface" - ); + $result_error = array(); - } - } - for( $i=0; $i < count($en_preface["xmlns"]); $i ++ ) { - if( $en_preface["xmlns"][$i] != $lang_preface["xmlns"][$i] ) { - $result_error[] = array( - "value_en" => $en_preface["xmlns"][$i], - "value_lang" => $lang_preface["xmlns"][$i], - "type" => "attributXmlNsPreface" - ); + $reg = '/<preface\s*?xml:id="(.*?)"\s*?(xmlns="(.*?)")?\s*?(xmlns:xlink="(.*?)"\s*?)?>/s'; - } - } - for( $i=0; $i < count($en_preface["xmlnsxlink"]); $i ++ ) { - if( $en_preface["xmlnsxlink"][$i] != $lang_preface["xmlnsxlink"][$i] ) { - $result_error[] = array( - "value_en" => $en_preface["xmlnsxlink"][$i], - "value_lang" => $lang_preface["xmlnsxlink"][$i], - "type" => "attributXmlNsXlinkPreface" - ); + $match = $en_preface = array(); + if (preg_match_all($reg, $en_content, $match)) { + $en_preface['xmlid'] = $match[1]; + $en_preface['xmlns'] = $match[3]; + $en_preface['xmlnsxlink'] = $match[5]; + } + + $match = $lang_preface = array(); + if (preg_match_all($reg, $lang_content, $match)) { + $lang_preface['xmlid'] = $match[1]; + $lang_preface['xmlns'] = $match[3]; + $lang_preface['xmlnsxlink'] = $match[5]; + } + + $properties = array( + 'xmlid' => 'XmlId', + 'xmlns' => 'XmlNs', + 'xmlnsxlink' => 'XmlNsXlink', + ); + foreach ($properties as $property => $label) { + for ($i = 0; $i < count($en_preface[$property]); $i++) { + if ($en_preface[$property][$i] != $lang_preface[$property][$i] ) { + $result_error[] = array( + 'value_en' => $en_preface[$property][$i], + 'value_lang' => $lang_preface[$property][$i], + 'type' => 'attribut' . $label . 'Preface', + ); + } } } return $result_error; @@ -2764,117 +2744,109 @@ function tools_error_check_attributSectionTags($lang_content, $en_content) { // attributs in Section tags - $result_error = FALSE; - - $en_section = array(); - preg_match_all("/<section\s*?xml:id=(\"|')(.*?)(\"|')\s*?(xmlns=(\"|')(.*?)(\"|'))?\s*?(xmlns:xlink=(\"|')(.*?)(\"|')\s*?)?>/s", $en_content, $match); - $en_section["xmlid"] = $match[2]; - $en_section["xmlns"] = $match[6]; - $en_section["xmlnsxlink"] = $match[10]; - - $lang_section = array(); - preg_match_all("/<section\s*?xml:id=(\"|')(.*?)(\"|')\s*?(xmlns=(\"|')(.*?)(\"|'))?\s*?(xmlns:xlink=(\"|')(.*?)(\"|')\s*?)?>/s", $lang_content, $match); - $lang_section["xmlid"] = $match[2]; - $lang_section["xmlns"] = $match[6]; - $lang_section["xmlnsxlink"] = $match[10]; - - - - for( $i=0; $i < count($en_section["xmlid"]); $i ++ ) { - - if( !isset($en_section["xmlid"][$i]) ) { $en_section["xmlid"][$i] = ''; } - if( !isset($lang_section["xmlid"][$i]) ) { $lang_section["xmlid"][$i] = ''; } + $result_error = array(); - if( $en_section["xmlid"][$i] != $lang_section["xmlid"][$i] ) { - $result_error[] = array( - "value_en" => $en_section["xmlid"][$i], - "value_lang" => $lang_section["xmlid"][$i], - "type" => "attributXmlIdSection" - ); + $reg = '/<section\s*?xml:id=("|\')(.*?)("|\')\s*?(xmlns=("|\')(.*?)("|\'))?\s*?(xmlns:xlink=("|\')(.*?)("|\')\s*?)?>/s'; - } + $en_section = array(); + $match = array(); + if (preg_match_all($reg, $en_content, $match)) { + $en_section["xmlid"] = $match[2]; + $en_section["xmlns"] = $match[6]; + $en_section["xmlnsxlink"] = $match[10]; } - for( $i=0; $i < count($en_section["xmlns"]); $i ++ ) { - - if( !isset($en_section["xmlns"][$i]) ) { $en_section["xmlns"][$i] = ''; } - if( !isset($lang_section["xmlns"][$i]) ) { $lang_section["xmlns"][$i] = ''; } - - if( $en_section["xmlns"][$i] != $lang_section["xmlns"][$i] ) { - $result_error[] = array( - "value_en" => $en_section["xmlns"][$i], - "value_lang" => $lang_section["xmlns"][$i], - "type" => "attributXmlNsSection" - ); - } + $lang_section = array(); + $match = array(); + if (preg_match_all($reg, $lang_content, $match)) { + $lang_section["xmlid"] = $match[2]; + $lang_section["xmlns"] = $match[6]; + $lang_section["xmlnsxlink"] = $match[10]; } - for( $i=0; $i < count($en_section["xmlnsxlink"]); $i ++ ) { - - if( !isset($en_section["xmlnsxlink"][$i]) ) { $en_section["xmlnsxlink"][$i] = ''; } - if( !isset($lang_section["xmlnsxlink"][$i]) ) { $lang_section["xmlnsxlink"][$i] = ''; } - if( $en_section["xmlnsxlink"][$i] != $lang_section["xmlnsxlink"][$i] ) { - $result_error[] = array( - "value_en" => $en_section["xmlnsxlink"][$i], - "value_lang" => $lang_section["xmlnsxlink"][$i], - "type" => "attributXmlNsXlinkSection" - ); + $properties = array( + 'xmlid' => 'XmlId', + 'xmlns' => 'XmlNs', + 'xmlnsxlink' => 'XmlNsXlink', + ); + foreach ($properties as $property => $label) { + for ($i = 0; $i < count($en_section[$property]); $i++) { + if ($en_section[$property][$i] != $lang_section[$property][$i] ) { + $result_error[] = array( + 'value_en' => $en_section[$property][$i], + 'value_lang' => $lang_section[$property][$i], + 'type' => 'attribut' . $label . 'Section', + ); + } } } return $result_error; } + function tools_error_check_attributVarlistentryTags($lang_content, $en_content) { // attributs in Varlistentry tags - $result_error = FALSE; + $result_error = array(); - $en_varlistentry = array(); - preg_match_all("/<varlistentry\s*?xml:id=(\"|')(.*?)(\"|')\s*?>/s", $en_content, $match); - $en_varlistentry = $match[2]; + $reg = '/<varlistentry\s*?xml:id=("|\')(.*?)("|\')\s*?>/s'; - $lang_varlistentry = array(); - preg_match_all("/<varlistentry\s*?xml:id=(\"|')(.*?)(\"|')\s*?>/s", $lang_content, $match); - $lang_varlistentry = $match[2]; + $match = $en_varlistentry = array(); + if (preg_match_all($reg, $en_content, $match)) { + $en_varlistentry = $match[2]; + } - for( $i=0; $i < count($en_varlistentry); $i ++ ) { + $match = $lang_varlistentry = array(); + if (preg_match_all($reg, $lang_content, $match)) { + $lang_varlistentry = $match[2]; + } - if( !isset($en_varlistentry[$i]) ) { $en_varlistentry[$i] = ''; } - if( !isset($lang_varlistentry[$i]) ) { $lang_varlistentry[$i] = ''; } + for ($i = 0; $i < count($en_varlistentry); $i++) { - if( $en_varlistentry[$i] != $lang_varlistentry[$i] ) { - $result_error[] = array( - "value_en" => $en_varlistentry[$i], - "value_lang" => $lang_varlistentry[$i], - "type" => "attributXmlIdVarlistentry" - ); + if (!isset($en_varlistentry[$i]) ) { + $en_varlistentry[$i] = ''; + } + if (!isset($lang_varlistentry[$i])) { + + $lang_varlistentry[$i] = ''; } } + + if ($en_varlistentry[$i] != $lang_varlistentry[$i] ) { + $result_error[] = array( + "value_en" => $en_varlistentry[$i], + "value_lang" => $lang_varlistentry[$i], + "type" => "attributXmlIdVarlistentry" + ); + } return $result_error; } + function tools_error_check_attributReferenceTags($lang_content, $en_content) { // attributs in Reference tags $result_error = FALSE; $en_reference = array(); - preg_match_all("/<reference\s*?xml:id=\"(.*?)\"\s*?xmlns=\"(.*?)\"\s*?(xmlns:xlink=\"(.*?)\"\s*?)?>/s", $en_content, $match); + $match = array(); + preg_match_all('/<reference\s*?xml:id="(.*?)"\s*?xmlns="(.*?)"\s*?(xmlns:xlink="(.*?)"\s*?)?>/s', $en_content, $match); $en_reference["xmlid"] = $match[1]; $en_reference["xmlns"] = $match[2]; $en_reference["xmlnsxlink"] = $match[4]; $lang_reference = array(); - preg_match_all("/<reference\s*?xml:id=\"(.*?)\"\s*?xmlns=\"(.*?)\"\s*?(xmlns:xlink=\"(.*?)\"\s*?)?>/s", $lang_content, $match); + $match = array(); + preg_match_all('/<reference\s*?xml:id="(.*?)"\s*?xmlns="(.*?)"\s*?(xmlns:xlink="(.*?)"\s*?)?>/s', $lang_content, $match); $lang_reference["xmlid"] = $match[1]; $lang_reference["xmlns"] = $match[2]; $lang_reference["xmlnsxlink"] = $match[4]; - for( $i=0; $i < count($en_reference["xmlid"]); $i ++ ) { + for ($i = 0; $i < count($en_reference["xmlid"]); $i++) { - if( !isset($en_reference["xmlid"][$i]) ) { $en_reference["xmlid"][$i] = ''; } - if( !isset($lang_reference["xmlid"][$i]) ) { $lang_reference["xmlid"][$i] = ''; } + if (!isset($en_reference["xmlid"][$i]) ) { $en_reference["xmlid"][$i] = ''; } + if (!isset($lang_reference["xmlid"][$i])) { $lang_reference["xmlid"][$i] = ''; } - if( $en_reference["xmlid"][$i] != $lang_reference["xmlid"][$i] ) { + if ($en_reference["xmlid"][$i] != $lang_reference["xmlid"][$i] ) { $result_error[] = array( "value_en" => $en_reference["xmlid"][$i], "value_lang" => $lang_reference["xmlid"][$i], @@ -2884,12 +2856,12 @@ } } - for( $i=0; $i < count($en_reference["xmlns"]); $i ++ ) { + for ($i = 0; $i < count($en_reference["xmlns"]); $i++) { - if( !isset($en_reference["xmlns"][$i]) ) { $en_reference["xmlns"][$i] = ''; } - if( !isset($lang_reference["xmlns"][$i]) ) { $lang_reference["xmlns"][$i] = ''; } + if (!isset($en_reference["xmlns"][$i]) ) { $en_reference["xmlns"][$i] = ''; } + if (!isset($lang_reference["xmlns"][$i])) { $lang_reference["xmlns"][$i] = ''; } - if( $en_reference["xmlns"][$i] != $lang_reference["xmlns"][$i] ) { + if ($en_reference["xmlns"][$i] != $lang_reference["xmlns"][$i] ) { $result_error[] = array( "value_en" => $en_reference["xmlns"][$i], "value_lang" => $lang_reference["xmlns"][$i], @@ -2898,12 +2870,12 @@ } } - for( $i=0; $i < count($en_reference["xmlnsxlink"]); $i ++ ) { + for ($i = 0; $i < count($en_reference["xmlnsxlink"]); $i++) { - if( !isset($en_reference["xmlnsxlink"][$i]) ) { $en_reference["xmlnsxlink"][$i] = ''; } - if( !isset($lang_reference["xmlnsxlink"][$i]) ) { $lang_reference["xmlnsxlink"][$i] = ''; } + if (!isset($en_reference["xmlnsxlink"][$i]) ) { $en_reference["xmlnsxlink"][$i] = ''; } + if (!isset($lang_reference["xmlnsxlink"][$i])) { $lang_reference["xmlnsxlink"][$i] = ''; } - if( $en_reference["xmlnsxlink"][$i] != $lang_reference["xmlnsxlink"][$i] ) { + if ($en_reference["xmlnsxlink"][$i] != $lang_reference["xmlnsxlink"][$i] ) { $result_error[] = array( "value_en" => $en_reference["xmlnsxlink"][$i], "value_lang" => $lang_reference["xmlnsxlink"][$i], @@ -2913,29 +2885,32 @@ } return $result_error; } + function tools_error_check_attributRefentryTags($lang_content, $en_content) { // attributs in Refentry tags $result_error = FALSE; $en_refentry = array(); - preg_match_all("/<refentry\s*?xml:id=\"(.*?)\"\s*?xmlns=\"(.*?)\"\s*?(xmlns:xlink=\"(.*?)\"\s*?)?>/s", $en_content, $match); + $match = array(); + preg_match_all('/<refentry\s*?xml:id="(.*?)"\s*?xmlns="(.*?)"\s*?(xmlns:xlink="(.*?)"\s*?)?>/s', $en_content, $match); $en_refentry["xmlid"] = $match[1]; $en_refentry["xmlns"] = $match[2]; $en_refentry["xmlnsxlink"] = $match[4]; $lang_refentry = array(); - preg_match_all("/<refentry\s*?xml:id=\"(.*?)\"\s*?xmlns=\"(.*?)\"\s*?(xmlns:xlink=\"(.*?)\"\s*?)?>/s", $lang_content, $match); + $match = array(); + preg_match_all('/<refentry\s*?xml:id="(.*?)"\s*?xmlns="(.*?)"\s*?(xmlns:xlink="(.*?)"\s*?)?>/s', $lang_content, $match); $lang_refentry["xmlid"] = $match[1]; $lang_refentry["xmlns"] = $match[2]; $lang_refentry["xmlnsxlink"] = $match[4]; - for( $i=0; $i < count($en_refentry["xmlid"]); $i ++ ) { + for ($i = 0; $i < count($en_refentry["xmlid"]); $i++) { - if( !isset($en_refentry["xmlid"][$i]) ) { $en_refentry["xmlid"][$i] = ''; } - if( !isset($lang_refentry["xmlid"][$i]) ) { $lang_refentry["xmlid"][$i] = ''; } + if (!isset($en_refentry["xmlid"][$i])) { $en_refentry["xmlid"][$i] = ''; } + if (!isset($lang_refentry["xmlid"][$i])) { $lang_refentry["xmlid"][$i] = ''; } - if( $en_refentry["xmlid"][$i] != $lang_refentry["xmlid"][$i] ) { + if ($en_refentry["xmlid"][$i] != $lang_refentry["xmlid"][$i] ) { $result_error[] = array( "value_en" => $en_refentry["xmlid"][$i], "value_lang" => $lang_refentry["xmlid"][$i], @@ -2944,12 +2919,12 @@ } } - for( $i=0; $i < count($en_refentry["xmlns"]); $i ++ ) { + for ($i = 0; $i < count($en_refentry["xmlns"]); $i++) { - if( !isset($en_refentry["xmlns"][$i]) ) { $en_refentry["xmlns"][$i] = ''; } - if( !isset($lang_refentry["xmlns"][$i]) ) { $lang_refentry["xmlns"][$i] = ''; } + if (!isset($en_refentry["xmlns"][$i])) { $en_refentry["xmlns"][$i] = ''; } + if (!isset($lang_refentry["xmlns"][$i])) { $lang_refentry["xmlns"][$i] = ''; } - if( $en_refentry["xmlns"][$i] != $lang_refentry["xmlns"][$i] ) { + if ($en_refentry["xmlns"][$i] != $lang_refentry["xmlns"][$i] ) { $result_error[] = array( "value_en" => $en_refentry["xmlns"][$i], "value_lang" => $lang_refentry["xmlns"][$i], @@ -2959,19 +2934,19 @@ } } - for( $i=0; $i < count($en_refentry["xmlnsxlink"]); $i ++ ) { + for ($i = 0; $i < count($en_refentry["xmlnsxlink"]); $i++) { - if( !isset($en_refentry["xmlnsxlink"][$i]) ) { $en_refentry["xmlnsxlink"][$i] = ''; } - if( !isset($lang_refentry["xmlnsxlink"][$i]) ) { $lang_refentry["xmlnsxlink"][$i] = ''; } + if (!isset($en_refentry["xmlnsxlink"][$i])) { $en_refentry["xmlnsxlink"][$i] = ''; } + if (!isset($lang_refentry["xmlnsxlink"][$i])) { $lang_refentry["xmlnsxlink"][$i] = ''; } - if( $en_refentry["xmlnsxlink"][$i] != $lang_refentry["xmlnsxlink"][$i] ) { + if ($en_refentry["xmlnsxlink"][$i] != $lang_refentry["xmlnsxlink"][$i] ) { $result_error[] = array( "value_en" => $en_refentry["xmlnsxlink"][$i], "value_lang" => $lang_refentry["xmlnsxlink"][$i], "type" => "attributXmlNsXlinkRefentry" ); - } + } } return $result_error; } @@ -2981,15 +2956,17 @@ $result_error = FALSE; $en_refsect1 = array(); - preg_match_all("/<refsect1\s*?role=\"(.*?)\"\s*?>/s", $en_content, $match); + $match = array(); + preg_match_all('/<refsect1\s*?role="(.*?)"\s*?>/s', $en_content, $match); $en_refsect1 = $match[1]; $lang_refsect1 = array(); - preg_match_all("/<refsect1\s*?role=\"(.*?)\"\s*?>/s", $lang_content, $match); + $match = array(); + preg_match_all('/<refsect1\s*?role="(.*?)"\s*?>/s', $lang_content, $match); $lang_refsect1 = $match[1]; - for( $i=0; $i < count($en_refsect1); $i ++ ) { - if( isset($lang_refsect1[$i]) && $en_refsect1[$i] != $lang_refsect1[$i] ) { + for ($i = 0; $i < count($en_refsect1); $i++) { + if (isset($lang_refsect1[$i]) && $en_refsect1[$i] != $lang_refsect1[$i] ) { $result_error[] = array( "value_en" => $en_refsect1[$i], "value_lang" => $lang_refsect1[$i], @@ -3004,15 +2981,16 @@ // Space or period at the end of Refpurpose tags $result_error = FALSE; - preg_match_all("/<refpurpose>.*([^A-Za-z1-9 ])<\/refpurpose>/s", $lang_content, $match); + $match = array(); + preg_match_all('/<refpurpose>.*([^A-Za-z1-9 ])<\/refpurpose>/s', $lang_content, $match); - if( isset($match[1][0]) ) { + if (isset($match[1][0])) { - if($match[1][0] == '.') { + if ($match[1][0] == '.') { $result_error[] = array( - "value_en" => "N/A", - "value_lang" => "N/A", - "type" => "spaceOrPeriodRefpurpose" + 'value_en' => 'N/A', + 'value_lang' => 'N/A', + 'type' => 'spaceOrPeriodRefpurpose' ); } } @@ -3024,14 +3002,18 @@ $result_error = FALSE; $en_cdataSection = 0; - preg_match_all("/<!\[CDATA\[(.*?)\]\]>/s", $en_content, $match2); - $en_cdataSection = count($match2[1]); + $match = array(); + if (preg_match_all('/<!\[CDATA\[(.*?)\]\]>/s', $en_content, $match)) { + $en_cdataSection = count($match[1]); + } $lang_cdataSection = 0; - preg_match_all("/<!\[CDATA\[(.*?)\]\]>/s", $lang_content, $match2); - $lang_cdataSection = count($match2[1]); + $match = array(); + if (preg_match_all('/<!\[CDATA\[(.*?)\]\]>/s', $lang_content, $match)) { + $lang_cdataSection = count($match[1]); + } - if( $en_cdataSection != $lang_cdataSection ) { + if ($en_cdataSection != $lang_cdataSection ) { $result_error[] = array( "value_en" => $en_cdataSection, "value_lang" => $lang_cdataSection, @@ -3043,19 +3025,20 @@ function tools_error_check_classsynopsis($lang_content, $en_content) { // Error in <classsynopsis> tags - $result_error = FALSE; + $result_error = array(); - $en_classsynopsis = array(); - preg_match_all("/<classsynopsis>(\s.*?)<\/classsynopsis>/s", $en_content, $match); + $match = $en_classsynopsis = array(); + preg_match_all('/<classsynopsis>(\s.*?)<\/classsynopsis>/s', $en_content, $match); - for( $i = 0; $i < count($match[1]); $i++) { - preg_match_all("/<ooclass><classname>(.*?)<\/classname><\/ooclass>/s", $match[1][$i], $match2); - if( !isset($match2[1][0]) ) { $match2[1][0] = ''; } + for ($i = 0; $i < count($match[1]); $i++) { + $match2 = array(); + preg_match_all('/<ooclass><classname>(.*?)<\/classname><\/ooclass>/s', $match[1][$i], $match2); + if (!isset($match2[1][0])) { $match2[1][0] = ''; } $en_classsynopsis[$i]['ooclass']['classname']['libel'] = $match2[1][0]; $en_classsynopsis[$i]['ooclass']['classname']['nb'] = count($match2[1]); - preg_match_all("/<fieldsynopsis>\s*?<modifier>(.*?)<\/modifier>\s*?<type>(.*?)<\/type>\s*?<varname(.*?)>(.*?)<\/varname>\s*?<initializer>(.*?)<\/initializer>\s*?<\/fieldsynopsis>/s", $match[1][$i], $match2); - + $match2 = array(); + preg_match_all('/<fieldsynopsis>\s*?<modifier>(.*?)<\/modifier>\s*?<type>(.*?)<\/type>\s*?<varname(.*?)>(.*?)<\/varname>\s*?<initializer>(.*?)<\/initializer>\s*?<\/fieldsynopsis>/s', $match[1][$i], $match2); $en_classsynopsis[$i]['fieldsynopsis']['modifier'] = $match2[1]; $en_classsynopsis[$i]['fieldsynopsis']['type'] = $match2[2]; $en_classsynopsis[$i]['fieldsynopsis']['varname']['attr'] = $match2[3]; @@ -3065,16 +3048,17 @@ } $lang_classsynopsis = array(); - preg_match_all("/<classsynopsis>(\s.*?)<\/classsynopsis>/s", $lang_content, $match); - - for( $i = 0; $i < count($match[1]); $i++) { + $match = array(); + preg_match_all('/<classsynopsis>(\s.*?)<\/classsynopsis>/s', $lang_content, $match); - preg_match_all("/<ooclass><classname>(.*?)<\/classname><\/ooclass>/s", $match[1][$i], $match2); - if( !isset($match2[1][0]) ) { $match2[1][0] = ''; } + for ($i = 0; $i < count($match[1]); $i++) { + $match2 = array(); + preg_match_all('/<ooclass><classname>(.*?)<\/classname><\/ooclass>/s', $match[1][$i], $match2); + if (!isset($match2[1][0])) { $match2[1][0] = ''; } $lang_classsynopsis[$i]['ooclass']['classname']['libel'] = $match2[1][0]; $lang_classsynopsis[$i]['ooclass']['classname']['nb'] = count($match2[1]); - preg_match_all("/<fieldsynopsis>\s*?<modifier>(.*?)<\/modifier>\s*?<type>(.*?)<\/type>\s*?<varname(.*?)>(.*?)<\/varname>\s*?<initializer>(.*?)<\/initializer>\s*?<\/fieldsynopsis>/s", $match[1][$i], $match2); + preg_match_all('/<fieldsynopsis>\s*?<modifier>(.*?)<\/modifier>\s*?<type>(.*?)<\/type>\s*?<varname(.*?)>(.*?)<\/varname>\s*?<initializer>(.*?)<\/initializer>\s*?<\/fieldsynopsis>/s', $match[1][$i], $match2); $lang_classsynopsis[$i]['fieldsynopsis']['modifier'] = $match2[1]; $lang_classsynopsis[$i]['fieldsynopsis']['type'] = $match2[2]; @@ -3084,13 +3068,15 @@ } - // V�rif - for( $i=0; $i < count($en_classsynopsis); $i++) { + // Verification + for ($i = 0; $i < count($en_classsynopsis); $i++) { - if( !isset($lang_classsynopsis[$i]['ooclass']['classname']['libel']) ) { $lang_classsynopsis[$i]['ooclass']['classname']['libel'] = ''; } + if (!isset($lang_classsynopsis[$i]['ooclass']['classname']['libel'])) { + $lang_classsynopsis[$i]['ooclass']['classname']['libel'] = ''; + } // ooclass, classname - if( $en_classsynopsis[$i]['ooclass']['classname']['libel'] != $lang_classsynopsis[$i]['ooclass']['classname']['libel'] ) { + if ($en_classsynopsis[$i]['ooclass']['classname']['libel'] != $lang_classsynopsis[$i]['ooclass']['classname']['libel'] ) { $result_error[] = array( "value_en" => $en_classsynopsis[$i]['ooclass']['classname']['libel'], "value_lang" => $lang_classsynopsis[$i]['ooclass']['classname']['libel'], @@ -3098,10 +3084,10 @@ ); } - if( !isset($lang_classsynopsis[$i]['ooclass']['classname']['nb']) ) { $lang_classsynopsis[$i]['ooclass']['classname']['nb'] = 0; } + if (!isset($lang_classsynopsis[$i]['ooclass']['classname']['nb'])) { $lang_classsynopsis[$i]['ooclass']['classname']['nb'] = 0; } // ooclass, classname - if( $en_classsynopsis[$i]['ooclass']['classname']['nb'] != $lang_classsynopsis[$i]['ooclass']['classname']['nb'] ) { + if ($en_classsynopsis[$i]['ooclass']['classname']['nb'] != $lang_classsynopsis[$i]['ooclass']['classname']['nb'] ) { $result_error[] = array( "value_en" => $en_classsynopsis[$i]['ooclass']['classname']['nb'], "value_lang" => $lang_classsynopsis[$i]['ooclass']['classname']['nb'], @@ -3112,11 +3098,13 @@ // fieldsynopsis - for( $j = 0; $j < count($en_classsynopsis[$i]['fieldsynopsis']['varname']['value']); $j++ ) { + for ($j = 0; $j < count($en_classsynopsis[$i]['fieldsynopsis']['varname']['value']); $j++ ) { // fieldsynopsis varname value - if( !isset($lang_classsynopsis[$i]['fieldsynopsis']['varname']['value'][$j]) ) { $lang_classsynopsis[$i]['fieldsynopsis']['varname']['value'][$j] = ''; } - if( $en_classsynopsis[$i]['fieldsynopsis']['varname']['value'][$j] != $lang_classsynopsis[$i]['fieldsynopsis']['varname']['value'][$j] ) { + if (!isset($lang_classsynopsis[$i]['fieldsynopsis']['varname']['value'][$j])) { + $lang_classsynopsis[$i]['fieldsynopsis']['varname']['value'][$j] = ''; + } + if ($en_classsynopsis[$i]['fieldsynopsis']['varname']['value'][$j] != $lang_classsynopsis[$i]['fieldsynopsis']['varname']['value'][$j] ) { $result_error[] = array( "value_en" => $en_classsynopsis[$i]['fieldsynopsis']['varname']['value'][$j], "value_lang" => $lang_classsynopsis[$i]['fieldsynopsis']['varname']['value'][$j], @@ -3126,8 +3114,10 @@ } // fieldsynopsis varname attr - if( !isset($lang_classsynopsis[$i]['fieldsynopsis']['varname']['attr'][$j]) ) { $lang_classsynopsis[$i]['fieldsynopsis']['varname']['attr'][$j] = ''; } - if( $en_classsynopsis[$i]['fieldsynopsis']['varname']['attr'][$j] != $lang_classsynopsis[$i]['fieldsynopsis']['varname']['attr'][$j] ) { + if (!isset($lang_classsynopsis[$i]['fieldsynopsis']['varname']['attr'][$j])) { + $lang_classsynopsis[$i]['fieldsynopsis']['varname']['attr'][$j] = ''; + } + if ($en_classsynopsis[$i]['fieldsynopsis']['varname']['attr'][$j] != $lang_classsynopsis[$i]['fieldsynopsis']['varname']['attr'][$j] ) { $result_error[] = array( "value_en" => $en_classsynopsis[$i]['fieldsynopsis']['varname']['attr'][$j], "value_lang" => $lang_classsynopsis[$i]['fieldsynopsis']['varname']['attr'][$j], @@ -3137,8 +3127,10 @@ } // fieldsynopsis type - if( !isset($lang_classsynopsis[$i]['fieldsynopsis']['type'][$j]) ) { $lang_classsynopsis[$i]['fieldsynopsis']['type'][$j] = ''; } - if( $en_classsynopsis[$i]['fieldsynopsis']['type'][$j] != $lang_classsynopsis[$i]['fieldsynopsis']['type'][$j] ) { + if (!isset($lang_classsynopsis[$i]['fieldsynopsis']['type'][$j])) { + $lang_classsynopsis[$i]['fieldsynopsis']['type'][$j] = ''; + } + if ($en_classsynopsis[$i]['fieldsynopsis']['type'][$j] != $lang_classsynopsis[$i]['fieldsynopsis']['type'][$j] ) { $result_error[] = array( "value_en" => $en_classsynopsis[$i]['fieldsynopsis']['type'][$j], "value_lang" => $lang_classsynopsis[$i]['fieldsynopsis']['type'][$j], @@ -3148,8 +3140,8 @@ } // fieldsynopsis modifier - if( !isset($lang_classsynopsis[$i]['fieldsynopsis']['modifier'][$j]) ) { $lang_classsynopsis[$i]['fieldsynopsis']['modifier'][$j] = ''; } - if( $en_classsynopsis[$i]['fieldsynopsis']['modifier'][$j] != $lang_classsynopsis[$i]['fieldsynopsis']['modifier'][$j] ) { + if (!isset($lang_classsynopsis[$i]['fieldsynopsis']['modifier'][$j])) { $lang_classsynopsis[$i]['fieldsynopsis']['modifier'][$j] = ''; } + if ($en_classsynopsis[$i]['fieldsynopsis']['modifier'][$j] != $lang_classsynopsis[$i]['fieldsynopsis']['modifier'][$j] ) { $result_error[] = array( "value_en" => $en_classsynopsis[$i]['fieldsynopsis']['modifier'][$j], "value_lang" => $lang_classsynopsis[$i]['fieldsynopsis']['modifier'][$j], @@ -3159,8 +3151,8 @@ } // fieldsynopsis initializer - if( !isset($lang_classsynopsis[$i]['fieldsynopsis']['initializer'][$j]) ) { $lang_classsynopsis[$i]['fieldsynopsis']['initializer'][$j] = ''; } - if( $en_classsynopsis[$i]['fieldsynopsis']['initializer'][$j] != $lang_classsynopsis[$i]['fieldsynopsis']['initializer'][$j] ) { + if (!isset($lang_classsynopsis[$i]['fieldsynopsis']['initializer'][$j])) { $lang_classsynopsis[$i]['fieldsynopsis']['initializer'][$j] = ''; } + if ($en_classsynopsis[$i]['fieldsynopsis']['initializer'][$j] != $lang_classsynopsis[$i]['fieldsynopsis']['initializer'][$j] ) { $result_error[] = array( "value_en" => $en_classsynopsis[$i]['fieldsynopsis']['initializer'][$j], "value_lang" => $lang_classsynopsis[$i]['fieldsynopsis']['initializer'][$j], @@ -3177,21 +3169,21 @@ function tools_error_check_nbParaTag($lang_content, $en_content) { // Nb <para> tags - $result_error = FALSE; + $result_error = array(); - $en_para = 0; - preg_match_all("/<para(( )(.*?))?>/s", $en_content, $match); + $match = array(); + preg_match_all('/<para(( )(.*?))?>/s', $en_content, $match); $en_para = count($match[0]); - $lang_para = 0; - preg_match_all("/<para(( )(.*?))?>/s", $lang_content, $match); + $match = array(); + preg_match_all('/<para(( )(.*?))?>/s', $lang_content, $match); $lang_para = count($match[0]); - if( $en_para != $lang_para ) { + if ($en_para != $lang_para) { $result_error[] = array( - "value_en" => $en_para, - "value_lang" => $lang_para, - "type" => "nbParaTags", + 'value_en' => $en_para, + 'value_lang' => $lang_para, + 'type' => 'nbParaTags', ); } @@ -3201,17 +3193,21 @@ function tools_error_check_nbNoteTag($lang_content, $en_content) { // Nb <note> tags - $result_error = FALSE; + $result_error = array(); $en_note = 0; - preg_match_all("/<note>/s", $en_content, $match); - $en_note = count($match[0]); + $match = array(); + if (preg_match_all('/<note>/s', $en_content, $match)) { + $en_note = count($match[0]); + } $lang_note = 0; - preg_match_all("/<note>/s", $lang_content, $match); - $lang_note = count($match[0]); + $match = array(); + if (preg_match_all('/<note>/s', $lang_content, $match)) { + $lang_note = count($match[0]); + } - if( $en_note != $lang_note ) { + if ($en_note != $lang_note) { $result_error[] = array( "value_en" => $en_note, "value_lang" => $lang_note, @@ -3227,14 +3223,18 @@ // Nb <chapter> tags $result_error = FALSE; $en_chapter = 0; - preg_match_all("/<chapter /s", $en_content, $match); - $en_chapter = count($match[0]); + $match = array(); + if (preg_match_all('/<chapter /s', $en_content, $match)) { + $en_chapter = count($match[0]); + } $lang_chapter = 0; - preg_match_all("/<chapter /s", $lang_content, $match); - $lang_chapter = count($match[0]); + $match = array(); + if (preg_match_all('/<chapter /s', $lang_content, $match)) { + $lang_chapter = count($match[0]); + } - if( $en_chapter != $lang_chapter ) { + if ($en_chapter != $lang_chapter ) { $result_error[] = array( "value_en" => $en_chapter, "value_lang" => $lang_chapter, @@ -3249,14 +3249,18 @@ // Nb <literal> tags $result_error = FALSE; $en_literal = 0; - preg_match_all("/<literal>/s", $en_content, $match); - $en_literal = count($match[0]); + $match = array(); + if (preg_match_all('/<literal>/s', $en_content, $match)) { + $en_literal = count($match[0]); + } $lang_literal = 0; - preg_match_all("/<literal>/s", $lang_content, $match); - $lang_literal = count($match[0]); + $match = array(); + if (preg_match_all('/<literal>/s', $lang_content, $match)) { + $lang_literal = count($match[0]); + } - if( $en_literal != $lang_literal ) { + if ($en_literal != $lang_literal ) { $result_error[] = array( "value_en" => $en_literal, "value_lang" => $lang_literal, @@ -3268,99 +3272,62 @@ function tools_error_check_nbElInTable($lang_content, $en_content) { - $result_error = FALSE; + $result_error = array(); // attr in <row> tags $en_attrRow = array(); - preg_match_all("/<row(\s.*?)xml:id=\"(.*?)\">/s", $en_content, $match); - $en_attrRow["xmlid"] = $match[2]; + $match = array(); + $reg = '/<row(\s.*?)xml:id="(.*?)">/s'; + if (preg_match_all($reg, $en_content, $match)) { + $en_attrRow['xmlid'] = $match[2]; + } $lang_attrRow = array(); - preg_match_all("/<row(\s.*?)xml:id=\"(.*?)\">/s", $lang_content, $match); - $lang_attrRow["xmlid"] = $match[2]; + $match = array(); + if (preg_match_all($reg, $lang_content, $match)) { + $lang_attrRow['xmlid'] = $match[2]; + } - for( $i=0; $i < count($en_attrRow["xmlid"]); $i ++ ) { + for ($i = 0; $i < count($en_attrRow['xmlid']); $i++) { - if( !isset($en_attrRow["xmlid"][$i]) ) { $en_attrRow["xmlid"][$i] = ''; } - if( !isset($lang_attrRow["xmlid"][$i]) ) { $lang_attrRow["xmlid"][$i] = ''; } + if (!isset($en_attrRow['xmlid'][$i])) { $en_attrRow['xmlid'][$i] = ''; } + if (!isset($lang_attrRow['xmlid'][$i])) { $lang_attrRow['xmlid'][$i] = ''; } - if( $en_attrRow["xmlid"][$i] != $lang_attrRow["xmlid"][$i] ) { + if ($en_attrRow['xmlid'][$i] != $lang_attrRow['xmlid'][$i] ) { $result_error[] = array( - "value_en" => $en_attrRow["xmlid"][$i], - "value_lang" => $lang_attrRow["xmlid"][$i], - "type" => "attributXmlIdRow" + 'value_en' => $en_attrRow['xmlid'][$i], + 'value_lang' => $lang_attrRow['xmlid'][$i], + 'type' => 'attributXmlIdRow' ); } } - // Nb <row> tags - $en_row = 0; - preg_match_all("/<row>/s", $en_content, $match); - $en_row = count($match[0]); - - $lang_row = 0; - preg_match_all("/<row>/s", $lang_content, $match); - $lang_row = count($match[0]); - - if( $en_row != $lang_row ) { - $result_error[] = array( - "value_en" => $en_row, - "value_lang" => $lang_row, - "type" => "nbRowTags", - ); - } - - // Nb <thead> tags - $en_thead = 0; - preg_match_all("/<thead>/s", $en_content, $match); - $en_thead = count($match[0]); - - $lang_thead = 0; - preg_match_all("/<thead>/s", $lang_content, $match); - $lang_thead = count($match[0]); - - if( $en_thead != $lang_thead ) { - $result_error[] = array( - "value_en" => $en_thead, - "value_lang" => $lang_thead, - "type" => "nbTheadTags", - ); - } + $tags = array('row', 'thead', 'tbody', 'entry'); - // Nb <tbody> tags - $en_tbody = 0; - preg_match_all("/<tbody>/s", $en_content, $match); - $en_tbody = count($match[0]); - - $lang_tbody = 0; - preg_match_all("/<tbody>/s", $lang_content, $match); - $lang_tbody = count($match[0]); + foreach ($tags as $tag) { - if( $en_tbody != $lang_tbody ) { - $result_error[] = array( - "value_en" => $en_tbody, - "value_lang" => $lang_tbody, - "type" => "nbTbodyTags", - ); - } + $reg = '/<' . $tag . '>/s'; + $en_tag = 0; + $match = array(); + if (preg_match_all($reg, $en_content, $match)) { + $en_tag = count($match[0]); + } - // Nb <entry> tags - $en_entry = 0; - preg_match_all("/<entry>/s", $en_content, $match); - $en_entry = count($match[0]); - - $lang_entry = 0; - preg_match_all("/<entry>/s", $lang_content, $match); - $lang_entry = count($match[0]); + $lang_tag = 0; + $match = array(); + if (preg_match_all($reg, $lang_content, $match)) { + $lang_tag = count($match[0]); + } - if( $en_entry != $lang_entry ) { - $result_error[] = array( - "value_en" => $en_entry, - "value_lang" => $lang_entry, - "type" => "nbEntryTags", - ); + if ($en_tag != $lang_tag) { + $result_error[] = array( + 'value_en' => $en_tag, + 'value_lang' => $lang_tag, + 'type' => 'nb' . ucfirst($tag) . 'Tags', + ); + } } return $result_error; @@ -3369,29 +3336,33 @@ function tools_error_check_nbMemberInSeeAlso($lang_content, $en_content) { // SeeAlso section : check nb member - $result_error = FALSE; + $result_error = array(); + $reg = '!<refsect1 role="seealso">(.*)</refsect1>!s'; + $reg2 = '!<member>(.*?)</member>!s'; + $match = array(); $en_seeAlsoMember = 0; - preg_match("/<refsect1 role=\"seealso\">(.*)<\/refsect1>/s", $en_content, $match2); - - if (isset($match2[1])) { - preg_match_all("/<member>(.*?)<\/member>/s", $match2[1], $match3); - if (isset($match3[1])) { - $en_seeAlsoMember = count($match3[1]); + preg_match($reg, $en_content, $match); + if (isset($match[1])) { + $match2 = array(); + preg_match_all($reg2, $match[1], $match2); + if (isset($match2[1])) { + $en_seeAlsoMember = count($match2[1]); } } + $match = array(); $lang_seeAlsoMember = 0; - preg_match("/<refsect1 role=\"seealso\">(.*)<\/refsect1>/s", $lang_content, $match2); - - if (isset($match2[1])) { - preg_match_all("/<member>(.*?)<\/member>/s", $match2[1], $match3); - if (isset($match3[1])) { - $lang_seeAlsoMember = count($match3[1]); + preg_match($reg, $lang_content, $match); + if (isset($match[1])) { + $match2 = array(); + preg_match_all($reg2, $match[1], $match2); + if (isset($match2[1])) { + $lang_seeAlsoMember = count($match2[1]); } } - if( $en_seeAlsoMember != $lang_seeAlsoMember ) { + if ($en_seeAlsoMember != $lang_seeAlsoMember ) { $result_error[] = array( "value_en" => $en_seeAlsoMember, "value_lang" => $lang_seeAlsoMember, @@ -3408,19 +3379,22 @@ // test with methodsynopsis $result_error = FALSE; - $en_methodsynopsis = array(); - preg_match_all("/<methodsynopsis>(\s.*?)<\/methodsynopsis>/s", $en_content, $match); + $match = $en_methodsynopsis = array(); + preg_match_all('/<methodsynopsis>(\s.*?)<\/methodsynopsis>/s', $en_content, $match); - for( $i = 0; $i < count($match[1]); $i++) { + for ($i = 0; $i < count($match[1]); $i++) { - preg_match_all("/<type>(.*?)<\/type>\s*?<methodname>(.*?)<\/methodname>/s", $match[1][$i], $match2); + $match2 = array(); - if( isset($match2[2][0]) && isset($match2[1][0]) ) { + preg_match_all('/<type>(.*?)<\/type>\s*?<methodname>(.*?)<\/methodname>/s', $match[1][$i], $match2); + + if (isset($match2[2][0]) && isset($match2[1][0])) { $en_methodsynopsis[$i]['methodname']['name'] = $match2[2][0]; $en_methodsynopsis[$i]['methodname']['type'] = $match2[1][0]; - preg_match_all("/<methodparam\s*?((choice=\"opt\")|(choice='opt'))?>\s*?<type>(.*?)<\/type>\s*?<parameter\s*?((role=\"reference\")|(role='reference'))?>(.*?)<\/parameter>\s*?(<initializer>(.*?)<\/initializer>\s*?)?<\/methodparam>/s", $match[1][$i], $match2); + $match2 = array(); + preg_match_all('/<methodparam\s*?((choice=\'opt\')|(choice="opt"))?>\s*?<type>(.*?)<\/type>\s*?<parameter\s*?((role=\'reference\')|(role="reference"))?>(.*?)<\/parameter>\s*?(<initializer>(.*?)<\/initializer>\s*?)?<\/methodparam>/s', $match[1][$i], $match2); $en_methodsynopsis[$i]['methodparam']['parameter'] = $match2[8]; $en_methodsynopsis[$i]['methodparam']['initializer'] = $match2[10]; @@ -3428,49 +3402,63 @@ - for( $j=0; $j < count($match2[1]); $j++) { - if( trim($match2[1][$j]) == 'choice="opt"' || trim($match2[1][$j]) == "choice='opt'" ) { $en_methodsynopsis[$i]['methodparam']['optionnel'][$j] = 1; } - else { $en_methodsynopsis[$i]['methodparam']['optionnel'][$j] = 0; } + for ($j = 0; $j < count($match2[1]); $j++) { + if (trim($match2[1][$j]) == 'choice="opt"' || trim($match2[1][$j]) == "choice='opt'" ) { + $en_methodsynopsis[$i]['methodparam']['optionnel'][$j] = 1; + } + else { + $en_methodsynopsis[$i]['methodparam']['optionnel'][$j] = 0; + } } - for( $j=0; $j < count($match2[5]); $j++) { - if( trim($match2[5][$j]) == 'role="reference"' || trim($match2[5][$j]) == "role='reference'" ) { $en_methodsynopsis[$i]['methodparam']['role'][$j] = 1; } - else { $en_methodsynopsis[$i]['methodparam']['role'][$j] = 0; } + for ($j = 0; $j < count($match2[5]); $j++) { + if (trim($match2[5][$j]) == "role='reference'" || trim($match2[5][$j]) == 'role="reference"' ) { + $en_methodsynopsis[$i]['methodparam']['role'][$j] = 1; + } + else { + $en_methodsynopsis[$i]['methodparam']['role'][$j] = 0; + } } } } - $lang_methodsynopsis = array(); - preg_match_all("/<methodsynopsis>(\s.*?)<\/methodsynopsis>/s", $lang_content, $match); + $match = $lang_methodsynopsis = array(); + preg_match_all('/<methodsynopsis>(\s.*?)<\/methodsynopsis>/s', $lang_content, $match); - for( $i = 0; $i < count($match[1]); $i++) { + for ($i = 0; $i < count($match[1]); $i++) { - preg_match_all("/<type>(.*?)<\/type>\s*?<methodname>(.*?)<\/methodname>/s", $match[1][$i], $match2); + $match2 = array(); + preg_match_all('/<type>(.*?)<\/type>\s*?<methodname>(.*?)<\/methodname>/s', $match[1][$i], $match2); - if( isset($match2[2][0]) && isset($match2[1][0]) ) { + if (isset($match2[2][0]) && isset($match2[1][0])) { $lang_methodsynopsis[$i]['methodname']['name'] = $match2[2][0]; $lang_methodsynopsis[$i]['methodname']['type'] = $match2[1][0]; - preg_match_all("/<methodparam\s*?((choice=\"opt\")|(choice='opt'))?>\s*?<type>(.*?)<\/type>\s*?<parameter\s*?((role=\"reference\")|(role='reference'))?>(.*?)<\/parameter>\s*?(<initializer>(.*?)<\/initializer>\s*?)?<\/methodparam>/s", $match[1][$i], $match2); + $match2 = array(); + preg_match_all('/<methodparam\s*?((choice=\'opt\')|(choice="opt"))?>\s*?<type>(.*?)<\/type>\s*?<parameter\s*?((role=\'reference\')|(role="reference"))?>(.*?)<\/parameter>\s*?(<initializer>(.*?)<\/initializer>\s*?)?<\/methodparam>/s', $match[1][$i], $match2); $lang_methodsynopsis[$i]['methodparam']['parameter'] = $match2[8]; $lang_methodsynopsis[$i]['methodparam']['initializer'] = $match2[10]; $lang_methodsynopsis[$i]['methodparam']['type'] = $match2[4]; - for( $j=0; $j < count($match2[1]); $j++) { + for ($j=0; $j < count($match2[1]); $j++) { - if( trim($match2[1][$j]) == 'choice="opt"' || trim($match2[1][$j]) == "choice='opt'" ) { $lang_methodsynopsis[$i]['methodparam']['optionnel'][$j] = 1; } - else { $lang_methodsynopsis[$i]['methodparam']['optionnel'][$j] = 0; } + if (trim($match2[1][$j]) == 'choice="opt"' || trim($match2[1][$j]) == "choice='opt'" ) { + $lang_methodsynopsis[$i]['methodparam']['optionnel'][$j] = 1; + } else { + $lang_methodsynopsis[$i]['methodparam']['optionnel'][$j] = 0; + } } - - for( $j=0; $j < count($match2[5]); $j++) { - - if( trim($match2[5][$j]) == 'role="reference"' ) { $lang_methodsynopsis[$i]['methodparam']['role'][$j] = 1; } - else { $lang_methodsynopsis[$i]['methodparam']['role'][$j] = 0; } + for ($j=0; $j < count($match2[5]); $j++) { + if (trim($match2[5][$j]) == "role='reference'" || trim($match2[5][$j]) == 'role="reference"' ) { + $lang_methodsynopsis[$i]['methodparam']['role'][$j] = 1; + } else { + $lang_methodsynopsis[$i]['methodparam']['role'][$j] = 0; + } } @@ -3478,17 +3466,17 @@ } - for( $i=0; $i < count($en_methodsynopsis); $i++) { + for ($i = 0; $i < count($en_methodsynopsis); $i++) { // Check on name - if( isset($en_methodsynopsis[$i]['methodname']['name']) ) { + if (isset($en_methodsynopsis[$i]['methodname']['name'])) { - if( !isset($lang_methodsynopsis[$i]['methodname']['name']) ) { $lang_methodsynopsis[$i]['methodname']['name'] = ''; } - if( $en_methodsynopsis[$i]['methodname']['name'] != $lang_methodsynopsis[$i]['methodname']['name'] ) { + if (!isset($lang_methodsynopsis[$i]['methodname']['name'])) { $lang_methodsynopsis[$i]['methodname']['name'] = ''; } + if ($en_methodsynopsis[$i]['methodname']['name'] != $lang_methodsynopsis[$i]['methodname']['name'] ) { $result_error[] = array( - "value_en" => $en_methodsynopsis[$i]['methodname']['name'], - "value_lang" => $lang_methodsynopsis[$i]['methodname']['name'], - "type" => "errorMethodnameMethodsynopsis" + 'value_en' => $en_methodsynopsis[$i]['methodname']['name'], + 'value_lang' => $lang_methodsynopsis[$i]['methodname']['name'], + 'type' => 'errorMethodnameMethodsynopsis' ); } @@ -3496,115 +3484,117 @@ } // Check on type - if( isset($en_methodsynopsis[$i]['methodname']['type']) ) { + if (isset($en_methodsynopsis[$i]['methodname']['type'])) { - if( !isset($lang_methodsynopsis[$i]['methodname']['type']) ) { $lang_methodsynopsis[$i]['methodname']['type'] = ''; } - if( $en_methodsynopsis[$i]['methodname']['type'] != $lang_methodsynopsis[$i]['methodname']['type'] ) { + if (!isset($lang_methodsynopsis[$i]['methodname']['type'])) { $lang_methodsynopsis[$i]['methodname']['type'] = ''; } + if ($en_methodsynopsis[$i]['methodname']['type'] != $lang_methodsynopsis[$i]['methodname']['type'] ) { $result_error[] = array( - "value_en" => $en_methodsynopsis[$i]['methodname']['type'], - "value_lang" => $lang_methodsynopsis[$i]['methodname']['type'], - "type" => "errorTypeMethodsynopsis" + 'value_en' => $en_methodsynopsis[$i]['methodname']['type'], + 'value_lang' => $lang_methodsynopsis[$i]['methodname']['type'], + 'type' => 'errorTypeMethodsynopsis' ); } } // Check on methodparam - if(isset($en_methodsynopsis[$i]['methodparam']['parameter'])) { + if (isset($en_methodsynopsis[$i]['methodparam']['parameter'])) { // Init - if(!isset($en_methodsynopsis[$i]['methodparam']['parameter'])) { $en_methodsynopsis[$i]['methodparam']['parameter']=array(); } - if(!isset($lang_methodsynopsis[$i]['methodparam']['parameter'])) { $lang_methodsynopsis[$i]['methodparam']['parameter']=array(); } + if (!isset($en_methodsynopsis[$i]['methodparam']['parameter'])) { $en_methodsynopsis[$i]['methodparam']['parameter']=array(); } + if (!isset($lang_methodsynopsis[$i]['methodparam']['parameter'])) { $lang_methodsynopsis[$i]['methodparam']['parameter']=array(); } // Check on Nb $nb_lang = count($lang_methodsynopsis[$i]['methodparam']['parameter']); $nb_en = count($en_methodsynopsis[$i]['methodparam']['parameter']); - if($nb_lang != $nb_en){ + if ($nb_lang != $nb_en){ $result_error[]=array( - "value_en" =>$nb_en, - "value_lang" =>$nb_lang, - "type"=>"errorNbMethodparamMethodsynopsis" + 'value_en' =>$nb_en, + 'value_lang' =>$nb_lang, + 'type'=>'errorNbMethodparamMethodsynopsis' ); } for($j=0;$j<count($en_methodsynopsis[$i]['methodparam']['parameter']);$j++) { // Check on parameter - if(isset($en_methodsynopsis[$i]['methodparam']['parameter'][$j])) { + if (isset($en_methodsynopsis[$i]['methodparam']['parameter'][$j])) { - if(!isset($lang_methodsynopsis[$i]['methodparam']['parameter'][$j])) { $lang_methodsynopsis[$i]['methodparam']['parameter'][$j]=''; } + if (!isset($lang_methodsynopsis[$i]['methodparam']['parameter'][$j])) { $lang_methodsynopsis[$i]['methodparam']['parameter'][$j]=''; } - if($en_methodsynopsis[$i]['methodparam']['parameter'][$j] != $lang_methodsynopsis[$i]['methodparam']['parameter'][$j]) { + if ($en_methodsynopsis[$i]['methodparam']['parameter'][$j] != $lang_methodsynopsis[$i]['methodparam']['parameter'][$j]) { $result_error[]=array( - "value_en" => $en_methodsynopsis[$i]['methodparam']['parameter'][$j], - "value_lang" => $lang_methodsynopsis[$i]['methodparam']['parameter'][$j], - "type"=>"errorParameterNameMethodsynopsis" + 'value_en' => $en_methodsynopsis[$i]['methodparam']['parameter'][$j], + 'value_lang' => $lang_methodsynopsis[$i]['methodparam']['parameter'][$j], + 'type'=>'errorParameterNameMethodsynopsis' ); } } // Check on type - if(isset($en_methodsynopsis[$i]['methodparam']['type'][$j])) { + if (isset($en_methodsynopsis[$i]['methodparam']['type'][$j])) { - if(!isset($lang_methodsynopsis[$i]['methodparam']['type'][$j])) { $lang_methodsynopsis[$i]['methodparam']['type'][$j]=''; } + if (!isset($lang_methodsynopsis[$i]['methodparam']['type'][$j])) { $lang_methodsynopsis[$i]['methodparam']['type'][$j]=''; } - if($en_methodsynopsis[$i]['methodparam']['type'][$j]!=$lang_methodsynopsis[$i]['methodparam']['type'][$j]) { + if ($en_methodsynopsis[$i]['methodparam']['type'][$j]!=$lang_methodsynopsis[$i]['methodparam']['type'][$j]) { $result_error[]=array( - "value_en"=>$en_methodsynopsis[$i]['methodparam']['type'][$j], - "value_lang"=>$lang_methodsynopsis[$i]['methodparam']['type'][$j], - "type"=>"errorParameterTypeMethodsynopsis" + 'value_en'=>$en_methodsynopsis[$i]['methodparam']['type'][$j], + 'value_lang'=>$lang_methodsynopsis[$i]['methodparam']['type'][$j], + 'type'=>'errorParameterTypeMethodsynopsis' ); } } // Check on initializer - if(isset($en_methodsynopsis[$i]['methodparam']['initializer'][$j])) { + if (isset($en_methodsynopsis[$i]['methodparam']['initializer'][$j])) { - if(!isset($lang_methodsynopsis[$i]['methodparam']['initializer'][$j])) { $lang_methodsynopsis[$i]['methodparam']['initializer'][$j]=''; } + if (!isset($lang_methodsynopsis[$i]['methodparam']['initializer'][$j])) { $lang_methodsynopsis[$i]['methodparam']['initializer'][$j]=''; } - if($en_methodsynopsis[$i]['methodparam']['initializer'][$j]!=$lang_methodsynopsis[$i]['methodparam']['initializer'][$j]) { + if ($en_methodsynopsis[$i]['methodparam']['initializer'][$j]!=$lang_methodsynopsis[$i]['methodparam']['initializer'][$j]) { $result_error[]=array( - "value_en"=>$en_methodsynopsis[$i]['methodparam']['initializer'][$j], - "value_lang"=>$lang_methodsynopsis[$i]['methodparam']['initializer'][$j], - "type"=>"errorParameterInitializerMethodsynopsis" + 'value_en'=>$en_methodsynopsis[$i]['methodparam']['initializer'][$j], + 'value_lang'=>$lang_methodsynopsis[$i]['methodparam']['initializer'][$j], + 'type'=>'errorParameterInitializerMethodsynopsis' ); } } // Check on optionnel - if(isset($en_methodsynopsis[$i]['methodparam']['optionnel'][$j])) { + if (isset($en_methodsynopsis[$i]['methodparam']['optionnel'][$j])) { - if(!isset($lang_methodsynopsis[$i]['methodparam']['optionnel'][$j])) { $lang_methodsynopsis[$i]['methodparam']['optionnel'][$j]=''; } + if (!isset($lang_methodsynopsis[$i]['methodparam']['optionnel'][$j])) { + $lang_methodsynopsis[$i]['methodparam']['optionnel'][$j] = ''; + } - if($en_methodsynopsis[$i]['methodparam']['optionnel'][$j]!=$lang_methodsynopsis[$i]['methodparam']['optionnel'][$j]) { - $tmp1 = ($en_methodsynopsis[$i]['methodparam']['optionnel'][$j] == 0) ? $en_methodsynopsis[$i]['methodparam']['parameter'][$j]." <strong>ISN'T</strong> optionnel" : $en_methodsynopsis[$i]['methodparam']['parameter'][$j]." <strong>IS</strong> optionnel (choice=\"opt\")"; + if ($en_methodsynopsis[$i]['methodparam']['optionnel'][$j] != $lang_methodsynopsis[$i]['methodparam']['optionnel'][$j]) { + $tmp1 = ($en_methodsynopsis[$i]['methodparam']['optionnel'][$j] == 0) ? $en_methodsynopsis[$i]['methodparam']['parameter'][$j] . ' <strong>ISN\'T</strong> optional' : $en_methodsynopsis[$i]['methodparam']['parameter'][$j].' <strong>IS</strong> optional (choice="opt")'; - $tmp2 = ($lang_methodsynopsis[$i]['methodparam']['optionnel'][$j] == 0) ? $lang_methodsynopsis[$i]['methodparam']['parameter'][$j]." <strong>ISN'T</strong> optionnel" : $lang_methodsynopsis[$i]['methodparam']['parameter'][$j]." <strong>IS</strong> optionnel (choice=\"opt\")"; + $tmp2 = ($lang_methodsynopsis[$i]['methodparam']['optionnel'][$j] == 0) ? $lang_methodsynopsis[$i]['methodparam']['parameter'][$j].' <strong>ISN\'T</strong> optional' : $lang_methodsynopsis[$i]['methodparam']['parameter'][$j].' <strong>IS</strong> optional (choice="opt")'; - $result_error[]=array( - "value_en" => $tmp1, - "value_lang" => $tmp2, - "type"=>"errorOptionalMethodsynopsis" + $result_error[] = array( + 'value_en' => $tmp1, + 'value_lang' => $tmp2, + 'type'=>'errorOptionalMethodsynopsis', ); } } // Check on role - if(isset($en_methodsynopsis[$i]['methodparam']['role'][$j])) { + if (isset($en_methodsynopsis[$i]['methodparam']['role'][$j])) { - if(!isset($lang_methodsynopsis[$i]['methodparam']['role'][$j])) { + if (!isset($lang_methodsynopsis[$i]['methodparam']['role'][$j])) { $lang_methodsynopsis[$i]['methodparam']['role'][$j]=''; } - if( $en_methodsynopsis[$i]['methodparam']['role'][$j] != $lang_methodsynopsis[$i]['methodparam']['role'][$j] ) { - $tmp1 = ($en_methodsynopsis[$i]['methodparam']['role'][$j] == 0) ? $en_methodsynopsis[$i]['methodparam']['parameter'][$j]." <strong>ISN'T</strong> reference" : $en_methodsynopsis[$i]['methodparam']['parameter'][$j]." <strong>IS</strong> reference (role=\"reference\")"; - $tmp2 = ($lang_methodsynopsis[$i]['methodparam']['role'][$j]==0) ? $lang_methodsynopsis[$i]['methodparam']['parameter'][$j]." <strong>ISN'T</strong> reference" : $lang_methodsynopsis[$i]['methodparam']['parameter'][$j]." <strong>IS</strong> reference (role=\"reference\")"; + if ($en_methodsynopsis[$i]['methodparam']['role'][$j] != $lang_methodsynopsis[$i]['methodparam']['role'][$j] ) { + $tmp1 = ($en_methodsynopsis[$i]['methodparam']['role'][$j] == 0) ? $en_methodsynopsis[$i]['methodparam']['parameter'][$j].' <strong>ISN\'T</strong> reference' : $en_methodsynopsis[$i]['methodparam']['parameter'][$j].' <strong>IS</strong> reference (role="reference")'; + $tmp2 = ($lang_methodsynopsis[$i]['methodparam']['role'][$j]==0) ? $lang_methodsynopsis[$i]['methodparam']['parameter'][$j].' <strong>ISN\'T</strong> reference' : $lang_methodsynopsis[$i]['methodparam']['parameter'][$j].' <strong>IS</strong> reference (role="reference")'; $result_error[]=array( - "value_en"=>$tmp1, - "value_lang"=>$tmp2, - "type"=>"errorRoleMethodsynopsis",); + 'value_en'=>$tmp1, + 'value_lang'=>$tmp2, + 'type'=>'errorRoleMethodsynopsis',); } } } @@ -3619,9 +3609,10 @@ * @param $value The value of the option. * @return Nothing */ - function updateConf($item, $value) { + function updateConf($item, $value) + { - $s = 'UPDATE users SET '.$item.'=\''.$value.'\' WHERE cvs_login=\''.$this->cvsLogin.'\''; + $s = sprintf('UPDATE users SET %s="%s" WHERE cvs_login="%s"', $item, $value, $this->cvsLogin); $this->db->query($s) or die($this->db->error); @@ -3636,13 +3627,11 @@ * Erase personal data. Delete all reference into the DB for this user. * @return Nothing */ - function erasePersonalData() { + function erasePersonalData() + { - /* The DB */ - $s = 'DELETE FROM commitMessage WHERE userID=\''.$this->userID.'\''; - $this->db->query($s); - $s = 'DELETE FROM users WHERE userID=\''.$this->userID.'\''; - $this->db->query($s); + $this->db->query(sprintf('DELETE FROM commitMessage WHERE userID="%s"', $this->userID)); + $this->db->query(sprintf('DELETE FROM users WHERE userID="%s"', $this->userID)); return; @@ -3662,12 +3651,12 @@ while($f = $d->read()){ // We display only 'en' and 'LANG' tree - if( $node == '/' && $f != 'en' && $f != $this->cvsLang ) { + if ($node == '/' && $f != 'en' && $f != $this->cvsLang ) { continue; } - if( $f == '.' || + if ($f == '.' || $f == '..' || substr($f, 0, 1) == '.' || // skip hidden files substr($f, -4) == '.new' || // skip pendingCommit files @@ -3676,11 +3665,11 @@ ) continue; - if(is_dir($this->cvsDoc.$node.'/'.$f)) { - $nodes[] = array('text'=>$f, 'id'=>$node.'/'.$f, 'cls'=>'folder', 'type'=>'folder'); + if (is_dir($this->cvsDoc . $node . '/' . $f)) { + $nodes[] = array('text' => $f, 'id' => $node . '/' . $f, 'cls' => 'folder', 'type' => 'folder'); } else { - if( isset($ModifiedFiles[substr($node, 2, (strlen($node)-1)).'/'.$f]) ) { + if (isset($ModifiedFiles[substr($node, 2, (strlen($node)-1)).'/'.$f])) { $cls = 'file modified'; } else { $cls = 'file'; @@ -3697,26 +3686,26 @@ return $nodes; } - function saveLogMessage($messID, $mess) { - - $s = 'UPDATE commitMessage SET text=\''.$this->db->real_escape_string($mess).'\' WHERE id=\''.$messID.'\''; - $r = $this->db->query($s) or die($this->db->error); - + function saveLogMessage($messID, $mess) + { + $s = sprintf('UPDATE commitMessage SET text="%s" WHERE id="%s"', $this->db->real_escape_string($mess), $messID); + $this->db->query($s) or die($this->db->error); } - function deleteLogMessage($messID) { - $s = 'DELETE FROM commitMessage WHERE id=\''.$messID.'\''; - $r = $this->db->query($s) or die($this->db->error); + function deleteLogMessage($messID) + { + $s = sprintf('DELETE FROM commitMessage WHERE id="%s"', $messID); + $this->db->query($s) or die($this->db->error); } function allFilesExtension($ExtName) { $s = 'SELECT `path`, `name` FROM `files` WHERE `path` LIKE \'/reference/'.$ExtName.'/%\' AND lang=\''.$this->cvsLang.'\' ORDER BY `path`, `name`'; $r = $this->db->query($s) or die($this->db->error); - $node = Array(); + $node = array(); $i=0; - while( $a = $r->fetch_object() ) { + while ($a = $r->fetch_object()) { $node[$i]['path'] = $a->path; $node[$i]['name'] = $a->name; @@ -3735,7 +3724,7 @@ $a = $r->fetch_object(); // We need to send an email ? - if( trim($a->email) != '' ) { + if (trim($a->email) != '' ) { $to = trim($a->email); $subject = '[PHP-DOC] - Patch Accepted for '.$a->lang.$a->path.$a->name; @@ -3755,12 +3744,12 @@ function afterPatchReject($PatchUniqID) { - $s = 'SELECT * FROM `pendingPatch` WHERE uniqID = \''.$PatchUniqID.'\''; + $s = sprintf('SELECT * FROM `pendingPatch` WHERE uniqID = "%s"', $PatchUniqID); $r = $this->db->query($s) or die($this->db->error); $a = $r->fetch_object(); // We need to send an email ? - if( trim($a->email) != '' ) { + if (trim($a->email) != '' ) { $to = trim($a->email); $subject = '[PHP-DOC] - Patch Rejected for '.$a->lang.$a->path.$a->name; @@ -3773,17 +3762,16 @@ @unlink($this->cvsDoc.$a->lang.$a->path.$a->name.'.'.$a->uniqID.'.patch'); // ... and from DB - $s = 'DELETE FROM `pendingPatch` WHERE id=\''.$a->id.'\''; + $s = sprintf('DELETE FROM `pendingPatch` WHERE id="%s"', $a->id); $this->db->query($s) or die($this->db->error); } - function searchXmlID($lang, $fileID) { - - $s = 'SELECT lang, path, name FROM files WHERE lang=\''.$lang.'\' AND xmlid LIKE \'%'.$fileID.'%\''; + function searchXmlID($lang, $fileID) + { + $s = sprintf('SELECT lang, path, name FROM files WHERE lang="%s" AND xmlid LIKE "%' . $fileID . '%"', $lang); $r = $this->db->query($s) or die($this->db->error); - $a = $r->fetch_object(); - return $a; + return $r->fetch_object(); } function check_doc($content) { @@ -3862,7 +3850,7 @@ case 'void': // This either the return type or 0 parameters if (!isset($methodname)) { - $returnvoid = true; + //$returnvoid = true; } else { // no parameters $noparameters = true; } @@ -3977,7 +3965,7 @@ function get_Check_Doc_Data() { - $nodes = array(); + $node = array(); $s = 'SELECT path, @@ -4005,7 +3993,7 @@ $r = $this->db->query($s); $nb = $r->num_rows; $i = 0; - while( $a = $r->fetch_object() ) { + while ($a = $r->fetch_object()) { $i++; $tmp = explode('/', $a->path); @@ -4028,28 +4016,20 @@ } // While - return Array('nb'=>$nb, 'node'=>$node); + return array('nb' => $nb, 'node' => $node); } //get_Check_Doc_Data - function get_Check_Doc_Files($path, $errorType) { - - $s = 'SELECT path, name FROM `files` WHERE `lang`=\'en\' AND `path`=\''.$path.'\' and `'.$errorType.'`=1'; + function get_Check_Doc_Files($path, $errorType) + { + $s = sprintf('SELECT name FROM `files` WHERE `lang`="en" AND `path`="%s" AND `%s`=1', $path, $errorType); $r = $this->db->query($s); - $i = 0; - $node = Array(); - - while( $a = $r->fetch_object() ) { - - $node[$i]['name'] = $a->name; - - $i++; + $node = array(); + while ($row = $r->fetch_assoc()) { + $node[] = $row; } - return $node; - - } // get_Check_Doc_Files } // End of class \ No newline at end of file http://cvs.php.net/viewvc.cgi/doc-editor/php/controler.php?r1=1.2&r2=1.3&diff_format=u Index: doc-editor/php/controler.php diff -u doc-editor/php/controler.php:1.2 doc-editor/php/controler.php:1.3 --- doc-editor/php/controler.php:1.2 Sat Mar 28 23:53:29 2009 +++ doc-editor/php/controler.php Sun Mar 29 02:44:06 2009 @@ -78,7 +78,7 @@ $phpDoc->rev_parse_translation(); // Check errors in files - //$phpDoc->tools_error_start(); + //$phpDoc->tools_error_do('/'); // Remove the lock File $phpDoc->lockFileRemove('lock_apply_tools'); @@ -683,4 +683,4 @@ } echo '{"success":false}'; -exit; \ No newline at end of file +exit;