You are here

function lingotek_admin_content_defaults_form_submit in Lingotek Translation 7.3

1 string reference to 'lingotek_admin_content_defaults_form_submit'
lingotek_admin_content_defaults_form in ./lingotek.admin.inc
Content defaults Form

File

./lingotek.admin.inc, line 1051

Code

function lingotek_admin_content_defaults_form_submit($form, &$form_state) {
  if (module_exists('workbench_moderation')) {

    // set or unset multiple transition globals based on form selection
    variable_set('lingotek_sync_workbench_moderation', $form_state['input']['wb_options']);
    $states = lingotek_get_workbench_moderation_states();
    if (isset($form_state['values']['lingotek_sync']) && $form_state['values']['lingotek_sync'] == 1) {
      if (isset($form_state['input']['wb_options']) && $form_state['input']['wb_options'] == 'increment') {
        foreach ($states as $state) {
          if (isset($form_state['input']['lingotek_sync_wb_select_' . $state])) {
            variable_set('lingotek_sync_wb_select_' . $state, $form_state['input']['lingotek_sync_wb_select_' . $state]);
          }
        }
      }
    }
    else {
      foreach ($states as $state) {
        if (variable_get('lingotek_sync_wb_select_' . $state)) {
          variable_del('lingotek_sync_wb_select_' . $state);
        }
      }
    }
  }
  system_settings_form_submit($form, $form_state);
}