<?php
// $Id$

/**
 * DO NOT EDIT THIS FILE.  It contains autoloading functions generated
 * automatically by generate-autoload.pl.  The function names,
 * arguments, and PHPdoc are copied from the file that defines the
 * underlying function. To edit them, edit the underlying file instead.
 */

/**
 * @ingroup field_attach
 * @{
 */

/**
 * Add form elements for all fields for an object to a form structure.
 *
 * @param $obj_type
 *   The type of $object; e.g. 'node' or 'user'.
 * @param $object
 *   The object for which to load form elements, used to initialize
 *   default form values.
 * @param $form
 *   The form structure to fill in.
 * @param $form_state
 *   An associative array containing the current state of the form.
 *
 * TODO : document the resulting $form structure, like we do for
 * field_attach_view().
 *
 * This function is an autoloader for _field_attach_form() in modules/field/field.attach.inc.
 */
function field_attach_form($obj_type, $object, &$form, $form_state) {
  require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
  return _field_attach_form($obj_type, $object, $form, $form_state);
}

/**
 * Load all fields for the most current version of each of a set of
 * objects of a single object type.
 *
 * @param $obj_type
 *   The type of $object; e.g. 'node' or 'user'.
 * @param $objects
 *   An array of objects for which to load fields, keyed by object id.
 *   Each object needs to have its 'bundle key', 'id key' and (if applicable)
 *   'revision key' filled.
 * @param $age
 *   FIELD_LOAD_CURRENT to load the most recent revision for all
 *   fields, or FIELD_LOAD_REVISION to load the version indicated by
 *   each object. Defaults to FIELD_LOAD_CURRENT; use
 *   field_attach_load_revision() instead of passing FIELD_LOAD_REVISION.
 * @returns
 *   Loaded field values are added to $objects. Fields with no values should be
 *   set as an empty array.
 *
 * This function is an autoloader for _field_attach_load() in modules/field/field.attach.inc.
 */
function field_attach_load($obj_type, $objects, $age = FIELD_LOAD_CURRENT) {
  require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
  return _field_attach_load($obj_type, $objects, $age);
}

/**
 * Load all fields for a previous version of each of a set of
 * objects of a single object type.
 *
 * Loading different versions of the same objects is not supported,
 * and should be done by separate calls to the function.
 *
 * @param $obj_type
 *   The type of $object; e.g. 'node' or 'user'.
 * @param $objects
 *   An array of objects for which to load fields, keyed by object id.
 *   Each object needs to have its 'bundle key', 'id key' and 'revision key'
 *   filled.
 * @returns
 *   On return, the objects in $objects are modified by having the
 *   appropriate set of fields added.
 *
 * This function is an autoloader for _field_attach_load_revision() in modules/field/field.attach.inc.
 */
function field_attach_load_revision($obj_type, $objects) {
  require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
  return _field_attach_load_revision($obj_type, $objects);
}

/**
 * Perform field validation against the field data in an object.
 *
 * This function does not perform field widget validation on form
 * submissions. It is intended to be called during API save
 * operations. Use field_attach_form_validate() to validate form
 * submissions.
 *
 * @param $obj_type
 *   The type of $object; e.g. 'node' or 'user'.
 * @param $object
 *   The object with fields to validate.
 * @return
 *   Throws a FieldValidationException if validation errors are found.
 *
 * This function is an autoloader for _field_attach_validate() in modules/field/field.attach.inc.
 */
function field_attach_validate($obj_type, &$object) {
  require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
  return _field_attach_validate($obj_type, $object);
}

/**
 * Perform field validation against form-submitted field values.
 *
 * There are two levels of validation for fields in forms: widget
 * validation, and field validation.
 * - Widget validation steps are specific to a given widget's own form
 * structure and UI metaphors. They are executed through FAPI's
 * #element_validate property during normal form validation.
 * - Field validation steps are common to a given field type, independently of
 * the specific widget being used in a given form. They are defined in the
 * field type's implementation of hook_field_validate().
 *
 * This function performs field validation in the context of a form
 * submission. It converts field validation errors into form errors
 * on the correct form elements. Fieldable object types should call
 * this function during their own form validation function.
 *
 * @param $obj_type
 *   The type of $object; e.g. 'node' or 'user'.
 * @param $object
 *   The object being submitted. The 'bundle key', 'id key' and (if applicable)
 *   'revision key' should be present. The actual field values will be read
 *   from $form_state['values'].
 * @param $form
 *   The form structure.
 * @param $form_state
 *   An associative array containing the current state of the form.
 *
 * This function is an autoloader for _field_attach_form_validate() in modules/field/field.attach.inc.
 */
