* Marketing:
- Switch to the new URI scheme. -MC
+ * Platal:
+ - Create module. -MC
+
* Search:
- Switch to the new URI scheme. -MC
$globals->menu->addPrivateEntry(XOM_CUSTOM, 20, 'Mes contacts', 'carnet/mescontacts.php');
$globals->menu->addPrivateEntry(XOM_CUSTOM, 30, 'Mon carnet', 'carnet/');
$globals->menu->addPrivateEntry(XOM_CUSTOM, 40, 'Mon mot de passe', 'motdepasse.php');
- $globals->menu->addPrivateEntry(XOM_CUSTOM, 50, 'Mes préférences', 'preferences.php');
+ $globals->menu->addPrivateEntry(XOM_CUSTOM, 50, 'Mes préférences', 'preferences');
$globals->menu->addPrivateEntry(XOM_GROUPS, 10, 'Trombi/Site promo', 'trombipromo.php');
$globals->menu->addPrivateEntry(XOM_GROUPS, 20, 'Conseil Pro.', 'referent.php');
$fmt2 = Session::get('mail_fmt', 'html') == 'html' ? 'texte' : 'HTML';
return Array(
Array(
- 'url' => 'preferences.php?mail_fmt='.$fmt,
+ 'url' => 'preferences?mail_fmt='.$fmt,
'title' => 'Recevoir les mails en format '.$fmt2,
'text' => 'Tu recois les mails envoyés par le site (lettre mensuelle, carnet, ...) de préférence <strong>sous forme de '
.Session::get('mail_fmt', 'html').'</strong>',
'weight' => 80
),
Array(
- 'url' => 'preferences.php?rss='.(intval(Session::get('core_rss_hash')=='')),
+ 'url' => 'preferences?rss='.(intval(Session::get('core_rss_hash')=='')),
'title' => (Session::get('core_rss_hash') ? 'Désactiver' : 'Activer').' les fils rss',
'text' => 'Ceci te permet d\'utiliser les fils rss du site. Attention, désactiver puis réactiver les fils en change les URL !',
'weight' => 90
+++ /dev/null
-<?php
-/***************************************************************************
- * Copyright (C) 2003-2006 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 *
- ***************************************************************************/
-
-require_once("xorg.inc.php");
-new_skinned_page('preferences.tpl', AUTH_COOKIE);
-$page->assign('xorg_title','Polytechnique.org - Mes préférences');
-
-if (Env::has('mail_fmt')) {
- $fmt=Env::get('mail_fmt');
- if ($fmt != 'texte') $fmt = 'html';
- $globals->xdb->execute(" UPDATE auth_user_quick
- SET core_mail_fmt = '$fmt'
- WHERE user_id = {?}", Session::getInt('uid'));
- $_SESSION['mail_fmt'] = $fmt;
- redirect('preferences.php');
-}
-
-if (Env::has('rss')) {
- if (Env::getBool('rss')) {
- $_SESSION['core_rss_hash'] = rand_url_id(16);
- $globals->xdb->execute('UPDATE auth_user_quick SET core_rss_hash={?} WHERE user_id={?}',
- Session::get('core_rss_hash'), Session::getInt('uid'));
- } else {
- $globals->xdb->execute('UPDATE auth_user_quick SET core_rss_hash="" WHERE user_id={?}', Session::getInt('uid'));
- Session::kill('core_rss_hash');
- }
- redirect('preferences.php');
-}
-
-$page->assign('prefs', $globals->hook->prefs());
-$page->run();
-
-// vim:set et sw=4 sts=4 sws=4:
-?>
--- /dev/null
+<?php
+/***************************************************************************
+ * Copyright (C) 2003-2006 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 PlatalModule extends PLModule
+{
+ function handlers()
+ {
+ return array(
+ 'preferences' => $this->make_hook('prefs', AUTH_COOKIE),
+ );
+ }
+
+ function handler_prefs(&$page)
+ {
+ global $globals;
+
+ $page->changeTpl('preferences.tpl');
+ $page->assign('xorg_title','Polytechnique.org - Mes préférences');
+
+ if (Env::has('mail_fmt')) {
+ $fmt = Env::get('mail_fmt');
+ if ($fmt != 'texte') $fmt = 'html';
+ $globals->xdb->execute("UPDATE auth_user_quick
+ SET core_mail_fmt = '$fmt'
+ WHERE user_id = {?}",
+ Session::getInt('uid'));
+ $_SESSION['mail_fmt'] = $fmt;
+ redirect('preferences');
+ }
+
+ if (Env::has('rss')) {
+ if (Env::getBool('rss')) {
+ $_SESSION['core_rss_hash'] = rand_url_id(16);
+ $globals->xdb->execute('UPDATE auth_user_quick
+ SET core_rss_hash={?} WHERE user_id={?}',
+ Session::get('core_rss_hash'),
+ Session::getInt('uid'));
+ } else {
+ $globals->xdb->execute('UPDATE auth_user_quick
+ SET core_rss_hash="" WHERE user_id={?}',
+ Session::getInt('uid'));
+ Session::kill('core_rss_hash');
+ }
+ redirect('preferences');
+ }
+
+ $page->assign('prefs', $globals->hook->prefs());
+ }
+}
+
+?>
</div>
{else}
<p>
- Pour récupérer un calendrier iCal avec l'anniversaire de tes contacts, active les flux RSS dans <a href="{rel}/preferences.php">Mes préférences</a>.
+ Pour récupérer un calendrier iCal avec l'anniversaire de tes contacts, active les flux RSS dans <a href="{rel}/preferences">Mes préférences</a>.
</p>
{/if}
{if $nls}
<p>
-Tu es actuellement inscrit à la lettre mensuelle de Polytechnique.org (pour choisir le format HTML ou texte, rends toi sur la page <a href='../preferences.php'>des préférences</a>)
+Tu es actuellement inscrit à la lettre mensuelle de Polytechnique.org (pour choisir le format HTML ou texte, rends toi sur la page <a href='{rel}/preferences'>des préférences</a>)
</p>
<div class='center'>
[<a href='?out=1'>me désinscrire de la lettre mensuelle</a>]