You are here

protected function BigMenuForm::buildOverviewForm in Big Menu 8

Same name and namespace in other branches
  1. 2.x src/BigMenuForm.php \Drupal\bigmenu\BigMenuForm::buildOverviewForm()

Overrides Drupal\menu_ui\MenuForm::buildOverviewForm() to limit the depth.

Parameters

array $form: The form array.

\Drupal\Core\Form\FormStateInterface $form_state: The form state object.

Return value

array The form.

Overrides MenuForm::buildOverviewForm

File

src/BigMenuForm.php, line 53

Class

BigMenuForm
Defines class for BigMenuForm.

Namespace

Drupal\bigmenu

Code

protected function buildOverviewForm(array &$form, FormStateInterface $form_state) {
  $menu_link = $this
    ->getRequest()->query
    ->get('menu_link');
  $form['#cache']['contexts'][] = 'url.query_args:menu_link';
  $max_depth = $this->config
    ->get('max_depth') ?: 1;
  return $this
    ->buildOverviewFormWithDepth($form, $form_state, $max_depth, $menu_link);
}