summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/task.php
diff options
context:
space:
mode:
authorNathan Kinkade <nkinkade@nkinka.de>2010-02-03 13:48:34 +0000
committerNathan Kinkade <nkinkade@nkinka.de>2010-02-03 13:48:34 +0000
commit052476ef44ca801766cbd6bdbfe42d5a0a362e52 (patch)
treef7a1d39fe4aae154e916e2cd4c02a798aef6c67f /modules/gallery/helpers/task.php
parent92d211bae653b6c94e0038b1a47734a1acaa149e (diff)
parent99a7f470b93d35717f8d5979d05da6cf05a1dd20 (diff)
Merge branch 'master' of git://github.com/gallery/gallery3
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;