Provides a form for deleting a feed.
Expanded class hierarchy of FeedDelete
class FeedDelete extends ConfirmFormBase {
/**
* The feed the being deleted.
*
* @var \Drupal\aggregator\Plugin\Core\Entity\Feed
*/
protected $feed;
/**
* {@inheritdoc}
*/
public function getFormID() {
return 'aggregator_feed_delete_form';
}
/**
* {@inheritdoc}
*/
protected function getQuestion() {
return t('Are you sure you want to delete the feed %feed?', array(
'%feed' => $this->feed
->label(),
));
}
/**
* {@inheritdoc}
*/
protected function getCancelPath() {
return 'admin/config/services/aggregator';
}
/**
* {@inheritdoc}
*/
protected function getConfirmText() {
return t('Delete');
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, array &$form_state, Feed $aggregator_feed = NULL) {
$this->feed = $aggregator_feed;
return parent::buildForm($form, $form_state);
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, array &$form_state) {
$this->feed
->delete();
watchdog('aggregator', 'Feed %feed deleted.', array(
'%feed' => $this->feed
->label(),
));
drupal_set_message(t('The feed %feed has been deleted.', array(
'%feed' => $this->feed
->label(),
)));
if (arg(0) == 'admin') {
$form_state['redirect'] = 'admin/config/services/aggregator';
}
else {
$form_state['redirect'] = 'aggregator/sources';
}
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FeedDelete:: |
public | function |
Returns a unique string identifying the form. Overrides FormInterface:: |
|
FeedDelete:: |
protected | function |
Returns the question to ask the user. Overrides ConfirmFormBase:: |
|
FeedDelete:: |
protected | function |
Returns the page to go to if the user cancels the action. Overrides ConfirmFormBase:: |
|
FeedDelete:: |
protected | function |
Returns a caption for the button that confirms the action. Overrides ConfirmFormBase:: |
|
FeedDelete:: |
public | function |
Implements \Drupal\Core\Form\FormInterface::buildForm(). Overrides ConfirmFormBase:: |
|
FeedDelete:: |
public | function |
Form submission handler. Overrides FormInterface:: |
|
ConfirmFormBase:: |
protected | function | Returns additional text to display as a description. | 10 |
ConfirmFormBase:: |
protected | function | Returns a caption for the link which cancels the action. | 2 |
ConfirmFormBase:: |
protected | function | Returns the internal name used to refer to the confirmation item. | |
ConfirmFormBase:: |
public | function |
Implements \Drupal\Core\Form\FormInterface::validateForm(). Overrides FormInterface:: |
1 |
FeedDelete:: |
protected | property | The feed the being deleted. |