Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 protected function actions(array $form, FormStateInterface $form_state)
 {
     $actions = parent::actions($form, $form_state);
     $actions['submit']['#value'] = t('Save bundle');
     $actions['delete']['#value'] = t('Delete bundle');
     return $actions;
 }
Ejemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 protected function actions(array $form, FormStateInterface $form_state)
 {
     $actions = parent::actions($form, $form_state);
     $actions['submit']['#value'] = $this->t('Save contact type');
     $actions['delete']['#title'] = $this->t('Delete contact type');
     return $actions;
 }
Ejemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 protected function actions(array $form, FormStateInterface $form_state)
 {
     $actions = parent::actions($form, $form_state);
     if ($this->entity->isNew()) {
         $actions['submit']['#value'] = $this->t('Save and edit');
     }
     return $actions;
 }
Ejemplo n.º 4
0
 /**
  * {@inheritdoc}
  */
 protected function actions(array $form, FormStateInterface $form_state)
 {
     // Get the basic actions from the base class.
     $actions = parent::actions($form, $form_state);
     // Change the submit button text.
     $actions['submit']['#value'] = $this->t('Save');
     return $actions;
 }
Ejemplo n.º 5
0
 /**
  * {@inheritdoc}
  */
 protected function actions(array $form, FormStateInterface $form_state)
 {
     $actions = parent::actions($form, $form_state);
     $actions['submit']['#value'] = $this->getConfirmText();
     unset($actions['delete']);
     // Prepare cancel link.
     $actions['cancel'] = ConfirmFormHelper::buildCancelLink($this, $this->getRequest());
     return $actions;
 }
 /**
  * {@inheritdoc}
  */
 protected function actions(array $form, FormStateInterface $form_state)
 {
     $form = parent::actions($form, $form_state);
     // We want to display the button only on add page.
     if ($this->entity->isNew() && \Drupal::moduleHandler()->moduleExists('field_ui')) {
         $form['submit']['#value'] = $this->t('Save and manage fields');
     }
     return $form;
 }
Ejemplo n.º 7
0
 /**
  * {@inheritdoc}
  */
 protected function actions(array $form, FormStateInterface $form_state)
 {
     $actions = parent::actions($form, $form_state);
     if (\Drupal::moduleHandler()->moduleExists('field_ui') && $this->getEntity()->isNew()) {
         $actions['save_continue'] = $actions['submit'];
         $actions['save_continue']['#value'] = t('Save and manage fields');
         $actions['save_continue']['#submit'][] = [$this, 'redirectToFieldUI'];
     }
     return $actions;
 }
Ejemplo n.º 8
0
 /**
  * {@inheritdoc}
  */
 protected function actions(array $form, FormStateInterface $form_state)
 {
     // If we are displaying the delete confirmation skip the regular actions.
     if (!$form_state->get('confirm_delete')) {
         $actions = parent::actions($form, $form_state);
         // We cannot leverage the regular submit handler definition because we
         // have button-specific ones here. Hence we need to explicitly set it for
         // the submit action, otherwise it would be ignored.
         if ($this->moduleHandler->moduleExists('content_translation')) {
             array_unshift($actions['submit']['#submit'], 'content_translation_language_configuration_element_submit');
         }
         return $actions;
     } else {
         return array();
     }
 }
Ejemplo n.º 9
0
 /**
  * {@inheritdoc}
  */
 protected function actions(array $form, FormStateInterface $form_state)
 {
     $actions = parent::actions($form, $form_state);
     $actions['submit']['#value'] = $this->t('Save settings');
     if (!$this->entity->isNew()) {
         $target_entity_type = $this->entityManager->getDefinition($this->entity->getTargetEntityTypeId());
         $route_parameters = ['field_config' => $this->entity->id()] + FieldUI::getRouteBundleParameter($target_entity_type, $this->entity->bundle);
         $url = new Url('entity.field_config.' . $target_entity_type->id() . '_field_delete_form', $route_parameters);
         if ($this->getRequest()->query->has('destination')) {
             $query = $url->getOption('query');
             $query['destination'] = $this->getRequest()->query->get('destination');
             $url->setOption('query', $query);
         }
         $actions['delete'] = array('#type' => 'link', '#title' => $this->t('Delete'), '#url' => $url, '#access' => $this->entity->access('delete'), '#attributes' => array('class' => array('button', 'button--danger')));
     }
     return $actions;
 }
Ejemplo n.º 10
0
 /**
  * {@inheritdoc}
  */
 protected function actions(array $form, FormStateInterface $form_state)
 {
     $actions = parent::actions($form, $form_state);
     /* @var $search_api_page \Drupal\search_api_page\SearchApiPageInterface */
     $search_api_page = $this->entity;
     if ($search_api_page->isNew()) {
         $actions['submit']['#value'] = $this->t('Next');
     }
     $default_index = $search_api_page->getIndex();
     if (!empty($default_index)) {
         // Add an update button that shows up when changing the index.
         $default_index_states_invisible = array('invisible' => array(':input[name="index"]' => array('value' => $default_index)));
         $actions['update'] = $actions['submit'];
         $actions['update']['#value'] = $this->t('Update');
         $actions['update']['#states'] = $default_index_states_invisible;
         // Hide the Save button when the index changes.
         $default_index_states_visible = array('visible' => array(':input[name="index"]' => array('value' => $default_index)));
         $actions['submit']['#states'] = $default_index_states_visible;
     }
     return $actions;
 }
