Quickly find Module Names in Drupal

28 Apr 2013

Posted by Darrell
Darrell's picture

While I don't like to hack Drupal core, there are a few tweaks to Drupal that I've found myself making to enhance the ability to administrate that I'm not able to accomplish using hooks.
Because each module on the module configuration page lists all of its dependencies and all of the modules dependent on it, it is often hard to find the checkbox for a given module on the module. This quick fix will put a carat (^) in front of each module name so you can quickly search for the checkbox to enable/disable or configure it:

D7.24: line 982 of modules/system/system.admin.inc
change to be: '#markup' => '^' . $info['name'],
D6.28. line 680 of modules/system/system.admin.inc
$form['name'][$filename] = array('#value' => '^' . $file->info['name']);

A further enhancement to D7 is to provide a link to the module page on Drupal.org:


if(isset($info['project']) ) {
$markup = '^<a href="http://drupal.org/project/' . $info['project'] . '">' . $info['name'] . '';
}else{
$markup = '^' . $info['name'];
}
$form['name'] = array(
'#markup' => $markup,
);

I'm not super proud of this fix because it does involve hacking core, and I'm hopeful that I can eventually figure out a way to implement it with a module, similar to what Module Filter does. Attached below is a patch file.

Tags: