You are here

function formdefaults_enable_submit in Form Defaults 7

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. 6 formdefaults.module \formdefaults_enable_submit()

Toggle the form editor controls on and off

File

./formdefaults.module, line 342

Code

function formdefaults_enable_submit($formid, $form_state) {
  $editor_enabled = @$_SESSION['formdefaults_enabled'];
  if ($editor_enabled) {
    $_SESSION['formdefaults_enabled'] = FALSE;
    drupal_set_message(t('Form defaults editor is now disabled'));
  }
  else {
    $_SESSION['formdefaults_enabled'] = TRUE;
    drupal_set_message(t('Form defaults editor is now enabled'));
  }
}