You are here

function jdrupal_services_resources in jDrupal 7

Defines function signatures for resources available to services.

File

./jdrupal.services.inc, line 12
jDrupal's implementation of Hooks provided by Services for the definition of new service resources.

Code

function jdrupal_services_resources() {
  $jdrupal_resource = array(
    'jdrupal' => array(
      'actions' => array(
        'content_types_list' => array(
          'help' => t('Gets a list of Drupal content types.'),
          'file' => array(
            'type' => 'inc',
            'module' => 'jdrupal',
            'name' => 'jdrupal.resource',
          ),
          'callback' => '_jdrupal_resource_content_types_list',
          'args' => array(),
          'access callback' => '_jdrupal_resource_access',
          'access callback file' => array(
            'type' => 'inc',
            'module' => 'jdrupal',
            'name' => 'jdrupal.resource',
          ),
          'access arguments' => array(
            'access content',
          ),
          'access arguments append' => TRUE,
        ),
        'content_types_user_permissions' => array(
          'help' => t('Returns a list of permissions the current user has for
           all content types.'),
          'file' => array(
            'type' => 'inc',
            'module' => 'jdrupal',
            'name' => 'jdrupal.resource',
          ),
          'callback' => '_jdrupal_resource_content_types_user_permissions',
          'args' => array(),
          'access callback' => '_jdrupal_resource_access',
          'access callback file' => array(
            'type' => 'inc',
            'module' => 'jdrupal',
            'name' => 'jdrupal.resource',
          ),
          'access arguments' => array(
            'access content',
          ),
          'access arguments append' => TRUE,
        ),
        'site_settings' => array(
          'help' => t('Gets a list of various drupal settings and variables.'),
          'file' => array(
            'type' => 'inc',
            'module' => 'jdrupal',
            'name' => 'jdrupal.resource',
          ),
          'callback' => '_jdrupal_resource_system_site_settings',
          'args' => array(),
          'access callback' => '_jdrupal_resource_access',
          'access callback file' => array(
            'type' => 'inc',
            'module' => 'jdrupal',
            'name' => 'jdrupal.resource',
          ),
          'access arguments' => array(
            'access content',
          ),
          'access arguments append' => TRUE,
        ),
        'get_vocabularies' => array(
          'help' => t('Returns a list of vocabularies.'),
          'file' => array(
            'type' => 'inc',
            'module' => 'jdrupal',
            'name' => 'jdrupal.resource',
          ),
          'callback' => '_jdrupal_taxonomy_get_vocabularies',
          'args' => array(),
          'access callback' => '_jdrupal_resource_access',
          'access callback file' => array(
            'type' => 'inc',
            'module' => 'jdrupal',
            'name' => 'jdrupal.resource',
          ),
          'access arguments' => array(
            'jdrupal get vocabularies',
          ),
          'access arguments append' => TRUE,
        ),
        'get_terms' => array(
          'help' => t('Returns a list of terms for a vocabulary.'),
          'file' => array(
            'type' => 'inc',
            'module' => 'jdrupal',
            'name' => 'jdrupal.resource',
          ),
          'callback' => '_jdrupal_taxonomy_get_terms',
          'args' => array(
            array(
              'name' => 'vid',
              'type' => 'int',
              'description' => t('The vocabulary id to retrieve.'),
              'source' => array(
                'data' => 'vid',
              ),
              'optional' => FALSE,
            ),
            array(
              'name' => 'parent',
              'type' => 'int',
              'description' => t('The term ID under which to generate the tree. If 0, generate the tree for the entire vocabulary.'),
              'source' => array(
                'data' => 'parent',
              ),
              'default value' => 0,
              'optional' => TRUE,
            ),
            array(
              'name' => 'maxdepth',
              'type' => 'int',
              'description' => t('The number of levels of the tree to return. Leave NULL to return all levels.'),
              'source' => array(
                'data' => 'maxdepth',
              ),
              'default value' => NULL,
              'optional' => TRUE,
            ),
          ),
          'access callback' => '_jdrupal_resource_access',
          'access callback file' => array(
            'type' => 'inc',
            'module' => 'jdrupal',
            'name' => 'jdrupal.resource',
          ),
          'access arguments' => array(
            'jdrupal get terms',
          ),
          'access arguments append' => TRUE,
        ),
        'permissions' => array(
          'help' => t("Retrieves the current user's permissions."),
          'file' => array(
            'type' => 'inc',
            'module' => 'jdrupal',
            'name' => 'jdrupal.resource',
          ),
          'callback' => '_jdrupal_resource_user_permissions',
          'access callback' => '_jdrupal_resource_access',
          'access callback file' => array(
            'type' => 'inc',
            'module' => 'jdrupal',
            'name' => 'jdrupal.resource',
          ),
          'access arguments' => array(
            'access content',
          ),
          'access arguments append' => TRUE,
        ),
      ),
    ),
  );
  return $jdrupal_resource;
}