You are here

function datex_admin_form_submit in Datex 7.2

Form submit for datex admin form.

This admin form could be implemented better.

1 string reference to 'datex_admin_form_submit'
datex_admin_form in ./datex.admin.inc
Provides administration form for datex module (menu callback).

File

./datex.admin.inc, line 228

Code

function datex_admin_form_submit($form, &$form_state) {
  $v = $form_state['values'];
  if ($v['datex_register_names'] == 1) {
    datex_get_all_dummy_names();
    drupal_set_message('All names registered with t()');
  }
  $cfg = array(
    'useintl',
    'mode',
    'node_fmt',
    'comment_fmt',
  );
  foreach ($cfg as $name) {
    _datex_set_cfg($name, $v[$name]);
  }
  $schema = variable_get('datex_schema');
  if (!empty($v['datex_new_schema_machine_name'])) {
    $machine = $v['datex_new_schema_machine_name'];
    foreach (language_list() as $language) {
      $code = $language->language;
      if ($v['new_datex_' . $code] != '0') {
        $schema[$machine][$code] = $v['new_datex_' . $code . '_calendar'];
      }
    }
  }
  foreach ($v['datex_table'] as $select) {
    if ($select !== 'default' && isset($schema[$select])) {
      unset($schema[$select]);
    }
  }
  variable_set('datex_schema', $schema);
}