+++ /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 *
- ***************************************************************************/
-
-// {{{ config HOOK
-
-function skin_prefs()
-{
- global $globals;
-
- return Array(
- Array(
- 'url' => 'skin',
- 'title' => 'Apparence du site (skins)',
- 'text' => 'Tu peux changer les couleurs et les images du site.',
- 'weight' => 70
- )
- );
-}
-
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
-?>
}
// }}}
-// {{{ prfs hook
-
-function tmp_prefs()
-{
- $fmt = S::v('mail_fmt', 'html') == 'html' ? 'texte' : 'html';
- $fmt2 = S::v('mail_fmt', 'html') == 'html' ? 'texte' : 'HTML';
- return Array(
- Array(
- 'url' => 'prefs?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 '
- .S::v('mail_fmt', 'html').'</strong>',
- 'weight' => 80
- ),
- Array(
- 'url' => 'prefs?rss='.(intval(S::v('core_rss_hash')=='')),
- 'title' => (S::v('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 *
- ***************************************************************************/
-
-// {{{ config HOOK
-
-// {{{ class WebRedirConfig
-
-class WebRedirConfig
-{
- var $domain = '';
-}
-
-// }}}
-
-function webredirect_config()
-{
- global $globals;
- $globals->webredirect = new WebRedirConfig;
-}
-
-// }}}
-// {{{ prefs hook
-
-function webredirect_prefs()
-{
- $text = "Tu peux configurer tes redirections WEB http://www.carva.org/" . S::v('bestalias');
- if (S::v('forlife') != S::v('bestalias')) {
- $text .= ' et http://www.carva.org/'.S::v('forlife');
- }
-
- return Array(
- Array(
- 'url' => 'prefs/webredirect',
- 'title' => 'Ma redirection de page WEB',
- 'text' => $text,
- 'weight' => 60
- )
- );
-}
-
-// }}}
-
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
-?>
function dynpostkv(action, k, v)
{
- dynpost(action, {k: v});
+ var dict = {};
+ dict[k] = v;
+ dynpost(action, dict);
}
// }}}
'changelog' => $this->make_hook('changelog', AUTH_PUBLIC),
// Preferences thingies
- 'prefs' => $this->make_hook('prefs', AUTH_COOKIE),
- 'prefs/rss' => $this->make_hook('prefs_rss', AUTH_COOKIE),
+ 'prefs' => $this->make_hook('prefs', AUTH_COOKIE),
+ 'prefs/rss' => $this->make_hook('prefs_rss', AUTH_COOKIE),
'prefs/webredirect'
- => $this->make_hook('webredir', AUTH_MDP),
- 'skin' => $this->make_hook('skin', AUTH_COOKIE),
+ => $this->make_hook('webredir', AUTH_MDP),
+ 'prefs/skin' => $this->make_hook('skin', AUTH_COOKIE),
// password related thingies
'password' => $this->make_hook('password', AUTH_MDP),
{
global $globals;
+ var_export($_POST);
+
$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 (Post::has('mail_fmt')) {
+ $fmt = Post::get('mail_fmt');
if ($fmt != 'texte') $fmt = 'html';
XDB::execute("UPDATE auth_user_quick
SET core_mail_fmt = '$fmt'
WHERE user_id = {?}",
S::v('uid'));
$_SESSION['mail_fmt'] = $fmt;
- redirect($globals->baseurl.'/preferences');
}
- if (Env::has('rss')) {
- $this->__set_rss_state(Env::getBool('rss'));
+ if (Post::has('rss')) {
+ $this->__set_rss_state(Post::getBool('rss'));
}
$page->assign('prefs', $globals->hook->prefs());
</tr>
{/if}
{/foreach}
+ <tr class="pair">
+ <td class="half">
+ <h3><a href="prefs/webredirect">Ma redirection de page WEB</a></h3>
+ <div class='explication'>
+ Tu peux configurer tes redirections WEB
+ http://www.carva.org/{$smarty.session.bestalias}.
+ </div>
+ </td>
+ <td class="half">
+ <h3><a href="prefs/skin">Apparence du site (skins)</a></h3>
+ <div class='explication'>
+ Tu peux changer les couleurs et les images du site.
+ </div>
+ </td>
+ </tr>
+ <tr class="impair">
+ <td class="half">
+ {if $smarty.session.mail_fmt eq html}
+ <h3>
+ <a href="javascript:dynpostkv('prefs', 'mail_fmt', 'texte')">Recevoir les mails en format texte</a>
+ </h3>
+ <div class='explication'>
+ Tu recois tous les mails envoyés par le site
+ (lettre mensuelle, carnet, ...) de préférence
+ <strong>sous forme de html</strong>
+ </div>
+ {else}
+ <h3>
+ <a href="javascript:dynpostkv('prefs', 'mail_fmt', 'html')">Recevoir les mails en HTML</a>
+ </h3>
+ <div class='explication'>
+ Tu recois tous les mails envoyés par le site
+ (lettre mensuelle, carnet, ...) de préférence
+ <strong>sous forme de texte</strong>
+ </div>
+ {/if}
+ </td>
+ <td class="half">
+ <h3>
+ {if $smarty.session.core_rss_hash}
+ <a href="javascript:dynpostkv('prefs', 'rss', 0)">Désactiver les fils rss</a>
+ {else}
+ <a href="javascript:dynpostkv('prefs', 'rss', 1)">Activer les fils rss</a>
+ {/if}
+ </h3>
+ <div class='explication'>
+ Ceci te permet d'utiliser les fils rss du site.
+ Attention, désactiver puis réactiver les fils en change les URL !
+ </div>
+ </td>
+ </tr>
</table>
<br />
<p>
Dans la lignée du service de redirection d'emails de <strong>Polytechnique.org</strong>,
il est possible de faire pointer
- les adresses <strong>http://{#globals.webredirect.domain#}/{$smarty.session.bestalias}</strong>
- et <strong>http://{#globals.webredirect.domain#}/{$smarty.session.forlife}</strong>
+ les adresses <strong>http://www.carva.org/{$smarty.session.bestalias}</strong>
+ et <strong>http://www.carva.org/{$smarty.session.forlife}</strong>
vers la page WEB de ton choix. Pour de plus amples détails, consulte
<a href="Docs/MaRedirectionDePageWEB">cette page</a>
</p>
<p>
{if $carva}
Actuellement, les adresses
- <a href="http://{#globals.webredirect.domain#}/{$smarty.session.bestalias}">
- http://{#globals.webredirect.domain#}/{$smarty.session.bestalias}
- </a> et <a href="http://{#globals.webredirect.domain#}/{$smarty.session.forlife}">
- http://{#globals.webredirect.domain#}/{$smarty.session.forlife}
+ <a href="http://www.carva.org/{$smarty.session.bestalias}">
+ http://www.carva.org/{$smarty.session.bestalias}
+ </a> et <a href="http://www.carva.org/{$smarty.session.forlife}">
+ http://www.carva.org/{$smarty.session.forlife}
</a> sont redirigées sur <a href="http://{$carva}">http://{$carva}</a>
{else}
La redirection n'est pas utilisée ...