You are here

function coder_form_alter in Coder 5.2

Same name and namespace in other branches
  1. 5 coder.module \coder_form_alter()
  2. 6.2 coder.module \coder_form_alter()
  3. 6 coder.module \coder_form_alter()

Implementation of hook_form_alter().

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

File

./coder.module, line 151
Developer Module that assists with code review and version upgrade that supports a plug-in extensible hook system so contributed modules can define additional review standards.

Code

function coder_form_alter($form_id, &$form) {
  if ($form_id == 'system_modules' && $form['#base'] != 'confirm_form') {
    if (user_access('view code review')) {
      $path = drupal_get_path('module', 'coder');
      drupal_add_css($path . '/coder.css', 'module');
      foreach ($form['name'] as $name => $data) {
        $form['description'][$name]['#value'] = $form['description'][$name]['#value'] . '(' . l(t('Code Review'), "coder/{$name}") . ')';
      }
    }
  }
}