You are here

function ds_api_info in Display Suite 6.2

Same name and namespace in other branches
  1. 6.3 ds.module \ds_api_info()
  2. 6 ds.module \ds_api_info()

Return API info about a module and type.

Parameters

string $module: The module to get the API info from.

string $type_name: (Optional) The object type name.

20 calls to ds_api_info()
ds_block_field_form in includes/ds.fields.inc
Block field form.
ds_build_fields_and_regions in ./ds.module
Get fields and regions for an object.
ds_build_modes_page in includes/ds.buildmodes.inc
Build modes overview.
ds_code_field_form in includes/ds.fields.inc
Code field form.
ds_display_overview_form in includes/ds.display.inc
Menu callback; presents a listing of fields display settings for an object type.

... See full list

File

./ds.module, line 219
Core functions for the Display Suite module.

Code

function ds_api_info($module, $type_name = 'all') {
  static $api_info = array();
  if (!isset($api_info[$module][$type_name])) {

    // Gather information.
    $api_data = module_invoke($module, 'ds_api');
    if (!empty($api_data)) {
      $api_info[$module][$type_name] = $api_data;
      if (!isset($api_info[$module][$type_name]['extra'])) {
        $api_info[$module][$type_name]['extra'] = array();
      }

      // Extra info needed or not.
      if ($type_name != 'all' && !empty($api_data['extra'])) {
        $extra = array();
        $types = $api_data['types']();
        $type_info = $types[$type_name];
        foreach ($api_data['extra'] as $key) {
          $extra[$key] = $type_info->{$key};
        }
        $api_info[$module][$type_name]['extra'] = $extra;
      }
    }
  }
  return $api_info[$module][$type_name];
}