begin to move carnet (beginning with the rss feed)
authorx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Tue, 11 Jul 2006 01:47:58 +0000 (01:47 +0000)
committerx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Tue, 11 Jul 2006 01:47:58 +0000 (01:47 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@428 839d8a87-29fc-0310-9880-83ba4fa771e5

htdocs/carnet/index.php
htdocs/carnet/panel.php
modules/carnet.php [moved from htdocs/carnet/rss.php with 74% similarity]
templates/carnet/index.tpl
templates/carnet/panel.tpl
templates/filrss.tpl

index 7beb2d4..f780e67 100644 (file)
@@ -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']);
index f67de53..e8254cb 100644 (file)
@@ -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();
similarity index 74%
rename from htdocs/carnet/rss.php
rename to modules/carnet.php
index accb694..9cbb8d0 100644 (file)
  *  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;
+    }
 }
-?> 
+
+?>
index 031d49f..5783415 100644 (file)
@@ -65,7 +65,7 @@
         Affichage de tous les évenements de camarades/promos
   {if $smarty.session.core_rss_hash}
   <div class="right">
-    <a href='{rel}/rss.php/{$smarty.session.forlife}/{$smarty.session.core_rss_hash}.xml'><img src='{rel}/images/rssicon.gif' alt='fil rss' /></a>
+    <a href='{rel}/carnet/rss/{$smarty.session.forlife}/{$smarty.session.core_rss_hash}/rss.xml'><img src='{rel}/images/rssicon.gif' alt='fil rss' /></a>
   </div>
   {else}
   <div class="right">
index 5859281..516d697 100644 (file)
@@ -39,7 +39,7 @@ Il faut pour cel
 
 <div class="right">
 {if $smarty.session.core_rss_hash}
-<a href='{rel}/carnet/rss.php/{$smarty.session.forlife}/{$smarty.session.core_rss_hash}.xml'><img src='{rel}/images/rssicon.gif' alt='fil rss' /></a>
+<a href='{rel}/carnet/rss/{$smarty.session.forlife}/{$smarty.session.core_rss_hash}/rss.xml'><img src='{rel}/images/rssicon.gif' alt='fil rss' /></a>
 {/if}
 </div>
 
index 9312aa0..a49e3f1 100644 (file)
@@ -54,7 +54,7 @@ En voici les adresses :
   </li>
   <li>
   Ton carnet polytechnicien :
-  <a href='{rel}/carnet/rss.php/{$smarty.session.forlife}/{$smarty.session.core_rss_hash}.xml'><img src='{rel}/images/rssicon.gif' alt='fil rss' title='fil RSS'/></a>
+  <a href='{rel}/carnet/rss/{$smarty.session.forlife}/{$smarty.session.core_rss_hash}/rss.xml'><img src='{rel}/images/rssicon.gif' alt='fil rss' title='fil RSS'/></a>
   </li>
 </ul>
 <p>