summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEskiso <eSkiSo@users.noreply.github.com>2016-09-28 17:41:27 +0100
committerGitHub <noreply@github.com>2016-09-28 17:41:27 +0100
commit3cf554e6382ac28b64e23bfcb7064b48bc6b8696 (patch)
treeadfae5870328cc6287fee16fe4c21c1944974f4a
parentc0991e2a442858e7d427accca99517c5399d0c3f (diff)
Added prepareValues with hook for plugins
-rw-r--r--app/Controller/SubtaskController.php23
1 files changed, 19 insertions, 4 deletions
diff --git a/app/Controller/SubtaskController.php b/app/Controller/SubtaskController.php
index 7502d84f..134b057e 100644
--- a/app/Controller/SubtaskController.php
+++ b/app/Controller/SubtaskController.php
@@ -27,10 +27,7 @@ class SubtaskController extends BaseController
$task = $this->getTask();
if (empty($values)) {
- $values = array(
- 'task_id' => $task['id'],
- 'another_subtask' => $this->request->getIntegerParam('another_subtask', 0)
- );
+ $values = $this->prepareValues($task);
}
$this->response->html($this->template->render('subtask/create', array(
@@ -40,6 +37,24 @@ class SubtaskController extends BaseController
'task' => $task,
)));
}
+
+ /**
+ * Prepare form values
+ *
+ * @access protected
+ * @param array $task
+ * @return array
+ */
+ protected function prepareValues(array $task)
+ {
+ $values = array(
+ 'task_id' => $task['id'],
+ 'another_subtask' => $this->request->getIntegerParam('another_subtask', 0)
+ );
+
+ $values = $this->hook->merge('controller:subtask:form:default', $values, array('default_values' => $values));
+ return $values;
+ }
/**
* Validation and creation