diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc index 708854f..f47f96f 100644 --- a/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -787,6 +787,14 @@ function _system_is_incompatible(&$incompatible, $files, $file) { * @see system_modules_submit() */ function system_modules($form, $form_state = array()) { + + $form['filter_by'] = array( + '#type' => 'textfield', + '#title' => t('Filter by'), + '#description' => t('Filter the list of modules below by hidding modules whose name does not contain this string.'), //@todo: word this better + ); + // @todo: Do we need to add a button for non-js users, or is the fact that all modules are displayed by default enough? Accessibility? + // Get current list of modules. $files = system_rebuild_module_data(); diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 950fee6..792a7b3 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -1950,7 +1950,7 @@ function system_library_info() { ), ); $libraries['drupal.system.modules'] = array( - 'title' => 'System cron', + 'title' => 'System modules', 'version' => VERSION, 'js' => array( drupal_get_path('module', 'system') . '/system.modules.js' => array(), diff --git a/core/modules/system/system.modules.js b/core/modules/system/system.modules.js index 0df6629..a30e1c6 100644 --- a/core/modules/system/system.modules.js +++ b/core/modules/system/system.modules.js @@ -64,4 +64,31 @@ Drupal.behaviors.hideModuleInformation = { } }; +/** + * Filter the module list based on the value of the "filter_by" field. + */ +Drupal.behaviors.filterModuleList = { + attach: function (context, settings) { + var $table = $('#system-modules'); + + $('#edit-filter-by').keyup(function (event) { + var q = $(this).val(); + if (q === '') { + $table.find('tr').show(); + } + else { + $table.find('label').each(function() { + if ($(this).html().toLowerCase().indexOf(q) !== -1) { + $(this).closest('tr').slideDown('slow'); + } + else { + $(this).closest('tr').slideUp('slow'); + } + }); + } + }); + } +}; + + }(jQuery, Drupal));