예제 #1
0
 /**
  * {@inheritdoc}
  */
 public function buildConfigurationForm(array $form, FormStateInterface $form_state)
 {
     // Put the title field first.
     $form['title'] = array('#type' => 'textfield', '#title' => $this->t('Title'), '#default_value' => $this->menuLink->getTitle(), '#weight' => -10);
     $form['description'] = array('#type' => 'textfield', '#title' => $this->t('Description'), '#description' => $this->t('Shown when hovering over the menu link.'), '#default_value' => $this->menuLink->getDescription(), '#weight' => -5);
     $form += parent::buildConfigurationForm($form, $form_state);
     $form['info']['#weight'] = -8;
     $form['path']['#weight'] = -7;
     $view = $this->menuLink->loadView();
     $id = $view->storage->id();
     $label = $view->storage->label();
     if ($this->moduleHandler->moduleExists('views_ui')) {
         $message = $this->t('This link is provided by the Views module. The path can be changed by editing the view <a href=":url">@label</a>', array(':url' => \Drupal::url('entity.view.edit_form', array('view' => $id)), '@label' => $label));
     } else {
         $message = $this->t('This link is provided by the Views module from view %label.', array('%label' => $label));
     }
     $form['info']['#title'] = $message;
     return $form;
 }