bandeau
authorx2001corpet <x2001corpet@839d8a87-29fc-0310-9880-83ba4fa771e5>
Thu, 25 Jan 2007 23:16:12 +0000 (23:16 +0000)
committerx2001corpet <x2001corpet@839d8a87-29fc-0310-9880-83ba4fa771e5>
Thu, 25 Jan 2007 23:16:12 +0000 (23:16 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1394 839d8a87-29fc-0310-9880-83ba4fa771e5

htdocs/css/bandeau.css [new file with mode: 0644]
htdocs/xorg.php
modules/bandeau.php [new file with mode: 0644]
templates/skin/common.bandeau.head.tpl
templates/skin/common.bandeau.tpl

diff --git a/htdocs/css/bandeau.css b/htdocs/css/bandeau.css
new file mode 100644 (file)
index 0000000..5cfd3c0
--- /dev/null
@@ -0,0 +1,28 @@
+/***************************************************************************
+ *  Copyright (C) 2003-2007 Polytechnique.org                              *
+ *  http://opensource.polytechnique.org/                                   *
+ *                                                                         *
+ *  This program is free software; you can redistribute it and/or modify   *
+ *  it under the terms of the GNU General Public License as published by   *
+ *  the Free Software Foundation; either version 2 of the License, or      *
+ *  (at your option) any later version.                                    *
+ *                                                                         *
+ *  This program is distributed in the hope that it will be useful,        *
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
+ *  GNU General Public License for more details.                           *
+ *                                                                         *
+ *  You should have received a copy of the GNU General Public License      *
+ *  along with this program; if not, write to the Free Software            *
+ *  Foundation, Inc.,                                                      *
+ *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
+ ***************************************************************************/
+
+#bandeau-X a        { vertical-align: middle; }
+#bandeau-X a:link, #bandeau-X a:visited    { text-decoration: none ; color: #505050; }
+#bandeau-X a:hover   { text-decoration: underline; color: black; }
+#bandeau-X a:active  { color: #CCCCCC ; background: #505050 ; }
+body {margin:0px;}
+#bandeau-X {
+background:#CCCCCC;color:#505050;font-size:10px;font-family:Verdana, Arial, Helvetica, sans-serif;height:15px;border:none;padding:0;margin:0 }
+#bandeau-X img { vertical-align:middle;border:0;padding:0;margin:0 }
index 82f398b..fc0bb57 100644 (file)
@@ -28,7 +28,7 @@ if (!($path = Env::v('n')) || ($path{0} < 'A' || $path{0} > 'Z')) {
     $platal = new Platal('auth', 'banana', 'carnet', 'email', 'events',
                          'geoloc', 'lists', 'marketing', 'payment', 'platal',
                          'profile', 'register', 'search', 'stats', 'admin',
-                         'newsletter', 'axletter');
+                         'newsletter', 'axletter', 'bandeau');
     $platal->run();
 
     exit;
diff --git a/modules/bandeau.php b/modules/bandeau.php
new file mode 100644 (file)
index 0000000..94d0cbb
--- /dev/null
@@ -0,0 +1,55 @@
+<?php
+/***************************************************************************
+ *  Copyright (C) 2003-2007 Polytechnique.org                              *
+ *  http://opensource.polytechnique.org/                                   *
+ *                                                                         *
+ *  This program is free software; you can redistribute it and/or modify   *
+ *  it under the terms of the GNU General Public License as published by   *
+ *  the Free Software Foundation; either version 2 of the License, or      *
+ *  (at your option) any later version.                                    *
+ *                                                                         *
+ *  This program is distributed in the hope that it will be useful,        *
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
+ *  GNU General Public License for more details.                           *
+ *                                                                         *
+ *  You should have received a copy of the GNU General Public License      *
+ *  along with this program; if not, write to the Free Software            *
+ *  Foundation, Inc.,                                                      *
+ *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
+ ***************************************************************************/
+
+class BandeauModule extends PLModule
+{
+    function handlers()
+    {
+        return array(
+            'bandeau/icone.png'  => $this->make_hook('icone',AUTH_PUBLIC),
+            'bandeau'            => $this->make_hook('html', AUTH_PUBLIC),
+            'bandeau.css'                               => $this->make_hook('css', AUTH_PUBLIC),
+        );
+    }
+
+    function handler_icone(&$page)
+    {
+        header("Content-Type: image/png");
+        readfile('../htdocs/images/x.png');
+        exit();
+    }
+    
+    function handler_html(&$page, $login = '')
+    {
+        $page->changeTpl('skin/common.bandeau.tpl', NO_SKIN);
+        $page->assign('login', $login);
+    }
+
+    function handler_css(&$page)
+    {
+        header("Content-Type: text/css");
+        readfile('../htdocs/css/bandeau.css');
+        exit();
+    }
+    
+}
+
+?>
index e69de29..e8a5a7e 100644 (file)
@@ -0,0 +1,23 @@
+{**************************************************************************}\r
+{*                                                                        *}\r
+{*  Copyright (C) 2003-2007 Polytechnique.org                             *}\r
+{*  http://opensource.polytechnique.org/                                  *}\r
+{*                                                                        *}\r
+{*  This program is free software; you can redistribute it and/or modify  *}\r
+{*  it under the terms of the GNU General Public License as published by  *}\r
+{*  the Free Software Foundation; either version 2 of the License, or     *}\r
+{*  (at your option) any later version.                                   *}\r
+{*                                                                        *}\r
+{*  This program is distributed in the hope that it will be useful,       *}\r
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}\r
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}\r
+{*  GNU General Public License for more details.                          *}\r
+{*                                                                        *}\r
+{*  You should have received a copy of the GNU General Public License     *}\r
+{*  along with this program; if not, write to the Free Software           *}\r
+{*  Foundation, Inc.,                                                     *}\r
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}\r
+{*                                                                        *}\r
+{**************************************************************************}\r
+\r
+       <link rel="stylesheet" media="screen" type="text/css" href="css/bandeau.css"/>\r
index afcfaec..b4cf84b 100644 (file)
 {*                                                                        *}
 {**************************************************************************}
 
