You are here

function readonlymode_check_form_validate in Read only mode 7

Same name and namespace in other branches
  1. 8 readonlymode.module \readonlymode_check_form_validate()
  2. 6 readonlymode.module \readonlymode_check_form_validate()

Validate handler for checking whether the form submission is occurring.

Sets an form error when read-only mode is enabled.

1 string reference to 'readonlymode_check_form_validate'
readonlymode_form_alter in ./readonlymode.module
Implements hook_form_alter().

File

./readonlymode.module, line 356
The Read Ony Mode main module file.

Code

function readonlymode_check_form_validate($form, &$form_state) {

  // Check for read-only mode, whether we are allowed this form,
  if (_readonlymode_form_check($form['form_id']['#value']) != READONLYMODE_FORM_ALLOWED) {
    form_set_error('', _readonlymode_notice_form_not_saved());
  }
}