/** * Hook to fallback to default search functions * * @param string $hook the name of the hook * @param string $type the type of the hook * @param string $returnvalue current return value * @param array $params supplied params * * @return void */ public static function searchFallback($hook, $type, $returnvalue, $params) { if (!empty($returnvalue)) { return; } if (!in_array($type, ['object', 'user', 'group', 'tags'])) { return; } switch ($type) { case 'object': return search_objects_hook($hook, $type, $returnvalue, $params); case 'user': return search_users_hook($hook, $type, $returnvalue, $params); case 'group': return search_groups_hook($hook, $type, $returnvalue, $params); case 'tags': return search_tags_hook($hook, $type, $returnvalue, $params); } }
/** * Return the data from the default search hook * * @param string $hook name of hook * @param string $type type of hook * @param unknown_type $value current value * @param array $params parameters * * @return array */ function search_advanced_fallback_search_hook($hook, $type, $value, $params) { if (!empty($value)) { return; } if (!in_array($type, ['object', 'user', 'group', 'tags'])) { return; } switch ($type) { case 'object': return search_objects_hook($hook, $type, $value, $params); case 'user': return search_users_hook($hook, $type, $value, $params); case 'group': return search_groups_hook($hook, $type, $value, $params); case 'tags': return search_tags_hook($hook, $type, $value, $params); } }