function theme_user_admin_perm in Drupal 4
Same name and namespace in other branches
- 5 modules/user/user.module \theme_user_admin_perm()
- 6 modules/user/user.admin.inc \theme_user_admin_perm()
File
- modules/
user.module, line 1812 - Enables the user registration and login system.
Code
function theme_user_admin_perm($form) {
foreach (element_children($form['permission']) as $key) {
// Don't take form control structures
if (is_array($form['permission'][$key])) {
$row = array();
// Module name
if (is_numeric($key)) {
$row[] = array(
'data' => form_render($form['permission'][$key]),
'class' => 'module',
'colspan' => count($form['role_names']) + 1,
);
// Permissions
}
else {
$row[] = array(
'data' => form_render($form['permission'][$key]),
'class' => 'permission',
);
foreach (element_children($form['checkboxes']) as $rid) {
if (is_array($form['checkboxes'][$rid])) {
$row[] = array(
'data' => form_render($form['checkboxes'][$rid][$key]),
'align' => 'center',
'title' => t($key),
);
}
}
}
$rows[] = $row;
}
}
$header[] = t('Permission');
foreach (element_children($form['role_names']) as $rid) {
if (is_array($form['role_names'][$rid])) {
$header[] = form_render($form['role_names'][$rid]);
}
}
$output = theme('table', $header, $rows, array(
'id' => 'permissions',
));
$output .= form_render($form);
return $output;
}