atrblacklist_form_process_atrblacklist_keywords

Versions
6.1
atrblacklist_form_process_atrblacklist_keywords($element, $form_state)

Form process handler for atrblacklist_keywords elements.

Code

atr/modules/atrblacklist/atrblacklist.module, line 127

<?php
function atrblacklist_form_process_atrblacklist_keywords($element, $form_state) {
  $i = -1;
  if (count($element['#default_value'])) {
    foreach ($element['#default_value'] as $i => $keyword) {
      $element['blacklist_keyword_' . $i] = array(
        '#type' => 'textfield',
        '#default_value' => $keyword->keyword,
      );
      $element['blacklist_comment_' . $i] = array(
        '#type' => 'textarea',
        '#default_value' => $keyword->comment,
        '#rows' => 1,
      );
    }
  }
  foreach (range($i + 1, $i + 3) as $j) {
    $element['blacklist_keyword_' . $j] = array(
      '#type' => 'textfield',
    );
    $element['blacklist_comment_' . $j] = array(
      '#type' => 'textarea',
      '#rows' => 1,
    );
  }
  $element['#tree'] = TRUE;

  return $element;
}
?>