".$legend."";
} else {
$list_type = "div";
$legend = "
".$legend."
";
}
$limit = $vars['limit'];
if (!$limit) $limit = 9999;
// get the current page's owner
$page_owner = page_owner_entity();
if ($page_owner === false || is_null($page_owner)) {
$page_owner = $_SESSION['user'];
set_page_owner($_SESSION['guid']);
}
$whos_tasks = $_SESSION['guid'];
if (get_input('username')) {
$user = get_user_by_username(get_input("username"));
if ($user) {
$whos_tasks = $user->guid;
}
}
$tasks = get_entities('object', 'task', $whos_tasks, '', $limit);
if (is_array($tasks) && sizeof($tasks) > 0) {
$tasks_div = "<".$list_type.">";
$tasks_div .= $legend;
$tasks_div .= "";
if (is_array($tasks) && sizeof($tasks) > 0) {
foreach($tasks as $task) {
$tasks_div .= "- ";
$tasks_div .= sprintf(date("d.m.Y", $task->time_created));
$tasks_div .= " getUrl() . "\">" . $task->title;
$tasks_div .= "";
$color = "past";
if ($task->deadline > time()) {
if ($task->deadline > (time() + (1 * 24 * 60 * 60)) ) {
$color = "future";
} else {
$color = "soon";
}
}
$tasks_div .= "";
/*translation:Deadline*/
$tasks_div .= " [" . elgg_echo('task_manager:label_deadline') . ": " . sprintf(date("d.m.Y", $task->deadline)). "]";
$tasks_div .= " ";
$answer_entities = get_entities_from_relationship("hasAnswers", $task->getGUID(), false, "object", "blog", 0, "", 9999, 0, false, 0);
if (is_array($answer_entities) && sizeof($answer_entities) > 0) {
$tasks_div .= sizeof($answer_entities);
if (sizeof($answer_entities)==1) {
/*translation:answer*/
$tasks_div .= " ".elgg_echo('task_manager:mono_answer');
} else {
/*translation:answers*/
$tasks_div .= " ".elgg_echo('task_manager:stereo_answers');
}
} else {
/*translation:no answers*/
$tasks_div .= elgg_echo('task_manager:no_answers');
}
$tasks_div .= "
";
}
}
$tasks_div .= "
";
$tasks_div .= "".$list_type.">";
}
echo $tasks_div;
?>