mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-09-30 13:19:01 +02:00
28 lines
627 B
PHP
28 lines
627 B
PHP
<?php
|
|
|
|
namespace ipl\Web\Table\Extension;
|
|
|
|
use ipl\Web\Url;
|
|
|
|
// Could also be a static method, MultiSelect::enable($table)
|
|
trait MultiSelect
|
|
{
|
|
protected function enableMultiSelect($url, $sourceUrl, array $keys)
|
|
{
|
|
$this->addAttributes([
|
|
'class' => 'multiselect'
|
|
]);
|
|
|
|
$prefix = 'data-icinga-multiselect';
|
|
$multi = [
|
|
"$prefix-url" => Url::fromPath($url),
|
|
"$prefix-controllers" => Url::fromPath($sourceUrl),
|
|
"$prefix-data" => implode(',', $keys),
|
|
];
|
|
|
|
$this->addAttributes($multi);
|
|
|
|
return $this;
|
|
}
|
|
}
|