From 898ac3ac359258ccb0958f5be420d17a9a264fec Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 5 Mar 2009 06:28:23 +0000 Subject: A little task restructuring --- core/helpers/task.php | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'core/helpers/task.php') diff --git a/core/helpers/task.php b/core/helpers/task.php index 816a5288..d5cc7c4e 100644 --- a/core/helpers/task.php +++ b/core/helpers/task.php @@ -21,7 +21,7 @@ class task_Core { /** * Get all available tasks */ - static function get_task_definitions($type=array("admin", "both")) { + static function get_definitions($type) { $tasks = array(); foreach (module::installed() as $module_name => $module_info) { $class_name = "{$module_name}_task"; @@ -38,7 +38,7 @@ class task_Core { } static function create($task_callback) { - $task_definitions = self::get_task_definitions(array("admin", "general", "both")); + $task_definitions = self::get_definitions(array("admin", "general", "both")); $task = ORM::factory("task"); $task->callback = $task_callback; @@ -84,18 +84,4 @@ class task_Core { return $task; } - - static function success($task, $location=null) { - $result = array("result" => "success", "task" => $task->as_array()); - if (!empty($location)) { - $result["location"] = $location; - } - return json_encode($result); - } - - static function in_progress($task) { - return json_encode( - array("result" => "in_progress", - "task" => $task->as_array())); - } } \ No newline at end of file -- cgit v1.2.3