function devel_form_user_admin_permissions_alter

Same name in other branches
  1. 4.x devel.module \devel_form_user_admin_permissions_alter()
  2. 5.x devel.module \devel_form_user_admin_permissions_alter()

Implements hook_form_alter().

Adds mouse-over hints on the Permissions page to display language-independent machine names and module base names.

File

./devel.module, line 2262

Code

function devel_form_user_admin_permissions_alter(&$form, &$form_state) {
    if (user_access('access devel information') && variable_get('devel_raw_names', FALSE)) {
        foreach ($form['permission'] as $perm => $data) {
            if (is_numeric($perm)) {
                $form['permission'][$perm]['#markup'] = '<span title="' . $form['permission'][$perm]['#id'] . '">' . $form['permission'][$perm]['#markup'] . '</span>';
            }
            else {
                $form['permission'][$perm]['#markup'] = '<span title="' . check_plain($perm) . '">' . $form['permission'][$perm]['#markup'] . '</span>';
            }
        }
    }
}