You are here

function l10n_update_get_file_history in Localization update 7.2

Gets current translation status from the {l10n_update_file} table.

Return value

array Array of translation file objects.

4 calls to l10n_update_get_file_history()
L10nUpdateCronTest::testUpdateCron in tests/L10nUpdateCronTest.test
Tests interface translation update using cron.
L10nUpdateTest::testUpdateImportSourceLocal in tests/L10nUpdateTest.test
Tests translation import from local sources.
L10nUpdateTest::testUpdateImportSourceRemote in tests/L10nUpdateTest.test
Tests translation import from remote sources.
l10n_update_source_build in ./l10n_update.translation.inc
Builds abstract translation source.
4 string references to 'l10n_update_get_file_history'
L10nUpdateCronTest::testUpdateCron in tests/L10nUpdateCronTest.test
Tests interface translation update using cron.
L10nUpdateTest::testUpdateImportSourceLocal in tests/L10nUpdateTest.test
Tests translation import from local sources.
L10nUpdateTest::testUpdateImportSourceRemote in tests/L10nUpdateTest.test
Tests translation import from remote sources.
l10n_update_update_file_history in ./l10n_update.module
Updates the {locale_file} table.

File

./l10n_update.module, line 581
Download translations from remote localization server.

Code

function l10n_update_get_file_history() {
  $history =& drupal_static(__FUNCTION__, array());
  if (empty($history)) {

    // Get file history from the database.
    $result = db_query('SELECT project, language, filename, version, uri, timestamp, last_checked FROM {l10n_update_file}');
    foreach ($result as $file) {
      $file->langcode = $file->language;
      $file->type = $file->timestamp ? L10N_UPDATE_CURRENT : '';
      $history[$file->project][$file->langcode] = $file;
    }
  }
  return $history;
}