Simple status box for the sidebar.
[elgg_plugins.git] / category / category_sidebar.php
blob615346a7512c45ac8b451148827b4b81a6a76a17
1 <?php
3 global $page_owner, $CFG, $PAGE;
5 if (!empty($page_owner) && $page_owner != -1) {
7 if ($categories = get_records_sql("select * from ".$CFG->prefix."tags where tagtype = 'weblogcat' and owner = $page_owner order by tag asc")) {
9 $title = __gettext('Blog categories');
10 $body = '<ul>';
12 // TODO insert tags where tag_type = category
14 foreach($categories as $category) {
15 $body .= '<li><a href="' . $CFG->wwwroot . user_info("username",$page_owner) . '/weblog/category/'. urlencode($category->tag) .'">'. $category->tag .'</a></li>';
18 $body .= '</ul>';
20 $run_result .= '<li id="weblog_category">';
21 $run_result .= templates_draw(array('context' => 'sidebarholder',
22 'title' => $title,
23 'body' => $body));
24 $run_result .= '</li>';