mirror of
https://github.com/Icinga/icingaweb2.git
synced 2026-04-06 09:45:23 -04:00
Add SPDX license headers and mark source files as GPL-3.0-or-later to preserve the option to relicense under later GPL versions.
40 lines
895 B
PHP
40 lines
895 B
PHP
<?php
|
|
|
|
// SPDX-FileCopyrightText: 2018 Icinga GmbH <https://icinga.com>
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
namespace Icinga\Forms;
|
|
|
|
use Icinga\Web\Form;
|
|
|
|
/**
|
|
* Form for confirming removal of an object
|
|
*/
|
|
class ConfirmRemovalForm extends Form
|
|
{
|
|
const DEFAULT_CLASSES = 'icinga-controls';
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function init()
|
|
{
|
|
$this->setName('form_confirm_removal');
|
|
$this->getSubmitLabel() ?: $this->setSubmitLabel($this->translate('Confirm Removal'));
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function addSubmitButton()
|
|
{
|
|
parent::addSubmitButton();
|
|
|
|
if (($submit = $this->getElement('btn_submit')) !== null) {
|
|
$class = $submit->getAttrib('class');
|
|
$submit->setAttrib('class', empty($class) ? 'autofocus' : $class . ' autofocus');
|
|
}
|
|
|
|
return $this;
|
|
}
|
|
}
|