diff options
author | Andy Staudacher <andy.st@gmail.com> | 2009-11-15 19:44:47 -0800 |
---|---|---|
committer | Andy Staudacher <andy.st@gmail.com> | 2009-11-15 19:44:47 -0800 |
commit | 0733dc37fda27a5ba35f9020edf3c66aa41a95a0 (patch) | |
tree | 6877946232f1b01b1c8709054c689f6658cef34f /modules/rss/helpers | |
parent | 218493c50be9362d4abed6900a816308fee5d978 (diff) | |
parent | 9379308f91a476f790fb8d444536719535c584e4 (diff) |
Merge commit 'upstream/master'
Conflicts:
modules/gallery/tests/xss_data.txt
Diffstat (limited to 'modules/rss/helpers')
-rw-r--r-- | modules/rss/helpers/rss_block.php (renamed from modules/rss/helpers/rss_theme.php) | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/modules/rss/helpers/rss_theme.php b/modules/rss/helpers/rss_block.php index 3d1b9a29..8da45e98 100644 --- a/modules/rss/helpers/rss_theme.php +++ b/modules/rss/helpers/rss_block.php @@ -17,24 +17,33 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class rss_theme_Core { - static function sidebar_blocks($theme) { - $block = new Block(); - $block->css_id = "gRss"; - $block->title = t("Available RSS Feeds"); - $block->content = new View("rss_block.html"); - $block->content->feeds = array(); - foreach (module::active() as $module) { - $class_name = "{$module->name}_rss"; - if (method_exists($class_name, "available_feeds")) { - $block->content->feeds = array_merge( - $block->content->feeds, - call_user_func(array($class_name, "available_feeds"), $theme->item(), $theme->tag())); +class rss_block_Core { + static function get_site_list() { + return array("rss_feeds" => t("Available RSS feeds")); + } + + static function get($block_id, $theme) { + $block = ""; + switch ($block_id) { + case "rss_feeds": + $feeds = array(); + foreach (module::active() as $module) { + $class_name = "{$module->name}_rss"; + if (method_exists($class_name, "available_feeds")) { + $feeds = array_merge($feeds, + call_user_func(array($class_name, "available_feeds"), $theme->item(), $theme->tag())); + } } + if (!empty($feeds)) { + $block = new Block(); + $block->css_id = "g-rss"; + $block->title = t("Available RSS feeds"); + $block->content = new View("rss_block.html"); + $block->content->feeds = $feeds; + } + break; } - if ($block->content->feeds) { - return $block; - } + return $block; } } |