diff --git a/application/forms/Dashboard/RemoveHomeForm.php b/application/forms/Dashboard/RemoveHomeForm.php new file mode 100644 index 000000000..6efe91d62 --- /dev/null +++ b/application/forms/Dashboard/RemoveHomeForm.php @@ -0,0 +1,35 @@ +hasBeenSent() && $this->getPopulatedValue('btn_remove'); + } + + protected function assemble() + { + $this->addHtml(HtmlElement::create( + 'h2', + null, + sprintf(t('Please confirm removal of dashboard home "%s"'), $this->dashboard->getActiveHome()->getTitle()) + )); + + $this->addHtml($this->registerSubmitButton('Remove Home')->setName('btn_remove')); + } + + protected function onSuccess() + { + $home = $this->dashboard->getActiveHome(); + $this->dashboard->removeEntry($home); + + Notification::success(sprintf(t('Removed dashboard home "%s" successfully'), $home->getTitle())); + } +}