You are here

function wsclient_ui_types in Web service client 7

Returns a list of available data types for service parameters, return values or data type properties. Entities are excluded.

Parameters

$hidden: Flag to indicate whether the special 'hidden' data type should be added to the list as well.

2 calls to wsclient_ui_types()
wsclient_ui_operation in wsclient_ui/wsclient_ui.inc
Operation form.
wsclient_ui_type in wsclient_ui/wsclient_ui.inc
Data type form.

File

wsclient_ui/wsclient_ui.inc, line 1077
WSClient UI - implements service description management and configuration screens.

Code

function wsclient_ui_types($hidden = FALSE) {
  $cache = rules_get_cache();
  $data_info = $cache['data_info'];
  $entity_info = entity_get_info();

  // Remove entities.
  $data_info = array_diff_key($data_info, $entity_info);
  unset($data_info['entity']);

  // Remove the generic list type.
  unset($data_info['list']);
  $options = array();
  foreach ($data_info as $type => $properties) {

    // Do not add lists as this handled by the "multiple" checkbox.
    if (strpos($type, 'list<') !== 0) {
      $options[$type] = $properties['label'];
    }
  }
  if ($hidden) {

    // Add special 'hidden' data type
    $options['hidden'] = t('hidden');
  }
  natcasesort($options);
  return $options;
}