You are here

function hosting_get_profile_languages in Hosting 5

Same name and namespace in other branches
  1. 6.2 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_validate in site/hosting_site.module
_hosting_site_form_language in site/hosting_site.module
generate hosting site node form element 'language'

File

package/hosting_package.module, line 113

Code

function hosting_get_profile_languages($profile = NULL, $platform = NULL) {
  $languages = array(
    'en' => 'en',
  );
  if ($profile && $platform) {
    $instance = hosting_package_instance_load(array(
      'rid' => $platform,
      'package_id' => $profile,
    ));
    $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;
}