You are here

function finder_text_finder_element in Finder 7

Same name and namespace in other branches
  1. 6 modules/finder_text/finder_text.module \finder_text_finder_element()

Implements hook_finder_element().

See also

hook_finder_element()

finder_text_finder_element_validate()

File

modules/finder_text/finder_text.module, line 105
The finder text module.

Code

function finder_text_finder_element($element, &$form_element) {
  if ($element->element == 'text') {
    $form_element['#type'] = 'textfield';
    $properties = array(
      'field_prefix',
      'field_suffix',
    );
    if ($element->settings['form']['rows']) {
      $form_element['#type'] = 'textarea';
      $properties[] = 'rows';
      $properties[] = 'cols';
      $element->settings['form']['cols'] = $element->settings['form']['size'];
    }
    else {
      $properties[] = 'maxlength';
      $properties[] = 'minlength';
      $properties[] = 'size';
    }
    foreach ($properties as $property) {
      if ($element->settings['form'][$property]) {
        $form_element['#' . $property] = $element->settings['form'][$property];
      }
    }
    $form_element['#element_validate'][] = 'finder_text_finder_element_validate';
  }
}