2013-08-26 16:56:23 +02:00
|
|
|
<?php
|
2016-02-08 15:41:00 +01:00
|
|
|
/* Icinga Web 2 | (c) 2013 Icinga Development Team | GPLv2+ */
|
2013-08-26 16:56:23 +02:00
|
|
|
|
2014-11-14 10:57:14 +01:00
|
|
|
namespace Icinga\Forms;
|
2013-08-26 16:56:23 +02:00
|
|
|
|
|
|
|
use Icinga\Web\Form;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Form for confirming removal of an object
|
|
|
|
*/
|
|
|
|
class ConfirmRemovalForm extends Form
|
|
|
|
{
|
2019-07-19 15:34:09 +02:00
|
|
|
const DEFAULT_CLASSES = 'icinga-controls';
|
|
|
|
|
2013-08-26 16:56:23 +02:00
|
|
|
/**
|
2016-01-25 07:06:39 +01:00
|
|
|
* {@inheritdoc}
|
2013-08-26 16:56:23 +02:00
|
|
|
*/
|
2014-07-24 16:20:01 +02:00
|
|
|
public function init()
|
2013-08-26 16:56:23 +02:00
|
|
|
{
|
2014-07-24 16:20:01 +02:00
|
|
|
$this->setName('form_confirm_removal');
|
2015-05-19 17:25:48 +02:00
|
|
|
$this->getSubmitLabel() ?: $this->setSubmitLabel($this->translate('Confirm Removal'));
|
2013-08-26 16:56:23 +02:00
|
|
|
}
|
2016-01-25 07:06:39 +01: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 16:56:23 +02:00
|
|
|
}
|