From c4f61dd4c1b5a28a7c073c734f003ffd45b820d4 Mon Sep 17 00:00:00 2001 From: icewing Date: Tue, 18 Mar 2008 11:34:19 +0000 Subject: Marcus Povey * Added VERY simple tasklist plugin. git-svn-id: https://code.elgg.org/elgg/trunk@247 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/tasklist/start.php | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 mod/tasklist/start.php (limited to 'mod/tasklist/start.php') diff --git a/mod/tasklist/start.php b/mod/tasklist/start.php new file mode 100644 index 000000000..260109866 --- /dev/null +++ b/mod/tasklist/start.php @@ -0,0 +1,74 @@ +wwwroot . "mod/tasklist/",array( + menu_item("The tasklist plugin",$CONFIG->wwwroot."mod/tasklist/"), + )); + } + + /** + * The entity. + * + * @param ElggObject $entity + */ + function tasklist_draw_task($entity) + { + // Get the status + $status = $entity->getMetaData("status"); + + // Task + $task = $entity->getMetaData("task"); + + // Render the item + return elgg_view("tasklist/item", array( + "owner_id" => $entity->owner_guid, + "task" => $task, + "status" => $status, + "guid" => $entity->guid + )); + } + + function tasklist_drawtasks($ownerid, $offset = 0, $limit = 10) + { + // Get all entities of task + //$entities = get_entities("object","task",$ownerid, "time_created desc", $limit, $offset); + $entities = get_entities_from_metadata("status", "notdone", "object", "task", $limit, $offset); + + if (($entities) && (is_array($entities))) + { + $display = ""; + + foreach($entities as $e) + $display .= tasklist_draw_task($e); + + $display .= "
"; + + return $display; + } + + return "No tasks present for user."; + } + + function tasklist_draw_newtask_form($ownerid) + { + return elgg_view("tasklist/newtask", array( + "owner_id" => $ownerid, + "guid" => $entity->guid + )); + } + + // Make sure test_init is called on initialisation + register_event_handler('init','system','tasklist_init'); + +?> \ No newline at end of file -- cgit v1.2.3