You are here

function theme_ip_ban_country_table in IP Ban 7

Same name and namespace in other branches
  1. 8 ip_ban.admin.inc \theme_ip_ban_country_table()

Theme the IP Ban Country configuration table.

1 theme call to theme_ip_ban_country_table()
ip_ban_admin in ./ip_ban.admin.inc
Ip_ban admin form.

File

./ip_ban.admin.inc, line 201
Administration functions for the IP Ban module.

Code

function theme_ip_ban_country_table($form) {
  $countries = element_children($form['ip_ban_table']);
  $header = array(
    t('Country'),
    t('Policy'),
  );
  foreach ($countries as $country) {

    // Put the select element's title in its own cell.
    $country_name = $form['ip_ban_table'][$country]['#title'];
    unset($form['ip_ban_table'][$country]['#title']);
    $rows[] = array(
      $country_name,
      drupal_render($form['ip_ban_table'][$country]),
    );
  }
  $output = theme('table', array(
    'header' => $header,
    'rows' => $rows,
    'attributes' => array(
      'id' => 'ip-ban-country-listing-table',
      'style' => 'width: 50%',
    ),
  ));
  return $output;
}