You are here

function theme_user_admin_new_role in Drupal 6

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

Theme the new-role form.

Related topics

File

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

Code

function theme_user_admin_new_role($form) {
  $header = array(
    t('Name'),
    array(
      'data' => t('Operations'),
      'colspan' => 2,
    ),
  );
  foreach (user_roles() as $rid => $name) {
    $edit_permissions = l(t('edit permissions'), 'admin/user/permissions/' . $rid);
    if (!in_array($rid, array(
      DRUPAL_ANONYMOUS_RID,
      DRUPAL_AUTHENTICATED_RID,
    ))) {
      $rows[] = array(
        $name,
        l(t('edit role'), 'admin/user/roles/edit/' . $rid),
        $edit_permissions,
      );
    }
    else {
      $rows[] = array(
        $name,
        t('locked'),
        $edit_permissions,
      );
    }
  }
  $rows[] = array(
    drupal_render($form['name']),
    array(
      'data' => drupal_render($form['submit']),
      'colspan' => 2,
    ),
  );
  $output = drupal_render($form);
  $output .= theme('table', $header, $rows);
  return $output;
}