diff --git a/core/modules/action/action.info b/core/modules/action/action.info index ddddd63..921577f 100644 --- a/core/modules/action/action.info +++ b/core/modules/action/action.info @@ -4,3 +4,6 @@ package = Core version = VERSION core = 8.x configure = admin/config/system/actions +tags[] = action +tags[] = api +tags[] = views/field diff --git a/core/modules/aggregator/aggregator.info b/core/modules/aggregator/aggregator.info index 66e1e51..6dab216 100644 --- a/core/modules/aggregator/aggregator.info +++ b/core/modules/aggregator/aggregator.info @@ -5,3 +5,5 @@ version = VERSION core = 8.x configure = admin/config/services/aggregator/settings dependencies[] = file +tags[] = block +tags[] = service diff --git a/core/modules/ban/ban.info b/core/modules/ban/ban.info index e23331c..c297f20 100644 --- a/core/modules/ban/ban.info +++ b/core/modules/ban/ban.info @@ -4,3 +4,4 @@ package = Core version = VERSION core = 8.x configure = admin/config/people/ban +tags[] = spam diff --git a/core/modules/block/block.info b/core/modules/block/block.info index e22e797..a10f9fe 100644 --- a/core/modules/block/block.info +++ b/core/modules/block/block.info @@ -4,3 +4,6 @@ package = Core version = VERSION core = 8.x configure = admin/structure/block +tags[] = api +tags[] = block +tags[] = layout diff --git a/core/modules/block/custom_block/custom_block.info b/core/modules/block/custom_block/custom_block.info index 3dafb61..f5c505e 100644 --- a/core/modules/block/custom_block/custom_block.info +++ b/core/modules/block/custom_block/custom_block.info @@ -4,3 +4,6 @@ package = Core version = VERSION core = 8.x dependencies[] = block +tags[] = block +tags[] = content +tags[] = entity diff --git a/core/modules/book/book.info b/core/modules/book/book.info index b42a72b..f743729 100644 --- a/core/modules/book/book.info +++ b/core/modules/book/book.info @@ -5,3 +5,6 @@ version = VERSION core = 8.x dependencies[] = node configure = admin/content/book/settings +tags[] = block +tags[] = content +tags[] = structure diff --git a/core/modules/breakpoint/breakpoint.info b/core/modules/breakpoint/breakpoint.info index 793bdcd..4494238 100644 --- a/core/modules/breakpoint/breakpoint.info +++ b/core/modules/breakpoint/breakpoint.info @@ -3,4 +3,5 @@ description = Manage breakpoints and breakpoint groups for responsive designs. package = Core version = VERSION core = 8.x - +tags[] = layout +tags[] = theme diff --git a/core/modules/color/color.info b/core/modules/color/color.info index 6d2c9f9..960ca0f 100644 --- a/core/modules/color/color.info +++ b/core/modules/color/color.info @@ -3,3 +3,4 @@ description = Allows administrators to change the color scheme of compatible the package = Core version = VERSION core = 8.x +tags[] = theme diff --git a/core/modules/comment/comment.info b/core/modules/comment/comment.info index 340df76..a2de9f3 100644 --- a/core/modules/comment/comment.info +++ b/core/modules/comment/comment.info @@ -6,3 +6,6 @@ core = 8.x dependencies[] = node dependencies[] = text configure = admin/content/comment +tags[] = block +tags[] = entity +tags[] = content diff --git a/core/modules/config/config.info b/core/modules/config/config.info index efab7a1..9a82cc3 100644 --- a/core/modules/config/config.info +++ b/core/modules/config/config.info @@ -4,3 +4,4 @@ package = Core version = VERSION core = 8.x configure = admin/config/development/sync +tags[] = api/ui diff --git a/core/modules/contact/contact.info b/core/modules/contact/contact.info index eff6d33..7e661a5 100644 --- a/core/modules/contact/contact.info +++ b/core/modules/contact/contact.info @@ -4,3 +4,5 @@ package = Core version = VERSION core = 8.x configure = admin/structure/contact +tags[] = entity +tags[] = mail diff --git a/core/modules/contextual/contextual.info b/core/modules/contextual/contextual.info index 8a99dea..d0a26f1 100644 --- a/core/modules/contextual/contextual.info +++ b/core/modules/contextual/contextual.info @@ -3,3 +3,4 @@ description = Provides contextual links to perform actions related to elements o package = Core version = VERSION core = 8.x +tags[] = ux diff --git a/core/modules/dblog/dblog.info b/core/modules/dblog/dblog.info index fd18bb3..d84d0de 100644 --- a/core/modules/dblog/dblog.info +++ b/core/modules/dblog/dblog.info @@ -3,3 +3,4 @@ description = Logs and records system events to the database. package = Core version = VERSION core = 8.x +tags[] = admin diff --git a/core/modules/edit/edit.info b/core/modules/edit/edit.info index 4074a7b..959eef8 100644 --- a/core/modules/edit/edit.info +++ b/core/modules/edit/edit.info @@ -4,3 +4,5 @@ package = Core core = 8.x version = VERSION dependencies[] = field +tags[] = admin +tags[] = ux diff --git a/core/modules/email/email.info b/core/modules/email/email.info index c5b7437..4156d6c 100644 --- a/core/modules/email/email.info +++ b/core/modules/email/email.info @@ -4,3 +4,4 @@ package = Core version = VERSION core = 8.x dependencies[] = field +tags[] = field/type diff --git a/core/modules/entity/entity.info b/core/modules/entity/entity.info index 5887b39..a7a92e5 100644 --- a/core/modules/entity/entity.info +++ b/core/modules/entity/entity.info @@ -4,3 +4,4 @@ package = Core version = VERSION core = 8.x required = TRUE +tags[] = api diff --git a/core/modules/field/field.info b/core/modules/field/field.info index c74da0e..e129c12 100644 --- a/core/modules/field/field.info +++ b/core/modules/field/field.info @@ -5,3 +5,5 @@ version = VERSION core = 8.x dependencies[] = field_sql_storage required = TRUE +tags[] = api +tags[] = field diff --git a/core/modules/field_sql_storage/field_sql_storage.info b/core/modules/field_sql_storage/field_sql_storage.info index 2106ac7..28110f7 100644 --- a/core/modules/field_sql_storage/field_sql_storage.info +++ b/core/modules/field_sql_storage/field_sql_storage.info @@ -5,3 +5,4 @@ version = VERSION core = 8.x dependencies[] = field required = TRUE +tags[] = field/storage diff --git a/core/modules/field_ui/field_ui.info b/core/modules/field_ui/field_ui.info index 2c3c27a..cc41bdc 100644 --- a/core/modules/field_ui/field_ui.info +++ b/core/modules/field_ui/field_ui.info @@ -4,3 +4,6 @@ package = Core version = VERSION core = 8.x dependencies[] = field +tags[] = api/ui +tags[] = entity +tags[] = field diff --git a/core/modules/file/file.info b/core/modules/file/file.info index dc93ab0..2058ea8 100644 --- a/core/modules/file/file.info +++ b/core/modules/file/file.info @@ -4,3 +4,6 @@ package = Core version = VERSION core = 8.x dependencies[] = field +tags[] = entity +tags[] = field/type +tags[] = media diff --git a/core/modules/filter/filter.info b/core/modules/filter/filter.info index 03ed179..bc83718 100644 --- a/core/modules/filter/filter.info +++ b/core/modules/filter/filter.info @@ -5,3 +5,5 @@ version = VERSION core = 8.x required = TRUE configure = admin/config/content/formats +tags[] = api +tags[] = filter diff --git a/core/modules/forum/forum.info b/core/modules/forum/forum.info index 79317ea..aea6c38 100644 --- a/core/modules/forum/forum.info +++ b/core/modules/forum/forum.info @@ -8,3 +8,5 @@ package = Core version = VERSION core = 8.x configure = admin/structure/forum +tags[] = block +tags[] = content diff --git a/core/modules/help/help.info b/core/modules/help/help.info index 615a302..c4c1e32 100644 --- a/core/modules/help/help.info +++ b/core/modules/help/help.info @@ -3,3 +3,5 @@ description = Manages the display of online help. package = Core version = VERSION core = 8.x +tags[] = api +tags[] = block diff --git a/core/modules/history/history.info b/core/modules/history/history.info index 7658749..e20b7e1 100644 --- a/core/modules/history/history.info +++ b/core/modules/history/history.info @@ -4,3 +4,4 @@ package = Core version = VERSION core = 8.x dependencies[] = node +tags[] = content diff --git a/core/modules/image/image.info b/core/modules/image/image.info index a63fbf5..16c0878 100644 --- a/core/modules/image/image.info +++ b/core/modules/image/image.info @@ -5,3 +5,5 @@ version = VERSION core = 8.x dependencies[] = file configure = admin/config/media/image-styles +tags[] = field/type +tags[] = media diff --git a/core/modules/jsonld/jsonld.info b/core/modules/jsonld/jsonld.info index fce4688..6de1930 100644 --- a/core/modules/jsonld/jsonld.info +++ b/core/modules/jsonld/jsonld.info @@ -4,3 +4,4 @@ package = Core version = VERSION core = 8.x dependencies[] = rdf +tags[] = service diff --git a/core/modules/language/language.info b/core/modules/language/language.info index 53ab979..d46e56e 100644 --- a/core/modules/language/language.info +++ b/core/modules/language/language.info @@ -4,3 +4,5 @@ package = Multilingual version = VERSION core = 8.x configure = admin/config/regional/language +tags[] = block +tags[] = language diff --git a/core/modules/layout/layout.info b/core/modules/layout/layout.info index 187bfea..1db674a 100644 --- a/core/modules/layout/layout.info +++ b/core/modules/layout/layout.info @@ -3,3 +3,4 @@ description = Makes it possible to swap different page layouts. package = Core version = VERSION core = 8.x +tags[] = layout diff --git a/core/modules/link/link.info b/core/modules/link/link.info index a43c222..5f93658 100644 --- a/core/modules/link/link.info +++ b/core/modules/link/link.info @@ -4,3 +4,4 @@ core = 8.x package = Core version = VERSION dependencies[] = field +tags[] = field/type diff --git a/core/modules/locale/locale.info b/core/modules/locale/locale.info index 4f316a3..90f7e46 100644 --- a/core/modules/locale/locale.info +++ b/core/modules/locale/locale.info @@ -5,3 +5,4 @@ version = VERSION core = 8.x dependencies[] = language dependencies[] = file +tags[] = language diff --git a/core/modules/menu/menu.info b/core/modules/menu/menu.info index e5e2c8b..3eda95b 100644 --- a/core/modules/menu/menu.info +++ b/core/modules/menu/menu.info @@ -4,3 +4,6 @@ package = Core version = VERSION core = 8.x configure = admin/structure/menu +tags[] = block +tags[] = content +tags[] = structure diff --git a/core/modules/node/node.info b/core/modules/node/node.info index da33c43..574f475 100644 --- a/core/modules/node/node.info +++ b/core/modules/node/node.info @@ -4,3 +4,7 @@ package = Core version = VERSION core = 8.x configure = admin/structure/types +tags[] = api +tags[] = block +tags[] = entity +tags[] = content diff --git a/core/modules/number/number.info b/core/modules/number/number.info index aabe3d7..6a185c7 100644 --- a/core/modules/number/number.info +++ b/core/modules/number/number.info @@ -4,3 +4,4 @@ package = Core version = VERSION core = 8.x dependencies[] = field +tags[] = field/type diff --git a/core/modules/openid/openid.info b/core/modules/openid/openid.info index fd7359a..f296d6f 100644 --- a/core/modules/openid/openid.info +++ b/core/modules/openid/openid.info @@ -3,3 +3,4 @@ description = "Allows users to log into your site using OpenID." version = VERSION package = Core core = 8.x +tags[] = service diff --git a/core/modules/options/options.info b/core/modules/options/options.info index f19e952..a05168c 100644 --- a/core/modules/options/options.info +++ b/core/modules/options/options.info @@ -4,3 +4,6 @@ package = Core version = VERSION core = 8.x dependencies[] = field +tags[] = field/type +; Ex Options widgets...? +tags[] = field/widget diff --git a/core/modules/overlay/overlay.info b/core/modules/overlay/overlay.info index a782792..34c2d64 100644 --- a/core/modules/overlay/overlay.info +++ b/core/modules/overlay/overlay.info @@ -3,3 +3,4 @@ description = Displays the Drupal administration interface in an overlay. package = Core version = VERSION core = 8.x +tags[] = ux diff --git a/core/modules/path/path.info b/core/modules/path/path.info index 7323d1b..20bf848 100644 --- a/core/modules/path/path.info +++ b/core/modules/path/path.info @@ -4,3 +4,5 @@ package = Core version = VERSION core = 8.x configure = admin/config/search/path +tags[] = content +tags[] = structure diff --git a/core/modules/php/php.info b/core/modules/php/php.info index f155609..d8c2254 100644 --- a/core/modules/php/php.info +++ b/core/modules/php/php.info @@ -3,3 +3,4 @@ description = Allows embedded PHP code/snippets to be evaluated. package = Core version = VERSION core = 8.x +tags[] = filter diff --git a/core/modules/picture/picture.info b/core/modules/picture/picture.info index 47649d5..de8ad00 100644 --- a/core/modules/picture/picture.info +++ b/core/modules/picture/picture.info @@ -6,3 +6,5 @@ core = 8.x dependencies[] = breakpoint dependencies[] = image configure = admin/config/media/picturemapping +tags[] = field/formatter +tags[] = theme diff --git a/core/modules/poll/poll.info b/core/modules/poll/poll.info index f6b5386..dfc5bf5 100644 --- a/core/modules/poll/poll.info +++ b/core/modules/poll/poll.info @@ -4,3 +4,5 @@ package = Core version = VERSION core = 8.x dependencies[] = node +tags[] = block +tags[] = content diff --git a/core/modules/rdf/rdf.info b/core/modules/rdf/rdf.info index bc975de..ec485b4 100644 --- a/core/modules/rdf/rdf.info +++ b/core/modules/rdf/rdf.info @@ -3,3 +3,4 @@ description = Enriches your content with metadata to let other applications (e.g package = Core version = VERSION core = 8.x +tags[] = service diff --git a/core/modules/rest/rest.info b/core/modules/rest/rest.info index c0bf4bd..2b9e55a 100644 --- a/core/modules/rest/rest.info +++ b/core/modules/rest/rest.info @@ -6,3 +6,4 @@ core = 8.x ; @todo Remove this dependency once hard coding to JSON-LD is gone. dependencies[] = jsonld configure = admin/config/services/rest +tags[] = service diff --git a/core/modules/search/search.info b/core/modules/search/search.info index 768b861..84bcdb7 100644 --- a/core/modules/search/search.info +++ b/core/modules/search/search.info @@ -4,3 +4,5 @@ package = Core version = VERSION core = 8.x configure = admin/config/search/settings +tags[] = block +tags[] = content diff --git a/core/modules/shortcut/shortcut.info b/core/modules/shortcut/shortcut.info index 5ed5f2d..eb08eae 100644 --- a/core/modules/shortcut/shortcut.info +++ b/core/modules/shortcut/shortcut.info @@ -4,3 +4,5 @@ package = Core version = VERSION core = 8.x configure = admin/config/user-interface/shortcut +tags[] = admin +tags[] = ux diff --git a/core/modules/simpletest/simpletest.info b/core/modules/simpletest/simpletest.info index 6e18c42..94c81b6 100644 --- a/core/modules/simpletest/simpletest.info +++ b/core/modules/simpletest/simpletest.info @@ -4,4 +4,4 @@ package = Core version = VERSION core = 8.x configure = admin/config/development/testing/settings - +tags[] = dev diff --git a/core/modules/statistics/statistics.info b/core/modules/statistics/statistics.info index 4b18b8a..fbc5ecc 100644 --- a/core/modules/statistics/statistics.info +++ b/core/modules/statistics/statistics.info @@ -4,3 +4,4 @@ package = Core version = VERSION core = 8.x configure = admin/config/system/statistics +tags[] = admin diff --git a/core/modules/syslog/syslog.info b/core/modules/syslog/syslog.info index e3f541f..e29f844 100644 --- a/core/modules/syslog/syslog.info +++ b/core/modules/syslog/syslog.info @@ -3,3 +3,4 @@ description = Logs and records system events to syslog. package = Core version = VERSION core = 8.x +tags[] = admin diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc index c3c2ce4..d1575dc 100644 --- a/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -809,6 +809,65 @@ function system_modules($form, $form_state = array()) { return system_modules_confirm_form($visible_files, $form_state['storage']); } + $form['filters']['tag'] = array( + '#type' => 'select', + '#title' => t('Filter by tag'), + '#empty_option' => t('- Select -'), + '#options' => array(), + '#id' => 'system-filter-tag', + ); + // Process all tags. + $all_tags = array(); + foreach ($visible_files as $filename => $module) { + $module_tags = array(); + // Tag untagged modules. + if (empty($module->info['tags'])) { + $module->info['tags'][] = '-'; + } + // Process tags. + foreach ($module->info['tags'] as $tag) { + // Prepare specified tag name. + // @todo Simple Porter-Stemmer to help prevent duplicates. + $tag = drupal_strtolower($tag); + $tag = strtr($tag, ',', ''); + + // Track the tag globally and (re)set it for the module. + $all_tags[$tag][$filename] = $filename; + $module_tags[$tag] = $tag; + + // If the tag is namespaced, additionally record the parent tag. + if ($pos = strpos($tag, '/')) { + $parent_tag = substr($tag, 0, $pos); + $all_tags[$parent_tag][$filename] = $filename; + $module_tags[$parent_tag] = $parent_tag; + } + } + // Replace tags in info with processed tags. + $module->info['tags'] = $module_tags; + } + // Remove tags that only appear once. + foreach ($all_tags as $tag => $modules) { + if (count($modules) < 2) { + foreach ($modules as $filename => $module) { + unset($visible_files[$filename]->info['tags'][$tag]); + // If this removal leaves the module untagged, tag it accordingly. + if (empty($visible_files[$filename]->info['tags'])) { + $visible_files[$filename]->info['tags']['-'] = '-'; + } + } + unset($all_tags[$tag]); + } + } + // Populate the tag filter select options. + // Sort tags alphabetically and move the option for untagged modules last. + ksort($all_tags); + $options = drupal_map_assoc(array_keys($all_tags)); + if (isset($options['-'])) { + unset($options['-']); + $options['-'] = t('- Other -'); + } + $form['filters']['tag']['#options'] = $options; + $modules = array(); $form['modules'] = array('#tree' => TRUE); @@ -909,28 +968,18 @@ function system_modules($form, $form_state = array()) { } } } - $form['modules'][$module->info['package']][$filename] = _system_modules_build_row($module->info, $extra); + $form['modules'][$filename] = _system_modules_build_row($module->info, $extra); } // Add basic information to the details. - foreach (element_children($form['modules']) as $package) { - $form['modules'][$package] += array( - '#type' => 'details', - '#title' => t($package), - '#collapsible' => TRUE, - '#theme' => 'system_modules_details', - '#header' => array( - array('data' => t('Enabled'), 'class' => array('checkbox')), - array('data' => t('Name'), 'class' => array('name')), - array('data' => t('Description'), 'class' => array('description', RESPONSIVE_PRIORITY_LOW)), - ), - // Ensure that the "Core" package comes first. - '#weight' => $package == 'Core' ? -10 : NULL, - ); - } - - // Lastly, sort all packages by title. - uasort($form['modules'], 'element_sort_by_title'); + $form['modules'] += array( + '#theme' => 'system_modules_details', + '#header' => array( + array('data' => t('Enabled'), 'class' => array('checkbox')), + array('data' => t('Name'), 'class' => array('name')), + array('data' => t('Description'), 'class' => array('description', RESPONSIVE_PRIORITY_LOW)), + ), + ); $form['#attached']['library'][] = array('system', 'drupal.system.modules'); $form['actions'] = array('#type' => 'actions'); @@ -990,6 +1039,16 @@ function _system_modules_build_row($info, $extra) { ); $form['#requires'] = $extra['requires']; $form['#required_by'] = $extra['required_by']; + $form['#tags'] = $info['tags']; + + // Module row attributes. + $form['#attributes'] = array(); + + // Add data-tags HTML attribute. + // Unconditionally add the attribute even if it is empty, so the front-end can + // target all elements that need to be filtered more easily. + // Prefix and suffix with delimiter to simplify tag matching in front-end. + $form['#attributes']['data-tags'] = ',' . implode(',', $info['tags']) . ','; // Check the compatibilities. $compatible = TRUE; @@ -2332,6 +2391,7 @@ function theme_system_modules_details($variables) { $requires = !empty($module['#requires']); $required_by = !empty($module['#required_by']); $version = !empty($module['version']['#markup']); + $tags = !empty($module['#tags']); $row[] = array('class' => array('checkbox'), 'data' => drupal_render($module['enable'])); @@ -2341,7 +2401,7 @@ function theme_system_modules_details($variables) { // Add the description, along with any modules it requires. $description = '' . drupal_render($module['description']) . ''; - if ($version || $requires || $required_by) { + if ($version || $requires || $required_by || $tags) { $description .= '