Same name and namespace in other branches
  1. 6.x-1.x xmlrpc_example/xmlrpc_example.module \xmlrpc_example_menu()

Implements hook_menu().

Registers all the demonstration forms.

Related topics

File

xmlrpc_example/xmlrpc_example.module, line 39
Module file for xmlrpc_example module.

Code

function xmlrpc_example_menu() {
  $items['examples/xmlrpc'] = array(
    'title' => 'XML-RPC Example',
    'description' => 'Information about the XML-RPC example',
    'page callback' => 'xmlrpc_example_info',
    'access callback' => TRUE,
  );

  // This is the server configuration form menu entry. This form can be used to
  // configure the settings of the exposed services. An XML-RPC server does not
  // require a configuration form, and has been included here as an example.
  $items['examples/xmlrpc/server'] = array(
    'title' => 'XML-RPC Server configuration',
    'description' => 'Server configuration form',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'xmlrpc_example_server_form',
    ),
    'access callback' => TRUE,
    'weight' => 0,
  );

  // This is the client form menu entry. This form is used to allow user
  // interaction with the services, but again, user interface is not required
  // to create an XML-RPC client with Drupal.
  $items['examples/xmlrpc/client'] = array(
    'title' => 'XML-RPC Client form',
    'description' => 'Demonstrates client side XML-RPC calls with Drupal',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'xmlrpc_example_client_form',
    ),
    'access callback' => TRUE,
    'weight' => 1,
  );

  // This part is completely optional. It allows the modification of services
  // defined by this or other modules. This configuration form is used to
  // enable the hook_xmlrpc_alter API and alter current existing services.
  $items['examples/xmlrpc/alter'] = array(
    'title' => 'XML-RPC Alterations',
    'description' => 'Demonstrates how to alter defined XML-RPC services',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'xmlrpc_example_alter_form',
    ),
    'access callback' => TRUE,
    'weight' => 2,
  );
  return $items;
}