content_fields

contributions/cck/content.module, line 712

Versions
6 – 5
content_fields($field_name = NULL, $content_type_name = NULL)

Return a list of all fields.

Parameters

$field_name If set, return information on just this field.

$content_type_name If set, return information of the field within the context of this content type.

▾ 42 functions call content_fields()

asset_panels_content_gallery in contributions/asset/contrib/asset_panels/asset_panels.module
Output function for the 'node' content type. Outputs a node based on the module and delta supplied in the configuration.
asset_wizard_get_config in contributions/asset/asset_wizard.module
Load the current asset wizard config array, passed in throught $_GET['config'] Options for config are 'macro' (default), 'id', or the name of a cck field
audiofield_js in contributions/mediafield/audiofield.module
Menu callback for JavaScript-based uploads.
content_copy_export_form in contributions/cck/content_copy.module
A form to export field definitions.
content_fields in contributions/cck/content.module
Return a list of all fields.
content_format in contributions/cck/content.module
Format a field item for display.
content_panels_edit_field in contributions/cck/content_panels.inc
content_panels_title_content in contributions/cck/content_panels.inc
'Title' callback for the 'field' content type.
content_taxonomy_hierarchical_select_form_alter in contributions/hierarchical_select/modules/content_taxonomy.inc
Implementation of hook_hierarchical_select_form_alter().
content_update_10 in contributions/cck/content.install
Fix corrupted db due to a bug in 1.3 release (http://drupal.org/node/115332)
content_update_1003 in contributions/cck/content.install
Rename data tables to avoid collision with core node_* tables
content_update_1004 in contributions/cck/content.install
Fix corrupted db due to a bug in 1.3 release (http://drupal.org/node/115332)
content_update_1006 in contributions/cck/content.install
Set text db columns to accept NULL values for mysql (see http://drupal.org/node/108094)
content_update_5 in contributions/cck/content.install
Move data from per-field storage to per-content-type storage where possible.
content_views_arguments in contributions/cck/content_views.inc
Implementation of hook_views_arguments().
content_views_argument_handler in contributions/cck/content_views.inc
Perform filtering by an argument for field data stored via content.module.
content_views_tables in contributions/cck/content_views.inc
Implementation of hook_views_tables().
filefield_js in contributions/filefield/filefield.module
Menu callback for JavaScript-based uploads.
imagefield_js in contributions/imagefield/imagefield.module
Menu-callback for JavaScript-based uploads.
imagefield_update_1 in contributions/imagefield/imagefield.install
Data is now stored in per-field tables.
link_update_1 in contributions/link/link.install
Removed link.module created tables, move data to content.module tables
link_views_argument_handler in contributions/link/link.module
Views module argument handler for link fields
nodereference_autocomplete in contributions/cck/nodereference.module
Retrieve a pipe delimited string of autocomplete suggestions
nodereference_node_from_noderef_settings_form in contributions/cck/nodereference.module
Settings form for the panels relationship.
nodereference_update_3 in contributions/cck/nodereference.install
Data is now stored in per-field tables.
number_update_4 in contributions/cck/number.install
Data is now stored in per-field tables.
number_update_5 in contributions/cck/number.install
Set the value columns to accept NULL values
optionwidgets_help in contributions/cck/optionwidgets.module
Implementation of hook_help().
text_update_4 in contributions/cck/text.install
Data is now stored in per-field tables.
uc_importer_import in contributions/ubercart/uc_importer/uc_importer.module
Imports an XML document into the database.
userreference_autocomplete in contributions/cck/userreference.module
Menu callback; Retrieve a pipe delimited string of autocomplete suggestions for existing users
userreference_update_3 in contributions/cck/userreference.install
Data is now stored in per-field tables.
userreference_update_4 in contributions/cck/userreference.install
Set the value columns to accept NULL values and replace 0 with NULL in the field data tables
userreference_user_from_userref_context_settings_form in contributions/cck/userreference.module
Settings form for the panels relationship.
videofield_js in contributions/mediafield/videofield.module
Menu callback for JavaScript-based uploads.
video_cck_update_2 in contributions/emfield/contrib/video_cck/video_cck.install
we need a new data field for extra info stored by certain providers, such as blip.tv
_content_admin_field_add_existing_submit in contributions/cck/content_admin.inc
Add an existing field to a content type.
_content_admin_field_add_new_submit in contributions/cck/content_admin.inc
Create a new field for a content type.
_content_admin_field_add_new_validate in contributions/cck/content_admin.inc
Field name validation for programmatic field addition that supply the field name.
_content_admin_field_submit in contributions/cck/content_admin.inc
Save a field's settings after editing.
_content_admin_type_fields in contributions/cck/content_admin.inc
Menu callback; lists all defined fields for quick reference.
_emfield_handler_arg_provider in contributions/emfield/emfield.module
Handle the provider argument. This is called from a wrapper that includes the module.

Code

<?php
function content_fields($field_name = NULL, $content_type_name = NULL) {
  $info = _content_type_info();

  // If there is no field name specified, return the entire fields array.
  if (!isset($field_name)) {
    return $info['fields'];
  }
  elseif (!isset($info['fields'][$field_name])) {
    return NULL;
  }
  elseif (!isset($content_type_name)) {
    return $info['fields'][$field_name];
  }
  elseif (isset($info['content types'][$content_type_name]['fields'][$field_name])) {
    return $info['content types'][$content_type_name]['fields'][$field_name];
  }

  // If all else fails, return NULL.
  return NULL;
}
?>