From: x2000habouzit Date: Tue, 11 Jul 2006 01:47:58 +0000 (+0000) Subject: begin to move carnet (beginning with the rss feed) X-Git-Tag: xorg/0.9.11~468 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=c9f82d49b1c5aa1b4afa830f7f7264563ab2d95d;p=platal.git begin to move carnet (beginning with the rss feed) git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@428 839d8a87-29fc-0310-9880-83ba4fa771e5 --- diff --git a/htdocs/carnet/index.php b/htdocs/carnet/index.php index 7beb2d4..f780e67 100644 --- a/htdocs/carnet/index.php +++ b/htdocs/carnet/index.php @@ -24,7 +24,9 @@ new_skinned_page('carnet/index.tpl', AUTH_COOKIE); $page->assign('xorg_title','Polytechnique.org - Mon carnet'); if (Session::has('core_rss_hash')) { - $page->assign('xorg_rss', Array("title" => "Polytechnique.org :: Carnet", "href" => "/carnet/rss.php/".Session::get('forlife')."/".Session::get('core_rss_hash').".xml")); + $page->assign('xorg_rss', + array("title" => "Polytechnique.org :: Carnet", + "href" => "/carnet/rss/".Session::get('forlife')."/".Session::get('core_rss_hash')."/rss..xml")); } $page->assign('refe',$_SERVER['PHP_SELF']); diff --git a/htdocs/carnet/panel.php b/htdocs/carnet/panel.php index f67de53..e8254cb 100644 --- a/htdocs/carnet/panel.php +++ b/htdocs/carnet/panel.php @@ -35,7 +35,9 @@ $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.php/".Session::get('forlife')."/".Session::get('core_rss_hash').".xml")); + $page->assign('xorg_rss', + array("title" => "Polytechnique.org :: Carnet", + "href" => "/carnet/rss/".Session::get('forlife')."/".Session::get('core_rss_hash')."/rss.xml")); } $page->run(); diff --git a/htdocs/carnet/rss.php b/modules/carnet.php similarity index 74% rename from htdocs/carnet/rss.php rename to modules/carnet.php index accb694..9cbb8d0 100644 --- a/htdocs/carnet/rss.php +++ b/modules/carnet.php @@ -19,15 +19,26 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ -require_once('xorg.inc.php'); -require_once('rss.inc.php'); -require_once('notifs.inc.php'); +class CarnetModule extends PLModule +{ + function handlers() + { + return array( + 'carnet/rss' => $this->make_hook('rss', AUTH_PUBLIC), + ); + } -if (preg_match(',^/([^/]+)/([^/]+)\.xml$,', $_SERVER['PATH_INFO'], $m)) { - $uid = init_rss('carnet/rss.tpl', $m[1], $m[2]); - $notifs = new Notifs($uid, false); - $page->assign('notifs', $notifs); + function handler_rss(&$page, $user = null, $hash = null) + { + require_once 'rss.inc.php'; + require_once 'notifs.inc.php'; - $page->run(); + $uid = init_rss('carnet/rss.tpl', $user, $hash); + $notifs = new Notifs($uid, false); + $page->assign('notifs', $notifs); + + return PL_OK; + } } -?> + +?> diff --git a/templates/carnet/index.tpl b/templates/carnet/index.tpl index 031d49f..5783415 100644 --- a/templates/carnet/index.tpl +++ b/templates/carnet/index.tpl @@ -65,7 +65,7 @@ Affichage de tous les évenements de camarades/promos {if $smarty.session.core_rss_hash}
- fil rss + fil rss
{else}
diff --git a/templates/carnet/panel.tpl b/templates/carnet/panel.tpl index 5859281..516d697 100644 --- a/templates/carnet/panel.tpl +++ b/templates/carnet/panel.tpl @@ -39,7 +39,7 @@ Il faut pour cel
{if $smarty.session.core_rss_hash} -fil rss +fil rss {/if}
diff --git a/templates/filrss.tpl b/templates/filrss.tpl index 9312aa0..a49e3f1 100644 --- a/templates/filrss.tpl +++ b/templates/filrss.tpl @@ -54,7 +54,7 @@ En voici les adresses :
  • Ton carnet polytechnicien : - fil rss + fil rss