public function MaestroManualWebTask::getTaskEditForm in Maestro 3.x
Same name and namespace in other branches
- 8.2 src/Plugin/EngineTasks/MaestroManualWebTask.php \Drupal\maestro\Plugin\EngineTasks\MaestroManualWebTask::getTaskEditForm()
Method to allow a task to add their own fields to the task edit form.
Parameters
array $task: This is the array representation of the task from the configuration entity.
string $templateMachineName: The Maestro template machine name.
Return value
array Array Must return form declaration fields for the task editor
Overrides MaestroEngineTaskInterface::getTaskEditForm
File
- src/
Plugin/ EngineTasks/ MaestroManualWebTask.php, line 107
Class
- MaestroManualWebTask
- Maestro Manual Web Task Plugin.
Namespace
Drupal\maestro\Plugin\EngineTasksCode
public function getTaskEditForm(array $task, $templateMachineName) {
$form = [
'#markup' => t('Interactive Task Edit'),
];
$form['handler'] = [
'#type' => 'textfield',
'#title' => $this
->t('Handler'),
'#description' => $this
->t('The web location for this task to be sent to. This can be an external site prefixed with http:// or internal link.'),
'#default_value' => $task['handler'],
'#required' => TRUE,
];
// We force this to not modal to let the task consoles create an outbound link.
$form['modal'] = [
'#type' => 'hidden',
'#default_value' => 'notmodal',
'#value' => 'notmodal',
'#required' => TRUE,
];
return $form;
}