[ Index ]

PHP Cross Reference of Drupal 6 (yi-drupal)

title

Body

[close]

/sites/all/modules/cck/ -> content.module (summary)

(no description)

File Size: 2709 lines (95 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 79 functions

  content_help()
  content_flush_caches()
  content_init()
  content_perm()
  content_menu_alter()
  content_menu()
  content_elements()
  content_theme()
  content_views_api()
  content_ctools_plugin_directory()
  content_load()
  content_validate()
  content_presave()
  content_insert()
  content_update()
  content_delete()
  content_delete_revision()
  content_view()
  content_view_field()
  content_alter()
  content_prepare_translation()
  content_nodeapi()
  content_form_alter()
  content_alter_extra_weights()
  content_add_more_submit_proxy()
  theme_content_multiple_values()
  content_notify()
  content_associate_fields()
  content_field()
  content_set_empty()
  _content_sort_items()
  _content_sort_items_helper()
  _content_sort_items_value_helper()
  content_storage()
  content_write_record()
  _content_field_invoke()
  _content_field_invoke_default()
  content_types()
  content_fields()
  _content_field_types()
  _content_widget_types()
  _content_get_formatter()
  _content_type_info()
  content_node_type()
  content_clear_type_cache()
  content_database_info()
  content_storage_type()
  content_transpose_array_rows_cols()
  content_array_flatten()
  content_allowed_values()
  content_allowed_values_filter_html()
  content_filter_xss()
  _content_filter_xss_allowed_tags()
  _content_filter_xss_display_allowed_tags()
  content_format()
  content_build_modes()
  node_content_build_modes()
  search_content_build_modes()
  book_content_build_modes()
  _content_tablename()
  content_field_tablename()
  content_instance_tablename()
  content_cache_tablename()
  content_table_schema()
  content_db_index_exists()
  content_callback()
  content_handle()
  content_default_value()
  content_access()
  content_field_wrapper_post_render()
  theme_content_exclude()
  template_preprocess_content_field()
  content_preprocess_node()
  content_content_fieldapi()
  content_content_extra_fields()
  content_extra_field_weight()
  content_max_delta()
  content_inactive_fields()
  content_inactive_instances()

Functions
Functions that are not part of a class:

content_help($path, $arg)   X-Ref


content_flush_caches()   X-Ref
Implementation of hook_flush_caches.


content_init()   X-Ref
Implementation of hook_init().


content_perm()   X-Ref
Implementation of hook_perm().


content_menu_alter(&$items)   X-Ref
Implementation of hook_menu_alter().


content_menu()   X-Ref
Implementation of hook_menu().


content_elements()   X-Ref
Hook elements().

Used to add multiple value processing, validation, and themes.

FAPI callbacks can be declared here, and the element will be
passed to those callbacks.

Drupal will automatically theme the element using a theme with
the same name as the hook_elements key.

content_theme()   X-Ref
Implementation of hook_theme().


content_views_api()   X-Ref
Implementation of hook_views_api().


content_ctools_plugin_directory($module, $plugin)   X-Ref
Implementation of hook_ctools_plugin_directory().


content_load(&$node)   X-Ref
Load data for a node type's fields.
Implementation of hook_nodeapi 'load' op.

When loading one of the content.module nodes, we need to let each field handle
its own loading. This can make for a number of queries in some cases, so we
cache the loaded object structure and invalidate it during the update process.

content_validate(&$node, $form = NULL)   X-Ref
Implementation of hook_nodeapi 'validate' op.


content_presave(&$node)   X-Ref
Implementation of hook_nodeapi 'presave' op.


content_insert(&$node)   X-Ref
Implementation of hook_nodeapi 'insert' op.

Insert node type fields.

content_update(&$node)   X-Ref
Implementation of hook_nodeapi 'update' op.

Update node type fields.

content_delete(&$node)   X-Ref
Implementation of hook_nodeapi 'delete' op.

Delete node type fields.

content_delete_revision(&$node)   X-Ref
Implementation of hook_nodeapi 'delete_revision' op.

Delete node type fields for a revision.

content_view(&$node, $teaser = FALSE, $page = FALSE)   X-Ref
Implementation of hook_nodeapi 'view' op.

Generate field render arrays.

content_view_field($field, $node, $teaser = FALSE, $page = FALSE)   X-Ref
Render a single field, fully themed with label and multiple values.

To be used by third-party code (Views, Panels...) that needs to output
an isolated field. Do *not* use inside node templates, use the
$FIELD_NAME_rendered variables instead.

By default, the field is displayed using the settings defined for the
'full node' or 'teaser' contexts (depending on the value of the $teaser param).
Set $node->build_mode to a different value to use a different context.

Different settings can be specified by adjusting $field['display_settings'].

param: $field
param: $node
param: $teaser
param: $page
return:

content_alter(&$node, $teaser = FALSE, $page = FALSE)   X-Ref
Implementation of hook_nodeapi 'alter' op.

Add back the formatted values in the 'view' element for all fields,
so that node templates can use it.

content_prepare_translation(&$node)   X-Ref
Implementation of hook_nodeapi 'prepare translation' op.

Generate field render arrays.

content_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL)   X-Ref
Implementation of hook_nodeapi().


