You are here

function content_types in Content Construction Kit (CCK) 5

Same name and namespace in other branches
  1. 6.3 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.

32 calls to content_types()
content_admin_display_overview_form in ./content_admin.inc
Menu callback; presents a listing of fields display settings for a content type.
content_admin_field_overview_form in ./content_admin.inc
Menu callback; presents a listing of fields for a content type.
content_copy_export in ./content_copy.module
Process the export, get field admin forms for all requested fields and save the form values as formatted text.
content_copy_import_form_submit in ./content_copy.module
Submit handler for import form. For each submitted field: 1) add new field to the database 2) execute the imported field macro to update the settings to the imported values
content_delete in ./content.module
Delete node type fields.

... See full list

File

./content.module, line 687
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($type_name)) {
    if (isset($info['content types'][$type_name])) {
      return $info['content types'][$type_name];
    }
    else {
      return NULL;
    }
  }
  return $info['content types'];
}