hack infame pur valider les pages
authorx2000habouzit <x2000habouzit>
Thu, 12 Feb 2004 01:26:50 +0000 (01:26 +0000)
committerx2000habouzit <x2000habouzit>
Thu, 12 Feb 2004 01:26:50 +0000 (01:26 +0000)
(pour le faire marcher, juste faire un lien symbolique de htdocx/valid.html sur cache/valid.html)

include/xorg.page.inc.php
templates/skin/default.tpl

index 0eb9dee..63db33a 100644 (file)
@@ -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;
   }
 
index 0407227..e43d8f0 100644 (file)
@@ -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 $ *}
 <?xml version="1.0" encoding="iso-8859-1"?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 {include file=skin/common.bandeau.head.tpl}
   </head>
   <body>
+    
+{if $validate}
+    <table style="width: 100%; background: cyan; color: blue;">
+      <tr>
+        <td>
+          <a href="{$validate}" target="_new">VALIDER !!!</a>
+        </td>
+      </tr>
+    </table>
+{/if}
+
 {include file=skin/common.bandeau.tpl}
 
 {if $smarty.session.suid}