From 7ef7e3deb1a167f18568e1bc3a7ec2c4dce3d89a Mon Sep 17 00:00:00 2001 From: x2000habouzit Date: Wed, 24 Nov 2004 10:12:46 +0000 Subject: [PATCH] skins should be our first module ever :) --- Makefile | 3 +- htdocs/skins.php | 5 ++- include/xorg/smarty.plugins.inc.php | 6 ++-- templates/preferences.tpl | 48 ++++++++++------------------- templates/preferences.tpl.d/10.mails.tpl | 28 +++++++++++++++++ templates/preferences.tpl.d/20.alias.tpl | 28 +++++++++++++++++ templates/preferences.tpl.d/30.redirect.tpl | 30 ++++++++++++++++++ templates/preferences.tpl.d/90.skin.tpl | 30 ++++++++++++++++++ 8 files changed, 142 insertions(+), 36 deletions(-) create mode 100644 templates/preferences.tpl.d/10.mails.tpl create mode 100644 templates/preferences.tpl.d/20.alias.tpl create mode 100644 templates/preferences.tpl.d/30.redirect.tpl create mode 100644 templates/preferences.tpl.d/90.skin.tpl diff --git a/Makefile b/Makefile index 636d514..54bb7ba 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.3 2004-11-23 10:25:23 x2000habouzit Exp $ +# $Id: Makefile,v 1.4 2004-11-24 10:12:46 x2000habouzit Exp $ ################################################################################ # definitions @@ -35,6 +35,7 @@ templates_c: chmod o+w templates_c devel: build cache templates_c + ln -sf ../cache/valid.html htdocs/valid.html ################################################################################ # diogenes package targets diff --git a/htdocs/skins.php b/htdocs/skins.php index 403f5c4..3649f47 100644 --- a/htdocs/skins.php +++ b/htdocs/skins.php @@ -18,10 +18,13 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: skins.php,v 1.11 2004-11-22 20:04:36 x2000habouzit Exp $ + * $Id: skins.php,v 1.12 2004-11-24 10:12:47 x2000habouzit Exp $ ***************************************************************************/ require_once("xorg.inc.php"); +if (!$globals->skin->enable) { + header("Location: index.php"); +} new_skinned_page('skins.tpl', AUTH_COOKIE); if (isset($_REQUEST['newskin'])) { // formulaire soumis, traitons les données envoyées diff --git a/include/xorg/smarty.plugins.inc.php b/include/xorg/smarty.plugins.inc.php index 613c65f..0053dce 100644 --- a/include/xorg/smarty.plugins.inc.php +++ b/include/xorg/smarty.plugins.inc.php @@ -18,7 +18,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: smarty.plugins.inc.php,v 1.2 2004-11-23 12:01:32 x2000habouzit Exp $ + $Id: smarty.plugins.inc.php,v 1.3 2004-11-24 10:12:47 x2000habouzit Exp $ ***************************************************************************/ // {{{ function block_dynamic() @@ -113,9 +113,9 @@ function _to_globals($s) { global $globals; $t = explode('.',$s); if (count($t) == 1) { - return $globals->$t[0]; + return var_export($globals->$t[0],true); } else { - return $globals->$t[0]->$t[1]; + return var_export($globals->$t[0]->$t[1],true); } } diff --git a/templates/preferences.tpl b/templates/preferences.tpl index 11bed3a..be9d323 100644 --- a/templates/preferences.tpl +++ b/templates/preferences.tpl @@ -17,7 +17,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: preferences.tpl,v 1.13 2004-11-24 09:47:25 x2000habouzit Exp $ + $Id: preferences.tpl,v 1.14 2004-11-24 10:12:47 x2000habouzit Exp $ ***************************************************************************}

@@ -26,41 +26,24 @@ - - - + {/if} + + {if $id is even && $smarty.foreach.glob.last} + + {/if} + {if $id is odd || $smarty.foreach.glob.last} + {/if} + {/foreach}
+ Configuration des différents services du site
-
-

Mes adresses de redirection

-
- Tu peux configurer tes différentes redirections de mails ici. -
-
-
-

Mon alias mail @melix.net/.org

