You are here

function patterns_export_form_alter in Patterns 7

Same name and namespace in other branches
  1. 7.2 patterns_export/api.inc \patterns_export_form_alter()

Implements of hook_form_alter()

Needed for deactivating actual submission of the forms when submitting, i.e. we only want to know what gets submitted without the submission getting processed

File

patterns_export/api.inc, line 66
Export the components configuration to a Pattern file.

Code

function patterns_export_form_alter(&$form, $form_state, $form_id) {

  // Add the record callback on submit and delete all others
  if ($form_id != 'macro_import_macro' && variable_get('macro_enabled', FALSE) && variable_get('patterns_extract_actions', FALSE)) {
    $form['#submit'] = array();
    $form['#submit'][] = 'macro_record_macro';
  }
}