diff options
Diffstat (limited to 'core/helpers')
-rw-r--r-- | core/helpers/core_task.php | 1 | ||||
-rw-r--r-- | core/helpers/task.php | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/core/helpers/core_task.php b/core/helpers/core_task.php index 008c593f..785bf874 100644 --- a/core/helpers/core_task.php +++ b/core/helpers/core_task.php @@ -23,6 +23,7 @@ class core_task_Core { return array(Task_Definition::factory() ->callback("core_task::rebuild_dirty_images") ->name(t("Rebuild Images")) + ->type("admin") ->description($dirty_count ? t2("You have one out of date photo", "You have %count out of date photos", diff --git a/core/helpers/task.php b/core/helpers/task.php index d5cc7c4e..9a38c0de 100644 --- a/core/helpers/task.php +++ b/core/helpers/task.php @@ -27,7 +27,7 @@ class task_Core { $class_name = "{$module_name}_task"; if (method_exists($class_name, "available_tasks")) { foreach (call_user_func(array($class_name, "available_tasks")) as $task) { - if (in_array($task->type, $type)) { + if ($task->type == $type) { $tasks[$task->callback] = $task; } } @@ -37,8 +37,8 @@ class task_Core { return $tasks; } - static function create($task_callback) { - $task_definitions = self::get_definitions(array("admin", "general", "both")); + static function create($type, $task_callback) { + $task_definitions = self::get_definitions($type); $task = ORM::factory("task"); $task->callback = $task_callback; |