parent
2c8b16893c
commit
b513b40d4e
|
@ -314,6 +314,16 @@ constants
|
|||
));
|
||||
}
|
||||
|
||||
public function getUserObjects()
|
||||
{
|
||||
return $this->getDirectorObjects('User', 'User', 'users', array(
|
||||
'display_name' => 'display_name',
|
||||
'email' => 'email',
|
||||
'groups' => 'groups',
|
||||
'vars' => 'vars',
|
||||
));
|
||||
}
|
||||
|
||||
protected function buildEndpointZoneMap()
|
||||
{
|
||||
$zones = $this->getObjects('zone', 'zones', $attrs = array('endpoints'), 'director');
|
||||
|
|
|
@ -50,15 +50,24 @@ class ImportSourceCoreApi extends ImportSourceHook
|
|||
$form->addElement('select', 'object_type', array(
|
||||
'label' => 'Object type',
|
||||
'required' => true,
|
||||
'multiOptions' => $form->optionalEnum(array(
|
||||
'CheckCommand' => 'Commands',
|
||||
'Endpoint' => 'Endpoints',
|
||||
'Host' => 'Host',
|
||||
'Zone' => 'Zones',
|
||||
))
|
||||
'multiOptions' => $form->optionalEnum(self::enumObjectTypes($form))
|
||||
));
|
||||
}
|
||||
|
||||
protected static function enumObjectTypes($form)
|
||||
{
|
||||
$types = array(
|
||||
'CheckCommand' => $form->translate('Commands'),
|
||||
'Endpoint' => $form->translate('Endpoints'),
|
||||
'Host' => $form->translate('Hosts'),
|
||||
'User' => $form->translate('Users'),
|
||||
'Zone' => $form->translate('Zones'),
|
||||
);
|
||||
|
||||
asort($types);
|
||||
return $types;
|
||||
}
|
||||
|
||||
protected function api()
|
||||
{
|
||||
if ($this->api === null) {
|
||||
|
|
Loading…
Reference in New Issue