You are here

wsclient_ui.module in Web service client 7

Web service client UI - module file.

File

wsclient_ui/wsclient_ui.module
View source
<?php

/**
 * @file
 * Web service client UI - module file.
 */
define('WSCLIENT_UI_PATH', 'admin/config/services/wsclient');

/**
 * Implements hook_entity_info_alter().
 */
function wsclient_ui_entity_info_alter(&$entity_info) {

  // Enable the entity API UI controller. See EntityDefaultUIController.
  $entity_info['wsclient_service']['admin ui'] = array(
    'controller class' => 'WSClientUIController',
    'path' => WSCLIENT_UI_PATH,
    'file' => 'wsclient_ui.inc',
    'file path' => drupal_get_path('module', 'wsclient_ui'),
  );

  // Enable URI callback.
  $entity_info['wsclient_service']['uri callback'] = 'wsclient_ui_uri';
}

/**
 * Operation load callback.
 */
function wsclient_ui_operation_load($operation_name, $service_name) {
  $service = wsclient_service_load($service_name);
  if ($service && isset($service->operations[$operation_name])) {
    $operation = $service->operations[$operation_name];
    $operation['name'] = $operation_name;
    return $operation;
  }
  return FALSE;
}

/**
 * Data type load callback.
 */
function wsclient_ui_type_load($type_name, $service_name) {
  $service = wsclient_service_load($service_name);
  if ($service && isset($service->datatypes[$type_name])) {
    $type = $service->datatypes[$type_name];
    $type['name'] = $type_name;
    return $type;
  }
  return FALSE;
}

/**
 * Entity URI callback.
 */
function wsclient_ui_uri($service) {
  return array(
    'path' => WSCLIENT_UI_PATH . '/manage/' . $service->name,
  );
}

/**
 * Implements hook_theme().
 */
function wsclient_ui_theme() {
  return array(
    'wsclient_ui_parameter_form' => array(
      'render element' => 'element',
      'file' => 'wsclient_ui.inc',
    ),
    'wsclient_ui_header_form' => array(
      'render element' => 'element',
      'file' => 'wsclient_ui.inc',
    ),
    'wsclient_ui_property_form' => array(
      'render element' => 'element',
      'file' => 'wsclient_ui.inc',
    ),
    'wsclient_ui_global_parameter_form' => array(
      'render element' => 'element',
      'file' => 'wsclient_ui.inc',
    ),
    'wsclient_ui_global_header_parameter_form' => array(
      'render element' => 'element',
      'file' => 'wsclient_ui.inc',
    ),
  );
}

Functions

Namesort descending Description
wsclient_ui_entity_info_alter Implements hook_entity_info_alter().
wsclient_ui_operation_load Operation load callback.
wsclient_ui_theme Implements hook_theme().
wsclient_ui_type_load Data type load callback.
wsclient_ui_uri Entity URI callback.

Constants

Namesort descending Description
WSCLIENT_UI_PATH @file Web service client UI - module file.