function views_service_service in Services 6
Same name and namespace in other branches
- 5 services/views_service/views_service.module \views_service_service()
- 6.2 services/views_service/views_service.module \views_service_service()
- 7 services/views_service/views_service.module \views_service_service()
Implementation of hook_service().
File
- services/
views_service/ views_service.module, line 23 - @author Services Dev Team
Code
function views_service_service() {
return array(
// views.get
array(
'#method' => 'views.get',
'#callback' => 'views_service_get',
'#access callback' => 'views_service_get_access',
'#file' => array(
'file' => 'inc',
'module' => 'views_service',
),
'#key' => FALSE,
'#args' => array(
array(
'#name' => 'view_name',
'#type' => 'string',
'#description' => t('View name.'),
),
array(
'#name' => 'fields',
'#type' => 'array',
'#optional' => TRUE,
'#description' => t('A list of fields to return.'),
),
array(
'#name' => 'args',
'#type' => 'array',
'#optional' => TRUE,
'#description' => t('An array of arguments to pass to the view.'),
),
array(
'#name' => 'offset',
'#type' => 'int',
'#optional' => TRUE,
'#description' => t('An offset integer for paging.'),
),
array(
'#name' => 'limit',
'#type' => 'int',
'#optional' => TRUE,
'#description' => t('A limit integer for paging.'),
),
),
'#return' => 'array',
'#help' => t('Retrieves a view defined in views.module.'),
),
// views.export
array(
'#method' => 'views.export',
'#callback' => 'views_service_export',
'#access arguments' => array(
'administer views',
),
'#file' => array(
'file' => 'inc',
'module' => 'views_service',
),
'#args' => array(
'string',
),
'#args' => array(
array(
'#name' => 'view_name',
'#type' => 'string',
'#description' => t('View name.'),
),
),
'#return' => 'string',
'#help' => t('Exports the code of a view, same as the output you would get from the Export tab.'),
),
// views.import
array(
'#method' => 'views.import',
'#callback' => 'views_service_import',
'#access arguments' => array(
'administer views',
),
'#file' => array(
'file' => 'inc',
'module' => 'views_service',
),
'#args' => array(
array(
'#name' => 'view_import',
'#type' => 'string',
'#size' => 'big',
'#description' => t('Code from a Views->Export.'),
),
array(
'#name' => 'view_name',
'#type' => 'string',
'#optional' => TRUE,
'#description' => t('The new Views name.'),
),
),
'#return' => 'int',
'#help' => t('Imports a view through code, equivalent to using the Import tab in the views admin.'),
),
);
}