You are here

function services_menu in Services 6.3

Same name and namespace in other branches
  1. 5 services.module \services_menu()
  2. 6 services.module \services_menu()
  3. 6.2 services.module \services_menu()
  4. 7.3 services.module \services_menu()
  5. 7 services.module \services_menu()

Implementation of hook_menu().

File

./services.module, line 54
Provides a generic but powerful API for web services.

Code

function services_menu() {
  $items = array();

  // Add menu items for the different endpoints
  if (module_exists('ctools')) {
    $endpoints = services_endpoint_load_all();
    foreach ($endpoints as $endpoint) {
      if (empty($endpoint->disabled)) {
        $items[$endpoint->path] = array(
          'title' => 'Services endpoint',
          'access callback' => 'services_access_menu',
          'page callback' => 'services_endpoint_callback',
          'page arguments' => array(
            $endpoint->name,
          ),
          'type' => MENU_CALLBACK,
        );
      }
    }
  }
  return $items;
}