You are here

function advanced_help_form_system_modules_alter in Advanced Help 7

Implements hook_form_system_modules_alter().

Add advanced help links to the modules page.

File

./advanced_help.module, line 394
Pluggable system to provide advanced help facilities for Drupal and modules.

Code

function advanced_help_form_system_modules_alter(&$form, &$form_state) {
  if (!isset($form['modules'])) {
    return;
  }
  $advanced_help_modules = drupal_map_assoc(array_keys(advanced_help_get_topics()));
  foreach (element_children($form['modules']) as $group) {
    foreach (element_children($form['modules'][$group]) as $module) {
      if (isset($advanced_help_modules[$module])) {
        $form['modules'][$group][$module]['links']['help'] = array(
          '#type' => 'link',
          '#title' => t('Help'),
          '#href' => "admin/help/ah/{$module}",
          '#options' => array(
            'attributes' => array(
              'class' => array(
                'module-link',
                'module-link-help',
              ),
              'title' => t('Help'),
            ),
          ),
        );
      }
    }
  }
}