content_form_alter(&$form, $form_state, $form_id)   X-Ref
Implementation of hook_form_alter().


content_alter_extra_weights($elements)   X-Ref
Pre-render callback to adjust weights of non-CCK fields.


content_add_more_submit_proxy($form, &$form_state)   X-Ref
Proxy function to call content_add_more_submit(), because it might not be
included yet when the form is processed and invokes the callback.


theme_content_multiple_values($element)   X-Ref
Theme an individual form element.

Combine multiple values into a table with drag-n-drop reordering.

content_notify($op, $module)   X-Ref
Modules notify Content module when uninstalled, disabled, etc.

param: string $op
param: string $module

content_associate_fields($module)   X-Ref
Allows a module to update the database for fields and columns it controls.

param: string $module

content_field($op, &$node, $field, &$items, $teaser, $page)   X-Ref
Implementation of hook_field(). Handles common field housekeeping.

This implementation is special, as content.module does not define any field
types. Instead, this function gets called after the type-specific hook, and
takes care of default stuff common to all field types.

Db-storage ops ('load', 'insert', 'update', 'delete', 'delete revisions')
are not executed field by field, and are thus handled separately in
content_storage.

The 'view' operation constructs the $node in a way that you can use
drupal_render() to display the formatted output for an individual field.
i.e. print drupal_render($node->countent['field_foo']);

The code now supports both single value formatters, which theme an
individual item value as has been done in previous version of CCK,
and multiple value formatters, which theme all values for the field
in a single theme. The multiple value formatters could be used, for
instance, to plot field values on a single map or display them
in a graph. Single value formatters are the default, multiple value
formatters can be designated as such in formatter_info().

The node array will look like:
$node->content['field_foo']['wrapper'] = array(
'#type' => 'content_field',
'#title' => 'label'
'#field_name' => 'field_name',
'#node' => $node,
// Value of the $teaser param of hook_nodeapi('view').
'#teaser' => $teaser,
// Value of the $page param of hook_nodeapi('view').
'#page' => $page,
// The curent rendering context ('teaser', 'full', NODE_BUILD_SEARCH_INDEX...).
'#context' => $context,
'items' =>
0 => array(
'#item' => $items[0],
// Only for 'single-value' formatters
'#theme' => $theme,
'#field_name' => 'field_name',
'#type_name' => $node->type,
'#formatter' => $formatter_name,
'#node' => $node,
'#delta' => 0,
),
1 => array(
'#item' => $items[1],
// Only for 'single-value' formatters
'#theme' => $theme,
'#field_name' => 'field_name',
'#type_name' => $node->type,
'#formatter' => $formatter_name,
'#node' => $node,
'#delta' => 1,
),
// Only for 'multiple-value' formatters
'#theme' => $theme,
'#field_name' => 'field_name',
'#type_name' => $node->type,
'#formatter' => $formatter_name,
),
);

content_set_empty($field, $items)   X-Ref
Helper function to filter out empty values.

On order to keep marker rows in the database, the function ensures
that the right number of 'all columns NULL' values is kept.

param: array $field
param: array $items
return: array

_content_sort_items($field, $items)   X-Ref
Helper function to sort items in a field according to
user drag-n-drop reordering.


