You are here

protected function Kanban::buildFilterForm in Content Planner 8

Builds the Filter form.

Return value

array Returns an array with the filter form.

1 call to Kanban::buildFilterForm()
Kanban::build in modules/content_kanban/src/Component/Kanban.php
Build.

File

modules/content_kanban/src/Component/Kanban.php, line 334

Class

Kanban
The main Kanban class.

Namespace

Drupal\content_kanban\Component

Code

protected function buildFilterForm() {

  // If the user cannot edit any content, hide the Filter form.
  if (!$this->currentUser
    ->hasPermission('manage any content with content kanban')) {
    return [];
  }

  // Get Filter form.
  $form_params = [
    'workflow_id' => $this->workflowID,
    'states' => $this->states,
  ];
  $filter_form = \Drupal::formBuilder()
    ->getForm('Drupal\\content_kanban\\Form\\KanbanFilterForm', $form_params);

  // Remove certain needed form properties.
  unset($filter_form['form_build_id']);
  unset($filter_form['form_id']);
  return $filter_form;
}