/** * {@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; }
/** * {@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; }
/** * {@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; }
/** * {@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; }
/** * {@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; }
/** * {@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; }
/** * {@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(); } }
/** * {@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; }
/** * {@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; }
/** * {@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(); } }
/** * {@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; }
/** * {@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; }
/** * {@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; }
/** * {@inheritdoc} */ protected function actions(array $form, FormStateInterface $form_state) { $actions = parent::actions($form, $form_state); $actions['delete']['#access'] = FALSE; return $actions; }
/** * {@inheritdoc} */ protected function actions(array $form, FormStateInterface $form_state) { $actions = parent::actions($form, $form_state); unset($actions['delete']); return $actions; }
/** * {@inheritdoc} */ protected function actions(array $form, array &$form_state) { $actions = parent::actions($form, $form_state); $actions['submit']['#value'] = $this->t('Save block'); return $actions; }
/** * {@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; }
/** * Overrides EntityForm::actions(). */ protected function actions(array $form, array &$form_state) { $element = parent::actions($form, $form_state); $element['submit']['#button_type'] = 'primary'; return $element; }
/** * {@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; }
/** * {@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; }
/** * {@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; }