You are here

function text_elements in Content Construction Kit (CCK) 6

Same name in this branch
  1. 6 examples/example_field.php \text_elements()
  2. 6 modules/text/text.module \text_elements()
Same name and namespace in other branches
  1. 6.3 modules/text/text.module \text_elements()
  2. 6.2 modules/text/text.module \text_elements()

Implementation of FAPI hook_elements().

Any FAPI callbacks needed for individual widgets can be declared here, and the element will be passed to those callbacks for processing.

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

Autocomplete_path is not used by text_widget but other widgets can use it (see nodereference and userreference).

File

examples/example_field.php, line 505
These hooks are defined by field modules, modules that define a new kind of field for insertion in a content type.

Code

function text_elements() {
  return array(
    'text_textfield' => array(
      '#input' => TRUE,
      '#columns' => array(
        'value',
      ),
      '#delta' => 0,
      '#process' => array(
        'text_textfield_process',
      ),
      '#autocomplete_path' => FALSE,
    ),
    'text_textarea' => array(
      '#input' => TRUE,
      '#columns' => array(
        'value',
        'format',
      ),
      '#delta' => 0,
      '#process' => array(
        'text_textarea_process',
      ),
      '#filter_value' => FILTER_FORMAT_DEFAULT,
    ),
  );
}