rework some more code
authorx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Tue, 25 Oct 2005 22:53:12 +0000 (22:53 +0000)
committerx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Tue, 25 Oct 2005 22:53:12 +0000 (22:53 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@140 839d8a87-29fc-0310-9880-83ba4fa771e5

include/platal/page.inc.php
templates/skin/common.content.tpl

index 47a56c2..fb527be 100644 (file)
@@ -72,7 +72,7 @@ class PlatalPage extends Smarty
     }
 
     // }}}
-    // {{{
+    // {{{ function fakeDiogenes()
     
     function fakeDiogenes()
     {
@@ -116,42 +116,41 @@ class PlatalPage extends Smarty
             $this->display($this->_tpl);
             exit;
         }
+
+        if (!$globals->debug) {
+            $this->display($skin);
+            exit;
+        }
         
-        if ($globals->debug) {
+        if ($globals->debug & 1) {
+            $this->assign('db_trace', $globals->db->trace_format($this, 'database-debug.tpl'));
+        }
 
-            if ($globals->debug & 1) {
-                $this->assign('db_trace', $globals->db->trace_format($this, 'database-debug.tpl'));
-            }
+        $this->assign('validate', urlencode($globals->baseurl.'/valid.html'));
+        $result = $this->fetch($skin);
+        $ttime  = sprintf('Temps total: %.02fs<br />', microtime_float() - $TIME_BEGIN);
+        $replc  = "<span class='erreur'>VALIDATION HTML INACTIVE</span><br />";
 
-            $this->assign('validate', urlencode($globals->baseurl.'/valid.html'));
-            $result = $this->fetch($skin);
-            $ttime  = sprintf('Temps total: %.02fs<br />', microtime_float() - $TIME_BEGIN);
-            $replc  = "<span class='erreur'>VALIDATION HTML INACTIVE</span><br />";
-
-            if ($globals->debug & 2) {
-
-                $fd = fopen($this->compile_dir."/valid.html","w");
-                fwrite($fd, $result);
-                fclose($fd);
-       
-                exec($globals->spoolroot."/bin/devel/xhtml.validate.pl ".$this->compile_dir."/valid.html", $val);
-                foreach ($val as $h) {
-                    if (preg_match("/^X-W3C-Validator-Errors: (\d+)$/", $h, $m)) {
-                        $replc = '<span style="color: #080;">HTML OK</span><br />';
-                        if ($m[1]) {
-                            $replc = "<span class='erreur'><a href='http://validator.w3.org/check?uri={$globals->baseurl}"
-                                ."/valid.html&amp;ss=1#result'>{$m[1]} ERREUR(S) !!!</a></span><br />";
-                        }
-                        break;
+        if ($globals->debug & 2) {
+
+            $fd = fopen($this->compile_dir."/valid.html","w");
+            fwrite($fd, $result);
+            fclose($fd);
+    
+            exec($globals->spoolroot."/bin/devel/xhtml.validate.pl ".$this->compile_dir."/valid.html", $val);
+            foreach ($val as $h) {
+                if (preg_match("/^X-W3C-Validator-Errors: (\d+)$/", $h, $m)) {
+                    $replc = '<span style="color: #080;">HTML OK</span><br />';
+                    if ($m[1]) {
+                        $replc = "<span class='erreur'><a href='http://validator.w3.org/check?uri={$globals->baseurl}"
+                            ."/valid.html&amp;ss=1#result'>{$m[1]} ERREUR(S) !!!</a></span><br />";
                     }
+                    break;
                 }
             }
-
-            echo str_replace("@HOOK@", $ttime.$replc, $result);
-            exit;
         }
 
-        $this->display($skin);
+        echo str_replace("@HOOK@", $ttime.$replc, $result);
         exit;
     }
 
index 382c086..9f07851 100644 (file)
@@ -37,10 +37,10 @@ Nous conseillons tr
 <br />
 {/if}
 
-{foreach from=$xorg_error->errs|smarty:nodefaults item=err}
+{foreach from=$xorg_errors item=err}
 <div class="erreur">{$err|smarty:nodefaults}</div>
 {/foreach}
 
-{if !$xorg_error->failure && $xorg_tpl}{include file=$xorg_tpl}{/if}
+{if !$xorg_failure && $xorg_tpl}{include file=$xorg_tpl}{/if}
 
 {* vim:set et sw=2 sts=2 sws=2: *}