Ejemplo n.º 11
0
 /**
  * {@inheritdoc}
  */
 protected function actions(array $form, array &$form_state)
 {
     // If we are displaying the delete confirmation skip the regular actions.
     if (empty($form_state['confirm_delete'])) {
         $actions = parent::actions($form, $form_state);
         // Add the language configuration submit handler. This is needed because
         // the submit button has custom submit handlers.
         if ($this->moduleHandler->moduleExists('language')) {
             array_unshift($actions['submit']['#submit'], 'language_configuration_element_submit');
             array_unshift($actions['submit']['#submit'], array($this, 'languageConfigurationSubmit'));
         }
         // We cannot leverage the regular submit handler definition because we
         // have button-specific ones here. Hence we need to explicitly set it for
         // the submit action, otherwise it would be ignored.
         if ($this->moduleHandler->moduleExists('content_translation')) {
             array_unshift($actions['submit']['#submit'], 'content_translation_language_configuration_element_submit');
         }
         return $actions;
     } else {
         return array();
     }
 }
Ejemplo n.º 12
0
 /**
  * {@inheritdoc}
  */
 protected function actions(array $form, FormStateInterface $form_state)
 {
     $actions = parent::actions($form, $form_state);
     // Change the submit button text.
     $actions['submit']['#value'] = $this->t('Save');
     $actions['submit']['#suffix'] = $this->l($this->t('Cancel'), $this->getCancelUrl());
     return $actions;
 }
Ejemplo n.º 13
0
  /**
   * {@inheritdoc}
   */
  protected function actions(array $form, FormStateInterface $form_state) {
    $actions = parent::actions($form, $form_state);

    // We don't have a "delete" action here.
    unset($actions['delete']);

    return $actions;
  }
Ejemplo n.º 14
0
 /**
  * {@inheritdoc}
  */
 protected function actions(array $form, FormStateInterface $form_state)
 {
     $actions = parent::actions($form, $form_state);
     $actions['submit']['#value'] = $this->entity->isNew() ? $this->t('Add ball') : $this->t('Update ball');
     return $actions;
 }
Ejemplo n.º 15
0
 /**
  * {@inheritdoc}
  */
 protected function actions(array $form, FormStateInterface $form_state)
 {
     $actions = parent::actions($form, $form_state);
     $actions['delete']['#access'] = FALSE;
     return $actions;
 }
Ejemplo n.º 16
0
 /**
  * {@inheritdoc}
  */
 protected function actions(array $form, FormStateInterface $form_state)
 {
     $actions = parent::actions($form, $form_state);
     unset($actions['delete']);
     return $actions;
 }
Ejemplo n.º 17
0
 /**
  * {@inheritdoc}
  */
 protected function actions(array $form, array &$form_state)
 {
     $actions = parent::actions($form, $form_state);
     $actions['submit']['#value'] = $this->t('Save block');
     return $actions;
 }
Ejemplo n.º 18
0
 /**
  * {@inheritdoc}
  */
 protected function actions(array $form, FormStateInterface $form_state)
 {
     $actions = parent::actions($form, $form_state);
     // Prevent access to the delete button when editing the default configuration.
     if ($this->entity->id() == 'default' && isset($actions['delete'])) {
         $actions['delete']['#access'] = FALSE;
     }
     return $actions;
 }
Ejemplo n.º 19
0
 /**
  * Overrides EntityForm::actions().
  */
 protected function actions(array $form, array &$form_state)
 {
     $element = parent::actions($form, $form_state);
     $element['submit']['#button_type'] = 'primary';
     return $element;
 }
Ejemplo n.º 20
0
 /**
  * {@inheritdoc}
  */
 public function actions(array $form, FormStateInterface $form_state)
 {
     $actions = parent::actions($form, $form_state);
     if ($this->getEntity()->isNew()) {
         $submit_callbacks = $actions['submit']['#submit'];
         $submit_callbacks[] = '::redirectToFieldsForm';
         $actions['save_edit'] = array('#type' => 'submit', '#value' => $this->t('Save and edit'), '#submit' => $submit_callbacks, '#button_type' => 'primary');
     }
     return $actions;
 }
Ejemplo n.º 21
0
 /**
  * {@inheritdoc}
  */
 protected function actions(array $form, FormStateInterface $form_state) {
   $actions = parent::actions($form, $form_state);
   $actions['submit']['#value'] = t('Save eform type');
   $actions['delete']['#value'] = t('Delete eform type');
   //$actions['delete']['#access'] = $this->entity->access('delete');
   return $actions;
 }
 /**
  * {@inheritdoc}
  */
 protected function actions(array $form, FormStateInterface $form_state)
 {
     $actions = parent::actions($form, $form_state);
     $actions = array($actions['submit']);
     return $actions;
 }
Ejemplo n.º 23
0
 /**
  * {@inheritdoc}
  */
 protected function actions(array $form, FormStateInterface $form_state)
 {
     $actions = parent::actions($form, $form_state);
     $actions['submit']['#value'] = $this->t('Save configuration');
     return $actions;
 }
 /**
  * {@inheritdoc}
  */
 protected function actions(array $form, FormStateInterface $form_state)
 {
     $elements = parent::actions($form, $form_state);
     $elements['submit']['#value'] = $this->t('Save field settings');
     return $elements;
 }