mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-09-24 18:37:52 +02:00
Introduce DashletlistMultiSelect
class
This commit is contained in:
parent
0f074325b3
commit
48b54f6025
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace Icinga\Web\Dashboard\ItemList;
|
||||
|
||||
use ipl\Html\Contract\FormElement;
|
||||
use ipl\Html\HtmlElement;
|
||||
|
||||
class DashletListMultiSelect extends DashletListItem
|
||||
{
|
||||
/** @var FormElement */
|
||||
protected $checkbox;
|
||||
|
||||
/**
|
||||
* Set a checkbox to be applied to the dashlet to enable multiselect
|
||||
*
|
||||
* @param FormElement $checkbox
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCheckBox(FormElement $checkbox)
|
||||
{
|
||||
$this->checkbox = $checkbox;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
protected function createLabel()
|
||||
{
|
||||
$label = HtmlElement::create('label');
|
||||
$label->addHtml($this->checkbox);
|
||||
|
||||
return $label;
|
||||
}
|
||||
|
||||
protected function assemble()
|
||||
{
|
||||
parent::assemble();
|
||||
|
||||
$this->addWrapper($this->createLabel());
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user