You are here

function content_types in Content Construction Kit (CCK) 6.3

Same name and namespace in other branches
  1. 5 content.module \content_types()
  2. 6 content.module \content_types()
  3. 6.2 content.module \content_types()

Return a list of all content types.

Parameters

$content_type_name: If set, return information on just this type.

Do some type checking and set up empty arrays for missing info to avoid foreach errors elsewhere in the code.

45 calls to content_types()
content_add_more_js in includes/content.node_form.inc
Menu callback for AHAH addition of new empty widgets.
content_content_field_content_type_content_types in includes/panels/content_types/content_field.inc
Return all field content types available.
content_copy_export in modules/content_copy/content_copy.module
Process the export, get field admin forms for all requested fields and save the form values as formatted text.
content_copy_export_form in modules/content_copy/content_copy.module
A form to export field definitions.
content_diff in includes/content.diff.inc
Implementation of hook_diff()

... See full list

4 string references to 'content_types'
content_copy_export in modules/content_copy/content_copy.module
Process the export, get field admin forms for all requested fields and save the form values as formatted text.
content_ctools_plugin_directory in ./content.module
Implementation of hook_ctools_plugin_directory().
content_multigroup_ctools_plugin_directory in modules/content_multigroup/content_multigroup.module
Implementation of hook_ctools_plugin_directory().
fieldgroup_ctools_plugin_directory in modules/fieldgroup/fieldgroup.module
Implementation of hook_ctools_plugin_directory().

File

./content.module, line 1377
Allows administrators to associate custom fields to content types.

Code

function content_types($type_name = NULL) {

  // handle type name with either an underscore or a dash
  $type_name = !empty($type_name) ? str_replace('-', '_', $type_name) : NULL;
  $info = _content_type_info();
  if (isset($info['content types'])) {
    if (!isset($type_name)) {
      return $info['content types'];
    }
    if (isset($info['content types'][$type_name])) {
      return $info['content types'][$type_name];
    }
  }
  return array(
    'tables' => array(),
    'fields' => array(),
    'extra' => array(),
  );
}