summaryrefslogtreecommitdiff
path: root/core/helpers/task.php
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-03-11 03:14:52 +0000
committerTim Almdal <tnalmdal@shaw.ca>2009-03-11 03:14:52 +0000
commit8da729cfa1ed17040720ddeefbfd6f4ec541bc9c (patch)
treeb25ade47dc6e929e2a7020ca98870825a7f5da16 /core/helpers/task.php
parent47756db8569400d5d23dbb1c30dd40f00c7beaf1 (diff)
Refine the task api but removing the optional parameters on the
task::create method call
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";