function coder_form_alter in Coder 6
Same name and namespace in other branches
- 5.2 coder.module \coder_form_alter()
- 5 coder.module \coder_form_alter()
- 6.2 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 147 - 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, $form_state, $form_id) {
if ($form_id == 'system_modules' && (!isset($form['#theme']) || $form['#theme'] != '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) {
$description = isset($form['description'][$name]['#value']) ? $form['description'][$name]['#value'] : $data['#value'];
$form['description'][$name]['#value'] = $description . ' (' . l(t('Code Review'), "coder/{$name}") . ')';
}
}
}
}