From f32f1697c95a0165d7781edbc8aa340c719c2b37 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 9 Mar 2009 07:02:09 +0000 Subject: Get rid of Task_Definition types: they're not necessary. This incidentally fixes the the problem that admin/maintenance tasks have been broken. --- core/helpers/task.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'core/helpers/task.php') diff --git a/core/helpers/task.php b/core/helpers/task.php index 9a38c0de..d9eeecfa 100644 --- a/core/helpers/task.php +++ b/core/helpers/task.php @@ -21,15 +21,13 @@ class task_Core { /** * Get all available tasks */ - static function get_definitions($type) { + static function get_definitions() { $tasks = array(); foreach (module::installed() as $module_name => $module_info) { $class_name = "{$module_name}_task"; if (method_exists($class_name, "available_tasks")) { foreach (call_user_func(array($class_name, "available_tasks")) as $task) { - if ($task->type == $type) { - $tasks[$task->callback] = $task; - } + $tasks[$task->callback] = $task; } } } @@ -37,8 +35,8 @@ class task_Core { return $tasks; } - static function create($type, $task_callback) { - $task_definitions = self::get_definitions($type); + static function create($task_callback) { + $task_definitions = self::get_definitions(); $task = ORM::factory("task"); $task->callback = $task_callback; -- cgit v1.2.3