Simple status box for the sidebar.
[elgg_plugins.git] / tasks / index.php
bloba144ede58f3e584758007e15d60a2b1590d3a263
1 <?php
3 require("../../includes.php");
5 global $page_owner;
7 $page_owner = optional_param('owner', $_SESSION['userid'], PARAM_INT);
9 tasks_actions();
11 define("context","tasks");
12 templates_page_setup();
14 $body = "";
16 if (user_type($page_owner) == "community") {
17 $assignedto = true;
18 } else {
19 $assignedto = false;
22 $yourtasks = tasks_display($page_owner,$_SESSION['userid'],gettext("Your tasks"),$assignedto);
24 if (!empty($yourtasks)) {
25 $body .= "<div class=\"tasks_yours\">".$yourtasks."</div>";
28 $body .= tasks_display($page_owner,-1,gettext("All tasks"),$assignedto);
30 if ($page_owner == $_SESSION['userid']) {
31 $body .= tasks_display(0 - $_SESSION['userid'],$_SESSION['userid'],gettext("Your tasks elsewhere"),$assignedto);
34 $body .= tasks_form($page_owner);
36 $title = user_info("name",$page_owner) . " :: " . gettext("Tasks");
38 $body = templates_draw( array(
39 'context' => 'contentholder',
40 'title' => $title,
41 'body' => $body
42 ));
44 echo templates_page_draw(array($title, $body));