You are here

function library_add_more_add_one in Library 7

Submit handler to add another instance of a library item to a node form.

This handler is used when javascript is not available. It makes changes to the form state and the entire form is rebuilt during the page reload.

Parameters

array $form: Regular form array.

array $form_state: Regular form_state array being modified.

1 string reference to 'library_add_more_add_one'
library_form_alter in ./library.module
Implements hook_form_alter().

File

./library.module, line 268

Code

function library_add_more_add_one($form, &$form_state) {
  if (!isset($form_state['library_item_count'])) {
    $form_state['library_item_count'] = count($form_state['values']['library_items']);
  }
  $form_state['library_item_count']++;
  $form_state['rebuild'] = TRUE;
}