From: x2003bruneau Date: Tue, 7 Nov 2006 11:14:48 +0000 (+0000) Subject: Cleaner way to set RSS links X-Git-Tag: xorg/0.9.12~140 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=162370e7f75c7f052e35623daa978ecf426f4654;p=platal.git Cleaner way to set RSS links git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1055 839d8a87-29fc-0310-9880-83ba4fa771e5 --- diff --git a/classes/platalpage.php b/classes/platalpage.php index 5ececae..b0f5d6a 100644 --- a/classes/platalpage.php +++ b/classes/platalpage.php @@ -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 () diff --git a/modules/carnet.php b/modules/carnet.php index 88e76b7..73c6930 100644 --- a/modules/carnet.php +++ b/modules/carnet.php @@ -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) diff --git a/modules/events.php b/modules/events.php index fab8dd9..3e317c9 100644 --- a/modules/events.php +++ b/modules/events.php @@ -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