You are here

function l10n_update_flag_history in Localization update 6

Same name and namespace in other branches
  1. 7 l10n_update.inc \l10n_update_flag_history()

Flag the file history as up to date.

Compare history data in the {l10n_update_file} table with translations available at translations server(s). Update the 'last_checked' timestamp of the files which are up to date.

Parameters

$available: Available translations as retreived from remote server.

1 call to l10n_update_flag_history()
l10n_update_admin_import_form_submit in ./l10n_update.admin.inc
Submit handler for Update form.

File

./l10n_update.inc, line 222

Code

function l10n_update_flag_history($available) {
  $time = time();
  if ($history = l10n_update_get_history()) {
    foreach ($history as $name => $project) {
      foreach ($project as $langcode => $current) {
        if (isset($available[$name][$langcode])) {
          $update = $available[$name][$langcode];

          // When the available update is equal to the current translation the current
          // is marked checked in the {l10n_update_file} table.
          if (_l10n_update_source_compare($current, $update) == 0 && $current->version == $update->version) {
            db_query("UPDATE {l10n_update_file} SET last_checked = %d WHERE project = '%s' AND language = '%s'", $time, $current->project, $current->language);
          }
        }
      }
    }
  }
}