mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-28 00:04:05 +02:00
parent
a8179507dc
commit
1e70cface0
@ -1863,6 +1863,18 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function renderLegacyGroups()
|
||||
{
|
||||
if ($this->supportsGroups()) {
|
||||
return $this->groups()->toLegacyConfigString();
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
@ -2009,7 +2021,7 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
|
||||
//$this->renderRanges(),
|
||||
//$this->renderArguments(),
|
||||
//$this->renderRelatedSets(),
|
||||
//$this->renderGroups(),
|
||||
$this->renderLegacyGroups(),
|
||||
//$this->renderMultiRelations(),
|
||||
//$this->renderCustomExtensions(),
|
||||
//$this->renderCustomVars(),
|
||||
|
@ -9,6 +9,7 @@ use Countable;
|
||||
use Icinga\Module\Director\Db\Cache\PrefetchCache;
|
||||
use Icinga\Module\Director\IcingaConfig\IcingaConfigRenderer;
|
||||
use Icinga\Module\Director\IcingaConfig\IcingaConfigHelper as c;
|
||||
use Icinga\Module\Director\IcingaConfig\IcingaLegacyConfigHelper as c1;
|
||||
|
||||
class IcingaObjectGroups implements Iterator, Countable, IcingaConfigRenderer
|
||||
{
|
||||
@ -344,6 +345,18 @@ class IcingaObjectGroups implements Iterator, Countable, IcingaConfigRenderer
|
||||
return c::renderKeyValue('groups', c::renderArray($groups));
|
||||
}
|
||||
|
||||
public function toLegacyConfigString()
|
||||
{
|
||||
$groups = array_keys($this->groups);
|
||||
|
||||
if (empty($groups)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$type = $this->object->getLegacyObjectType();
|
||||
return c1::renderKeyValue($type.'groups', c1::renderArray($groups));
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
{
|
||||
try {
|
||||
|
Loading…
x
Reference in New Issue
Block a user