You are here

function _hosting_site_form_language in Hosting 5

generate hosting site node form element 'language'

1 call to _hosting_site_form_language()
hosting_site_form in site/hosting_site.module
Implementation of hook_form

File

site/hosting_site.module, line 735

Code

function _hosting_site_form_language($profile = NULL, $platform = null) {
  $languages = hosting_get_profile_languages($profile, $platform);
  if (sizeof($languages) > 1) {
    $form['language'] = array(
      '#type' => 'radios',
      '#title' => t('Language'),
      '#description' => t('The type of site to install.'),
      '#options' => $languages,
      '#required' => TRUE,
      '#default_value' => 'en',
      '#attributes' => array(
        'class' => "hosting-site-form-language-options",
      ),
    );
  }
  else {
    $form['language'] = array(
      '#type' => 'hidden',
      '#default_value' => 'en',
      '#attributes' => array(
        'class' => "hosting-site-form-language-options",
      ),
    );
  }
  return $form['language'];
}