You are here

function readonlymode_block_form in Read only mode 7

After build callback to block the form.

See also

readonlymode_form_alter()

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

File

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

Code

function readonlymode_block_form($form) {

  // Remove all elements of the form.
  foreach (element_children($form) as $key) {
    if (!in_array($key, array(
      'form_id',
      'form_token',
      'form_build_id',
    ))) {
      unset($form[$key]);
    }
  }
  $form['readonly_notice'] = array(
    '#markup' => _readonlymode_notice(),
    '#prefix' => '<div class="messages warning">',
    '#suffix' => '</div>',
  );
  return $form;
}