You are here

function coder_review_form_system_modules_alter in Coder 7.2

Implements hook_form_FORMID_alter().

Modify the module display view by adding a Coder Review link to every module description.

File

coder_review/coder_review.module, line 106
Developer module to assist with coder reviews and API upgrade suggestions.

Code

function coder_review_form_system_modules_alter(&$form, &$form_state, $form_id) {
  if (!user_access('view code review') || isset($form['confirm'])) {
    return;
  }
  $path = drupal_get_path('module', 'coder_review');
  $form['#attached']['css'][] = "{$path}/coder_review.css";
  foreach ($form['modules'] as $package_name => &$package) {
    if ($package_name[0] != '#') {
      foreach ($package as $module_name => &$module) {
        if ($module_name[0] != '#') {
          $module['links']['coder_review'] = array(
            '#type' => 'link',
            '#title' => t('Code review'),
            '#href' => "admin/config/development/coder/review/{$module_name}",
            '#options' => array(
              'attributes' => array(
                'class' => array(
                  'module-link',
                  'module-link-coder-review',
                ),
                'title' => t('Coder review'),
              ),
            ),
          );
          $package['#theme'] = 'coder_review_modules_fieldset';
        }
      }
    }
  }
}