You are here

search_service.module in Services 6

@author Services Dev Team

Link general search functionalities to services module.

File

services/search_service/search_service.module
View source
<?php

/**
 * @author Services Dev Team
 * @file
 *  Link general search functionalities to services module.
 */

/**
 * Implementation of hook_help().
 */
function search_service_help($path, $arg) {
  switch ($path) {
    case 'admin/help#services_search':
      return t('<p>Provides search methods to services applications. Requires services.module.</p>');
    case 'admin/modules#description':
      return t('Provides search methods to services applications. Requires services.module.');
  }
}

/**
 * Implementation of hook_service().
 */
function search_service_service() {
  return array(
    array(
      '#method' => 'search.nodes',
      '#callback' => 'search_service_nodes',
      '#access arguments' => array(
        'search content',
      ),
      '#file' => array(
        'file' => 'inc',
        'module' => 'search_service',
      ),
      '#key' => FALSE,
      '#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('Searches nodes according to keys via hook_search.'),
    ),
    array(
      '#method' => 'search.users',
      '#callback' => 'search_service_users',
      '#access arguments' => array(
        'search content',
      ),
      '#file' => array(
        'file' => 'inc',
        'module' => 'search_service',
      ),
      '#key' => FALSE,
      '#args' => array(
        array(
          '#name' => 'search_keys',
          '#type' => 'string',
          '#description' => t('Search keys.'),
        ),
      ),
      '#return' => 'array',
      '#help' => t('Searches users according to keys via hook_search.'),
    ),
  );
}

Functions

Namesort descending Description
search_service_help Implementation of hook_help().
search_service_service Implementation of hook_service().