function search_service_service in Services 7
Same name and namespace in other branches
- 5 services/search_service/search_service.module \search_service_service()
- 6 services/search_service/search_service.module \search_service_service()
- 6.2 services/search_service/search_service.module \search_service_service()
Implementation of hook_service().
File
- services/
search_service/ search_service.module, line 50 - @author Services Dev Team
Code
function search_service_service() {
global $conf;
if (!isset($conf['search_service_options'])) {
drupal_set_message(t('Please configure <a href="@settings">search_service settings</a> to choose search methods to return with this method.', array(
'@settings' => url('admin/settings/search_service'),
)), 'error');
}
return array(
array(
'#method' => 'search.nodes',
'#callback' => 'search_service_nodes',
'#access arguments' => array(
'search content',
),
'#file' => array(
'file' => 'inc',
'module' => 'search_service',
),
'#args' => array(
array(
'#name' => 'search_keys',
'#type' => 'string',
'#description' => t('Search keys.'),
),
array(
'#name' => 'simple',
'#type' => 'string',
'#optional' => TRUE,
'#description' => t('If set, returns only the main search fields (link, type, title, user, date, snippet) and no additional data.'),
),
array(
'#name' => 'fields',
'#type' => 'array',
'#optional' => TRUE,
'#description' => t('A list of fields to filter.'),
),
),
'#return' => 'array',
'#help' => t('Searches nodes according to keys via node_search.'),
),
array(
'#method' => 'search.content',
'#callback' => 'search_service_content',
'#access arguments' => array(
'search content',
),
'#file' => array(
'file' => 'inc',
'module' => 'search_service',
),
'#args' => array(
array(
'#name' => 'search_keys',
'#type' => 'string',
'#description' => t('Search keys.'),
),
array(
'#name' => 'simple',
'#type' => 'string',
'#optional' => TRUE,
'#description' => t('If set, returns only the main search fields (link, type, title, user, date, snippet) and no additional data.'),
),
),
'#return' => 'array',
'#help' => t('Uses hook_search() selected under /admin/settings/search_service.'),
),
array(
'#method' => 'search.users',
'#callback' => 'search_service_users',
'#access arguments' => array(
'search content',
),
'#file' => array(
'file' => 'inc',
'module' => 'search_service',
),
'#args' => array(
array(
'#name' => 'search_keys',
'#type' => 'string',
'#description' => t('Search keys.'),
),
),
'#return' => 'array',
'#help' => t('Searches users according to keys via hook_search.'),
),
);
}