You are here

function theme_domain_locale_languages_overview_form in Domain Locale 6

Theme the language overview form for domain specific settings.

File

./domain_locale.admin.inc, line 80
Provides admin functionality for domain specific language settings

Code

function theme_domain_locale_languages_overview_form($form) {
  $language_default = $form['site_default']['#default_value'];
  foreach ($form['name'] as $key => $element) {

    // Do not take form control structures.
    if (is_array($element) && element_child($key)) {

      // Disable checkbox for the default language, because it cannot be disabled
      if ($key == $language_default) {
        $form['enabled'][$key]['#attributes']['disabled'] = 'disabled';
      }
      $rows[] = array(
        array(
          'data' => drupal_render($form['enabled'][$key]),
          'align' => 'center',
        ),
        check_plain($key),
        '<strong>' . drupal_render($form['name'][$key]) . '</strong>',
        drupal_render($form['native'][$key]),
        drupal_render($form['site_default'][$key]),
        drupal_render($form['weight'][$key]),
      );
    }
  }
  $header = array(
    array(
      'data' => t('Enabled'),
    ),
    array(
      'data' => t('Code'),
    ),
    array(
      'data' => t('English name'),
    ),
    array(
      'data' => t('Native name'),
    ),
    array(
      'data' => t('Default'),
    ),
    array(
      'data' => t('Weight'),
    ),
  );
  $output = theme('table', $header, $rows);
  $output .= drupal_render($form);
  return $output;
}