-
- Pour choisir un alias @melix.net et @melix.org (en choisir un nouveau annule l'ancien). -
-
-
-

Ma redirection de page WEB

-
- Tu peux configurer tes redirections WEB - http://www.carva.org/{dyn s=$smarty.session.bestalias} - et http://www.carva.org/{dyn s=$smarty.session.forlife} -
-
-
-

Apparence du site (skins)

-
- Tu peux changer les couleurs et les images du site. -
-
-
+ {foreach from="preferences.tpl.d/*.tpl"|glob item=inc key=id name=glob} + {if $id is even} +
+ {include file=$inc}

@@ -74,6 +57,7 @@

Changer mon mot de passe pour le site

permet de changer ton mot de passe pour accéder au site Polytechnique.org +
@@ -83,6 +67,7 @@ Pour activer ton compte sur le serveur SMTP et NNTP de Polytechnique.org. Cela te permet d'envoyer tes mails plus souplement (SMTP), et de consulter les forums directement depuis ton logiciel habituel de courrier électronique. + @@ -93,6 +78,7 @@ Clique sur le lien ci-dessus pour retirer l'accès sans mot de passe au site. Après avoir cliqué, tu devras à nouveau entrer ton mot de passe pour accéder aux différentes pages comme initialement. + {else}

Attribuer un cookie d'authentification permanente

diff --git a/templates/preferences.tpl.d/10.mails.tpl b/templates/preferences.tpl.d/10.mails.tpl new file mode 100644 index 0000000..17e6c9f --- /dev/null +++ b/templates/preferences.tpl.d/10.mails.tpl @@ -0,0 +1,28 @@ +{*************************************************************************** + * Copyright (C) 2003-2004 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 * + *************************************************************************** + $Id: 10.mails.tpl,v 1.1 2004-11-24 10:12:48 x2000habouzit Exp $ + ***************************************************************************} + +

Mes adresses de redirection

+
+ Tu peux configurer tes différentes redirections de mails ici. +
+ +{* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/preferences.tpl.d/20.alias.tpl b/templates/preferences.tpl.d/20.alias.tpl new file mode 100644 index 0000000..61d5a10 --- /dev/null +++ b/templates/preferences.tpl.d/20.alias.tpl @@ -0,0 +1,28 @@ +{*************************************************************************** + * Copyright (C) 2003-2004 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 * + *************************************************************************** + $Id: 20.alias.tpl,v 1.1 2004-11-24 10:12:48 x2000habouzit Exp $ + ***************************************************************************} + +

Mon alias mail @melix.net/.org

+
+ Pour choisir un alias @melix.net et @melix.org (en choisir un nouveau annule l'ancien). +
+ +{* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/preferences.tpl.d/30.redirect.tpl b/templates/preferences.tpl.d/30.redirect.tpl new file mode 100644 index 0000000..25f1491 --- /dev/null +++ b/templates/preferences.tpl.d/30.redirect.tpl @@ -0,0 +1,30 @@ +{*************************************************************************** + * Copyright (C) 2003-2004 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 * + *************************************************************************** + $Id: 30.redirect.tpl,v 1.1 2004-11-24 10:12:48 x2000habouzit Exp $ + ***************************************************************************} + +

Ma redirection de page WEB

+
+ Tu peux configurer tes redirections WEB + http://www.carva.org/{dyn s=$smarty.session.bestalias} + et http://www.carva.org/{dyn s=$smarty.session.forlife} +
+ +{* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/preferences.tpl.d/90.skin.tpl b/templates/preferences.tpl.d/90.skin.tpl new file mode 100644 index 0000000..f2775f2 --- /dev/null +++ b/templates/preferences.tpl.d/90.skin.tpl @@ -0,0 +1,30 @@ +{*************************************************************************** + * Copyright (C) 2003-2004 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 * + *************************************************************************** + $Id: 90.skin.tpl,v 1.1 2004-11-24 10:12:48 x2000habouzit Exp $ + ***************************************************************************} + +{if #globals.skin.enable#} +

Apparence du site (skins)

+
+ Tu peux changer les couleurs et les images du site. +
+{/if} + +{* vim:set et sw=2 sts=2 sws=2: *} -- 2.1.4