You are here

function _datex_schema_edit_form_submit in Datex 7.3

Form submit callback for: datex_schema_edit_form().

1 string reference to '_datex_schema_edit_form_submit'
datex_schema_edit_form in ./datex.admin.inc
Menu callback, Admin form for editing datex schema.

File

./datex.admin.inc, line 224
Datex administration forms.

Code

function _datex_schema_edit_form_submit($form, $form_state) {
  $v = $form_state['values'];
  $name = $v['name'];
  $schema = variable_get('datex_schema');
  foreach (language_list() as $lang) {
    $code = $lang->language;
    if ($v['datex_' . $code] === '') {
      if (isset($schema[$name][$code])) {
        unset($schema[$name][$code]);
      }
    }
    else {
      $schema[$name][$code] = $v['datex_' . $code];
    }
  }
  variable_set('datex_schema', $schema);
  $message = t('New configuration for @schema schema saved.', [
    '@schema' => $name,
  ]);
  drupal_set_message($message);
  drupal_goto('admin/config/regional/date-time/datex');
}