hasBeenSent() && $this->getPopulatedValue('btn_remove'); } protected function assemble() { $this->addHtml(HtmlElement::create( 'h2', null, sprintf(t('Please confirm removal of pane "%s"'), $this->requestUrl->getParam('pane')) )); $this->addHtml($this->registerSubmitButton(t('Remove Pane'))->setName('btn_remove')); } protected function onSuccess() { $home = $this->dashboard->getActiveEntry(); $pane = $home->getActiveEntry(); try { $home->removeEntry($pane); $this->requestSucceeded = true; Notification::success(sprintf(t('Removed pane "%s" successfully'), $pane->getTitle())); } catch (Exception $err) { Logger::error( 'Unable to remove pane "%s". An unexpected error occurred: %s', $pane->getTitle(), $err ); Notification::error(t('Failed to successfully remove the pane. Please check the logs for details!')); } } }