summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/controllers/admin_maintenance.php2
-rw-r--r--core/helpers/core_task.php1
-rw-r--r--core/helpers/task.php6
-rw-r--r--core/libraries/Task_Definition.php2
4 files changed, 6 insertions, 5 deletions
diff --git a/core/controllers/admin_maintenance.php b/core/controllers/admin_maintenance.php
index 315e2d63..c98251bc 100644
--- a/core/controllers/admin_maintenance.php
+++ b/core/controllers/admin_maintenance.php
@@ -40,7 +40,7 @@ class Admin_Maintenance_Controller extends Admin_Controller {
$view = new Admin_View("admin.html");
$view->content = new View("admin_maintenance.html");
- $view->content->task_definitions = task::get_definitions(array("admin", "both"));
+ $view->content->task_definitions = task::get_definitions("admin");
$view->content->running_tasks = ORM::factory("task")
->select("tasks.*", "users.name as user_name")
->join("users", "tasks.owner_id", "users.id")
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;
diff --git a/core/libraries/Task_Definition.php b/core/libraries/Task_Definition.php
index 1f1e3287..3ee4a772 100644
--- a/core/libraries/Task_Definition.php
+++ b/core/libraries/Task_Definition.php
@@ -23,7 +23,7 @@ class Task_Definition_Core {
public $description;
public $name;
public $severity;
- public $type = "admin"; // admin, general, both
+ public $type;
static function factory() {
return new Task_Definition();