summaryrefslogtreecommitdiff
path: root/core/helpers/task.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/helpers/task.php')
-rw-r--r--core/helpers/task.php14
1 files changed, 3 insertions, 11 deletions
diff --git a/core/helpers/task.php b/core/helpers/task.php
index 75151796..051cc76d 100644
--- a/core/helpers/task.php
+++ b/core/helpers/task.php
@@ -35,18 +35,10 @@ class task_Core {
return $tasks;
}
- static function create($task_callback, $task_name=null, $context=array()) {
+ static function create($task_definitions, $context) {
$task = ORM::factory("task");
- $task->callback = $task_callback;
- if (empty($task_name)) {
- $task_definitions = self::get_definitions();
- $task->name = $task_definitions[$task_callback]->name;
- } else {
- $task->name = $task_name;
- }
- if (empty($task->name)) {
- $task_name = $task_callback;
- }
+ $task->callback = $task_definitions->callback;
+ $task->name = $task_definitions->name;
$task->percent_complete = 0;
$task->status = "";
$task->state = "started";