function field_attach_form_validate($obj_type, &$object, $form, &$form_state) {
  require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
  return _field_attach_form_validate($obj_type, $object, $form, $form_state);
}

/**
 * Perform necessary operations on field data submitted by a form.
 *
 * Currently, this accounts for drag-and-drop reordering of
 * field values, and filtering of empty values.
 *
 * @param $obj_type
 *   The type of $object; e.g. 'node' or 'user'.
 * @param $object
 *   The object being submitted. The 'bundle key', 'id key' and (if applicable)
 *   'revision key' should be present. The actual field values will be read
 *   from $form_state['values'].
 * @param $form
 *   The form structure to fill in.
 * @param $form_state
 *   An associative array containing the current state of the form.
 *
 * This function is an autoloader for _field_attach_submit() in modules/field/field.attach.inc.
 */
function field_attach_submit($obj_type, &$object, $form, &$form_state) {
  require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
  return _field_attach_submit($obj_type, $object, $form, $form_state);
}

/**
 * Perform necessary operations just before fields data get saved.
 *
 * We take no specific action here, we just give other
 * modules the opportunity to act.
 *
 * @param $obj_type
 *   The type of $object; e.g. 'node' or 'user'.
 * @param $object
 *   The object with fields to process.
 *
 * This function is an autoloader for _field_attach_presave() in modules/field/field.attach.inc.
 */
function field_attach_presave($obj_type, &$object) {
  require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
  return _field_attach_presave($obj_type, $object);
}

/**
 * Save field data for a new object.
 *
 * The passed in object must already contain its id and (if applicable)
 * revision id attributes.
 * Default values (if any) will be inserted for fields not present in the
 * $object.
 *
 * @param $obj_type
 *   The type of $object; e.g. 'node' or 'user'.
 * @param $object
 *   The object with fields to save.
 * @return
 *   Default values (if any) will be added to the $object parameter for fields
 *   it leaves unspecified.
 *
 * This function is an autoloader for _field_attach_insert() in modules/field/field.attach.inc.
 */
function field_attach_insert($obj_type, &$object) {
  require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
  return _field_attach_insert($obj_type, $object);
}

/**
 * Save field data for an existing object.
 *
 * @param $obj_type
 *   The type of $object; e.g. 'node' or 'user'.
 * @param $object
 *   The object with fields to save.
 *
 * This function is an autoloader for _field_attach_update() in modules/field/field.attach.inc.
 */
function field_attach_update($obj_type, &$object) {
  require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
  return _field_attach_update($obj_type, $object);
}

/**
 * Delete field data for an existing object. This deletes all
 * revisions of field data for the object.
 *
 * @param $obj_type
 *   The type of $object; e.g. 'node' or 'user'.
 * @param $object
 *   The object whose field data to delete.
 *
 * This function is an autoloader for _field_attach_delete() in modules/field/field.attach.inc.
 */
function field_attach_delete($obj_type, &$object) {
  require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
  return _field_attach_delete($obj_type, $object);
}

/**
 * Delete field data for a single revision of an existing object. The
 * passed object must have a revision id attribute.
 *
 * @param $obj_type
 *   The type of $object; e.g. 'node' or 'user'.
 * @param $object
 *   The object with fields to save.
 *
 * This function is an autoloader for _field_attach_delete_revision() in modules/field/field.attach.inc.
 */
function field_attach_delete_revision($obj_type, &$object) {
  require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
  return _field_attach_delete_revision($obj_type, $object);
}

/**
 * Generate and return a structured content array tree suitable for
 * drupal_render() for all of the fields on an object. The format of
 * each field's rendered content depends on the display formatter and
 * its settings.
 *
 * @param $obj_type
 *   The type of $object; e.g. 'node' or 'user'.
 * @param $object
 *   The object with fields to render.
 * @param $teaser
 *   Whether to display the teaser only, as on the main page.
 * @return
 *   A structured content array tree for drupal_render().
 *
 * This function is an autoloader for _field_attach_view() in modules/field/field.attach.inc.
 */
