You are here

function theme_user_admin_new_role in Drupal 4

Same name and namespace in other branches
  1. 5 modules/user/user.module \theme_user_admin_new_role()
  2. 6 modules/user/user.admin.inc \theme_user_admin_new_role()

File

modules/user.module, line 1942
Enables the user registration and login system.

Code

function theme_user_admin_new_role($form) {
  $header = array(
    t('Name'),
    t('Operations'),
  );
  foreach (user_roles() as $rid => $name) {
    if (!in_array($rid, array(
      DRUPAL_ANONYMOUS_RID,
      DRUPAL_AUTHENTICATED_RID,
    ))) {
      $rows[] = array(
        $name,
        l(t('edit'), 'admin/access/roles/edit/' . $rid),
      );
    }
    else {
      $rows[] = array(
        $name,
        '<span class="disabled">' . t('locked') . '</span>',
      );
    }
  }
  $rows[] = array(
    form_render($form['name']),
    form_render($form['submit']),
  );
  $output = theme('table', $header, $rows);
  $output .= form_render($form);
  return $output;
}