Cleaner way to set RSS links
authorx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Tue, 7 Nov 2006 11:14:48 +0000 (11:14 +0000)
committerx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Tue, 7 Nov 2006 11:14:48 +0000 (11:14 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1055 839d8a87-29fc-0310-9880-83ba4fa771e5

classes/platalpage.php
modules/carnet.php
modules/events.php

index 5ececae..b0f5d6a 100644 (file)
@@ -179,6 +179,14 @@ class PlatalPage extends Smarty
     }
 
     // }}}
+    // {{{ function setRssLink
+
+    function setRssLink($title, $path)
+    {
+        $this->assign('xorg_rss', array('title' => $title, 'href' => $path));
+    }
+
+    // }}}
 }
 
 // {{{ function escape_html ()
index 88e76b7..73c6930 100644 (file)
@@ -49,11 +49,8 @@ class CarnetModule extends PLModule
         if (!S::has('core_rss_hash')) {
             return;
         }
-        $page->assign('xorg_rss',
-                      array('title' => 'Polytechnique.org :: Carnet',
-                            'href'  => '/carnet/rss/'.S::v('forlife')
-                                      .'/'.S::v('core_rss_hash').'/rss.xml')
-                      );
+        $page->setRssLink('Polytechnique.org :: Carnet',
+                          '/carnet/rss/'.S::v('forlife') .'/'.S::v('core_rss_hash').'/rss.xml');
     }
 
     function handler_index(&$page)
index fab8dd9..3e317c9 100644 (file)
@@ -100,11 +100,8 @@ class EventsModule extends PLModule
 
         // ajout du lien RSS
         if (S::has('core_rss_hash')) {
-            $page->assign('xorg_rss',
-                          array('title' => 'Polytechnique.org :: News',
-                                'href' => '/rss/'.S::v('forlife')
-                                         .'/'.S::v('core_rss_hash').'/rss.xml')
-            );
+            $page->setRssLink('Polytechnique.org :: News',
+                              '/rss/'.S::v('forlife') .'/'.S::v('core_rss_hash').'/rss.xml');
         }
 
         // cache les evenements lus et raffiche les evenements a relire