function field_attach_view($obj_type, &$object, $teaser = FALSE) {
  require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
  return _field_attach_view($obj_type, $object, $teaser);
}

/**
 * To be called in entity preprocessor.
 *
 * - Adds $FIELD_NAME_rendered variables
 *   containing the themed output for the whole field.
 * - Adds the formatted values in the 'view' key of the items.
 *
 * This function is an autoloader for _field_attach_preprocess() in modules/field/field.attach.inc.
 */
function field_attach_preprocess($obj_type, &$object) {
  require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
  return _field_attach_preprocess($obj_type, $object);
}

/**
 * Implement hook_node_prepare_translation.
 *
 * TODO D7: We do not yet know if this really belongs in Field API.
 *
 * This function is an autoloader for _field_attach_prepare_translation() in modules/field/field.attach.inc.
 */
function field_attach_prepare_translation($node) {
  require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
  return _field_attach_prepare_translation($node);
}

/**
 * Notify field.module that a new bundle was created.
 *
 * The default SQL-based storage doesn't need to do anytrhing about it, but
 * others might.
 *
 * @param $bundle
 *   The name of the newly created bundle.
 *
 * This function is an autoloader for _field_attach_create_bundle() in modules/field/field.attach.inc.
 */
function field_attach_create_bundle($bundle) {
  require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
  return _field_attach_create_bundle($bundle);
}

/**
 * Notify field.module that a bundle was renamed.
 *
 * @param $bundle_old
 *   The previous name of the bundle.
 * @param $bundle_new
 *   The new name of the bundle.
 *
 * This function is an autoloader for _field_attach_rename_bundle() in modules/field/field.attach.inc.
 */
function field_attach_rename_bundle($bundle_old, $bundle_new) {
  require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
  return _field_attach_rename_bundle($bundle_old, $bundle_new);
}

/**
 * Notify field.module the a bundle was deleted.
 *
 * This deletes the data for the field instances as well as the field instances
 * themselves. This function actually just marks the data and field instances
 * and deleted, leaving the garbage collection for a separate process, because
 * it is not always possible to delete this much data in a single page request
 * (particularly since for some field types, the deletion is more than just a
 * simple DELETE query).
 *
 * @param $bundle
 *   The bundle to delete.
 *
 * This function is an autoloader for _field_attach_delete_bundle() in modules/field/field.attach.inc.
 */
function field_attach_delete_bundle($bundle) {
  require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
  return _field_attach_delete_bundle($bundle);
}

/**
 * Helper function to extract id, vid, and bundle name from an object.
 *
 * @param $obj_type
 *   The type of $object; e.g. 'node' or 'user'.
 * @param $object
 *   The object from which to extract values.
 * @return
 *   A numerically indexed array (not a hash table) containing these
 *   elements:
 *
 *   0: primary id of the object
 *   1: revision id of the object, or NULL if $obj_type is not versioned
 *   2: bundle name of the object
 *   3: whether $obj_type's fields should be cached (TRUE/FALSE)
 *
 * This function is an autoloader for _field_attach_extract_ids() in modules/field/field.attach.inc.
 */
function field_attach_extract_ids($object_type, $object) {
  require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
  return _field_attach_extract_ids($object_type, $object);
}

/**
 * @} End of "field_attach"
 */

/**
 * @ingroup field_info
 * @{
 */

/**
 *  Helper function for determining the behavior of a field
 *  with respect to a given operation.
 *
 *  @param $op
 *    The name of the operation.
 *    Currently supported : none
 *    // TODO D7: no use cases (yet ?) - do we want to keep that function ?.
 *  @param $field
 *    The field array.
 *  @return
 *    FIELD_BEHAVIOR_NONE    - do nothing for this operation.
 *    FIELD_BEHAVIOR_CUSTOM  - use the field's callback function.
 *    FIELD_BEHAVIOR_DEFAULT - use field.module default behavior.
 *
 * This function is an autoloader for _field_behaviors_field() in modules/field/field.info.inc.
 */
function field_behaviors_field($op, $field) {
  require_once DRUPAL_ROOT . '/modules/field/field.info.inc';
  return _field_behaviors_field($op, $field);
}

