You are here

function theme_user_permissions_user_admin_new_role in User Permissions 6

Same name and namespace in other branches
  1. 5 user_permissions.module \theme_user_permissions_user_admin_new_role()

Theme user_admin_new_role

1 string reference to 'theme_user_permissions_user_admin_new_role'
user_permissions_theme in ./user_permissions.module
Implementation of hook_theme().

File

./user_permissions.module, line 179

Code

function theme_user_permissions_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,
    ))) {
      if (strpos($name, '_user_role_') === FALSE) {
        $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;
}