You are here

function hosting_get_profile_languages in Hostmaster (Aegir) 6

2 calls to hosting_get_profile_languages()
hosting_site_available_options in modules/hosting/site/hosting_site.form.inc
Pass in a site node and return an array of valid options for it's fields.
hosting_site_form in modules/hosting/site/hosting_site.form.inc
Implements hook_form().

File

modules/hosting/package/hosting_package.module, line 179

Code

function hosting_get_profile_languages($profile = NULL, $platform = NULL) {
  $languages['en'] = _hosting_language_name('en');
  if ($profile && $platform) {
    $instance = hosting_package_instance_load(array(
      'i.rid' => $platform,
      'i.package_id' => $profile,
    ));
    $languages = array_merge($languages, $instance->languages);
  }
  else {
    $result = db_query("SELECT DISTINCT language FROM {hosting_package_languages}");
    while ($lang = db_fetch_object($result)) {
      $languages[$lang->language] = _hosting_language_name($lang->language);
    }
  }
  return $languages;
}