From b4315e154da87ed9afc42426523e13f00530a8a2 Mon Sep 17 00:00:00 2001 From: x2000habouzit Date: Tue, 25 Oct 2005 22:53:12 +0000 Subject: [PATCH] rework some more code git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@140 839d8a87-29fc-0310-9880-83ba4fa771e5 --- include/platal/page.inc.php | 57 +++++++++++++++++++-------------------- templates/skin/common.content.tpl | 4 +-- 2 files changed, 30 insertions(+), 31 deletions(-) diff --git a/include/platal/page.inc.php b/include/platal/page.inc.php index 47a56c2..fb527be 100644 --- a/include/platal/page.inc.php +++ b/include/platal/page.inc.php @@ -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
', microtime_float() - $TIME_BEGIN); + $replc = "VALIDATION HTML INACTIVE
"; - $this->assign('validate', urlencode($globals->baseurl.'/valid.html')); - $result = $this->fetch($skin); - $ttime = sprintf('Temps total: %.02fs
', microtime_float() - $TIME_BEGIN); - $replc = "VALIDATION HTML INACTIVE
"; - - 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 = 'HTML OK
'; - if ($m[1]) { - $replc = "{$m[1]} ERREUR(S) !!!
"; - } - 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 = 'HTML OK
'; + if ($m[1]) { + $replc = "{$m[1]} ERREUR(S) !!!
"; } + break; } } - - echo str_replace("@HOOK@", $ttime.$replc, $result); - exit; } - $this->display($skin); + echo str_replace("@HOOK@", $ttime.$replc, $result); exit; } diff --git a/templates/skin/common.content.tpl b/templates/skin/common.content.tpl index 382c086..9f07851 100644 --- a/templates/skin/common.content.tpl +++ b/templates/skin/common.content.tpl @@ -37,10 +37,10 @@ Nous conseillons tr
{/if} -{foreach from=$xorg_error->errs|smarty:nodefaults item=err} +{foreach from=$xorg_errors item=err}
{$err|smarty:nodefaults}
{/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: *} -- 2.1.4