svn: /web/doc-editor/trunk/ error_type.php php/ToolsError.php

[email protected] (Yannick Torres)
Newsgroups php.doc.web
Message-ID <[email protected]>
yannick                                  Sun, 31 Jan 2010 23:16:38 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=294286

Log:
Take care of the errorSkipNbLiteralTag option to display errors when we check a file on the fly

Changed paths:
    U   web/doc-editor/trunk/error_type.php
    U   web/doc-editor/trunk/php/ToolsError.php

Modified: web/doc-editor/trunk/error_type.php
===================================================================
--- web/doc-editor/trunk/error_type.php	2010-01-31 22:54:00 UTC (rev 294285)
+++ web/doc-editor/trunk/error_type.php	2010-01-31 23:16:38 UTC (rev 294286)
@@ -15,6 +15,12 @@
     $errorTools->setParams('', '', $am->vcsLang, $_GET['dir'], $_GET['file'], '');
     $error_to_display = $errorTools->getInfo();

+    if( empty($error_to_display) ) {
+        // We fake an empty error
+        $error_to_display['-No error-']['error'][0]['value_en']   = '-';
+        $error_to_display['-No error-']['error'][0]['value_lang'] = '-';
+    }
+
     $fileLibel = $_GET['dir'] . $_GET['file'];

 } else {

Modified: web/doc-editor/trunk/php/ToolsError.php
===================================================================
--- web/doc-editor/trunk/php/ToolsError.php	2010-01-31 22:54:00 UTC (rev 294285)
+++ web/doc-editor/trunk/php/ToolsError.php	2010-01-31 23:16:38 UTC (rev 294286)
@@ -152,11 +152,18 @@

         $project = AccountManager::getInstance()->project;

+        if ( AccountManager::getInstance()->userConf->errorSkipNbLiteralTag ) {
+            $type = ' type != \'nbLiteralTag\' AND ';
+        } else {
+            $type = '';
+        }
+
         $s = 'SELECT
                    `value_en`, `value_lang`, `type`
                 FROM
                    `errorfiles`
                 WHERE
+                   '.$type.'
                    `project` = \''.$project.'\' AND
                    `lang` = \''.$this->lang.'\' AND
                    `path` = \''.$this->filePath.'\' AND
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.