[ Index ]
 

Code source de Drupal 5.3

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/includes/ -> form.inc (sommaire)

(pas de description)

Poids: 1601 lignes (55 kb)
Inclus ou requis: 5 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 54 fonctions

  drupal_get_form()
  _drupal_clean_form_sessions()
  drupal_execute()
  drupal_retrieve_form()
  drupal_process_form()
  drupal_prepare_form()
  drupal_validate_form()
  drupal_submit_form()
  drupal_render_form()
  drupal_redirect_form()
  _form_validate()
  form_set_error()
  form_get_errors()
  form_get_error()
  form_error()
  form_builder()
  form_set_value()
  _form_set_value()
  _element_info()
  form_options_flatten()
  theme_select()
  form_select_options()
  form_get_options()
  theme_fieldset()
  theme_radio()
  theme_radios()
  theme_password_confirm()
  expand_password_confirm()
  password_confirm_validate()
  theme_date()
  expand_date()
  date_validate()
  map_month()
  checkboxes_value()
  weight_value()
  expand_radios()
  theme_item()
  theme_checkbox()
  theme_checkboxes()
  expand_checkboxes()
  theme_submit()
  theme_button()
  theme_hidden()
  theme_token()
  theme_textfield()
  theme_form()
  theme_textarea()
  theme_markup()
  theme_password()
  process_weight()
  theme_file()
  theme_form_element()
  _form_set_class()
  form_clean_id()

Fonctions
Fonctions qui ne font pas partie d'une Classe:

drupal_get_form($form_id)   X-Ref
Retrieves a form from a builder function, passes it on for
processing, and renders the form or redirects to its destination
as appropriate. In multi-step form scenarios, it handles properly
processing the values using the previous step's form definition,
then rendering the requested step for display.

param: $form_id
param: ...
return:

_drupal_clean_form_sessions()   X-Ref
Remove form information that's at least a day old from the
$_SESSION['form'] array.


drupal_execute($form_id, $form_values)   X-Ref
Retrieves a form using a form_id, populates it with $form_values,
processes it, and returns any validation errors encountered. This
function is the programmatic counterpart to drupal_get_form().

param: $form_id
param: $form_values
param: ...
return:

drupal_retrieve_form($form_id)   X-Ref
Retrieves the structured array that defines a given form.

param: $form_id
param: ...

drupal_process_form($form_id, &$form)   X-Ref
This function is the heart of form API. The form gets built, validated and in
appropriate cases, submitted.

param: $form_id
param: $form
return:

drupal_prepare_form($form_id, &$form)   X-Ref
Prepares a structured form array by adding required elements,
executing any hook_form_alter functions, and optionally inserting
a validation token to prevent tampering.

param: $form_id
param: $form

drupal_validate_form($form_id, $form)   X-Ref
Validates user-submitted form data from a global variable using
the validate functions defined in a structured form array.

param: $form_id
param: $form

drupal_submit_form($form_id, $form)   X-Ref
Processes user-submitted form data from a global variable using
the submit functions defined in a structured form array.

param: $form_id
param: $form
return:

drupal_render_form($form_id, &$form)   X-Ref
Renders a structured form array into themed HTML.

param: $form_id
param: $form
return:

drupal_redirect_form($form, $redirect = NULL)   X-Ref
Redirect the user to a URL after a form has been processed.

param: $form
param: $redirect

_form_validate($elements, $form_id = NULL)   X-Ref
Performs validation on form elements. First ensures required fields are
completed, #maxlength is not exceeded, and selected options were in the
list of options given to the user. Then calls user-defined validators.

param: $elements
param: $form_id

