You are here

function devel_form_system_modules_alter in Devel 8

Same name and namespace in other branches
  1. 8.3 devel.module \devel_form_system_modules_alter()
  2. 8.2 devel.module \devel_form_system_modules_alter()
  3. 7 devel.module \devel_form_system_modules_alter()
  4. 4.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 598
This module holds functions useful for Drupal development. Please contribute!

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>';
          }
        }
      }
    }
  }
}