You are here

function theme_notify_admin_users in Notify 5

Same name and namespace in other branches
  1. 5.2 notify.module \theme_notify_admin_users()
  2. 6 notify.module \theme_notify_admin_users()
  3. 7 notify.admin.inc \theme_notify_admin_users()

Theme function to theme the admin user settings form in a table format.

File

./notify.module, line 276

Code

function theme_notify_admin_users($form) {
  $output = drupal_render($form['info']);
  $header = array(
    t('Username'),
    t('E-mail address'),
    t('Content'),
    t('Teasers'),
    t('Comment'),
    t('Failed attempts'),
  );
  $rows = array();
  foreach (element_children($form['users']) as $uid) {
    $row = array();
    foreach (element_children($form['users'][$uid]) as $entry_key) {
      unset($form['users'][$uid][$entry_key]['#title']);
      $row[] = drupal_render($form['users'][$uid][$entry_key]);
    }
    $rows[] = $row;
  }
  if (!$rows) {
    $rows[] = array(
      array(
        'data' => t('No users have notifications enabled.'),
        'colspan' => 6,
      ),
    );
  }
  $output .= theme('table', $header, $rows);
  $output .= drupal_render($form);
  return $output;
}