. " Voici les évènements survenus dans la semaine écoulée,\n"
. "et depuis ta dernière visite sur le site.\n\n"
. "Tu trouveras les mêmes informations sur la page :\n"
- . " {$globals->baseurl}/carnet/panel.php\n\n"
+ . " {$globals->baseurl}/carnet/panel\n\n"
. "------------------------------------------------------------------------\n\n";
$html = <<<EOF
</head>
<body>
<p>Voici les évènements survenus dans la semaine écoulée, et depuis ta dernière visite sur le site.</p>
- <p>Tu trouveras les mêmes informations sur <a href='{$globals->baseurl}/carnet/panel.php'>cette page</a></p>
+ <p>Tu trouveras les mêmes informations sur <a href='{$globals->baseurl}/carnet/panel'>cette page</a></p>
EOF;
foreach($u['data'] as $cid=>$d) {
+++ /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('carnet/panel.tpl', AUTH_COOKIE);
-require_once('notifs.inc.php');
-
-if(Get::has('read')) {
- $_SESSION['watch_last'] = Get::get('read');
- redirect("panel.php");
-}
-
-$page->assign('now',date('YmdHis'));
-$notifs = new Notifs(Session::getInt('uid'), true);
-
-$page->assign('notifs', $notifs);
-$page->assign('today', date('Y-m-d'));
-
-if (Session::has('core_rss_hash')) {
- $page->assign('xorg_rss',
- array("title" => "Polytechnique.org :: Carnet",
- "href" => "/carnet/rss/".Session::get('forlife')."/".Session::get('core_rss_hash')."/rss.xml"));
-}
-
-$page->run();
-
-?>
$res = select_notifs(false, $uid, $watchlast, false);
$n = $res->numRows();
$res->free();
- $url = $globals->baseurl."/carnet/panel.php";
+ $url = $globals->baseurl."/carnet/panel";
if($n==0) { return; }
if($n==1) { return "<a href='$url'>1 évènement !</a>"; }
return "<a href='$url'>$n évènements !</a>";
function handlers()
{
return array(
- 'carnet/rss' => $this->make_hook('rss', AUTH_PUBLIC),
- 'carnet/ical' => $this->make_hook('ical', AUTH_PUBLIC),
+ 'carnet/panel' => $this->make_hook('panel', AUTH_COOKIE),
+
+ 'carnet/rss' => $this->make_hook('rss', AUTH_PUBLIC),
+ 'carnet/ical' => $this->make_hook('ical', AUTH_PUBLIC),
);
}
+ function _add_rss_link(&$page)
+ {
+ if (!Session::has('core_rss_hash'))
+ return;
+ $page->assign('xorg_rss',
+ array('title' => 'Polytechnique.org :: Carnet',
+ 'href' => '/carnet/rss/'.Session::get('forlife')
+ .'/'.Session::get('core_rss_hash').'/rss.xml')
+ );
+ }
+
+ function handler_panel(&$page)
+ {
+ $page->changeTpl('carnet/panel.tpl');
+
+ if (Get::has('read')) {
+ global $globals;
+
+ $_SESSION['watch_last'] = Get::get('read');
+ redirect($globals->baseurl.'/carnet/panel');
+ }
+
+ require_once 'notifs.inc.php';
+
+ $page->assign('now',date('YmdHis'));
+ $notifs = new Notifs(Session::getInt('uid'), true);
+
+ $page->assign('notifs', $notifs);
+ $page->assign('today', date('Y-m-d'));
+ $this->_add_rss_link($page);
+
+ return PL_OK;
+ }
+
function handler_rss(&$page, $user = null, $hash = null)
{
require_once 'rss.inc.php';
<tr class="pair">
<td class='half'>
<h3>
- <a href="{"carnet/panel.php"|url}">Tous les évenements de la semaine</a>
+ <a href="{rel}/carnet/panel">Tous les évenements de la semaine</a>
</h3>
<div class="explication">
Affichage de tous les évenements de camarades/promos
<channel>
<title>Polytechnique.org :: Carnet</title>
<language>fr</language>
- <link>{#globals.baseurl#}/carnet/panel.php</link>
+ <link>{#globals.baseurl#}/carnet/panel</link>
<description>Ton carnet polytechnicien...</description>
<image>
<title>Polytechnique.org</title>