From: x2000habouzit Date: Thu, 12 Feb 2004 01:26:50 +0000 (+0000) Subject: hack infame pur valider les pages X-Git-Tag: xorg/old~1869 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=069a2fa8521d8e9e57f38623fc9c5c23132fff40;p=platal.git hack infame pur valider les pages (pour le faire marcher, juste faire un lien symbolique de htdocx/valid.html sur cache/valid.html) --- diff --git a/include/xorg.page.inc.php b/include/xorg.page.inc.php index 0eb9dee..63db33a 100644 --- a/include/xorg.page.inc.php +++ b/include/xorg.page.inc.php @@ -44,13 +44,26 @@ class XorgPage extends DiogenesCorePage { } function display($append_to_id="") { + global $baseurl, $site_dev; if(isset($_SESSION['suid'])) $this->caching=false; $id = $this->make_id($append_to_id); - if($this->_page_type == POPUP) - parent::display('skin/'.$_SESSION['skin_popup'], $id); - else - parent::display('skin/'.$_SESSION['skin'], $id); + if($site_dev) { + $this->assign('validate', "http://validator.w3.org/check?uri=".urlencode($baseurl.'/valid.html')); + if($this->_page_type == POPUP) + $result = $this->fetch('skin/'.$_SESSION['skin_popup'], $id); + else + $result = $this->fetch('skin/'.$_SESSION['skin'], $id); + $fd = fopen($this->cache_dir."valid.html","w"); + fwrite($fd, $result); + fclose($fd); + echo $result; + } else { + if($this->_page_type == POPUP) + parent::display('skin/'.$_SESSION['skin_popup'], $id); + else + parent::display('skin/'.$_SESSION['skin'], $id); + } exit; } diff --git a/templates/skin/default.tpl b/templates/skin/default.tpl index 0407227..e43d8f0 100644 --- a/templates/skin/default.tpl +++ b/templates/skin/default.tpl @@ -1,4 +1,4 @@ -{* $Id: default.tpl,v 1.7 2004-02-11 20:00:39 x2000habouzit Exp $ *} +{* $Id: default.tpl,v 1.8 2004-02-12 01:26:50 x2000habouzit Exp $ *} @@ -11,6 +11,17 @@ {include file=skin/common.bandeau.head.tpl} + +{if $validate} + + + + +
+ VALIDER !!! +
+{/if} + {include file=skin/common.bandeau.tpl} {if $smarty.session.suid}