summaryrefslogtreecommitdiff
path: root/core/helpers
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-03-09 07:02:09 +0000
committerBharat Mediratta <bharat@menalto.com>2009-03-09 07:02:09 +0000
commitf32f1697c95a0165d7781edbc8aa340c719c2b37 (patch)
tree665dc5ae93d14a4d1fb15dee2d0b305bc1c52f8e /core/helpers
parent4fed34873a7a4fddb846d4912dabe88cb3cae2f0 (diff)
Get rid of Task_Definition types: they're not necessary. This
incidentally fixes the the problem that admin/maintenance tasks have been broken.
Diffstat (limited to 'core/helpers')
-rw-r--r--core/helpers/core_task.php1
-rw-r--r--core/helpers/task.php10
2 files changed, 4 insertions, 7 deletions
diff --git a/core/helpers/core_task.php b/core/helpers/core_task.php
index 785bf874..008c593f 100644
--- a/core/helpers/core_task.php
+++ b/core/helpers/core_task.php
@@ -23,7 +23,6 @@ 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 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;