You are here

function l10n_update_get_projects in Localization update 6

Same name and namespace in other branches
  1. 7.2 l10n_update.translation.inc \l10n_update_get_projects()
  2. 7 l10n_update.module \l10n_update_get_projects()

Get stored list of projects

Parameters

boolean $refresh: TRUE = refresh the project data.

boolean $disabled: TRUE = get enabled AND disabled projects. FALSE = get enabled projects only.

Return value

array Array of project objects keyed by project name.

11 calls to l10n_update_get_projects()
drush_l10n_update_status in ./l10n_update.drush.inc
Callback for command l10n-update-status.
l10n_update_admin_import_form in ./l10n_update.admin.inc
Translation update form.
l10n_update_admin_import_form_submit in ./l10n_update.admin.inc
Submit handler for Update form.
l10n_update_admin_overview in ./l10n_update.admin.inc
Page callback: Admin overview page.
l10n_update_available_releases in ./l10n_update.check.inc
Fetch update information for all projects / all languages.

... See full list

File

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

Code

function l10n_update_get_projects($refresh = FALSE, $disabled = FALSE) {
  static $projects, $enabled;
  if (!isset($projects) || $refresh) {
    if (variable_get('l10n_update_rebuild_projects', 0)) {
      module_load_include('project.inc', 'l10n_update');
      variable_del('l10n_update_rebuild_projects');
      l10n_update_build_projects();
    }
    $projects = $enabled = array();
    $result = db_query('SELECT * FROM {l10n_update_project}');
    while ($project = db_fetch_object($result)) {
      $projects[$project->name] = $project;
      if ($project->status) {
        $enabled[$project->name] = $project;
      }
    }
  }
  return $disabled ? $projects : $enabled;
}