public function FormHelper::createActionBar in Filebrowser 3.x
Same name and namespace in other branches
- 8.2 src/Services/FormHelper.php \Drupal\filebrowser\Services\FormHelper::createActionBar()
File
- src/Services/FormHelper.php, line 37
Class
- FormHelper
- Class FormHelper
Service that provides utilities to forms
Namespace
Drupal\filebrowser\Services
Code
public function createActionBar(&$form, array $actions, $relative_fid) {
$form['action'] = [
'#type' => 'container',
'#attributes' => [
'id' => [
'form-action-actions-wrapper',
],
],
];
foreach ($actions as $action) {
switch ($action['type']) {
case 'link':
$form['action'][$action['operation']] = $this
->createLink($action, $this->node, $relative_fid);
break;
case 'button':
$form['action'][$action['operation']] = $this
->createAjaxButton($action);
break;
default:
$form['action'][$action['operation']] = $this
->createNormalButton($action);
}
}
}