You are here

function l10n_update_get_project_name in Localization update 6

Same name and namespace in other branches
  1. 7.2 l10n_update.compare.inc \l10n_update_get_project_name()
  2. 7 l10n_update.project.inc \l10n_update_get_project_name()

Given a $file object (as returned by system_get_files_database()), figure out what project it belongs to.

Parameters

$file:

Return value

string

See also

system_get_files_database()

1 call to l10n_update_get_project_name()
_l10n_update_project_info_list in ./l10n_update.project.inc
Populate an array of project data.

File

./l10n_update.project.inc, line 228
Library for querying Drupal projects

Code

function l10n_update_get_project_name($file) {
  $project_name = '';
  if (isset($file->info['project'])) {
    $project_name = $file->info['project'];
  }
  elseif (isset($file->info['package']) && strpos($file->info['package'], 'Core -') !== FALSE) {
    $project_name = 'drupal';
  }
  elseif (in_array($file->name, array(
    'bluemarine',
    'chameleon',
    'garland',
    'marvin',
    'minnelli',
    'pushbutton',
  ))) {

    // Unfortunately, there's no way to tell if a theme is part of core,
    // so we must hard-code a list here.
    $project_name = 'drupal';
  }
  return $project_name;
}