/**
 *  Helper function for determining the behavior of a widget
 *  with respect to a given operation.
 *
 *  @param $op
 *    The name of the operation.
 *    Currently supported: 'default value', 'multiple values'.
 *  @param $instance
 *    The field instance array.
 *  @return
 *    FIELD_BEHAVIOR_NONE    - do nothing for this operation.
 *    FIELD_BEHAVIOR_CUSTOM  - use the widget's callback function.
 *    FIELD_BEHAVIOR_DEFAULT - use field.module default behavior.
 *
 * This function is an autoloader for _field_behaviors_widget() in modules/field/field.info.inc.
 */
function field_behaviors_widget($op, $instance) {
  require_once DRUPAL_ROOT . '/modules/field/field.info.inc';
  return _field_behaviors_widget($op, $instance);
}

/**
 *  Helper function for determining the behavior of a formatter
 *  with respect to a given operation.
 *
 *  @param $op
 *    The name of the operation.
 *    Currently supported: 'multiple values'
 *  @param $display
 *    The $instance['display'][$build_mode] array.
 *  @return
 *    FIELD_BEHAVIOR_NONE    - do nothing for this operation.
 *    FIELD_BEHAVIOR_CUSTOM  - use the formatter's callback function.
 *    FIELD_BEHAVIOR_DEFAULT - use field module default behavior.
 *
 * This function is an autoloader for _field_behaviors_formatter() in modules/field/field.info.inc.
 */
function field_behaviors_formatter($op, $display) {
  require_once DRUPAL_ROOT . '/modules/field/field.info.inc';
  return _field_behaviors_formatter($op, $display);
}

/**
 * Return hook_field_info() data.
 *
 * @param $field_type
 *   (optional) A field type name. If ommitted, all field types will be
 *   returned.
 * @return
 *   Either a field type description, as provided by hook_field_info(), or an
 *   array of all existing field types, keyed by field type name.
 *
 * This function is an autoloader for _field_info_field_types() in modules/field/field.info.inc.
 */
function field_info_field_types($field_type = NULL) {
  require_once DRUPAL_ROOT . '/modules/field/field.info.inc';
  return _field_info_field_types($field_type);
}

/**
 * Return hook_field_widget_info() data.
 *
 * @param $widget_type
 *   (optional) A widget type name. If ommitted, all widget types will be
 *   returned.
 * @return
 *   Either a widget type description, as provided by
 *   hook_field_widget_info(), or an array of all existing widget
 *   types, keyed by widget type name.
 *
 * This function is an autoloader for _field_info_widget_types() in modules/field/field.info.inc.
 */
function field_info_widget_types($widget_type = NULL) {
  require_once DRUPAL_ROOT . '/modules/field/field.info.inc';
  return _field_info_widget_types($widget_type);
}

/**
 * Return hook_field_formatter_info() data.
 *
 * @param $formatter_type
 *   (optional) A formatter type name. If ommitted, all formatter types will be
 *   returned.
 * @return
 *   Either a formatter type description, as provided by hook_field_formatter_info(),
 *   or an array of all existing widget types, keyed by widget type name.
 *
 * This function is an autoloader for _field_info_formatter_types() in modules/field/field.info.inc.
 */
function field_info_formatter_types($formatter_type = NULL) {
  require_once DRUPAL_ROOT . '/modules/field/field.info.inc';
  return _field_info_formatter_types($formatter_type);
}

/**
 * Return hook_fieldable_info() data.
 *
 * @param $obj_type
 *   (optional) A fieldable type name. If ommitted, all fieldable types will be
 *   returned.
 * @return
 *   Either a fieldable type description, as provided by hook_fieldable_info(),
 *   or an array of all existing fieldable types, keyed by fieldable type name.
 *
 * This function is an autoloader for _field_info_fieldable_types() in modules/field/field.info.inc.
 */
function field_info_fieldable_types($obj_type = NULL) {
  require_once DRUPAL_ROOT . '/modules/field/field.info.inc';
  return _field_info_fieldable_types($obj_type);
}

/**
 * Return an array of fieldable bundle names and labels, for an individual
 * object type or for all object types.
 *
 * This function is an autoloader for _field_info_bundles() in modules/field/field.info.inc.
 */
