You are here

function hosting_get_profile_languages in Hosting 6.2

Same name and namespace in other branches
  1. 5 package/hosting_package.module \hosting_get_profile_languages()
  2. 7.4 package/hosting_package.module \hosting_get_profile_languages()
  3. 7.3 package/hosting_package.module \hosting_get_profile_languages()
2 calls to hosting_get_profile_languages()
hosting_site_available_options in 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 site/hosting_site.form.inc
Implements hook_form().

File

package/hosting_package.module, line 135

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;
}