cvs: doc-editor /js main.js /php ExtJsController.php class.php

From: Date: Wed, 22 Apr 2009 20:54:43 +0000
Subject: cvs: doc-editor /js main.js /php ExtJsController.php class.php
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-3844@lists.php.net to get a copy of this message
yannick Wed Apr 22 20:54:43 2009 UTC Modified files: /doc-editor/js main.js /doc-editor/php class.php ExtJsController.php Log: - When we modify a EN file, then, the LANG file and we want to check for error in LANG file before saving, the test is done now with the EN modified file - Add a wait message when we apply tools after a cvs commit http://cvs.php.net/viewvc.cgi/doc-editor/js/main.js?r1=1.49&r2=1.50&diff_format=u Index: doc-editor/js/main.js diff -u doc-editor/js/main.js:1.49 doc-editor/js/main.js:1.50 --- doc-editor/js/main.js:1.49 Wed Apr 22 05:23:22 2009 +++ doc-editor/js/main.js Wed Apr 22 20:54:43 2009 @@ -42,6 +42,7 @@ userLang: '', appName: 'PhpDocumentation Online Editor', appVer: '0.2', + uiRevision: '$Revision: 1.50 $', userConf: { 'conf_needupdate_diff': 'using-exec', @@ -2193,7 +2194,9 @@ }] }); winStatus.show(); - + + Ext.getBody().mask('<img src="themes/img/loading.gif" style="vertical-align: middle;" /> '+_('Please, wait...')); + // Apply modification Ext.Ajax.request({ url: './php/controller.php', @@ -2222,6 +2225,8 @@ // Reload summary data scope.storeSummary.reload(); + + Ext.getBody().unmask(); } }); } @@ -3051,7 +3056,7 @@ }, items: [{ title: _('About'), - html: '<div id="phd-oe-about"><img src="themes/img/logo.png" alt="' + this.appName + '" /></div><div id="phd-oe-about-info">' + this.appName + ' ver ' + this.appVer + '<br/> Copyright &copy; 2008-2009 The PHP Group<br/>'+_('Author:')+' <a href="mailto:yannick@php.net">Yannick Torr&egrave;s</a> '+ _('and <a href="http://cvs.php.net/viewvc.cgi/doc-editor/" target="_blank">others</a>')+'</div>' + html: '<div id="phd-oe-about"><img src="themes/img/logo.png" alt="' + this.appName + '" /></div><div id="phd-oe-about-info">' + this.appName + ' ver ' + this.appVer + '<br/>UI: ' + this.uiRevision + '<br/> Copyright &copy; 2008-2009 The PHP Group<br/>'+_('Author:')+' <a href="mailto:yannick@php.net">Yannick Torr&egrave;s</a> '+ _('and <a href="http://cvs.php.net/viewvc.cgi/doc-editor/" target="_blank">others</a>')+'</div>' }, { title: _('Credits'), bodyStyle: 'padding:15px', http://cvs.php.net/viewvc.cgi/doc-editor/php/class.php?r1=1.38&r2=1.39&diff_format=u Index: doc-editor/php/class.php diff -u doc-editor/php/class.php:1.38 doc-editor/php/class.php:1.39 --- doc-editor/php/class.php:1.38 Mon Apr 20 21:58:18 2009 +++ doc-editor/php/class.php Wed Apr 22 20:54:43 2009 @@ -761,6 +761,26 @@ } /** + * Test if the file is a modified file. + * + * @param $lang The lang of the tested file. + * @param $path The path of the tested file. + * @param $name The name of the tested file. + * + * @return Boolean TRUE if the file is a modified file, FALSE otherwise. + */ + function isModifiedFile($lang, $path, $name) { + + $s = sprintf('SELECT id, lang, path, name FROM pendingCommit WHERE + lang="%s" AND path="%s" AND name="%s"', $lang, $path, $name); + + $r = $this->db->query($s) or die('Error: '.$this->db->error.'|'.$s); + + return ( $r->num_rows == 0 ) ? FALSE : TRUE; + + } + + /** * Get all modified files. * @return An associated array containing all informations about modified files. */ http://cvs.php.net/viewvc.cgi/doc-editor/php/ExtJsController.php?r1=1.20&r2=1.21&diff_format=u Index: doc-editor/php/ExtJsController.php diff -u doc-editor/php/ExtJsController.php:1.20 doc-editor/php/ExtJsController.php:1.21 --- doc-editor/php/ExtJsController.php:1.20 Mon Apr 20 18:59:46 2009 +++ doc-editor/php/ExtJsController.php Wed Apr 22 20:54:43 2009 @@ -345,10 +345,15 @@ // Get EN content to check error with $dirEN = DOC_EDITOR_CVS_PATH.'/en'.$FilePath; - $en_content = file_get_contents($dirEN.$FileName); - // Do tools_error - //$error = $this->phpDoc->tools_error_check_all($fileContent, $en_content); + if( $this->phpDoc->isModifiedFile('en', $FilePath, $FileName) ) { + // We get the modified file + $en_content = file_get_contents($dirEN.$FileName.'.new'); + } else { + // We get the original file + $en_content = file_get_contents($dirEN.$FileName); + } + // Update DB with this new Error (if any) $info = $this->phpDoc->getInfoFromContent($FileContent); @@ -359,7 +364,7 @@ //$r = $this->phpDoc->updateFilesError($anode, 'nocommit'); - return $this->getResponse(array('success' => true, 'error' => $r['state'], 'error_first' => $r['first'])); + return $this->getResponse(array('success' => true, 'error' => $r['state'], 'error_first' => $r['first'], 'tmp'=>$tmp)); } // NEW

« previous php.doc.cvs (#3844) next »