_content_sort_items_helper($a, $b)   X-Ref
Sort function for items order.
(copied form element_sort(), which acts on #weight keys)


_content_sort_items_value_helper($a, $b)   X-Ref
Same as above, using ['_weight']['#value']


content_storage($op, $node)   X-Ref
Handle storage ops for _content_field_invoke_default().


content_write_record($table, &$object, $update = array()   X-Ref
Save a record to the database based upon the schema.

Directly copied from core's drupal_write_record, which can't update a
column to NULL. See http://drupal.org/node/227677 and
http://drupal.org/node/226264 for more details about that problem.

TODO - get rid of this function and change references back to
drupal_write_record() if the patch gets into core. Will need a method
of protecting people on older versions, though.

Default values are filled in for missing items, and 'serial' (auto increment)
types are filled in with IDs.

param: $table
param: $object
param: $update
return:

_content_field_invoke($op, &$node, $teaser = NULL, $page = NULL)   X-Ref
Invoke a field hook.

For each operation, both this function and _content_field_invoke_default() are
called so that the default database handling can occur.

_content_field_invoke_default($op, &$node, $teaser = NULL, $page = NULL)   X-Ref
Invoke content.module's version of a field hook.


content_types($type_name = NULL)   X-Ref
Return a list of all content types.

param: $content_type_name

content_fields($field_name = NULL, $content_type_name = NULL)   X-Ref
Return a list of all fields.

param: $field_name
param: $content_type_name

_content_field_types()   X-Ref
Return a list of field types.


_content_widget_types()   X-Ref
Return a list of widget types.


_content_get_formatter($formatter_name, $field_type)   X-Ref
Return the formatter description corresponding to a formatter name,
defaulting to 'default' if none is found.


_content_type_info($reset = FALSE)   X-Ref
Collate all information on content types, fields, and related structures.

param: $reset

content_node_type($op, $info)   X-Ref
Implementation of hook_node_type()
React to change in node types


content_clear_type_cache($rebuild_schema = FALSE)   X-Ref
Clear the cache of content_types; called in several places when content
information is changed.


content_database_info($field)   X-Ref
Retrieve the database storage location(s) for a field.

TODO: add a word about why it's not included in the global _content_type_info array.

param: $field
return:

content_storage_type($field)   X-Ref
Helper function for identifying the storage type for a field.


content_transpose_array_rows_cols($array)   X-Ref
Manipulate a 2D array to reverse rows and columns.

The default data storage for fields is delta first, column names second.
This is sometimes inconvenient for field modules, so this function can be
used to present the data in an alternate format.

param: $array
return:

content_array_flatten($array)   X-Ref
Helper function to flatten an array of allowed values.

param: $array
return:

content_allowed_values($field, $flatten = TRUE)   X-Ref
Create an array of the allowed values for this field.

Used by number and text fields, expects to find either
PHP code that will return the correct value, or a string
with keys and labels separated with '|' and with each
new value on its own line.

param: $field
param: $flatten

content_allowed_values_filter_html(&$options)   X-Ref
Filter out HTML from allowed values array while leaving entities unencoded.


content_filter_xss($string)   X-Ref
Like filter_xss_admin(), but with a shorter list of allowed tags.

Used for items entered by administrators, like field descriptions,
allowed values, where some (mainly inline) mark-up may be desired
(so check_plain() is not acceptable).

_content_filter_xss_allowed_tags()   X-Ref
List of tags allowed by content_filter_xss().


_content_filter_xss_display_allowed_tags()   X-Ref
Human-readable list of allowed tags, for display in help texts.


content_format($field, $item, $formatter_name = 'default', $node = NULL)   X-Ref
Format a field item for display.

Used to display a field's values outside the context of the $node, as
when fields are displayed in Views, or to display a field in a template
using a different formatter than the one set up on the Display Fields tab
for the node's context.

param: $field
param: $item
param: $formatter_name
param: $node
return:

content_build_modes($selector = NULL)   X-Ref
Registry of available node build modes.

param: $selector
return:

node_content_build_modes()   X-Ref
Implementations of hook_content_build_modes
on behalf of core modules.

return:

search_content_build_modes()   X-Ref
No description

book_content_build_modes()   X-Ref
No description

_content_tablename($name, $storage, $version = NULL)   X-Ref
Generate a table name for a field or a content type.

param: $name
param: $storage
return:

content_field_tablename($version = NULL)   X-Ref
Generate table name for the content field table.

Needed because the table name changes depending on version.
Using 'content_node_field' instead of 'content_field'
to avoid conflicts with field tables that will be prefixed
with 'content_field'.

content_instance_tablename($version = NULL)   X-Ref
Generate table name for the content field instance table.

Needed because the table name changes depending on version.

content_cache_tablename()   X-Ref
Generate table name for the content cache table.

Needed because the table name changes depending on version. Because of
a new database column, the content_cache table will be unusable until
update 6000 runs, so the cache table will be used instead.

content_table_schema($field = NULL)   X-Ref
A basic schema used by all field and type tables.

This will only add the columns relevant for the specified field.
Leave $field['columns'] empty to get only the base schema,
otherwise the function will return the whole thing.

content_db_index_exists($table, $name)   X-Ref
Checks if an index exists.

param: $table
param: $name
return:

content_callback($entity, $op, $field)   X-Ref
Helper function for determining the behavior of a field or a widget
with respect to a given operation. (currently used for field 'view',
and widget 'default values' and 'multiple values')

param: $entity
param: $op
param: $field
return:

content_handle($entity, $op, $object)   X-Ref
Helper function for determining the handling of a field, widget or
formatter with respect to a given operation.

Currently used for widgets and formatters 'multiple values'.

param: $entity
param: $op
param: $object
return:

content_default_value(&$form, &$form_state, $field, $delta)   X-Ref
Helper function to return the correct default value for a field.

param: $node
param: $field
param: $items
return:

content_access($op, $field, $account = NULL, $node = NULL)   X-Ref
Determine whether the user has access to a given field.

param: $op
param: $field
param: $account
param: $node
return:

content_field_wrapper_post_render($content, $element)   X-Ref
Hide specified fields from the $content variable in node templates.


theme_content_exclude($content, $object, $context)   X-Ref
'Theme' function for a field's addition to $content.

Adapts the all-inclusive $content variable in node templates to allow
some field content to be excluded. This is a theme function, so it can be
overridden in different themes to produce different results.

The html for individual fields and groups are available in the
$FIELD_NAME_rendered and $GROUP_NAME_rendered variables.

This allows more flexibility in node templates : you can use custom markup
around a few specific fields, and print the rest of the node with $content.

param: $content
param: $object
param: $context
return:

template_preprocess_content_field(&$variables)   X-Ref
Theme preprocess function for field.tpl.php.

The $variables array contains the following arguments:
- $node
- $field
- $items
- $teaser
- $page


content_preprocess_node(&$vars)   X-Ref
Theme preprocess function for node.

- Adds $FIELD_NAME_rendered variables
containing the themed output for the whole field.
- Adds the formatted values in the 'view' key of the items.

content_content_fieldapi($op, $field)   X-Ref
Debugging using hook_content_fieldapi.

param: $op
param: $field

content_content_extra_fields($type_name)   X-Ref
Implementation of hook_content_extra_fields.

Informations for non-CCK 'node fields' defined in core.

content_extra_field_weight($type_name, $pseudo_field_name)   X-Ref
Retrieve the user-defined weight for non-CCK node 'fields'.

CCK's 'Manage fields' page lets users reorder node fields, including non-CCK
items (body, taxonomy, other hook_nodeapi-added elements by contrib modules...).
Contrib modules that want to have their 'fields' supported need to expose
them with hook_content_extra_fields, and use this function to retrieve the
user-defined weight.

param: $type_name
param: $pseudo_field_name
return:

content_max_delta($field_name, $type_name = NULL)   X-Ref
Find max delta value actually in use for a field.

Helper function to do things like tell when we should prevent a
change in multiple value settings that would result in data loss,
or know if content actually exists for a field.

param: $field_name
param: $type_name
return:

content_inactive_fields($type_name = NULL)   X-Ref
Helper function to identify inactive fields.


content_inactive_instances($type_name = NULL)   X-Ref
Helper function to identify inactive instances.
This will be the same results as content_inactive_fields(),
EXCEPT that his function will return inactive instances even
if the fields have other (shared) instances that are still active.




Generated: Mon Jul 9 18:01:44 2012 Cross-referenced by PHPXref 0.7