function devel_form_system_modules_alter

Same name in other branches
  1. 7.x-1.x devel.module \devel_form_system_modules_alter()
  2. 5.x devel.module \devel_form_system_modules_alter()

Implements hook_form_FORM_ID_alter().

Adds mouse-over hints on the Modules page to display module base names.

See also

\Drupal\system\Form\ModulesListForm::buildForm()

theme_system_modules_details()

File

./devel.module, line 726

Code

function devel_form_system_modules_alter(&$form, FormStateInterface $form_state) {
    if (\Drupal::currentUser()->hasPermission('access devel information') && \Drupal::config('devel.settings')->get('raw_names', FALSE) && isset($form['modules']) && is_array($form['modules'])) {
        foreach (Element::children($form['modules']) as $group) {
            if (is_array($form['modules'][$group])) {
                foreach (Element::children($form['modules'][$group]) as $key) {
                    if (isset($form['modules'][$group][$key]['name']['#markup'])) {
                        $form['modules'][$group][$key]['name']['#markup'] = '<span title="' . $key . '">' . $form['modules'][$group][$key]['name']['#markup'] . '</span>';
                    }
                }
            }
        }
    }
}