You are here

function formdefaults_enable_submit in Form Defaults 6

Same name and namespace in other branches
  1. 5.3 formdefaults.module \formdefaults_enable_submit()
  2. 5 formdefaults.module \formdefaults_enable_submit()
  3. 5.2 formdefaults.module \formdefaults_enable_submit()
  4. 6.2 formdefaults.module \formdefaults_enable_submit()
  5. 7 formdefaults.module \formdefaults_enable_submit()

Toggle the form editor controls on and off

File

./formdefaults.module, line 401

Code

function formdefaults_enable_submit($formid, $form_state) {
  $editor_enabled = $_SESSION['formdefaults_enabled'];
  if ($editor_enabled) {
    $_SESSION['formdefaults_enabled'] = false;
    drupal_set_message('Form defaults editor is now disabled');
  }
  else {
    $_SESSION['formdefaults_enabled'] = true;
    drupal_set_message('Form defaults editor is now enabled');
  }
  return $output;
}