You are here

function hidden_language_form_submit in Hidden Language 7

Submit callback for the language_hierarchy_form form.

1 string reference to 'hidden_language_form_submit'
hidden_language_form_alter in ./hidden_language.module
Implements hook_form_alter().

File

./hidden_language.module, line 139

Code

function hidden_language_form_submit($form, &$form_state) {

  // Save information about hidden languages to DB.
  foreach ($form_state['values']['hidden'] as $langcode => $is_hidden) {
    $hidden = $is_hidden ? 1 : 0;

    // Update the language row in the db.
    db_update('languages')
      ->fields(array(
      'hidden' => $hidden,
    ))
      ->condition('language', $langcode, '=')
      ->execute();

    // Copy data to where locale submit function expects it.
    $form_state['values']['hidden'][$langcode] = $hidden;
  }
}