/**
  * {@inheritdoc}
  */
 public function buildForm(array $form, FormStateInterface $form_state, LanguageInterface $language = NULL)
 {
     if ($language) {
         $form_state->set('langcode', $language->getId());
     }
     return parent::buildForm($form, $form_state);
 }
Пример #2
0
 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     parent::submitForm($form, $form_state);
     $storage = $this->entityManager->getStorage('taxonomy_vocabulary');
     $vocabulary = $storage->load($this->entity->bundle());
     // @todo Move to storage http://drupal.org/node/1988712
     taxonomy_check_vocabulary_hierarchy($vocabulary, array('tid' => $this->entity->id()));
 }
Пример #3
0
 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     parent::submitForm($form, $form_state);
     /** @var \Drupal\Core\Entity\ContentEntityInterface $term */
     $term = $this->getEntity();
     if ($term->isDefaultTranslation()) {
         $storage = $this->entityManager->getStorage('taxonomy_vocabulary');
         $vocabulary = $storage->load($this->entity->bundle());
         // @todo Move to storage http://drupal.org/node/1988712
         taxonomy_check_vocabulary_hierarchy($vocabulary, array('tid' => $term->id()));
     }
 }
Пример #4
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(array $form, FormStateInterface $form_state)
 {
     $instances = $this->entity->getInstances();
     $form['message'] = array('#markup' => $this->formatPlural(count($instances), 'This will also remove 1 placed block instance.', 'This will also remove @count placed block instances.'), '#access' => !empty($instances));
     return parent::buildForm($form, $form_state);
 }