public function get_feeds_list()
 {
     $list = new FeedsList();
     //unsolved bugs list
     $cats_tree = new FeedsCat('bugtracker', 0, LangLoader::get_message('titles.unsolved', 'common', 'bugtracker'));
     //solved bugs list
     $sub_tree = new FeedsCat('bugtracker', 1, LangLoader::get_message('titles.solved', 'common', 'bugtracker'));
     $cats_tree->add_child($sub_tree);
     $list->add_feed($cats_tree, Feed::DEFAULT_FEED_NAME);
     return $list;
 }
 public function build_feeds_sub_list($module_id, $categories, FeedsCat $tree, $parent_id)
 {
     $id_categories = array_keys($categories);
     $num_cats = count($id_categories);
     for ($i = 0; $i < $num_cats; $i++) {
         $id = $id_categories[$i];
         $category =& $categories[$id];
         if ($id != 0 && $category->get_id_parent() == $parent_id) {
             $sub_tree = new FeedsCat($module_id, $id, $category->get_name());
             $this->build_feeds_sub_list($module_id, $categories, $sub_tree, $id);
             $tree->add_child($sub_tree);
         }
     }
 }
예제 #3
0
 function get_feeds_list()
 {
     global $LANG, $Sql;
     import('content/syndication/feeds_list');
     $feeds = new FeedsList();
     $cats_tree = new FeedsCat('news', 0, $LANG['root']);
     $result = $Sql->query_while("SELECT id, name FROM " . PREFIX . "news_cat ORDER BY name ASC", __LINE__, __FILE__);
     while ($row = $Sql->fetch_assoc($result)) {
         $cats_tree->add_child(new FeedsCat('news', $row['id'], $row['name']));
     }
     $Sql->query_close($result);
     $feeds->add_feed($cats_tree, DEFAULT_FEED_NAME);
     return $feeds;
 }