You are here

function _system_resource_definition in Services 6.3

Same name and namespace in other branches
  1. 7.3 resources/system_resource.inc \_system_resource_definition()

@file Link general system functionalities to services module.

1 call to _system_resource_definition()
_services_core_resources in ./services.resource_build.inc
Supplies the resource definitions for Drupal core data

File

resources/system_resource.inc, line 8
Link general system functionalities to services module.

Code

function _system_resource_definition() {
  return array(
    'system' => array(
      'actions' => array(
        'connect' => array(
          'access callback' => 'services_access_menu',
          'help' => t('Returns the details of currently logged in user.'),
          'file' => array(
            'type' => 'inc',
            'module' => 'services',
            'name' => 'resources/system_resource',
          ),
          'callback' => '_system_resource_connect',
        ),
        'get_variable' => array(
          'help' => t('Returns the value of a system variable using variable_get().'),
          'file' => array(
            'type' => 'inc',
            'module' => 'services',
            'name' => 'resources/system_resource',
          ),
          'callback' => 'variable_get',
          'access arguments' => array(
            'get a system variable',
          ),
          'access arguments append' => FALSE,
          'args' => array(
            array(
              'name' => 'name',
              'optional' => TRUE,
              'source' => array(
                'data' => 'name',
              ),
              'description' => t('The name of the variable to return.'),
              'type' => 'string',
            ),
            array(
              'name' => 'default',
              'optional' => FALSE,
              'source' => array(
                'data' => 'default',
              ),
              'description' => t('The default value to use if this variable has never been set.'),
              'type' => 'string',
            ),
          ),
        ),
        'set_variable' => array(
          'help' => t('Sets the value of a system variable using variable_set().'),
          'file' => array(
            'type' => 'inc',
            'module' => 'services',
            'name' => 'resources/system_resource',
          ),
          'callback' => 'variable_set',
          'access arguments' => array(
            'set a system variable',
          ),
          'access arguments append' => FALSE,
          'args' => array(
            array(
              'name' => 'name',
              'optional' => FALSE,
              'source' => array(
                'data' => 'name',
              ),
              'description' => t('The name of the variable to set.'),
              'type' => 'string',
            ),
            array(
              'name' => 'value',
              'optional' => FALSE,
              'source' => array(
                'data' => 'value',
              ),
              'description' => t('The value to set.'),
              'type' => 'string',
            ),
          ),
        ),
        'del_variable' => array(
          'help' => t('Deletes a system variable using variable_del().'),
          'file' => array(
            'type' => 'inc',
            'module' => 'services',
            'name' => 'resources/system_resource',
          ),
          'callback' => 'variable_del',
          'access arguments' => array(
            'set a system variable',
          ),
          'access arguments append' => FALSE,
          'args' => array(
            array(
              'name' => 'name',
              'optional' => FALSE,
              'source' => array(
                'data' => 'name',
              ),
              'description' => t('The name of the variable to delete.'),
              'type' => 'string',
            ),
          ),
        ),
      ),
    ),
  );
}