support for simple pages (without menu and stuff)
authorx2000habouzit <x2000habouzit>
Sun, 29 Aug 2004 17:35:35 +0000 (17:35 +0000)
committerx2000habouzit <x2000habouzit>
Sun, 29 Aug 2004 17:35:35 +0000 (17:35 +0000)
include/auto.prepend.inc.php
templates/skin/default.tpl
templates/skin/sharky.tpl

index 0aa473c..1574302 100644 (file)
@@ -32,7 +32,9 @@ function new_skinned_page($tpl_name, $min_auth, $popup=false, $tpl_head="") {
 }
 
 function new_simple_page($tpl_name, $min_auth, $popup=false, $tpl_head="") {
+    global $page;
     _new_page(SKINNED, $tpl_name, $tpl_head, $min_auth, $popup);
+    $page->assign('simple', true);
 }
 
 function new_nonhtml_page($tpl_name, $min_auth) {
index e889f45..9798c9f 100644 (file)
@@ -1,79 +1,87 @@
-{* $Id: default.tpl,v 1.11 2004-02-20 11:44:07 x2000habouzit Exp $ *}
+{* $Id: default.tpl,v 1.12 2004-08-29 17:35:35 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">
   <head>
-{include file=skin/common.header.tpl}
-  <link rel="stylesheet" type="text/css" href="{"css/default.css"|url}" media="screen" />
-{if $xorg_head}
-{include file=$xorg_head}
-{/if}
-{include file=skin/common.bandeau.head.tpl}
+    {include file=skin/common.header.tpl}
+    <link rel="stylesheet" type="text/css" href="{"css/default.css"|url}" media="screen" />
+    {if $xorg_head}
+    {include file=$xorg_head}
+    {/if}
+    {include file=skin/common.bandeau.head.tpl}
   </head>
   <body>
-{include file=skin/common.devel.tpl}
+    {include file=skin/common.devel.tpl}
 
-{if $smarty.session.suid}
+    {if $smarty.session.suid}
     <table id="suid" cellpadding="0" cellspacing="0">
-    <tr>
-      <td>
-        {dynamic}
-        {$smarty.session.suid} ({$smarty.session.username})
-        {/dynamic}
-        [<a href="{"exit.php"|url}">exit</a>]
-      </td>
-    </tr>
+      <tr>
+        <td>
+          {dynamic}
+          {$smarty.session.suid} ({$smarty.session.username})
+          {/dynamic}
+          [<a href="{"exit.php"|url}">exit</a>]
+        </td>
+      </tr>
     </table>
-{/if}
+    {/if}
 
-{include file=skin/common.bandeau.tpl}
+  {if $simple}
+
+    <div id="content">
+      {include file=$xorg_tpl}
+    </div>
+
+  {else}
+
+    {include file=skin/common.bandeau.tpl}
 
     <table id="body" cellpadding="0" cellspacing="0">
-    <tr>
-      <td id="body-logo">
-        <img src="{"images/sk_default_headlogo.jpg"|url}" alt="[ LOGO ]" />
-      </td>
-      <td id="body-top">
-        <img src="{"images/sk_default_ban.jpg"|url}" alt="[ Polytechnique.org ]" />
-        <table>
-        <tr>
-          <td class="date-heure">
-          <script type="text/javascript">
-          <!--
-            document.write(getNow());
-          //-->
-          </script>
-          </td>
-          <td class="inscrits">{insert name="getNbIns"} polytechniciens sur le web</td>
-        </tr>
-        </table>
-        <img src="{"images/sk_default_lesX.gif"|url}" alt="[LES X SUR LE WEB]" />
-      </td>
-    </tr>
-    <tr>
-      <td id="body-menu">
-{include_php file=menu.conf.php}
-{foreach key=menu_title item=menu_list from=$menu}
-{if $menu_title}
-        <div class="menu_title">{$menu_title}</div>
-{/if}
-{foreach key=menu_item item=menu_url from=$menu_list}
-        <div class="menu_item"><a href="{$menu_url|url}">{$menu_item}</a></div>
-{/foreach}
-{/foreach}
-{perms level=admin}{insert name="mkStats"}{/perms}
-      </td>
-      <td id="content">
-{include file=$xorg_tpl}
-      </td>
-    </tr>
-    <tr>
-      <td id="body-bottom" colspan="2">
-{include file=skin/common.footer.tpl}
-      </td>
-    </tr>
+      <tr>
+        <td id="body-logo">
+          <img src="{"images/sk_default_headlogo.jpg"|url}" alt="[ LOGO ]" />
+        </td>
+        <td id="body-top">
+          <img src="{"images/sk_default_ban.jpg"|url}" alt="[ Polytechnique.org ]" />
+          <table>
+            <tr>
+              <td class="date-heure">
+                <script type="text/javascript">
+                  <!--
+                  document.write(getNow());
+                  //-->
+                </script>
+              </td>
+              <td class="inscrits">{insert name="getNbIns"} polytechniciens sur le web</td>
+            </tr>
+          </table>
+          <img src="{"images/sk_default_lesX.gif"|url}" alt="[LES X SUR LE WEB]" />
+        </td>
+      </tr>
+      <tr>
+        <td id="body-menu">
+          {include_php file=menu.conf.php}
+          {foreach key=menu_title item=menu_list from=$menu}
+          {if $menu_title}
+          <div class="menu_title">{$menu_title}</div>
+          {/if}
+          {foreach key=menu_item item=menu_url from=$menu_list}
+          <div class="menu_item"><a href="{$menu_url|url}">{$menu_item}</a></div>
+          {/foreach}
+          {/foreach}
+          {perms level=admin}{insert name="mkStats"}{/perms}
+        </td>
+        <td id="content">
+          {include file=$xorg_tpl}
+        </td>
+      </tr>
+      <tr>
+        <td id="body-bottom" colspan="2">
+          {include file=skin/common.footer.tpl}
+        </td>
+      </tr>
     </table>
-
+  {/if}
   </body>
 </html>
 {* vim:set et sw=2 sts=2 sws=2: *}
index 210d95f..d2f6bfb 100644 (file)
@@ -1,79 +1,87 @@
-{* $Id: sharky.tpl,v 1.1 2004-08-29 15:46:54 x2000habouzit Exp $ *}
+{* $Id: sharky.tpl,v 1.2 2004-08-29 17:35:35 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">
   <head>
-{include file=skin/common.header.tpl}
-  <link rel="stylesheet" type="text/css" href="{"css/default.css"|url}" media="screen" />
-  <link rel="stylesheet" type="text/css" href="{"css/sharky.css"|url}" media="screen" />
-{if $xorg_head}
-{include file=$xorg_head}
-{/if}
-{include file=skin/common.bandeau.head.tpl}
+    {include file=skin/common.header.tpl}
+    <link rel="stylesheet" type="text/css" href="{"css/default.css"|url}" media="screen" />
+    <link rel="stylesheet" type="text/css" href="{"css/sharky.css"|url}" media="screen" />
+    {if $xorg_head}
+    {include file=$xorg_head}
+    {/if}
+    {include file=skin/common.bandeau.head.tpl}
   </head>
   <body>
-{include file=skin/common.devel.tpl}
+    {include file=skin/common.devel.tpl}
 
-{if $smarty.session.suid}
+    {if $smarty.session.suid}
     <table id="suid" cellpadding="0" cellspacing="0">
-    <tr>
-      <td>
-        {dynamic}
-        {$smarty.session.suid} ({$smarty.session.username})
-        {/dynamic}
-        [<a href="{"exit.php"|url}">exit</a>]
-      </td>
-    </tr>
+      <tr>
+        <td>
+          {dynamic}
+          {$smarty.session.suid} ({$smarty.session.username})
+          {/dynamic}
+          [<a href="{"exit.php"|url}">exit</a>]
+        </td>
+      </tr>
     </table>
-{/if}
+    {/if}
 
-{include file=skin/common.bandeau.tpl}
+  {if $simple}
+
+    <div id="content">
+      {include file=$xorg_tpl}
+    </div>
+
+  {else}
+
+    {include file=skin/common.bandeau.tpl}
 
     <table id="body" cellpadding="0" cellspacing="0">
-    <tr>
-      <td id="body-logo">
-        <img src="{"images/sk_sharky_logo.png"|url}" alt="[ LOGO ]" />
-      </td>
-      <td id="body-top">
-        <img src="{"images/sk_sharky_ban.png"|url}" alt="[ Polytechnique.org ]" />
-        <table>
-        <tr>
-          <td class="date-heure">
-          <script type="text/javascript">
-          <!--
-            document.write(getNow());
-          //-->
-          </script>
-          </td>
-          <td class="inscrits">{insert name="getNbIns"} polytechniciens sur le web</td>
-        </tr>
-        </table>
-      </td>
-    </tr>
-    <tr>
-      <td id="body-menu">
-{include_php file=menu.conf.php}
-{foreach key=menu_title item=menu_list from=$menu}
-{if $menu_title}
-        <div class="menu_title">{$menu_title}</div>
-{/if}
-{foreach key=menu_item item=menu_url from=$menu_list}
-        <div class="menu_item"><a href="{$menu_url|url}">{$menu_item}</a></div>
-{/foreach}
-{/foreach}
-{perms level=admin}{insert name="mkStats"}{/perms}
-      </td>
-      <td id="content">
-{include file=$xorg_tpl}
-      </td>
-    </tr>
-    <tr>
-      <td id="body-bottom" colspan="2">
-{include file=skin/common.footer.tpl}
-      </td>
-    </tr>
+      <tr>
+        <td id="body-logo">
+          <img src="{"images/sk_sharky_logo.png"|url}" alt="[ LOGO ]" />
+        </td>
+        <td id="body-top">
+          <img src="{"images/sk_sharky_ban.png"|url}" alt="[ Polytechnique.org ]" />
+          <table>
+            <tr>
+              <td class="date-heure">
+                <script type="text/javascript">
+                  <!--
+                  document.write(getNow());
+                  //-->
+                </script>
+              </td>
+              <td class="inscrits">{insert name="getNbIns"} polytechniciens sur le web</td>
+            </tr>
+          </table>
+        </td>
+      </tr>
+      <tr>
+        <td id="body-menu">
+          {include_php file=menu.conf.php}
+          {foreach key=menu_title item=menu_list from=$menu}
+          {if $menu_title}
+          <div class="menu_title">{$menu_title}</div>
+          {/if}
+          {foreach key=menu_item item=menu_url from=$menu_list}
+          <div class="menu_item"><a href="{$menu_url|url}">{$menu_item}</a></div>
+          {/foreach}
+          {/foreach}
+          {perms level=admin}{insert name="mkStats"}{/perms}
+        </td>
+        <td id="content">
+          {include file=$xorg_tpl}
+        </td>
+      </tr>
+      <tr>
+        <td id="body-bottom" colspan="2">
+          {include file=skin/common.footer.tpl}
+        </td>
+      </tr>
     </table>
-
+  {/if}
   </body>
 </html>
 {* vim:set et sw=2 sts=2 sws=2: *}