class FeedItemsDelete

Provides a deletion confirmation form for items that belong to a feed.

Hierarchy

Expanded class hierarchy of FeedItemsDelete

1 string reference to 'FeedItemsDelete'
aggregator.routing.yml in drupal/core/modules/aggregator/aggregator.routing.yml
drupal/core/modules/aggregator/aggregator.routing.yml

File

drupal/core/modules/aggregator/lib/Drupal/aggregator/Form/FeedItemsDelete.php, line 16
Contains \Drupal\aggregator\Form\FeedItemsDelete.

Namespace

Drupal\aggregator\Form
View source
class FeedItemsDelete extends ConfirmFormBase {

  /**
   * The feed the items being deleted belong to.
   *
   * @var \Drupal\aggregator\Plugin\Core\Entity\Feed
   */
  protected $feed;

  /**
   * Implements \Drupal\Core\Form\FormInterface::getFormID().
   */
  public function getFormID() {
    return 'aggregator_feed_items_delete_form';
  }

  /**
   * Implements \Drupal\Core\Form\ConfirmFormBase::getQuestion().
   */
  protected function getQuestion() {
    return t('Are you sure you want to remove all items from the feed %feed?', array(
      '%feed' => $this->feed
        ->label(),
    ));
  }

  /**
   * Implements \Drupal\Core\Form\ConfirmFormBase::getCancelPath().
   */
  protected function getCancelPath() {
    return 'admin/config/services/aggregator';
  }

  /**
   * Implements \Drupal\Core\Form\ConfirmFormBase::getConfirmText().
   */
  protected function getConfirmText() {
    return t('Remove items');
  }

  /**
   * Implements \Drupal\Core\Form\FormInterface::buildForm().
   */
  public function buildForm(array $form, array &$form_state, Feed $aggregator_feed = NULL) {
    $this->feed = $aggregator_feed;
    return parent::buildForm($form, $form_state);
  }

  /**
   * Implements \Drupal\Core\Form\FormInterface::submitForm().
   */
  public function submitForm(array &$form, array &$form_state) {

    // @todo Remove once http://drupal.org/node/1930274 is fixed.
    aggregator_remove($this->feed);
    $form_state['redirect'] = 'admin/config/services/aggregator';
  }

}

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
FeedItemsDelete::$feed protected property The feed the items being deleted belong to.
FeedItemsDelete::buildForm public function Implements \Drupal\Core\Form\FormInterface::buildForm(). Overrides ConfirmFormBase::buildForm
FeedItemsDelete::getCancelPath protected function Implements \Drupal\Core\Form\ConfirmFormBase::getCancelPath(). Overrides ConfirmFormBase::getCancelPath
FeedItemsDelete::getConfirmText protected function Implements \Drupal\Core\Form\ConfirmFormBase::getConfirmText(). Overrides ConfirmFormBase::getConfirmText
FeedItemsDelete::getFormID public function Implements \Drupal\Core\Form\FormInterface::getFormID(). Overrides FormInterface::getFormID
FeedItemsDelete::getQuestion protected function Implements \Drupal\Core\Form\ConfirmFormBase::getQuestion(). Overrides ConfirmFormBase::getQuestion
FeedItemsDelete::submitForm public function Implements \Drupal\Core\Form\FormInterface::submitForm(). Overrides FormInterface::submitForm