summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/task.php
diff options
context:
space:
mode:
authorAndy Staudacher <andy.st@gmail.com>2010-02-06 11:32:53 -0800
committerAndy Staudacher <andy.st@gmail.com>2010-02-06 11:32:53 -0800
commit4977c00db1b812abad5ad2d530e1dd44171b6d85 (patch)
tree4abab0ff9bb6951f8a53b49ea8d2f494a48140d0 /modules/gallery/helpers/task.php
parent31aaf7555f51dd80cf1e97fd3c20a1c245cbf61b (diff)
parent15e22076552929bf1f45888945f65de621aa2aac (diff)
Merge commit 'upstream/master'
Diffstat (limited to 'modules/gallery/helpers/task.php')
-rw-r--r--modules/gallery/helpers/task.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/gallery/helpers/task.php b/modules/gallery/helpers/task.php
index 645850d1..aa0eb94d 100644
--- a/modules/gallery/helpers/task.php
+++ b/modules/gallery/helpers/task.php
@@ -35,6 +35,15 @@ class task_Core {
return $tasks;
}
+ static function start($task_callback, $context=array()) {
+ $tasks = task::get_definitions();
+ $task = task::create($tasks[$task_callback], array());
+
+ $task->log(t("Task %task_name started (task id %task_id)",
+ array("task_name" => $task->name, "task_id" => $task->id)));
+ return $task;
+ }
+
static function create($task_def, $context) {
$task = ORM::factory("task");
$task->callback = $task_def->callback;