/** * Execute the hook * * @param array The parameters for the hook */ public static function execute($params) { $returnParams = array('display' => false, 'resourceType' => null); if (isset($params['objectType']) && in_array($params['objectType'], TagsRepository::getListResource())) { $returnParams['display'] = true; $returnParams['resourceType'] = $params['objectType']; } return array('template' => 'displayAddToTag.tpl', 'variables' => $returnParams); }
public function testGetListResource() { $this->assertEquals(array('host', 'service', 'hostgroup', 'servicegroup', 'ba'), TagsRepository::getListResource()); }