function field_info_bundles($obj_type = NULL) {
  require_once DRUPAL_ROOT . '/modules/field/field.info.inc';
  return _field_info_bundles($obj_type);
}

/**
 * Identity the type of entity that created a bundle.
 * // TODO : might not be needed depending on how we solve
 * // the 'namespace bundle names' issue
 *
 * This function is an autoloader for _field_info_bundle_entity() in modules/field/field.info.inc.
 */
function field_info_bundle_entity($bundle) {
  require_once DRUPAL_ROOT . '/modules/field/field.info.inc';
  return _field_info_bundle_entity($bundle);
}

/**
 * Return array of all field data, keyed by field name.
 *
 * @return
 *   An array of Field objects. Each Field object has an additional
 *   property, bundles, which is an array of all the bundles to which
 *   this field belongs.
 *
 * This function is an autoloader for _field_info_fields() in modules/field/field.info.inc.
 */
function field_info_fields() {
  require_once DRUPAL_ROOT . '/modules/field/field.info.inc';
  return _field_info_fields();
}

/**
 * Return data about an individual field.
 *
 * @param $field_name
 *   The name of the field to retrieve.
 * @return
 *   The named field object, or NULL. The Field object has an additional
 *   property, bundles, which is an array of all the bundles to which
 *   this field belongs.
 *
 * This function is an autoloader for _field_info_field() in modules/field/field.info.inc.
 */
function field_info_field($field_name) {
  require_once DRUPAL_ROOT . '/modules/field/field.info.inc';
  return _field_info_field($field_name);
}

/**
 * Return an array of instance data for a given bundle,
 * or for all known bundles, keyed by bundle name and field name.
 *
 * @param $bundle_name
 *   If set, return information on just this bundle.
 *
 * This function is an autoloader for _field_info_instances() in modules/field/field.info.inc.
 */
function field_info_instances($bundle_name = NULL) {
  require_once DRUPAL_ROOT . '/modules/field/field.info.inc';
  return _field_info_instances($bundle_name);
}

/**
 * Return an array of instance data for a specific field and bundle.
 *
 * This function is an autoloader for _field_info_instance() in modules/field/field.info.inc.
 */
function field_info_instance($field_name, $bundle_name) {
  require_once DRUPAL_ROOT . '/modules/field/field.info.inc';
  return _field_info_instance($field_name, $bundle_name);
}

/**
 * Return a field type's default settings.
 *
 * @param $type
 *   A field type name.
 * @return
 *   The field type's default settings, as provided by hook_field_info(), or an
 *   empty array.
 *
 * This function is an autoloader for _field_info_field_settings() in modules/field/field.info.inc.
 */
function field_info_field_settings($type) {
  require_once DRUPAL_ROOT . '/modules/field/field.info.inc';
  return _field_info_field_settings($type);
}

/**
 * Return a field type's default instance settings.
 *
 * @param $type
 *   A field type name.
 * @return
 *   The field type's default instance settings, as provided by
 *   hook_field_info(), or an empty array.
 *
 * This function is an autoloader for _field_info_instance_settings() in modules/field/field.info.inc.
 */
function field_info_instance_settings($type) {
  require_once DRUPAL_ROOT . '/modules/field/field.info.inc';
  return _field_info_instance_settings($type);
}

/**
 * Return a field widget's default settings.
 *
 * @param $type
 *   A widget type name.
 * @return
 *   The field type's default settings, as provided by hook_field_info(), or an
 *   empty array.
 *
 * This function is an autoloader for _field_info_widget_settings() in modules/field/field.info.inc.
 */
function field_info_widget_settings($type) {
  require_once DRUPAL_ROOT . '/modules/field/field.info.inc';
  return _field_info_widget_settings($type);
}

/**
 * Return a field formatter's default settings.
 *
 * @param $type
 *   A field formatter type name.
 * @return
 *   The field formatter's default settings, as provided by
 *   hook_field_info(), or an empty array.
 *
 * This function is an autoloader for _field_info_formatter_settings() in modules/field/field.info.inc.
 */
function field_info_formatter_settings($type) {
  require_once DRUPAL_ROOT . '/modules/field/field.info.inc';
  return _field_info_formatter_settings($type);
}

/**
 * @} End of "field_info"
 */