You are here

function pagepreview_form_alter in Page Preview 7

Same name and namespace in other branches
  1. 6 pagepreview.module \pagepreview_form_alter()

Implements hook_form_alter().

Replaces the default submit callback for the "Preview" button.

File

./pagepreview.module, line 28
An alternative node previewing system for the node add/edit form.

Code

function pagepreview_form_alter(&$form, &$form_state, $form_id) {
  if (!empty($form['#node_edit_form'])) {
    drupal_add_css(drupal_get_path('module', 'pagepreview') . '/pagepreview.css');
    if ($form['actions']['preview']) {
      $form['actions']['preview']['#submit'] = array(
        'pagepreview_node_form_build_preview',
      );
    }
  }
}