+++ /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/show.tpl', AUTH_COOKIE);
-require_once("newsletter.inc.php");
-
-$nid = Get::get('nid', 'last');
-$nl = new NewsLetter($nid);
-$page->assign_by_ref('nl',$nl);
-
-if (Post::has('send')) {
- $nl->sendTo(Session::get('prenom'), Session::get('nom'), Session::get('bestalias'), Session::get('femme'), Session::get('mail_fmt')!='text');
-}
-
-$page->run();
-?>
// Liens apparaissant de façon aléatoire
$pub_rnd = array(
- 'newsletter/show.php?nid=last' => 'Afficher la dernière newsletter' ,
+ 'nl/show' => 'Afficher la dernière newsletter' ,
'http://www.polytechnique.net' => 'Vers les autres sites polytechniciens' ,
"trombi/{$_SESSION["promo"]}" => "Voir le trombi de ma promo" ,
'banana' => 'Un petit tour du côté des forums !!'
{
return array(
'events/submit' => $this->make_hook('submit', AUTH_MDP),
+
+ 'nl/show' => $this->make_hook('nl', AUTH_COOKIE),
);
}
return PL_OK;
}
+
+ function handler_nl(&$page, $nid = 'last')
+ {
+ $page->changeTpl('newsletter/show.tpl');
+
+ require_once 'newsletter.inc.php';
+
+ $nl = new NewsLetter($nid);
+ $page->assign_by_ref('nl', $nl);
+
+ if (Post::has('send')) {
+ $nl->sendTo(Session::get('prenom'), Session::get('nom'),
+ Session::get('bestalias'), Session::get('femme'),
+ Session::get('mail_fmt') != 'text');
+ }
+
+ return PL_OK;
+ }
}
?>
{if !$art}
<p>
-[<a href="{"admin/newsletter.php"|url}">liste</a>]
-[<a href="{"newsletter/show.php"|url}?nid={$nl->_id}">visualiser</a>]
+[<a href="{rel}/admin/newsletter.php">liste</a>]
+[<a href="{rel}/nl/show/{$nl->_id}">visualiser</a>]
</p>
<form action='{$smarty.server.PHP_SELF}?nid={$nl->_id}' method='post'>
<tr class="{cycle values="impair,pair"}">
<td>{$nl.date|date_format}</td>
<td>
- <a href="{"newsletter/show.php"|url}?nid={$nl.id}">{$nl.titre}</a>
+ <a href="{rel}/nl/show/{$nl.id}">{$nl.titre}</a>
</td>
</tr>
{/foreach}
[<a href='?nid={$nl->_id}&text=1'>version Texte</a>]
{/if}
{perms level='admin'}
-[<a href='{"admin/newsletter_edit.php"|url}?nid={$nl->_id}'>Editer</a>]
+[<a href='{rel}/admin/newsletter_edit.php?nid={$nl->_id}'>Editer</a>]
{/perms}
</p>
-<form method="post" action="{$smarty.server.PHP_SELF}?nid={$nl->_id}">
+<form method="post" action="{rel}/{$platal->path}">
<div class='center'>
<input type='submit' value="me l'envoyer" name='send' />
</div>