class PictureMappingActionConfirmForm

Hierarchy

Expanded class hierarchy of PictureMappingActionConfirmForm

1 string reference to 'PictureMappingActionConfirmForm'
picture.routing.yml in drupal/core/modules/picture/picture.routing.yml
drupal/core/modules/picture/picture.routing.yml

File

drupal/core/modules/picture/lib/Drupal/picture/Form/PictureMappingActionConfirmForm.php, line 13
Contains \Drupal\picture\Form\PictureMappingActionConfirm.

Namespace

Drupal\picture\Form
View source
class PictureMappingActionConfirmForm extends ConfirmFormBase {

  /**
   * The picture mapping object to be deleted.
   *
   * @var type \Drupal\Core\Entity\EntityInterface
   */
  protected $pictureMapping;

  /**
   * {@inheritdoc}
   */
  protected function getQuestion() {
    return t('Are you sure you want to delete the picture_mapping %title?', array(
      '%title' => $this->pictureMapping
        ->label(),
    ));
  }

  /**
   * {@inheritdoc}
   */
  protected function getCancelPath() {
    return 'admin/config/media/picturemapping';
  }

  /**
   * {@inheritdoc}
   */
  protected function getConfirmText() {
    return t('Delete');
  }

  /**
   * {@inheritdoc}
   */
  public function getFormID() {
    return 'picture_mapping_action_confirm';
  }

  /**
   * {@inheritdoc}
   */
  public function buildForm(array $form, array &$form_state, EntityInterface $picture_mapping = NULL) {
    $this->pictureMapping = $picture_mapping;
    return parent::buildForm($form, $form_state);
  }

  /**
   * {@inheritdoc}
   */
  public function submitForm(array &$form, array &$form_state) {
    $this->pictureMapping
      ->delete();
    drupal_set_message(t('Picture mapping %label has been deleted.', array(
      '%label' => $this->pictureMapping
        ->label(),
    )));
    watchdog('picture', 'Picture mapping %label has been deleted.', array(
      '%label' => $this->pictureMapping
        ->label(),
    ), WATCHDOG_NOTICE);
    $form_state['redirect'] = 'admin/config/media/picturemapping';
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ConfirmFormBase::getCancelText protected function Returns a caption for the link which cancels the action. 2
ConfirmFormBase::getDescription protected function Returns additional text to display as a description. 10
ConfirmFormBase::getFormName protected function Returns the internal name used to refer to the confirmation item.
ConfirmFormBase::validateForm public function Implements \Drupal\Core\Form\FormInterface::validateForm(). Overrides FormInterface::validateForm 1
PictureMappingActionConfirmForm::$pictureMapping protected property The picture mapping object to be deleted.
PictureMappingActionConfirmForm::buildForm public function Implements \Drupal\Core\Form\FormInterface::buildForm(). Overrides ConfirmFormBase::buildForm
PictureMappingActionConfirmForm::getCancelPath protected function Returns the page to go to if the user cancels the action. Overrides ConfirmFormBase::getCancelPath
PictureMappingActionConfirmForm::getConfirmText protected function Returns a caption for the button that confirms the action. Overrides ConfirmFormBase::getConfirmText
PictureMappingActionConfirmForm::getFormID public function Returns a unique string identifying the form. Overrides FormInterface::getFormID
PictureMappingActionConfirmForm::getQuestion protected function Returns the question to ask the user. Overrides ConfirmFormBase::getQuestion
PictureMappingActionConfirmForm::submitForm public function Form submission handler. Overrides FormInterface::submitForm