diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-03-05 06:28:23 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-03-05 06:28:23 +0000 |
commit | 898ac3ac359258ccb0958f5be420d17a9a264fec (patch) | |
tree | 464f3a90654406c28093f58b592d3f01e83bc217 /core/helpers/task.php | |
parent | 08d2fcb1f7ae0ced528c0a7230c433480d64167c (diff) |
A little task restructuring
Diffstat (limited to 'core/helpers/task.php')
-rw-r--r-- | core/helpers/task.php | 18 |
1 files changed, 2 insertions, 16 deletions
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 |