summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-02-02 19:04:20 -0800
committerBharat Mediratta <bharat@menalto.com>2010-02-02 19:04:20 -0800
commit08f3f71ad93f9d834d6ba346f56fa58b455e0da2 (patch)
tree68aa4dff5436a5a30a9e9ab45d65b3ecee4d24af /modules/gallery/helpers
parentaa65bb0048411cbc657651899fb63f7afe2aa37a (diff)
parent9ac3eca4777436533257045e66e05cac41da97ad (diff)
Merge branch 'master' of git@github.com:gallery/gallery3
Diffstat (limited to 'modules/gallery/helpers')
-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;