form_set_error($name = NULL, $message = '')   X-Ref
File an error against a form element. If the name of the element is
edit[foo][bar] then you may pass either foo or foo][bar as $name
foo will set an error for all its children.


form_get_errors()   X-Ref
Return an associative array of all errors.


form_get_error($element)   X-Ref
Return the error message filed against the form with the specified name.


form_error(&$element, $message = '')   X-Ref
Flag an element as having an error.


form_builder($form_id, $form)   X-Ref
Adds some required properties to each form element, which are used
internally in the form API. This function also automatically assigns
the value property from the $edit array, provided the element doesn't
already have an assigned value.

param: $form_id
param: $form

form_set_value($form, $value)   X-Ref
Use this function to make changes to form values in the form validate
phase, so they will be available in the submit phase in $form_values.

Specifically, if $form['#parents'] is array('foo', 'bar')
and $value is 'baz' then this function will make
$form_values['foo']['bar'] to be 'baz'.

param: $form
param: $value

_form_set_value(&$form_values, $form, $parents, $value)   X-Ref
Helper function for form_set_value().

We iterate over $parents and create nested arrays for them
in $form_values if needed. Then we insert the value into
the right array.

_element_info($type, $refresh = NULL)   X-Ref
Retrieve the default properties for the defined element type.


form_options_flatten($array, $reset = TRUE)   X-Ref
Pas de description

theme_select($element)   X-Ref
Format a dropdown menu or scrolling selection box.

param: $element
return:

form_select_options($element, $choices = NULL)   X-Ref
Pas de description

form_get_options($element, $key)   X-Ref
Traverses a select element's #option array looking for any values
that hold the given key. Returns an array of indexes that match.

This function is useful if you need to modify the options that are
already in a form element; for example, to remove choices which are
not valid because of additional filters imposed by another module.
One example might be altering the choices in a taxonomy selector.
To correctly handle the case of a multiple hierarchy taxonomy,
#options arrays can now hold an array of objects, instead of a
direct mapping of keys to labels, so that multiple choices in the
selector can have the same key (and label). This makes it difficult
to manipulate directly, which is why this helper function exists.

This function does not support optgroups (when the elements of the
#options array are themselves arrays), and will return FALSE if
arrays are found. The caller must either flatten/restore or
manually do their manipulations in this case, since returning the
index is not sufficient, and supporting this would make the
"helper" too complicated and cumbersome to be of any help.

As usual with functions that can return array() or FALSE, do not
forget to use === and !== if needed.

param: $element
param: $key
return:

theme_fieldset($element)   X-Ref
Format a group of form items.

param: $element
return:

theme_radio($element)   X-Ref
Format a radio button.

param: $element
return:

theme_radios($element)   X-Ref
Format a set of radio buttons.

param: $element
return:

theme_password_confirm($element)   X-Ref
Format a password_confirm item.

param: $element
return:

expand_password_confirm($element)   X-Ref
Pas de description

password_confirm_validate($form)   X-Ref
Validate password_confirm element.


theme_date($element)   X-Ref
Format a date selection element.

param: $element
return:

expand_date($element)   X-Ref
Roll out a single date element.


date_validate($form)   X-Ref
Validates the date type to stop dates like February 30, 2006.


map_month($month)   X-Ref
Helper function for usage with drupal_map_assoc to display month names.


checkboxes_value(&$form)   X-Ref
Helper function to load value from default value for checkboxes.


weight_value(&$form)   X-Ref
If no default value is set for weight select boxes, use 0.


expand_radios($element)   X-Ref
Roll out a single radios element to a list of radios,
using the options array as index.


theme_item($element)   X-Ref
Format a form item.

param: $element
return:

theme_checkbox($element)   X-Ref
Format a checkbox.

param: $element
return:

theme_checkboxes($element)   X-Ref
Format a set of checkboxes.

param: $element
return:

expand_checkboxes($element)   X-Ref
Pas de description

theme_submit($element)   X-Ref
Pas de description

theme_button($element)   X-Ref
Pas de description

theme_hidden($element)   X-Ref
Format a hidden form field.

param: $element
return:

theme_token($element)   X-Ref
Pas de description

theme_textfield($element)   X-Ref
Format a textfield.

param: $element
return:

theme_form($element)   X-Ref
Format a form.

param: $element
return:

theme_textarea($element)   X-Ref
Format a textarea.

param: $element
return:

theme_markup($element)   X-Ref
Format HTML markup for use in forms.

This is used in more advanced forms, such as theme selection and filter format.

param: $element
return:

theme_password($element)   X-Ref
Format a password field.

param: $element
return:

process_weight($element)   X-Ref
Expand weight elements into selects.


theme_file($element)   X-Ref
Format a file upload field.

param: $title
param: $name
param: $size
param: $description
param: $required
return:

theme_form_element($element, $value)   X-Ref
Return a themed form element.

param: element
param: $value
return:

_form_set_class(&$element, $class = array()   X-Ref
Sets a form element's class attribute.

Adds 'required' and 'error' classes as needed.

param: &$element
param: $name

form_clean_id($id = NULL)   X-Ref
Remove invalid characters from an HTML ID attribute string.

param: $id
return:



Généré le : Fri Nov 30 16:20:15 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics