+++ /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('evenements.tpl', AUTH_MDP);
-
-$titre = Post::get('titre');
-$texte = Post::get('texte');
-$promo_min = Post::getInt('promo_min');
-$promo_max = Post::getInt('promo_max');
-$peremption = Post::getInt('peremption');
-$validation_message = Post::get('validation_message');
-$action = Post::get('action');
-
-$page->assign('titre', $titre);
-$page->assign('texte', $texte);
-$page->assign('promo_min', $promo_min);
-$page->assign('promo_max', $promo_max);
-$page->assign('peremption', $peremption);
-$page->assign('validation_message', $validation_message);
-$page->assign('action', strtolower($action));
-
-if ($action=="Confirmer") {
- $texte = preg_replace( "/((http|ftp)+(s)?:\/\/[^<>\s]+)/i", "<a href=\"\\0\">\\0</a>", $texte );
- $texte = preg_replace( "/([^,\s]+@[^,\s]+)/i", "<a href=\"mailto:\\0\">\\0</a>", $texte );
- require_once("validations.inc.php");
- $evtreq = new evtreq($titre, $texte, $promo_min, $promo_max,
- $peremption, $validation_message, Session::getInt('uid'));
- $evtreq->submit();
- $page->assign('ok', true);
-}
-
-$select = "";
-for ($i = 1 ; $i < 30 ; $i++) {
- $p_stamp=date("Ymd",time()+3600*24*$i);
- $year=substr($p_stamp,0,4);
- $month=substr($p_stamp,4,2);
- $day=substr($p_stamp,6,2);
-
- $select .= "<option value=\"$p_stamp\"" . (($p_stamp == strtr($peremption, array("-" => ""))) ? " selected" : "")."> $day / $month / $year</option>\n";
-}
-$page->assign('select',$select);
-$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 *
+ ***************************************************************************/
+
+class EventsModule extends PLModule
+{
+ function handlers()
+ {
+ return array(
+ 'events/submit' => $this->make_hook('submit', AUTH_MDP),
+ );
+ }
+
+ function handler_submit(&$page)
+ {
+ global $globals;
+ $page->changeTpl('evenements.tpl');
+
+ $titre = Post::get('titre');
+ $texte = Post::get('texte');
+ $promo_min = Post::getInt('promo_min');
+ $promo_max = Post::getInt('promo_max');
+ $peremption = Post::getInt('peremption');
+ $valid_mesg = Post::get('valid_mesg');
+ $action = Post::get('action');
+
+ $page->assign('titre', $titre);
+ $page->assign('texte', $texte);
+ $page->assign('promo_min', $promo_min);
+ $page->assign('promo_max', $promo_max);
+ $page->assign('peremption', $peremption);
+ $page->assign('valid_mesg', $valid_mesg);
+ $page->assign('action', strtolower($action));
+
+ if ($action == 'Confirmer') {
+ $texte = preg_replace('/((http|ftp)+(s)?:\/\/[^<>\s]+)/i',
+ '<a href=\"\\0\">\\0</a>', $texte);
+ $texte = preg_replace('/([^,\s]+@[^,\s]+)/i',
+ '<a href=\"mailto:\\0\">\\0</a>', $texte);
+ require_once 'validations.inc.php';
+ $evtreq = new EvtReq($titre, $texte, $promo_min, $promo_max,
+ $peremption, $valid_mesg, Session::getInt('uid'));
+ $evtreq->submit();
+ $page->assign('ok', true);
+ }
+
+ $select = '';
+ for ($i = 1 ; $i < 30 ; $i++) {
+ $time = time() + 3600 * 24 * $i;
+ $p_stamp = date('Ymd', $time);
+ $year = date('Y', $time);
+ $month = date('m', $time);
+ $day = date('d', $time);
+
+ $select .= "<option value=\"$p_stamp\"";
+ if ($p_stamp == strtr($peremption, array("-" => ""))) {
+ $select .= " selected='selected'";
+ }
+ $select .= "> $day / $month / $year</option>\n";
+ }
+ $page->assign('select',$select);
+
+ return PL_OK;
+ }
+}
+
+?>
{* *}
{**************************************************************************}
-
-<h1>
- Proposition d'information événementielle
-</h1>
-
+<h1>Proposition d'information événementielle</h1>
{if $action eq "proposer"}
</p>
<table class="bicol">
- <tr>
- <th>{$titre|nl2br}</th>
- </tr>
- <tr>
- <td>{$texte|nl2br}</td>
- </tr>
+ <tr><th>{$titre|nl2br}</th></tr>
+ <tr><td>{$texte|nl2br}</td></tr>
</table>
<p>
et sera affiché sur la page d'accueil jusqu'au {$peremption|date_format}
</p>
-{if $validation_message}
+{if $valid_mesg}
<p>
-Tu as ajouté le message suivant à l'intention du validateur : {$validation_message|nl2br}
+Tu as ajouté le message suivant à l'intention du validateur : {$valid_mesg|nl2br}
</p>
{/if}
-<form action="{$smarty.request.PHP_SELF}" method="post">
+<form action="{rel}/events/submit" method="post">
<div>
- <input type="hidden" name="titre" value="{$titre}" />
- <input type="hidden" name="texte" value="{$texte}" />
- <input type="hidden" name="promo_min" value="{$promo_min}" />
- <input type="hidden" name="promo_max" value="{$promo_max}" />
+ <input type="hidden" name="titre" value="{$titre}" />
+ <input type="hidden" name="texte" value="{$texte}" />
+ <input type="hidden" name="promo_min" value="{$promo_min}" />
+ <input type="hidden" name="promo_max" value="{$promo_max}" />
<input type="hidden" name="peremption" value="{$peremption}" />
- <input type="hidden" name="validation_message" value="{$validation_message}" />
- <input type="submit" name="action" value="Confirmer" />
- <input type="submit" name="action" value="Modifier" />
+ <input type="hidden" name="valid_mesg" value="{$valid_mesg}" />
+ <input type="submit" name="action" value="Confirmer" />
+ <input type="submit" name="action" value="Modifier" />
</div>
</form>
Merci pour ta contribution à la vie du site!
</p>
<p>
-<a href="login.php">Retour à la page d'accueil</a>
+<a href="{rel}/login.php">Retour à la page d'accueil</a>
</p>
{else}
<p class="erreur">
-Une erreur s'est produite pendant l'enregistrement de ta proposition. Merci de nous <a href="contacts.php">contacter</a>!
+Une erreur s'est produite pendant l'enregistrement de ta proposition.
+Merci de nous <a href="{rel}/Docs/NousContacter">contacter</a>!
</p>
{/if}
{* *}
{**************************************************************************}
-
-<form action="{$smarty.server.PHP_SELF}" method="post">
+<form action="{rel}/{$platal->path}" method="post">
<table class="bicol">
<tr>
<th colspan="2">Contenu du message</th>
</p>
<p>
- <a href="evenements.php">Proposer une information événementielle</a>
+ <a href="{rel}/events/submit">Proposer une information événementielle</a>
</p>
{if $smarty.session.core_rss_hash}
<div class="right">