+<!-- Pour récupérer ce bandeau sur votre site :
+       incluez le fichier http://www.polytechnique.org/bandeau dans vos php
+       ou http://www.polytechnique.org/bandeau/login pour profiter du login
+       automatique. Et rajoutez à la liste de css de vos pages
+       http://www.polytechnique.org/bandeau.css. -->
 
-    <!-- BANDEAU DEBUT -->
-    <table cellspacing="0" cellpadding="1" summary="" class="xdx">
-      <tr>
-        <td>
-          <img alt="" src="images/x.png" />&nbsp;&nbsp;<a href="http://www.polytechnique.fr/">L'&Eacute;cole</a>&nbsp;&middot;&nbsp;<a href="http://www.polytechnique.edu/">Institutional site</a>&nbsp;&nbsp;~~&nbsp;&nbsp;<a href="http://www.fondationx.org/">FX</a>&nbsp;&middot;&nbsp;<a href="http://www.polytechniciens.com/">AX</a>&nbsp;&nbsp;~~&nbsp;&nbsp;<a href="http://www.polytechnique.org/">Polytechnique.org</a>&nbsp;&middot;&nbsp;<a href="http://www.polytechnique.net/{if $smarty.session.auth}login{/if}">Associations polytechniciennes</a>&nbsp;&middot;&nbsp;<a href="http://www.polytechnique.fr/eleves/">&Eacute;l&egrave;ves</a>&nbsp;&middot;&nbsp;<a href="http://www.manageurs.com/{if $smarty.session.auth}anciens_accueil.php?asso=X.org{/if}">Manageurs</a>
-        </td>
-      </tr>
-    </table>
-    <!-- BANDEAU FIN -->
+{if !$login && $smarty.session.auth}
+       {assign var="login" value="true"}
+{/if}
+
+<div id="bandeau-X">
+       <img href="http://www.polytechnique.org/bandeau/icone.png" alt=""/>
+       <a href="http://www.polytechnique.fr/">L'&Eacute;cole</a> &middot;
+       <a href="http://www.polytechnique.edu/">Institutional site</a>
+       &tilde;&tilde;
+       <a href="http://www.fondationx.org/">FX</a> &middot;
+       <a href="http://www.polytechniciens.com/">AX</a>
+       &tilde;&tilde;
+       <a href="http://www.polytechnique.org">Polytechnique.org</a> &middot;
+       <a href="http://www.polytechnique.net{if $login}/login{/if}">Associations polytechniciennes</a> &middot;
+       <a href="http://www.polytechnique.fr/eleves/">&Eacute;l&egrave;ves</a> &middot;
+       <a href="http://www.manageurs.com/{if $login}anciens_accueil.php?asso=X.org{/if}">Manageurs</a>
+</div>
 
 {* vim:set et sw=2 sts=2 sws=2: *}