You are here

function blocked_ips_expire_page_alter in Blocked IPs Expire 7

Implements hook_page_alter().

File

./blocked_ips_expire.module, line 96
Hooks, callbacks and helper functions for the blocked_ips_expire module.

Code

function blocked_ips_expire_page_alter(&$page) {

  // On the list of blocked IP addresses, add an expiry date column.
  if (isset($page['content']['system_main']['system_ip_blocking_form'])) {
    $page['content']['system_main']['system_ip_blocking_table']['#header'][] = t('Expiry dates');
    foreach ($page['content']['system_main']['system_ip_blocking_table']['#rows'] as &$row) {
      $ip = _blocked_ips_expire_get_one_by_ip($row[0]);
      if ($ip) {
        $row[] = format_date($ip->expiry_date);
      }
      else {
        $row[] = t('Not set');
      }
    }
  }
}