+++ /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('newsletter/index.tpl', AUTH_COOKIE);
-$page->assign('xorg_title','Polytechnique.org - Lettres mensuelles');
-require_once("newsletter.inc.php");
-
-if(Get::has('out')) { unsubscribe_nl(); }
-if(Get::has('in')) { subscribe_nl(); }
-
-$page->assign('nls',get_nl_state());
-$page->assign_by_ref('nl_list',get_nl_list());
-$page->run();
-
-?>
+++ /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('newsletter/submit.tpl', AUTH_COOKIE);
-require_once("newsletter.inc.php");
-
-if (Post::has('see')) {
- $art = new NLArticle(Post::get('title'), Post::get('body'), Post::get('append'));
- $page->assign('art', $art);
-} elseif (Post::has('valid')) {
- require_once('validations.inc.php');
- $art = new NLReq(Session::getInt('uid'), Post::get('title'), Post::get('body'), Post::get('append'));
- $art->submit();
-
- $page->assign('submited', true);
-}
-
-$page->run();
-?>
if ($html) {
return '<div class="foot">Cette lettre est envoyée à tous les Polytechniciens sur Internet par l\'intermédiaire de Polytechnique.org.</div>'
. '<div class="foot">'
- . "[<a href=\"$url/newsletter/\">archives</a> | "
- . "<a href=\"$url/newsletter/submit.php\">écrire dans la NL</a> | "
- . "<a href=\"$url/newsletter/?out=1\">ne plus recevoir</a>]"
+ . "[<a href=\"$url/nl\">archives</a> | "
+ . "<a href=\"$url/nl/submit\">écrire dans la NL</a> | "
+ . "<a href=\"$url/nl/out\">ne plus recevoir</a>]"
. '</div>';
} else {
return "\n\n--------------------------------------------------------------------\n"
. "Cette lettre est envoyée à tous les Polytechniciens sur Internet par\n"
. "l'intermédiaire de Polytechnique.org.\n"
. "\n"
- . "archives : [$url/newsletter/]\n"
- . "écrire : [$url/newsletter/submit.php]\n"
- . "ne plus recevoir: [$url/newsletter/?out=1]\n";
+ . "archives : [$url/nl]\n"
+ . "écrire : [$url/nl/submit]\n"
+ . "ne plus recevoir: [$url/nl/out]\n";
}
}
function handlers()
{
return array(
- 'events/submit' => $this->make_hook('submit', AUTH_MDP),
+ 'events/submit' => $this->make_hook('submit', AUTH_MDP),
- 'nl/show' => $this->make_hook('nl', AUTH_COOKIE),
+ 'nl' => $this->make_hook('nl', AUTH_COOKIE),
+ 'nl/show' => $this->make_hook('nl_show', AUTH_COOKIE),
+ 'nl/submit' => $this->make_hook('nl_submit', AUTH_COOKIE),
);
}
return PL_OK;
}
- function handler_nl(&$page, $nid = 'last')
+ function handler_nl(&$page, $action = null)
+ {
+ require_once 'newsletter.inc.php';
+
+ $page->changeTpl('newsletter/index.tpl');
+ $page->assign('xorg_title','Polytechnique.org - Lettres mensuelles');
+
+ switch ($action) {
+ case 'out': unsubscribe_nl(); break;
+ case 'in': subscribe_nl(); break;
+ default: ;
+ }
+
+ $page->assign('nls', get_nl_state());
+ $page->assign_by_ref('nl_list', get_nl_list());
+
+ return PL_OK;
+ }
+
+ function handler_nl_show(&$page, $nid = 'last')
{
$page->changeTpl('newsletter/show.tpl');
return PL_OK;
}
+
+ function handler_nl_submit(&$page)
+ {
+ $page->changeTpl('newsletter/submit.tpl');
+
+ require_once 'newsletter.inc.php';
+
+ if (Post::has('see')) {
+ $art = new NLArticle(Post::get('title'), Post::get('body'), Post::get('append'));
+ $page->assign('art', $art);
+ } elseif (Post::has('valid')) {
+ require_once('validations.inc.php');
+ $art = new NLReq(Session::getInt('uid'), Post::get('title'),
+ Post::get('body'), Post::get('append'));
+ $art->submit();
+ $page->assign('submited', true);
+ }
+
+ return PL_OK;
+ }
}
?>
<tr class="{cycle values="pair,impair"}">
<td>{$nl.date|date_format}</td>
<td>
- <a href="{"admin/newsletter_edit.php"|url}?nid={$nl.id}">{$nl.titre|default:"[no title]"}</a>
+ <a href="{rel}/admin/newsletter_edit.php?nid={$nl.id}">{$nl.titre|default:"[no title]"}</a>
</td>
</tr>
{/foreach}
<p>
<strong>Pour demander l'ajout d'une annonce dans la prochaine lettre mensuelle</strong>,
-utilise <a href='submit.php'>le formulaire dédié !</a>
+utilise <a href='{rel}/nl/submit'>le formulaire dédié !</a>
</p>
<h2>Ton statut</h2>
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>]
+ [<a href='{rel}/nl/out'>me désinscrire de la lettre mensuelle</a>]
</div>
{else}
<p>
Tu n'es actuellement pas inscrit à la lettre mensuelle de Polytechnique.org.
</p>
<div class='center'>
- [<a href='?in=1'>m'inscrire à la lettre mensuelle</a>]
+ [<a href='{rel}/nl/in'>m'inscrire à la lettre mensuelle</a>]
</div>
{/if}
{* *}
{**************************************************************************}
-
-<h1>
- Proposer un article pour la prochaine Lettre mensuelle
-</h1>
-
+<h1>Proposer un article pour la prochaine Lettre mensuelle</h1>
{if $submited}
</p>
{/if}
-<form action="{$smarty.server.PHP_SELF}" method='post'>
+<form action="{rel}/nl/submit" method='post'>
<table class='tinybicol'>
<tr><th>Version texte</th></tr>
<tr id='text'>
Les contacts, prix, adresses mail utiles, liens web, ... sont en sus, et sont à placer dans la case "Ajouts"
</p>
-<form action="{$smarty.server.PHP_SELF}" method='post'>
+<form action="{rel}/nl/submit" method='post'>
<table class="bicol" cellpadding="3" cellspacing="0" summary="liste des NL">
<tr>
<th colspan='2'>proposer un article</th>