diff options
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..43043f5f 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 = "gRss"; + $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; } } |