Commit 6302d0e0 authored by webchick's avatar webchick

Issue #2089511 by RoSk0, tim.plunkett: Convert info file configure link to route name.

parent ae7c20c7
......@@ -4,4 +4,4 @@ description: 'Perform tasks on specific events triggered within the system.'
package: Core
version: VERSION
core: 8.x
configure: admin/config/system/actions
configure: action.admin
......@@ -4,6 +4,6 @@ description: 'Aggregates syndicated content (RSS, RDF, and Atom feeds) from exte
package: Core
version: VERSION
core: 8.x
configure: admin/config/services/aggregator/settings
configure: aggregator.admin_settings
dependencies:
- file
......@@ -4,4 +4,4 @@ description: 'Enables banning of IP addresses.'
package: Core
version: VERSION
core: 8.x
configure: admin/config/people/ban
configure: ban.admin_page
......@@ -4,4 +4,4 @@ description: 'Controls the visual building blocks a page is constructed with. Bl
package: Core
version: VERSION
core: 8.x
configure: admin/structure/block
configure: block.admin_display
......@@ -7,4 +7,4 @@ core: 8.x
dependencies:
- block
- text
configure: admin/structure/block/custom-blocks
configure: custom_block.list
......@@ -7,4 +7,4 @@ core: 8.x
dependencies:
- menu_link
- node
configure: admin/structure/book/settings
configure: book.settings
......@@ -7,4 +7,4 @@ core: 8.x
dependencies:
- datetime
- text
configure: admin/content/comment
configure: comment.admin
......@@ -4,4 +4,4 @@ description: 'Allows administrators to manage configuration changes.'
package: Core
version: VERSION
core: 8.x
configure: admin/config/development/configuration/sync
configure: config.sync
......@@ -4,4 +4,4 @@ description: 'Enables the use of both personal and site-wide contact forms.'
package: Core
version: VERSION
core: 8.x
configure: admin/structure/contact
configure: contact.category_list
......@@ -6,4 +6,4 @@ dependencies:
package: Multilingual
version: VERSION
core: 8.x
configure: admin/config/regional/content-language
configure: language.content_settings_page
......@@ -6,4 +6,4 @@ version: VERSION
core: 8.x
dependencies:
- filter
configure: admin/config/content/formats
configure: filter.admin_overview
......@@ -5,4 +5,4 @@ package: Core
version: VERSION
core: 8.x
required: true
configure: admin/config/content/formats
configure: filter.admin_overview
......@@ -10,4 +10,4 @@ dependencies:
package: Core
version: VERSION
core: 8.x
configure: admin/structure/forum
configure: forum.overview
......@@ -6,4 +6,4 @@ version: VERSION
core: 8.x
dependencies:
- file
configure: admin/config/media/image-styles
configure: image.style_list
......@@ -4,4 +4,4 @@ description: 'Allows users to configure languages and apply them to content.'
package: Multilingual
version: VERSION
core: 8.x
configure: admin/config/regional/language
configure: language.admin_overview
......@@ -4,6 +4,6 @@ description: 'Allows administrators to customize the site navigation menu.'
package: Core
version: VERSION
core: 8.x
configure: admin/structure/menu
configure: menu.overview_page
dependencies:
- menu_link
......@@ -4,4 +4,4 @@ description: 'Allows content to be submitted to the site and displayed on pages.
package: Core
version: VERSION
core: 8.x
configure: admin/structure/types
configure: node.overview_types
......@@ -4,4 +4,4 @@ description: 'Allows users to rename URLs.'
package: Core
version: VERSION
core: 8.x
configure: admin/config/search/path
configure: path.admin_overview
......@@ -7,4 +7,4 @@ core: 8.x
dependencies:
- breakpoint
- image
configure: admin/config/media/picturemapping
configure: picture.mapping_page
......@@ -4,4 +4,4 @@ description: 'Enables site-wide keyword searching.'
package: Core
version: VERSION
core: 8.x
configure: admin/config/search/settings
configure: search.settings
......@@ -6,4 +6,4 @@ version: VERSION
core: 8.x
dependencies:
- menu_link
configure: admin/config/user-interface/shortcut
configure: shortcut.set_admin
......@@ -4,4 +4,4 @@ description: 'Provides a framework for unit and functional testing.'
package: Core
version: VERSION
core: 8.x
configure: admin/config/development/testing/settings
configure: simpletest.settings
......@@ -4,4 +4,4 @@ description: 'Logs content statistics for your site.'
package: Core
version: VERSION
core: 8.x
configure: admin/config/system/statistics
configure: statistics.settings
......@@ -4,4 +4,4 @@ description: 'Logs and records system events to syslog.'
package: Core
version: VERSION
core: 8.x
configure: admin/config/development/logging
configure: system.logging_settings
......@@ -12,6 +12,7 @@
use Drupal\Core\Form\FormBase;
use Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Core\Access\AccessManager;
/**
* Provides module installation interface.
......@@ -43,7 +44,8 @@ class ModulesListForm extends FormBase {
public static function create(ContainerInterface $container) {
return new static(
$container->get('module_handler'),
$container->get('keyvalue.expirable')->get('module_list')
$container->get('keyvalue.expirable')->get('module_list'),
$container->get('access_manager')
);
}
......@@ -54,10 +56,13 @@ public static function create(ContainerInterface $container) {
* The module handler.
* @param \Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface $key_value_expirable
* The key value expirable factory.
* @param \Drupal\Core\Access\AccessManager $access_manager
* Access manager.
*/
public function __construct(ModuleHandlerInterface $module_handler, KeyValueStoreExpirableInterface $key_value_expirable) {
public function __construct(ModuleHandlerInterface $module_handler, KeyValueStoreExpirableInterface $key_value_expirable, AccessManager $access_manager) {
$this->moduleHandler = $module_handler;
$this->keyValueExpirable = $key_value_expirable;
$this->accessManager = $access_manager;
}
/**
......@@ -193,12 +198,18 @@ protected function buildRow(array $modules, $module, $distribution) {
// Generate link for module's configuration page, if it has one.
$row['links']['configure'] = array();
if ($module->status && isset($module->info['configure'])) {
if (($configure = menu_get_item($module->info['configure'])) && $configure['access']) {
if ($this->accessManager->checkNamedRoute($module->info['configure'])) {
$item = menu_get_item(trim($this->url($module->info['configure']), '/'));
$row['links']['configure'] = array(
'#type' => 'link',
'#title' => $this->t('Configure'),
'#href' => $configure['href'],
'#options' => array('attributes' => array('class' => array('module-link', 'module-link-configure'), 'title' => $configure['description'])),
'#route_name' => $module->info['configure'],
'#options' => array(
'attributes' => array(
'class' => array('module-link', 'module-link-configure'),
'title' => $item['description'],
),
),
);
}
}
......
......@@ -5,4 +5,4 @@ package: Core
version: VERSION
core: 8.x
required: true
configure: admin/config/system
configure: system.admin_config_system
......@@ -6,4 +6,4 @@ version: VERSION
core: 8.x
dependencies:
- options
configure: admin/structure/taxonomy
configure: taxonomy.vocabulary_list
......@@ -7,4 +7,3 @@ version: VERSION
dependencies:
- breakpoint
- menu_link
configure: admin/structure/toolbar
......@@ -4,6 +4,6 @@ description: 'Checks for available updates, and can securely install or update m
version: VERSION
package: Core
core: 8.x
configure: admin/reports/updates/settings
configure: update.settings
dependencies:
- file
......@@ -5,4 +5,4 @@ package: Core
version: VERSION
core: 8.x
required: true
configure: admin/config/people
configure: user.admin_index
......@@ -4,6 +4,6 @@ description: 'Administrative interface for Views.'
package: Core
version: VERSION
core: 8.x
configure: admin/structure/views
configure: views_ui.list
dependencies:
- views
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment