You are here

function theme_user_admin_account in Drupal 6

Same name and namespace in other branches
  1. 5 modules/user/user.module \theme_user_admin_account()

Theme user administration overview.

Related topics

File

modules/user/user.admin.inc, line 926
Admin page callback file for the user module.

Code

function theme_user_admin_account($form) {

  // Overview table:
  $header = array(
    theme('table_select_header_cell'),
    array(
      'data' => t('Username'),
      'field' => 'u.name',
    ),
    array(
      'data' => t('Status'),
      'field' => 'u.status',
    ),
    t('Roles'),
    array(
      'data' => t('Member for'),
      'field' => 'u.created',
      'sort' => 'desc',
    ),
    array(
      'data' => t('Last access'),
      'field' => 'u.access',
    ),
    t('Operations'),
  );
  $output = drupal_render($form['options']);
  if (isset($form['name']) && is_array($form['name'])) {
    foreach (element_children($form['name']) as $key) {
      $rows[] = array(
        drupal_render($form['accounts'][$key]),
        drupal_render($form['name'][$key]),
        drupal_render($form['status'][$key]),
        drupal_render($form['roles'][$key]),
        drupal_render($form['member_for'][$key]),
        drupal_render($form['last_access'][$key]),
        drupal_render($form['operations'][$key]),
      );
    }
  }
  else {
    $rows[] = array(
      array(
        'data' => t('No users available.'),
        'colspan' => '7',
      ),
    );
  }
  $output .= theme('table', $header, $rows);
  if ($form['pager']['#value']) {
    $output .= drupal_render($form['pager']);
  }
  $output .= drupal_render($form);
  return $output;
}