2013-08-26 10:56:23 -04:00
|
|
|
<?php
|
2026-03-26 12:46:27 -04:00
|
|
|
|
|
|
|
|
// SPDX-FileCopyrightText: 2018 Icinga GmbH <https://icinga.com>
|
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
2013-08-26 10:56:23 -04:00
|
|
|
|
2014-11-14 04:57:14 -05:00
|
|
|
namespace Icinga\Forms;
|
2013-08-26 10:56:23 -04:00
|
|
|
|
|
|
|
|
use Icinga\Web\Form;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Form for confirming removal of an object
|
|
|
|
|
*/
|
|
|
|
|
class ConfirmRemovalForm extends Form
|
|
|
|
|
{
|
2019-07-19 09:34:09 -04:00
|
|
|
const DEFAULT_CLASSES = 'icinga-controls';
|
|
|
|
|
|
2013-08-26 10:56:23 -04:00
|
|
|
/**
|
2016-01-25 01:06:39 -05:00
|
|
|
* {@inheritdoc}
|
2013-08-26 10:56:23 -04:00
|
|
|
*/
|
2014-07-24 10:20:01 -04:00
|
|
|
public function init()
|
2013-08-26 10:56:23 -04:00
|
|
|
{
|
2014-07-24 10:20:01 -04:00
|
|
|
$this->setName('form_confirm_removal');
|
2015-05-19 11:25:48 -04:00
|
|
|
$this->getSubmitLabel() ?: $this->setSubmitLabel($this->translate('Confirm Removal'));
|
2013-08-26 10:56:23 -04:00
|
|
|
}
|
2016-01-25 01:06:39 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* {@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;
|
|
|
|
|
}
|
2013-08-26 10:56:23 -04:00
|
|
|
}
|