From 3d14a7d25ac370a4616d095ade2f2d87de40b3b2 Mon Sep 17 00:00:00 2001 From: Alex Pott <alex.a.pott@googlemail.com> Date: Mon, 19 Jan 2015 09:37:11 +0000 Subject: [PATCH] Issue #2401505 by Berdir, jibran, larowlan: Add an entity collection template for lists --- core/lib/Drupal/Core/Entity/Entity.php | 7 +++++-- .../Core/Utility/LinkGeneratorInterface.php | 2 +- core/modules/action/action.info.yml | 2 +- core/modules/action/action.links.menu.yml | 2 +- core/modules/action/action.links.task.yml | 4 ++-- core/modules/action/action.module | 9 +++++---- core/modules/action/action.routing.yml | 2 +- core/modules/action/src/ActionFormBase.php | 2 +- .../action/src/Form/ActionDeleteForm.php | 2 +- .../src/Unit/Menu/ActionLocalTasksTest.php | 2 +- .../block_content/block_content.info.yml | 2 +- .../block_content.links.action.yml | 4 ++-- .../block_content/block_content.links.task.yml | 14 +++++++------- .../modules/block_content/block_content.module | 8 ++++---- .../block_content/block_content.routing.yml | 4 ++-- .../block_content/src/BlockContentForm.php | 2 +- .../block_content/src/BlockContentTypeForm.php | 2 +- .../block_content/src/Entity/BlockContent.php | 1 + .../src/Entity/BlockContentType.php | 3 ++- .../src/Form/BlockContentDeleteForm.php | 2 +- .../src/Form/BlockContentTypeDeleteForm.php | 2 +- .../LocalAction/BlockContentAddLocalAction.php | 2 +- .../src/Tests/BlockContentTypeTest.php | 2 +- .../Unit/Menu/BlockContentLocalTasksTest.php | 6 +++--- core/modules/comment/comment.links.action.yml | 2 +- core/modules/comment/comment.links.menu.yml | 4 ++-- core/modules/comment/comment.module | 4 ++-- core/modules/comment/comment.routing.yml | 2 +- core/modules/comment/src/CommentTypeForm.php | 2 +- .../modules/comment/src/Entity/CommentType.php | 3 ++- .../comment/src/Form/CommentTypeDeleteForm.php | 4 ++-- .../config_test/config_test.links.action.yml | 2 +- .../tests/config_test/config_test.routing.yml | 2 +- .../config_test/src/ConfigTestController.php | 4 ++-- .../tests/config_test/src/ConfigTestForm.php | 2 +- .../config_test/src/Entity/ConfigTest.php | 3 ++- .../src/Form/ConfigTestDeleteForm.php | 2 +- .../config_translation.module | 2 +- core/modules/contact/contact.info.yml | 2 +- core/modules/contact/contact.links.action.yml | 2 +- core/modules/contact/contact.links.menu.yml | 4 ++-- core/modules/contact/contact.module | 6 +++--- core/modules/contact/contact.routing.yml | 2 +- .../contact/src/ContactFormEditForm.php | 2 +- .../modules/contact/src/Entity/ContactForm.php | 3 ++- .../contact/src/Form/ContactFormDeleteForm.php | 2 +- .../content_translation.install | 2 +- .../content_translation.module | 4 ++-- core/modules/datetime/datetime.module | 2 +- .../modules/field_ui/field_ui.links.action.yml | 4 ++-- core/modules/field_ui/field_ui.links.menu.yml | 12 ++++++------ core/modules/field_ui/field_ui.links.task.yml | 18 +++++++++--------- core/modules/field_ui/field_ui.module | 9 ++++++--- core/modules/field_ui/field_ui.routing.yml | 6 +++--- .../src/Form/EntityDisplayModeDeleteForm.php | 3 +-- .../src/Form/EntityDisplayModeFormBase.php | 2 +- core/modules/image/image.info.yml | 2 +- core/modules/image/image.links.action.yml | 2 +- core/modules/image/image.links.menu.yml | 4 ++-- core/modules/image/image.links.task.yml | 6 +++--- core/modules/image/image.module | 6 +++--- core/modules/image/image.routing.yml | 2 +- core/modules/image/src/Entity/ImageStyle.php | 3 ++- .../image/src/Form/ImageStyleDeleteForm.php | 3 +-- .../image/src/Form/ImageStyleFlushForm.php | 3 +-- .../Field/FieldFormatter/ImageFormatter.php | 17 +++-------------- .../image/src/Tests/ImageFieldDisplayTest.php | 4 ++-- core/modules/language/language.info.yml | 2 +- .../modules/language/language.links.action.yml | 2 +- core/modules/language/language.links.menu.yml | 4 ++-- core/modules/language/language.links.task.yml | 8 ++++---- core/modules/language/language.module | 10 +++++----- core/modules/language/language.routing.yml | 2 +- .../src/Element/LanguageConfiguration.php | 2 +- .../src/Entity/ConfigurableLanguage.php | 3 ++- .../language/src/Form/LanguageAddForm.php | 2 +- .../language/src/Form/LanguageDeleteForm.php | 4 +--- .../language/src/Form/LanguageEditForm.php | 2 +- .../src/Tests/LanguageConfigurationTest.php | 2 +- ...LanguageCustomLanguageConfigurationTest.php | 4 ++-- .../language/src/Tests/LanguageListTest.php | 16 ++++++++-------- .../src/Unit/Menu/LanguageLocalTasksTest.php | 4 ++-- core/modules/locale/locale.module | 8 ++++---- .../locale/src/Form/TranslationStatusForm.php | 2 +- .../src/Tests/LocaleUpdateInterfaceTest.php | 2 +- .../src/Tests/MenuLinkContentUITest.php | 2 +- core/modules/menu_ui/menu_ui.info.yml | 2 +- core/modules/menu_ui/menu_ui.links.action.yml | 2 +- core/modules/menu_ui/menu_ui.links.menu.yml | 4 ++-- core/modules/menu_ui/menu_ui.links.task.yml | 6 +++--- core/modules/menu_ui/menu_ui.module | 7 ++++--- core/modules/menu_ui/menu_ui.routing.yml | 2 +- .../menu_ui/src/Form/MenuDeleteForm.php | 2 +- core/modules/node/node.info.yml | 2 +- core/modules/node/node.links.action.yml | 2 +- core/modules/node/node.links.menu.yml | 4 ++-- core/modules/node/node.links.task.yml | 6 +++--- core/modules/node/node.module | 2 +- core/modules/node/node.routing.yml | 2 +- core/modules/node/src/Entity/NodeType.php | 3 ++- .../node/src/Form/NodeTypeDeleteConfirm.php | 3 +-- core/modules/node/src/NodeTypeForm.php | 4 ++-- .../responsive_image/responsive_image.info.yml | 2 +- .../responsive_image.links.action.yml | 2 +- .../responsive_image.links.menu.yml | 4 ++-- .../responsive_image/responsive_image.module | 6 +++--- .../responsive_image.routing.yml | 2 +- .../src/Entity/ResponsiveImageMapping.php | 3 ++- .../Form/ResponsiveImageMappingDeleteForm.php | 2 +- .../src/ResponsiveImageMappingForm.php | 2 +- core/modules/search/search.info.yml | 2 +- core/modules/search/search.links.menu.yml | 4 ++-- core/modules/search/search.module | 8 ++++---- core/modules/search/search.routing.yml | 2 +- .../search/src/Controller/SearchController.php | 5 +++-- core/modules/search/src/Entity/SearchPage.php | 3 ++- .../modules/search/src/Form/ReindexConfirm.php | 2 +- .../search/src/Form/SearchPageDeleteForm.php | 3 +-- .../search/src/Form/SearchPageFormBase.php | 2 +- core/modules/shortcut/shortcut.info.yml | 2 +- .../modules/shortcut/shortcut.links.action.yml | 2 +- core/modules/shortcut/shortcut.links.menu.yml | 4 ++-- core/modules/shortcut/shortcut.module | 6 +++--- core/modules/shortcut/shortcut.routing.yml | 2 +- .../shortcut/src/Entity/ShortcutSet.php | 3 ++- .../src/Form/ShortcutSetDeleteForm.php | 2 +- .../system/src/Form/DateFormatDeleteForm.php | 3 +-- .../system/src/Form/DateFormatFormBase.php | 2 +- .../system/src/Tests/System/DateTimeTest.php | 6 +++--- core/modules/system/system.links.action.yml | 2 +- core/modules/system/system.links.menu.yml | 4 ++-- core/modules/system/system.links.task.yml | 6 +++--- core/modules/system/system.module | 5 +++-- core/modules/system/system.routing.yml | 2 +- .../entity_test/entity_test.routing.yml | 6 +++--- .../modules/taxonomy/src/Entity/Vocabulary.php | 3 ++- .../taxonomy/src/Form/TermDeleteForm.php | 5 +---- .../taxonomy/src/Form/VocabularyDeleteForm.php | 3 +-- core/modules/taxonomy/src/VocabularyForm.php | 2 +- core/modules/taxonomy/taxonomy.info.yml | 2 +- .../modules/taxonomy/taxonomy.links.action.yml | 2 +- core/modules/taxonomy/taxonomy.links.menu.yml | 4 ++-- core/modules/taxonomy/taxonomy.module | 6 +++--- core/modules/taxonomy/taxonomy.routing.yml | 2 +- core/modules/user/src/Entity/Role.php | 3 ++- core/modules/user/src/Entity/User.php | 1 + core/modules/user/src/Form/UserCancelForm.php | 2 +- .../src/Form/UserMultipleCancelConfirm.php | 8 ++++---- core/modules/user/src/Form/UserRoleDelete.php | 3 +-- core/modules/user/src/RoleForm.php | 2 +- .../tests/src/Unit/Menu/UserLocalTasksTest.php | 6 +++--- core/modules/user/user.links.action.yml | 4 ++-- core/modules/user/user.links.menu.yml | 4 ++-- core/modules/user/user.links.task.yml | 14 +++++++------- core/modules/user/user.module | 8 ++++---- core/modules/user/user.routing.yml | 4 ++-- .../selection/ViewsSelection.php | 2 +- .../src/Controller/ViewsUIController.php | 2 +- core/modules/views_ui/src/ViewAddForm.php | 4 ++-- core/modules/views_ui/src/ViewDeleteForm.php | 3 +-- core/modules/views_ui/src/ViewEditForm.php | 2 +- core/modules/views_ui/views_ui.info.yml | 2 +- .../modules/views_ui/views_ui.links.action.yml | 2 +- core/modules/views_ui/views_ui.links.menu.yml | 4 ++-- core/modules/views_ui/views_ui.links.task.yml | 8 ++++---- core/modules/views_ui/views_ui.module | 7 ++++--- core/modules/views_ui/views_ui.routing.yml | 2 +- 167 files changed, 317 insertions(+), 317 deletions(-) diff --git a/core/lib/Drupal/Core/Entity/Entity.php b/core/lib/Drupal/Core/Entity/Entity.php index 08c35c7a41ec..afdfcb04f1f1 100644 --- a/core/lib/Drupal/Core/Entity/Entity.php +++ b/core/lib/Drupal/Core/Entity/Entity.php @@ -274,9 +274,12 @@ public function url($rel = 'canonical', $options = array()) { * An array of URI placeholders. */ protected function urlRouteParameters($rel) { - // The entity ID is needed as a route parameter. - $uri_route_parameters[$this->getEntityTypeId()] = $this->id(); + $uri_route_parameters = []; + if ($rel != 'collection') { + // The entity ID is needed as a route parameter. + $uri_route_parameters[$this->getEntityTypeId()] = $this->id(); + } return $uri_route_parameters; } diff --git a/core/lib/Drupal/Core/Utility/LinkGeneratorInterface.php b/core/lib/Drupal/Core/Utility/LinkGeneratorInterface.php index ba4719784865..ef47ef55a97a 100644 --- a/core/lib/Drupal/Core/Utility/LinkGeneratorInterface.php +++ b/core/lib/Drupal/Core/Utility/LinkGeneratorInterface.php @@ -21,7 +21,7 @@ interface LinkGeneratorInterface { * However, for links enclosed in translatable text you should use t() and * embed the HTML anchor tag directly in the translated string. For example: * @code - * t('Visit the <a href="@url">content types</a> page', array('@url' => \Drupal::url('node.overview_types'))); + * t('Visit the <a href="@url">content types</a> page', array('@url' => \Drupal::url('entity.node_type.collection'))); * @endcode * This keeps the context of the link title ('settings' in the example) for * translators. diff --git a/core/modules/action/action.info.yml b/core/modules/action/action.info.yml index e99997d63664..7559efbcb297 100644 --- a/core/modules/action/action.info.yml +++ b/core/modules/action/action.info.yml @@ -4,4 +4,4 @@ description: 'Perform tasks on specific events triggered within the system.' package: Core version: VERSION core: 8.x -configure: action.admin +configure: entity.action.collection diff --git a/core/modules/action/action.links.menu.yml b/core/modules/action/action.links.menu.yml index fa5695125daa..cd18014e7487 100644 --- a/core/modules/action/action.links.menu.yml +++ b/core/modules/action/action.links.menu.yml @@ -1,5 +1,5 @@ action.admin: title: Actions description: 'Manage the actions defined for your site.' - route_name: action.admin + route_name: entity.action.collection parent: system.admin_config_system diff --git a/core/modules/action/action.links.task.yml b/core/modules/action/action.links.task.yml index 0ca44138bf3b..5a6a6e6984e3 100644 --- a/core/modules/action/action.links.task.yml +++ b/core/modules/action/action.links.task.yml @@ -1,4 +1,4 @@ action.admin: - route_name: action.admin + route_name: entity.action.collection title: 'Manage actions' - base_route: action.admin + base_route: entity.action.collection diff --git a/core/modules/action/action.module b/core/modules/action/action.module index 22138ae1b8e6..2fb412a34b0a 100644 --- a/core/modules/action/action.module +++ b/core/modules/action/action.module @@ -19,13 +19,13 @@ function action_help($route_name, RouteMatchInterface $route_match) { $output .= '<h3>' . t('Uses') . '</h3>'; $output .= '<dl>'; $output .= '<dt>' . t('Using simple actions') . '</dt>'; - $output .= '<dd>' . t('<em>Simple actions</em> do not require configuration and are listed automatically as available on the <a href="!actions">Actions page</a>.', array('!actions' => \Drupal::url('action.admin'))) . '</dd>'; + $output .= '<dd>' . t('<em>Simple actions</em> do not require configuration and are listed automatically as available on the <a href="!actions">Actions page</a>.', array('!actions' => \Drupal::url('entity.action.collection'))) . '</dd>'; $output .= '<dt>' . t('Creating and configuring advanced actions') . '</dt>'; - $output .= '<dd>' . t('<em>Advanced actions</em> are user-created and have to be configured individually. Create an advanced action on the <a href="!actions">Actions page</a> by selecting an action type from the drop-down list. Then configure your action, for example by specifying the recipient of an automated email message.', array('!actions' => \Drupal::url('action.admin'))) . '</dd>'; + $output .= '<dd>' . t('<em>Advanced actions</em> are user-created and have to be configured individually. Create an advanced action on the <a href="!actions">Actions page</a> by selecting an action type from the drop-down list. Then configure your action, for example by specifying the recipient of an automated email message.', array('!actions' => \Drupal::url('entity.action.collection'))) . '</dd>'; $output .= '</dl>'; return $output; - case 'action.admin': + case 'entity.action.collection': $output = '<p>' . t('There are two types of actions: simple and advanced. Simple actions do not require any additional configuration and are listed here automatically. Advanced actions need to be created and configured before they can be used because they have options that need to be specified; for example, sending an email to a specified address or unpublishing content containing certain words. To create an advanced action, select the action from the drop-down list in the advanced action section below and click the <em>Create</em> button.') . '</p>'; return $output; @@ -45,5 +45,6 @@ function action_entity_type_build(array &$entity_types) { ->setFormClass('delete', 'Drupal\action\Form\ActionDeleteForm') ->setListBuilderClass('Drupal\action\ActionListBuilder') ->setLinkTemplate('delete-form', '/admin/config/system/actions/configure/{action}/delete') - ->setLinkTemplate('edit-form', '/admin/config/system/actions/configure/{action}'); + ->setLinkTemplate('edit-form', '/admin/config/system/actions/configure/{action}') + ->setLinkTemplate('collection', '/admin/config/system/actions'); } diff --git a/core/modules/action/action.routing.yml b/core/modules/action/action.routing.yml index c75ff23e31d6..acb533acb9da 100644 --- a/core/modules/action/action.routing.yml +++ b/core/modules/action/action.routing.yml @@ -1,4 +1,4 @@ -action.admin: +entity.action.collection: path: '/admin/config/system/actions' defaults: _title: 'Actions' diff --git a/core/modules/action/src/ActionFormBase.php b/core/modules/action/src/ActionFormBase.php index e6f0c9152b41..96bb63d06360 100644 --- a/core/modules/action/src/ActionFormBase.php +++ b/core/modules/action/src/ActionFormBase.php @@ -149,7 +149,7 @@ public function save(array $form, FormStateInterface $form_state) { $this->entity->save(); drupal_set_message($this->t('The action has been successfully saved.')); - $form_state->setRedirect('action.admin'); + $form_state->setRedirect('entity.action.collection'); } } diff --git a/core/modules/action/src/Form/ActionDeleteForm.php b/core/modules/action/src/Form/ActionDeleteForm.php index 86e5eefb978f..93e47abde9ed 100644 --- a/core/modules/action/src/Form/ActionDeleteForm.php +++ b/core/modules/action/src/Form/ActionDeleteForm.php @@ -34,7 +34,7 @@ public function getConfirmText() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('action.admin'); + return new Url('entity.action.collection'); } /** diff --git a/core/modules/action/tests/src/Unit/Menu/ActionLocalTasksTest.php b/core/modules/action/tests/src/Unit/Menu/ActionLocalTasksTest.php index 2aa448b0d2ac..e69ba71e80fa 100644 --- a/core/modules/action/tests/src/Unit/Menu/ActionLocalTasksTest.php +++ b/core/modules/action/tests/src/Unit/Menu/ActionLocalTasksTest.php @@ -25,7 +25,7 @@ protected function setUp() { * Tests local task existence. */ public function testActionLocalTasks() { - $this->assertLocalTasks('action.admin', array(array('action.admin'))); + $this->assertLocalTasks('entity.action.collection', array(array('action.admin'))); } } diff --git a/core/modules/block_content/block_content.info.yml b/core/modules/block_content/block_content.info.yml index e9e7afbf13fe..d32bda79aabe 100644 --- a/core/modules/block_content/block_content.info.yml +++ b/core/modules/block_content/block_content.info.yml @@ -7,4 +7,4 @@ core: 8.x dependencies: - block - text -configure: block_content.list +configure: entity.block_content.collection diff --git a/core/modules/block_content/block_content.links.action.yml b/core/modules/block_content/block_content.links.action.yml index 735e3747722a..d94ca3fc495c 100644 --- a/core/modules/block_content/block_content.links.action.yml +++ b/core/modules/block_content/block_content.links.action.yml @@ -2,7 +2,7 @@ block_content_type_add: route_name: block_content.type_add title: 'Add custom block type' appears_on: - - block_content.type_list + - entity.block_content_type.collection block_content_add_action: route_name: block_content.add_page @@ -10,5 +10,5 @@ block_content_add_action: appears_on: - block.admin_display - block.admin_display_theme - - block_content.list + - entity.block_content.collection class: \Drupal\block_content\Plugin\Menu\LocalAction\BlockContentAddLocalAction diff --git a/core/modules/block_content/block_content.links.task.yml b/core/modules/block_content/block_content.links.task.yml index bc29ba65360f..2b8817131444 100644 --- a/core/modules/block_content/block_content.links.task.yml +++ b/core/modules/block_content/block_content.links.task.yml @@ -1,15 +1,15 @@ -block_content.list: +entity.block_content.collection: title: 'Custom block library' - route_name: block_content.list + route_name: entity.block_content.collection base_route: block.admin_display block_content.list_sub: title: Blocks - route_name: block_content.list - parent_id: block_content.list -block_content.type_list: + route_name: entity.block_content.collection + parent_id: entity.block_content.collection +entity.block_content_type.collection: title: Types - route_name: block_content.type_list - parent_id: block_content.list + route_name: entity.block_content_type.collection + parent_id: entity.block_content.collection weight: 1 entity.block_content.canonical: diff --git a/core/modules/block_content/block_content.module b/core/modules/block_content/block_content.module index ac45e62c1a50..1a6487872af1 100644 --- a/core/modules/block_content/block_content.module +++ b/core/modules/block_content/block_content.module @@ -17,21 +17,21 @@ function block_content_help($route_name, RouteMatchInterface $route_match) { case 'help.page.block_content': $output = ''; $output .= '<h3>' . t('About') . '</h3>'; - $output .= '<p>' . t('The Custom Block module allows you to create blocks of content, which can be placed in regions throughout the website. Custom blocks can have fields; see the <a href="!field-help">Field module help</a> for more information. Once created, custom blocks can be placed like blocks provided by other modules; see the <a href="!blocks">Block module help page</a> for details. For more information, see <a href="!online-help">the online documentation for the Custom Block module</a>.', array('!block-content' => \Drupal::url('block_content.list'), '!field-help' => \Drupal::url('help.page', array('name' => 'field')), '!blocks' => \Drupal::url('help.page', array('name' => 'block')), '!online-help' => 'https://drupal.org/documentation/modules/block_content')) . '</p>'; + $output .= '<p>' . t('The Custom Block module allows you to create blocks of content, which can be placed in regions throughout the website. Custom blocks can have fields; see the <a href="!field-help">Field module help</a> for more information. Once created, custom blocks can be placed like blocks provided by other modules; see the <a href="!blocks">Block module help page</a> for details. For more information, see <a href="!online-help">the online documentation for the Custom Block module</a>.', array('!block-content' => \Drupal::url('entity.block_content.collection'), '!field-help' => \Drupal::url('help.page', array('name' => 'field')), '!blocks' => \Drupal::url('help.page', array('name' => 'block')), '!online-help' => 'https://drupal.org/documentation/modules/block_content')) . '</p>'; $output .= '<h3>' . t('Uses') . '</h3>'; $output .= '<dl>'; $output .= '<dt>' . t('Creating and managing custom block types') . '</dt>'; - $output .= '<dd>' . t('Users with the <em>Administer blocks</em> permission can create different custom block types, each with different fields and display settings, from the <a href="!types">Custom block types</a> page. The Custom block types page lists all of your created custom block types, and allows you to edit and manage them. For more information about managing fields and display settings, see the <a href="!field-ui">Field UI module help</a>.', array('!types' => \Drupal::url('block_content.type_list'), '!field-ui' => \Drupal::url('help.page', array('name' => 'field_ui')))) . '</dd>'; + $output .= '<dd>' . t('Users with the <em>Administer blocks</em> permission can create different custom block types, each with different fields and display settings, from the <a href="!types">Custom block types</a> page. The Custom block types page lists all of your created custom block types, and allows you to edit and manage them. For more information about managing fields and display settings, see the <a href="!field-ui">Field UI module help</a>.', array('!types' => \Drupal::url('entity.block_content_type.collection'), '!field-ui' => \Drupal::url('help.page', array('name' => 'field_ui')))) . '</dd>'; $output .= '<dt>' . t('Creating custom blocks') . '</dt>'; $output .= '<dd>' . t('Users with the <em>Administer blocks</em> permission can <a href="!block-add">add custom blocks</a> of each of their defined custom block types. Created custom blocks are then listed on the <a href="!blocks">Blocks administration page</a>.', array('!blocks' => \Drupal::url('block.admin_display'), '!block-add' => \Drupal::url('block_content.add_page'))) . '</dd>'; $output .= '</dl>'; return $output; - case 'block_content.list': + case 'entity.block_content.collection': $output = '<p>' . t('This page lists user-created blocks. These blocks are derived from block types. A block type can consist of different fields and display settings. From the block types tab you can manage these fields as well as create new block types.') . '</p>'; return $output; - case 'block_content.type_list': + case 'entity.block_content_type.collection': $output = '<p>' . t('This page lists block types. A block type can consist of different fields and display settings. From here you can manage these fields as well as create new block types.') . '</p>'; return $output; diff --git a/core/modules/block_content/block_content.routing.yml b/core/modules/block_content/block_content.routing.yml index 6ab793751c52..1c78f0cb9e39 100644 --- a/core/modules/block_content/block_content.routing.yml +++ b/core/modules/block_content/block_content.routing.yml @@ -1,4 +1,4 @@ -block_content.type_list: +entity.block_content_type.collection: path: '/admin/structure/block/block-content/types' defaults: _entity_list: 'block_content_type' @@ -80,7 +80,7 @@ entity.block_content_type.edit_form: requirements: _entity_access: 'block_content_type.update' -block_content.list: +entity.block_content.collection: path: '/admin/structure/block/block-content' defaults: _title: 'Custom block library' diff --git a/core/modules/block_content/src/BlockContentForm.php b/core/modules/block_content/src/BlockContentForm.php index 994d956f2f05..1b81be233764 100644 --- a/core/modules/block_content/src/BlockContentForm.php +++ b/core/modules/block_content/src/BlockContentForm.php @@ -198,7 +198,7 @@ public function save(array $form, FormStateInterface $form_state) { ); } else { - $form_state->setRedirect('block_content.list'); + $form_state->setRedirectUrl($block->urlInfo('collection')); } } else { diff --git a/core/modules/block_content/src/BlockContentTypeForm.php b/core/modules/block_content/src/BlockContentTypeForm.php index 7e18e397bb5a..c0f9ec53e3df 100644 --- a/core/modules/block_content/src/BlockContentTypeForm.php +++ b/core/modules/block_content/src/BlockContentTypeForm.php @@ -108,7 +108,7 @@ public function save(array $form, FormStateInterface $form_state) { $logger->notice('Custom block type %label has been added.', array('%label' => $block_type->label(), 'link' => $edit_link)); } - $form_state->setRedirect('block_content.type_list'); + $form_state->setRedirectUrl($this->entity->urlInfo('collection')); } } diff --git a/core/modules/block_content/src/Entity/BlockContent.php b/core/modules/block_content/src/Entity/BlockContent.php index f3c47671766d..ef48ac6c5b2e 100644 --- a/core/modules/block_content/src/Entity/BlockContent.php +++ b/core/modules/block_content/src/Entity/BlockContent.php @@ -42,6 +42,7 @@ * "canonical" = "/block/{block_content}", * "delete-form" = "/block/{block_content}/delete", * "edit-form" = "/block/{block_content}", + * "collection" = "/admin/structure/block/block-content", * }, * translatable = TRUE, * entity_keys = { diff --git a/core/modules/block_content/src/Entity/BlockContentType.php b/core/modules/block_content/src/Entity/BlockContentType.php index 586cc1ea69a9..81b64e90491a 100644 --- a/core/modules/block_content/src/Entity/BlockContentType.php +++ b/core/modules/block_content/src/Entity/BlockContentType.php @@ -36,7 +36,8 @@ * }, * links = { * "delete-form" = "/admin/structure/block/block-content/manage/{block_content_type}/delete", - * "edit-form" = "/admin/structure/block/block-content/manage/{block_content_type}" + * "edit-form" = "/admin/structure/block/block-content/manage/{block_content_type}", + * "collection" = "/admin/structure/block/block-content/types", * } * ) */ diff --git a/core/modules/block_content/src/Form/BlockContentDeleteForm.php b/core/modules/block_content/src/Form/BlockContentDeleteForm.php index 26e55f4cddcd..0778ee286e48 100644 --- a/core/modules/block_content/src/Form/BlockContentDeleteForm.php +++ b/core/modules/block_content/src/Form/BlockContentDeleteForm.php @@ -58,7 +58,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) { $this->entity->delete(); drupal_set_message($this->t('Custom block %label has been deleted.', array('%label' => $this->entity->label()))); $this->logger('block_content')->notice('Custom block %label has been deleted.', array('%label' => $this->entity->label())); - $form_state->setRedirect('block_content.list'); + $form_state->setRedirectUrl($this->entity->urlInfo('collection')); } } diff --git a/core/modules/block_content/src/Form/BlockContentTypeDeleteForm.php b/core/modules/block_content/src/Form/BlockContentTypeDeleteForm.php index 4c7d909464c1..9b07b96c3954 100644 --- a/core/modules/block_content/src/Form/BlockContentTypeDeleteForm.php +++ b/core/modules/block_content/src/Form/BlockContentTypeDeleteForm.php @@ -55,7 +55,7 @@ public function getQuestion() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('block_content.type_list'); + return $this->entity->urlInfo('collection'); } /** diff --git a/core/modules/block_content/src/Plugin/Menu/LocalAction/BlockContentAddLocalAction.php b/core/modules/block_content/src/Plugin/Menu/LocalAction/BlockContentAddLocalAction.php index 1cf3bdcd30c3..86921ec19d40 100644 --- a/core/modules/block_content/src/Plugin/Menu/LocalAction/BlockContentAddLocalAction.php +++ b/core/modules/block_content/src/Plugin/Menu/LocalAction/BlockContentAddLocalAction.php @@ -25,7 +25,7 @@ public function getOptions(RouteMatchInterface $route_match) { $options['query']['theme'] = $theme; } // Adds a destination on custom block listing. - if ($route_match->getRouteName() == 'block_content.list') { + if ($route_match->getRouteName() == 'entity.block_content.collection') { $options['query']['destination'] = 'admin/structure/block/block-content'; } return $options; diff --git a/core/modules/block_content/src/Tests/BlockContentTypeTest.php b/core/modules/block_content/src/Tests/BlockContentTypeTest.php index 60f12100373f..d59a25d82c73 100644 --- a/core/modules/block_content/src/Tests/BlockContentTypeTest.php +++ b/core/modules/block_content/src/Tests/BlockContentTypeTest.php @@ -197,7 +197,7 @@ public function testsBlockContentAddTypes() { $this->drupalPostForm(NULL, $edit, t('Save')); $blocks = $storage->loadByProperties(array('info' => $edit['info[0][value]'])); if (!empty($blocks)) { - $this->assertUrl(\Drupal::url('block_content.list', array(), array('absolute' => TRUE))); + $this->assertUrl(\Drupal::url('entity.block_content.collection', array(), array('absolute' => TRUE))); } else { $this->fail('Could not load created block.'); diff --git a/core/modules/block_content/tests/src/Unit/Menu/BlockContentLocalTasksTest.php b/core/modules/block_content/tests/src/Unit/Menu/BlockContentLocalTasksTest.php index 7f95e6b32754..83cbcf803353 100644 --- a/core/modules/block_content/tests/src/Unit/Menu/BlockContentLocalTasksTest.php +++ b/core/modules/block_content/tests/src/Unit/Menu/BlockContentLocalTasksTest.php @@ -64,11 +64,11 @@ public function testBlockContentListLocalTasks($route) { $this->assertLocalTasks($route, array( 0 => array( 'block.admin_display', - 'block_content.list', + 'entity.block_content.collection', ), 1 => array( 'block_content.list_sub', - 'block_content.type_list', + 'entity.block_content_type.collection', ), )); } @@ -78,7 +78,7 @@ public function testBlockContentListLocalTasks($route) { */ public function getBlockContentListingRoutes() { return array( - array('block_content.list', 'block_content.type_list'), + array('entity.block_content.collection', 'entity.block_content_type.collection'), ); } diff --git a/core/modules/comment/comment.links.action.yml b/core/modules/comment/comment.links.action.yml index fc97d2d24ec6..6cd1f8b2af1b 100644 --- a/core/modules/comment/comment.links.action.yml +++ b/core/modules/comment/comment.links.action.yml @@ -2,4 +2,4 @@ comment_type_add: route_name: entity.comment_type.add_form title: 'Add comment type' appears_on: - - comment.type_list + - entity.comment_type.collection diff --git a/core/modules/comment/comment.links.menu.yml b/core/modules/comment/comment.links.menu.yml index e4d4488b58bc..8c81e68ba4ea 100644 --- a/core/modules/comment/comment.links.menu.yml +++ b/core/modules/comment/comment.links.menu.yml @@ -3,8 +3,8 @@ comment.admin: route_name: comment.admin parent: system.admin_content description: 'List and edit site comments and the comment approval queue.' -comment.type_list: +entity.comment_type.collection: title: 'Comment types' - route_name: comment.type_list + route_name: entity.comment_type.collection parent: system.admin_structure description: 'Manage form and displays settings of comments.' diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index 32a6e321e51a..163b13a4c49a 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -69,7 +69,7 @@ function comment_help($route_name, RouteMatchInterface $route_match) { $output .= '<h3>' . t('Uses') . '</h3>'; $output .= '<dl>'; $output .= '<dt>' . t('Enabling commenting and configuring defaults') . '</dt>'; - $output .= '<dd>' . t('Comment functionality can be enabled for any entity sub-type (for example, a <a href="!content-type">content type</a>). On the Manage fields page for each entity sub-type, you can enable commenting by adding a Comments field. The entity sub-types each have their own default comment settings configured as: <em>Open</em> to allow new comments, <em>Closed</em> to view existing comments, but prevent new comments, or <em>Hidden</em> to hide existing comments and prevent new comments. For background information about entities, see the <a href="!field">Field module help page</a>.', array('!content-type' => \Drupal::url('node.overview_types'), '!field' => \Drupal::url('help.page', array('name' => 'field')))) . '</dd>'; + $output .= '<dd>' . t('Comment functionality can be enabled for any entity sub-type (for example, a <a href="!content-type">content type</a>). On the Manage fields page for each entity sub-type, you can enable commenting by adding a Comments field. The entity sub-types each have their own default comment settings configured as: <em>Open</em> to allow new comments, <em>Closed</em> to view existing comments, but prevent new comments, or <em>Hidden</em> to hide existing comments and prevent new comments. For background information about entities, see the <a href="!field">Field module help page</a>.', array('!content-type' => \Drupal::url('entity.node_type.collection'), '!field' => \Drupal::url('help.page', array('name' => 'field')))) . '</dd>'; $output .= '<dt>' . t('Overriding default settings') . '</dt>'; $output .= '<dd>' . t('When you create an entity item, you can override the default comment settings. Changing the entity sub-type defaults will not affect existing entity items, whether they used the default settings or had overrides.') . '</dd>'; $output .= '<dt>' . t('Approving and managing comments') . '</dt>'; @@ -77,7 +77,7 @@ function comment_help($route_name, RouteMatchInterface $route_match) { $output .= '</dl>'; return $output; - case 'comment.type_list': + case 'entity.comment_type.collection': $output = '<p>' . t('This page provides a list of all comment types on the site and allows you to manage the fields, form and display settings for each.') . '</p>'; return $output; } diff --git a/core/modules/comment/comment.routing.yml b/core/modules/comment/comment.routing.yml index 521138746bc0..4799400aeeae 100644 --- a/core/modules/comment/comment.routing.yml +++ b/core/modules/comment/comment.routing.yml @@ -78,7 +78,7 @@ comment.node_redirect: _entity_access: 'node.view' _module_dependencies: 'node' -comment.type_list: +entity.comment_type.collection: path: '/admin/structure/comment' defaults: _entity_list: 'comment_type' diff --git a/core/modules/comment/src/CommentTypeForm.php b/core/modules/comment/src/CommentTypeForm.php index db9361aa18e5..3c7ef6af6f2f 100644 --- a/core/modules/comment/src/CommentTypeForm.php +++ b/core/modules/comment/src/CommentTypeForm.php @@ -173,7 +173,7 @@ public function save(array $form, FormStateInterface $form_state) { $this->logger->notice('Comment type %label has been added.', array('%label' => $comment_type->label(), 'link' => $edit_link)); } - $form_state->setRedirect('comment.type_list'); + $form_state->setRedirectUrl($comment_type->urlInfo('collection')); } } diff --git a/core/modules/comment/src/Entity/CommentType.php b/core/modules/comment/src/Entity/CommentType.php index 80a1aaade61a..fb4144284b7e 100644 --- a/core/modules/comment/src/Entity/CommentType.php +++ b/core/modules/comment/src/Entity/CommentType.php @@ -36,7 +36,8 @@ * links = { * "delete-form" = "/admin/structure/comment/manage/{comment_type}/delete", * "edit-form" = "/admin/structure/comment/manage/{comment_type}", - * "add-form" = "/admin/structure/comment/types/add" + * "add-form" = "/admin/structure/comment/types/add", + * "collection" = "/admin/structure/comment/types", * } * ) */ diff --git a/core/modules/comment/src/Form/CommentTypeDeleteForm.php b/core/modules/comment/src/Form/CommentTypeDeleteForm.php index 7ac7ce72156e..6fe26d4ccf1a 100644 --- a/core/modules/comment/src/Form/CommentTypeDeleteForm.php +++ b/core/modules/comment/src/Form/CommentTypeDeleteForm.php @@ -99,7 +99,7 @@ public function getQuestion() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('comment.type_list'); + return $this->entity->urlInfo('collection'); } /** @@ -143,7 +143,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { */ public function submitForm(array &$form, FormStateInterface $form_state) { $this->entity->delete(); - $form_state->setRedirect('comment.type_list'); + $form_state->setRedirectUrl($this->entity->urlInfo('collection')); drupal_set_message($this->t('Comment type %label has been deleted.', array('%label' => $this->entity->label()))); $this->logger->notice('comment type %label has been deleted.', array('%label' => $this->entity->label())); } diff --git a/core/modules/config/tests/config_test/config_test.links.action.yml b/core/modules/config/tests/config_test/config_test.links.action.yml index 8e1e4a4c5dfc..f70a79080ab2 100644 --- a/core/modules/config/tests/config_test/config_test.links.action.yml +++ b/core/modules/config/tests/config_test/config_test.links.action.yml @@ -2,4 +2,4 @@ config_test_entity_add_local_action: route_name: config_test.entity_add title: 'Add test configuration' appears_on: - - config_test.list_page + - entity.config_test.collection diff --git a/core/modules/config/tests/config_test/config_test.routing.yml b/core/modules/config/tests/config_test/config_test.routing.yml index 3a964818f700..569b601cecac 100644 --- a/core/modules/config/tests/config_test/config_test.routing.yml +++ b/core/modules/config/tests/config_test/config_test.routing.yml @@ -1,4 +1,4 @@ -config_test.list_page: +entity.config_test.collection: path: '/admin/structure/config_test' defaults: _entity_list: 'config_test' diff --git a/core/modules/config/tests/config_test/src/ConfigTestController.php b/core/modules/config/tests/config_test/src/ConfigTestController.php index cb626429a0f0..a195a6e06f31 100644 --- a/core/modules/config/tests/config_test/src/ConfigTestController.php +++ b/core/modules/config/tests/config_test/src/ConfigTestController.php @@ -41,7 +41,7 @@ public function editTitle(ConfigTest $config_test) { */ function enable(ConfigTest $config_test) { $config_test->enable()->save(); - return new RedirectResponse($this->url('config_test.list_page', array(), array('absolute' => TRUE))); + return new RedirectResponse($config_test->url('collection', array('absolute' => TRUE))); } /** @@ -55,7 +55,7 @@ function enable(ConfigTest $config_test) { */ function disable(ConfigTest $config_test) { $config_test->disable()->save(); - return new RedirectResponse(\Drupal::url('config_test.list_page', array(), array('absolute' => TRUE))); + return new RedirectResponse($config_test->url('collection', array('absolute' => TRUE))); } } diff --git a/core/modules/config/tests/config_test/src/ConfigTestForm.php b/core/modules/config/tests/config_test/src/ConfigTestForm.php index cb847ee4a49f..e77ddb069fb7 100644 --- a/core/modules/config/tests/config_test/src/ConfigTestForm.php +++ b/core/modules/config/tests/config_test/src/ConfigTestForm.php @@ -81,7 +81,7 @@ public function save(array $form, FormStateInterface $form_state) { drupal_set_message(format_string('%label configuration has been created.', array('%label' => $entity->label()))); } - $form_state->setRedirect('config_test.list_page'); + $form_state->setRedirectUrl($this->entity->urlInfo('collection')); } } diff --git a/core/modules/config/tests/config_test/src/Entity/ConfigTest.php b/core/modules/config/tests/config_test/src/Entity/ConfigTest.php index d9b69df63e68..e27fc16ef1f1 100644 --- a/core/modules/config/tests/config_test/src/Entity/ConfigTest.php +++ b/core/modules/config/tests/config_test/src/Entity/ConfigTest.php @@ -37,7 +37,8 @@ * "edit-form" = "/admin/structure/config_test/manage/{config_test}", * "delete-form" = "/admin/structure/config_test/manage/{config_test}/delete", * "enable" = "/admin/structure/config_test/manage/{config_test}/enable", - * "disable" = "/admin/structure/config_test/manage/{config_test}/disable" + * "disable" = "/admin/structure/config_test/manage/{config_test}/disable", + * "collection" = "/admin/structure/config_test", * } * ) */ diff --git a/core/modules/config/tests/config_test/src/Form/ConfigTestDeleteForm.php b/core/modules/config/tests/config_test/src/Form/ConfigTestDeleteForm.php index 76fc67e24332..05d9dc2e9f55 100644 --- a/core/modules/config/tests/config_test/src/Form/ConfigTestDeleteForm.php +++ b/core/modules/config/tests/config_test/src/Form/ConfigTestDeleteForm.php @@ -34,7 +34,7 @@ public function getConfirmText() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('config_test.list_page'); + return $this->entity->urlInfo('collection'); } /** diff --git a/core/modules/config_translation/config_translation.module b/core/modules/config_translation/config_translation.module index 3655d49551c5..ea4e532d0933 100644 --- a/core/modules/config_translation/config_translation.module +++ b/core/modules/config_translation/config_translation.module @@ -23,7 +23,7 @@ function config_translation_help($route_name, RouteMatchInterface $route_match) $output .= '<h3>' . t('Uses') . '</h3>'; $output .= '<dl>'; $output .= '<dt>' . t('Enabling translation') . '</dt>'; - $output .= '<dd>' . t('In order to translate configuration, the website must have at least two <a href="!url">languages</a>.', array('!url' => \Drupal::url('language.admin_overview'))) . '</dd>'; + $output .= '<dd>' . t('In order to translate configuration, the website must have at least two <a href="!url">languages</a>.', array('!url' => \Drupal::url('entity.configurable_language.collection'))) . '</dd>'; $output .= '<dt>' . t('Translating configuration text') . '</dt>'; $output .= '<dd>' . t('Users with the <em>Translate user edited configuration</em> permission can access the configuration translation overview, and manage translations for specific languages. The <a href="!translation-page">Configuration translation</a> page shows a list of all configuration text that can be translated, either as individual items or as lists. After you click on <em>Translate</em>, you are provided with a list of all languages. You can <em>add</em> or <em>edit</em> a translation for a specific language. Users with specific configuration permissions can also <em>edit</em> the text for the site\'s default language. For some configuration text items (for example for the site information), the specific translation pages can also be accessed directly from their configuration pages.', array('!translation-page' => \Drupal::url('config_translation.mapper_list'))) . '</dd>'; $output .= '<dt>' . t('Translating date formats') . '</dt>'; diff --git a/core/modules/contact/contact.info.yml b/core/modules/contact/contact.info.yml index a50d17dd86a4..2507fbd167c8 100644 --- a/core/modules/contact/contact.info.yml +++ b/core/modules/contact/contact.info.yml @@ -4,4 +4,4 @@ description: 'Enables the use of both personal and site-wide contact forms.' package: Core version: VERSION core: 8.x -configure: contact.form_list +configure: entity.contact_form.collection diff --git a/core/modules/contact/contact.links.action.yml b/core/modules/contact/contact.links.action.yml index 78e139a7ddcd..a191f806289e 100644 --- a/core/modules/contact/contact.links.action.yml +++ b/core/modules/contact/contact.links.action.yml @@ -3,4 +3,4 @@ contact.form_add: title: 'Add contact form' weight: 1 appears_on: - - contact.form_list + - entity.contact_form.collection diff --git a/core/modules/contact/contact.links.menu.yml b/core/modules/contact/contact.links.menu.yml index 92c15d0b0f8b..45db457a0384 100644 --- a/core/modules/contact/contact.links.menu.yml +++ b/core/modules/contact/contact.links.menu.yml @@ -1,8 +1,8 @@ -contact.form_list: +entity.contact_form.collection: title: 'Contact forms' parent: system.admin_structure description: 'Create and manage contact forms.' - route_name: contact.form_list + route_name: entity.contact_form.collection contact.site_page: title: Contact route_name: contact.site_page diff --git a/core/modules/contact/contact.module b/core/modules/contact/contact.module index 970032112a29..921e017408d4 100644 --- a/core/modules/contact/contact.module +++ b/core/modules/contact/contact.module @@ -24,15 +24,15 @@ function contact_help($route_name, RouteMatchInterface $route_match) { $output .= '<dt>' . t('Site-wide contact forms') . '</dt>'; $output .= '<dd>' . t('The <a href="@contact">Contact page</a> provides a simple form for users with the <em>Use the site-wide contact form</em> permission to send comments, feedback, or other requests. You can create forms for directing the contact messages to a set of defined recipients. Common forms for a business site, for example, might include "Website feedback" (messages are forwarded to website administrators) and "Product information" (messages are forwarded to members of the sales department). Email addresses defined within a form are not displayed publicly.', array('@contact' => \Drupal::url('contact.site_page'))) . '</p>'; $output .= '<dt>' . t('Navigation') . '</dt>'; - $output .= '<dd>' . t('When the site-wide contact form is enabled, a link in the <em>Footer</em> menu is created, which you can modify on the <a href="@menu">Menus administration page</a>.', array('@menu' => \Drupal::url('menu_ui.overview_page'))) . '</dd>'; + $output .= '<dd>' . t('When the site-wide contact form is enabled, a link in the <em>Footer</em> menu is created, which you can modify on the <a href="@menu">Menus administration page</a>.', array('@menu' => \Drupal::url('entity.menu.collection'))) . '</dd>'; $output .= '<dt>' . t('Customization') . '</dt>'; $output .= '<dd>' . t('If you would like additional text to appear on the site-wide or personal contact page, use a block. You can create and edit blocks on the <a href="@blocks">Blocks administration page</a>.', array('@blocks' => \Drupal::url('block.admin_display'))) . '</dd>'; $output .= '</dl>'; return $output; - case 'contact.form_list': + case 'entity.contact_form.collection': $output = '<p>' . t('Add one or more forms on this page to set up your site-wide <a href="@form">contact form</a>.', array('@form' => \Drupal::url('contact.site_page'))) . '</p>'; - $output .= '<p>' . t('A <em>Contact</em> menu item is added to the <em>Footer</em> menu, which you can modify on the <a href="@menu-settings">Menus administration page</a>.', array('@menu-settings' => \Drupal::url('menu_ui.overview_page'))) . '</p>'; + $output .= '<p>' . t('A <em>Contact</em> menu item is added to the <em>Footer</em> menu, which you can modify on the <a href="@menu-settings">Menus administration page</a>.', array('@menu-settings' => \Drupal::url('entity.menu.collection'))) . '</p>'; $output .= '<p>' . t('If you would like additional text to appear on the site-wide contact page, use a block. You can create and edit blocks on the <a href="@blocks">Blocks administration page</a>.', array('@blocks' => \Drupal::url('block.admin_display'))) . '</p>'; return $output; } diff --git a/core/modules/contact/contact.routing.yml b/core/modules/contact/contact.routing.yml index 876157d36def..2608a377fa1b 100644 --- a/core/modules/contact/contact.routing.yml +++ b/core/modules/contact/contact.routing.yml @@ -6,7 +6,7 @@ entity.contact_form.delete_form: requirements: _entity_access: 'contact_form.delete' -contact.form_list: +entity.contact_form.collection: path: '/admin/structure/contact' defaults: _entity_list: 'contact_form' diff --git a/core/modules/contact/src/ContactFormEditForm.php b/core/modules/contact/src/ContactFormEditForm.php index 420be7da1f8f..cc761529ea99 100644 --- a/core/modules/contact/src/ContactFormEditForm.php +++ b/core/modules/contact/src/ContactFormEditForm.php @@ -130,7 +130,7 @@ public function save(array $form, FormStateInterface $form_state) { ->save(); } - $form_state->setRedirect('contact.form_list'); + $form_state->setRedirectUrl($contact_form->urlInfo('collection')); } } diff --git a/core/modules/contact/src/Entity/ContactForm.php b/core/modules/contact/src/Entity/ContactForm.php index c6ffdafe9c64..febc5366c5fb 100644 --- a/core/modules/contact/src/Entity/ContactForm.php +++ b/core/modules/contact/src/Entity/ContactForm.php @@ -35,7 +35,8 @@ * }, * links = { * "delete-form" = "/admin/structure/contact/manage/{contact_form}/delete", - * "edit-form" = "/admin/structure/contact/manage/{contact_form}" + * "edit-form" = "/admin/structure/contact/manage/{contact_form}", + * "collection" = "/admin/structure/contact", * } * ) */ diff --git a/core/modules/contact/src/Form/ContactFormDeleteForm.php b/core/modules/contact/src/Form/ContactFormDeleteForm.php index a036f2eb2e89..13333059c161 100644 --- a/core/modules/contact/src/Form/ContactFormDeleteForm.php +++ b/core/modules/contact/src/Form/ContactFormDeleteForm.php @@ -27,7 +27,7 @@ public function getQuestion() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('contact.form_list'); + return $this->entity->urlInfo('collection'); } /** diff --git a/core/modules/content_translation/content_translation.install b/core/modules/content_translation/content_translation.install index 34d2717108b9..c6e173bd112e 100644 --- a/core/modules/content_translation/content_translation.install +++ b/core/modules/content_translation/content_translation.install @@ -96,7 +96,7 @@ function content_translation_install() { function content_translation_enable() { // Translation works when at least two languages are added. if (count(\Drupal::languageManager()->getLanguages()) < 2) { - $t_args = array('!language_url' => \Drupal::url('language.admin_overview')); + $t_args = array('!language_url' => \Drupal::url('entity.configurable_language.collection')); $message = t('Be sure to <a href="!language_url">add at least two languages</a> to translate content.', $t_args); drupal_set_message($message, 'warning'); } diff --git a/core/modules/content_translation/content_translation.module b/core/modules/content_translation/content_translation.module index fd510b520281..0c675584a2e9 100644 --- a/core/modules/content_translation/content_translation.module +++ b/core/modules/content_translation/content_translation.module @@ -25,7 +25,7 @@ function content_translation_help($route_name, RouteMatchInterface $route_match) $output .= '<h3>' . t('Uses') . '</h3>'; $output .= '<dl>'; $output .= '<dt>' . t('Enabling translation') . '</dt>'; - $output .= '<dd>' . t('In order to translate content, the website must have at least two <a href="!url">languages</a>. When that is the case, you can enable translation for the desired content entities on the <a href="!translation-entity">Content language</a> page. When enabling translation you can choose the default language for content and decide whether to show the language selection field on the content editing forms.', array('!url' => \Drupal::url('language.admin_overview'), '!translation-entity' => \Drupal::url('language.content_settings_page'), '!language-help' => \Drupal::url('help.page', array('name' => 'language')))) . '</dd>'; + $output .= '<dd>' . t('In order to translate content, the website must have at least two <a href="!url">languages</a>. When that is the case, you can enable translation for the desired content entities on the <a href="!translation-entity">Content language</a> page. When enabling translation you can choose the default language for content and decide whether to show the language selection field on the content editing forms.', array('!url' => \Drupal::url('entity.configurable_language.collection'), '!translation-entity' => \Drupal::url('language.content_settings_page'), '!language-help' => \Drupal::url('help.page', array('name' => 'language')))) . '</dd>'; $output .= '<dt>' . t('Enabling field translation') . '</dt>'; $output .= '<dd>' . t('You can define which fields of a content entity can be translated. For example, you might want to translate the title and body field while leaving the image field untranslated. If you exclude a field from being translated, it will still show up in the content editing form, but any changes made to that field will be applied to <em>all</em> translations of that content.') . '</dd>'; $output .= '<dt>' . t('Translating content') . '</dt>'; @@ -40,7 +40,7 @@ function content_translation_help($route_name, RouteMatchInterface $route_match) case 'language.content_settings_page': $output = ''; if (!\Drupal::languageManager()->isMultilingual()) { - $output .= '<br/>' . t('Before you can translate content, there must be at least two languages added on the <a href="!url">languages administration</a> page.', array('!url' => \Drupal::url('language.admin_overview'))); + $output .= '<br/>' . t('Before you can translate content, there must be at least two languages added on the <a href="!url">languages administration</a> page.', array('!url' => \Drupal::url('entity.configurable_language.collection'))); } return $output; } diff --git a/core/modules/datetime/datetime.module b/core/modules/datetime/datetime.module index 42c88533be11..113d9e7e931a 100644 --- a/core/modules/datetime/datetime.module +++ b/core/modules/datetime/datetime.module @@ -39,7 +39,7 @@ function datetime_help($route_name, RouteMatchInterface $route_match) { $output .= '<dt>' . t('Managing and displaying date fields') . '</dt>'; $output .= '<dd>' . t('The <em>settings</em> and the <em>display</em> of the Date field can be configured separately. See the <a href="!field_ui">Field UI help</a> for more information on how to manage fields and their display.', array('!field_ui' => \Drupal::url('help.page', array('name' => 'field_ui')))) . '</dd>'; $output .= '<dt>' . t('Displaying dates') . '</dt>'; - $output .= '<dd>' . t('Dates can be displayed using the <em>Plain</em> or the <em>Default</em> formatter. The <em>Plain</em> formatter displays the date in the <a href="http://en.wikipedia.org/wiki/ISO_8601">ISO 8601</a> format. If you choose the <em>Default</em> formatter, you can choose a format from a predefined list that can be managed on the <a href="!date_format_list">Date and time formats</a> page.', array('!date_format_list'=> \Drupal::url('system.date_format_list'))) . '</dd>'; + $output .= '<dd>' . t('Dates can be displayed using the <em>Plain</em> or the <em>Default</em> formatter. The <em>Plain</em> formatter displays the date in the <a href="http://en.wikipedia.org/wiki/ISO_8601">ISO 8601</a> format. If you choose the <em>Default</em> formatter, you can choose a format from a predefined list that can be managed on the <a href="!date_format_list">Date and time formats</a> page.', array('!date_format_list'=> \Drupal::url('entity.date_format.collection'))) . '</dd>'; $output .= '</dl>'; return $output; } diff --git a/core/modules/field_ui/field_ui.links.action.yml b/core/modules/field_ui/field_ui.links.action.yml index b03bac5c654a..45238431af9d 100644 --- a/core/modules/field_ui/field_ui.links.action.yml +++ b/core/modules/field_ui/field_ui.links.action.yml @@ -3,14 +3,14 @@ field_ui.entity_view_mode_add: title: 'Add new view mode' weight: 1 appears_on: - - field_ui.entity_view_mode_list + - entity.entity_view_mode.collection field_ui.entity_form_mode_add: route_name: field_ui.entity_form_mode_add title: 'Add new form mode' weight: 1 appears_on: - - field_ui.entity_form_mode_list + - entity.entity_form_mode.collection field_ui.field_storage_config_add: class: \Drupal\Core\Menu\LocalActionDefault diff --git a/core/modules/field_ui/field_ui.links.menu.yml b/core/modules/field_ui/field_ui.links.menu.yml index 1d3fdb0d239b..f3ed51841163 100644 --- a/core/modules/field_ui/field_ui.links.menu.yml +++ b/core/modules/field_ui/field_ui.links.menu.yml @@ -1,7 +1,7 @@ -field_ui.list: +entity.field_storage_config.collection: title: 'Field list' description: 'Overview of fields on all entity types.' - route_name: field_ui.list + route_name: entity.field_storage_config.collection parent: system.admin_reports field_ui.display_mode: @@ -10,14 +10,14 @@ field_ui.display_mode: route_name: field_ui.display_mode parent: system.admin_structure -field_ui.entity_view_mode_list: +entity.entity_view_mode.collection: title: 'View modes' description: 'Manage custom view modes.' - route_name: field_ui.entity_view_mode_list + route_name: entity.entity_view_mode.collection parent: field_ui.display_mode -field_ui.entity_form_mode_list: +entity.entity_form_mode.collection: title: 'Form modes' description: 'Manage custom form modes.' - route_name: field_ui.entity_form_mode_list + route_name: entity.entity_form_mode.collection parent: field_ui.display_mode diff --git a/core/modules/field_ui/field_ui.links.task.yml b/core/modules/field_ui/field_ui.links.task.yml index 7bb8f5439c05..5ee3eff20d5b 100644 --- a/core/modules/field_ui/field_ui.links.task.yml +++ b/core/modules/field_ui/field_ui.links.task.yml @@ -1,7 +1,7 @@ -field_ui.list: +entity.field_storage_config.collection: title: Entities - route_name: field_ui.list - base_route: field_ui.list + route_name: entity.field_storage_config.collection + base_route: entity.field_storage_config.collection field_ui.fields: class: \Drupal\Core\Menu\LocalTaskDefault @@ -17,12 +17,12 @@ field_ui.entity_form_mode.edit_form: route_name: field_ui.entity_form_mode.edit_form base_route: field_ui.entity_form_mode.edit_form -field_ui.entity_view_mode_list: +entity.entity_view_mode.collection: title: List - route_name: field_ui.entity_view_mode_list - base_route: field_ui.entity_view_mode_list + route_name: entity.entity_view_mode.collection + base_route: entity.entity_view_mode.collection -field_ui.entity_form_mode_list: +entity.entity_form_mode.collection: title: List - route_name: field_ui.entity_form_mode_list - base_route: field_ui.entity_form_mode_list + route_name: entity.entity_form_mode.collection + base_route: entity.entity_form_mode.collection diff --git a/core/modules/field_ui/field_ui.module b/core/modules/field_ui/field_ui.module index 8864befe4a2c..e305b79c3520 100644 --- a/core/modules/field_ui/field_ui.module +++ b/core/modules/field_ui/field_ui.module @@ -36,13 +36,13 @@ function field_ui_help($route_name, RouteMatchInterface $route_match) { $output .= '<dt>' . t('Configuring field display') . '</dt>'; $output .= '<dd>' . t('On the <em>Manage display</em> page of your entity type or sub-type, you can configure how each field is displayed by default and in each view mode. If your entity type has multiple view modes, you can toggle between the view modes at the top of the page, and you can toggle whether each view mode uses the default settings or custom settings in the <em>Custom display settings</em> section. For each field in each view mode, you can choose whether and how to display the label of the field from the <em>Label</em> drop-down list. You can also select the formatter to use for display; some formatters have configuration options, which you can edit using the Edit button (which looks like a wheel). You can also change the display order of fields. You can exclude a field from a specific view mode by choosing <em>Hidden</em> from the formatter drop-down list, or by dragging it into the <em>Disabled</em> section.') . '</dd>'; $output .= '<dt>' . t('Configuring view and form modes') . '</dt>'; - $output .= '<dd>' . t('You can add, edit, and delete view modes for entities on the <a href="!view_modes">View modes page</a>, and you can add, edit, and delete form modes for entities on the <a href="!form_modes">Form modes page</a>. Once you have defined a view mode or form mode for an entity type, it will be available on the Manage display or Manage form display page for each sub-type of that entity.', array('!view_modes' => \Drupal::url('field_ui.entity_view_mode_list'), '!form_modes' => \Drupal::url('field_ui.entity_form_mode_list'))) . '</dd>'; + $output .= '<dd>' . t('You can add, edit, and delete view modes for entities on the <a href="!view_modes">View modes page</a>, and you can add, edit, and delete form modes for entities on the <a href="!form_modes">Form modes page</a>. Once you have defined a view mode or form mode for an entity type, it will be available on the Manage display or Manage form display page for each sub-type of that entity.', array('!view_modes' => \Drupal::url('entity.entity_view_mode.collection'), '!form_modes' => \Drupal::url('entity.entity_form_mode.collection'))) . '</dd>'; $output .= '<dt>' . t('Listing fields') . '</dt>'; - $output .= '<dd>' . t('There are two reports available that list the fields defined on your site. The <a href="!entity-list" title="Entities field list report">Entities</a> report lists all your fields, showing the field machine names, types, and the entity types or sub-types they are used on (each sub-type links to the Manage fields page). If the <a href="!views">Views</a> and <a href="!views-ui">Views UI</a> modules are enabled, the <a href="!views-list" title="Used in views field list report">Used in views</a> report lists each field that is used in a view, with a link to edit that view.', array('!entity-list' => \Drupal::url('field_ui.list'), '!views-list' => (\Drupal::moduleHandler()->moduleExists('views_ui')) ? \Drupal::url('views_ui.reports_fields') : '#', '!views' => (\Drupal::moduleHandler()->moduleExists('views')) ? \Drupal::url('help.page', array('name' => 'views')) : '#','!views-ui' => (\Drupal::moduleHandler()->moduleExists('views_ui')) ? \Drupal::url('help.page', array('name' => 'views_ui')) : '#')) . '</dd>'; + $output .= '<dd>' . t('There are two reports available that list the fields defined on your site. The <a href="!entity-list" title="Entities field list report">Entities</a> report lists all your fields, showing the field machine names, types, and the entity types or sub-types they are used on (each sub-type links to the Manage fields page). If the <a href="!views">Views</a> and <a href="!views-ui">Views UI</a> modules are enabled, the <a href="!views-list" title="Used in views field list report">Used in views</a> report lists each field that is used in a view, with a link to edit that view.', array('!entity-list' => \Drupal::url('entity.field_storage_config.collection'), '!views-list' => (\Drupal::moduleHandler()->moduleExists('views_ui')) ? \Drupal::url('views_ui.reports_fields') : '#', '!views' => (\Drupal::moduleHandler()->moduleExists('views')) ? \Drupal::url('help.page', array('name' => 'views')) : '#','!views-ui' => (\Drupal::moduleHandler()->moduleExists('views_ui')) ? \Drupal::url('help.page', array('name' => 'views_ui')) : '#')) . '</dd>'; $output .= '</dl>'; return $output; - case 'field_ui.list': + case 'entity.field_storage_config.collection': return '<p>' . t('This list shows all fields currently in use for easy reference.') . '</p>'; } } @@ -67,6 +67,7 @@ function field_ui_entity_type_build(array &$entity_types) { $entity_types['field_config']->setFormClass('delete', 'Drupal\field_ui\Form\FieldConfigDeleteForm'); $entity_types['field_config']->setListBuilderClass('Drupal\field_ui\FieldConfigListBuilder'); $entity_types['field_storage_config']->setListBuilderClass('Drupal\field_ui\FieldStorageConfigListBuilder'); + $entity_types['field_storage_config']->setLinkTemplate('collection', '/admin/reports/fields'); foreach ($entity_types as $entity_type) { if ($bundle = $entity_type->getBundleOf()) { @@ -285,6 +286,7 @@ function field_ui_entity_type_alter(array &$entity_types) { $form_mode->set('admin_permission', 'administer display modes'); $form_mode->setLinkTemplate('delete-form', '/admin/structure/display-modes/form/manage/{entity_form_mode}/delete'); $form_mode->setLinkTemplate('edit-form', '/admin/structure/display-modes/form/manage/{entity_form_mode}'); + $form_mode->setLinkTemplate('collection', '/admin/structure/display-modes/form'); $view_mode = $entity_types['entity_view_mode']; $view_mode->setListBuilderClass('Drupal\field_ui\EntityDisplayModeListBuilder'); @@ -294,4 +296,5 @@ function field_ui_entity_type_alter(array &$entity_types) { $view_mode->set('admin_permission', 'administer display modes'); $view_mode->setLinkTemplate('delete-form', '/admin/structure/display-modes/view/manage/{entity_view_mode}/delete'); $view_mode->setLinkTemplate('edit-form', '/admin/structure/display-modes/view/manage/{entity_view_mode}'); + $view_mode->setLinkTemplate('collection', '/admin/structure/display-modes/view'); } diff --git a/core/modules/field_ui/field_ui.routing.yml b/core/modules/field_ui/field_ui.routing.yml index b7ab5b580143..22b8c7bf7f9f 100644 --- a/core/modules/field_ui/field_ui.routing.yml +++ b/core/modules/field_ui/field_ui.routing.yml @@ -1,4 +1,4 @@ -field_ui.list: +entity.field_storage_config.collection: path: '/admin/reports/fields' defaults: _entity_list: 'field_storage_config' @@ -14,7 +14,7 @@ field_ui.display_mode: requirements: _permission: 'administer display modes' -field_ui.entity_view_mode_list: +entity.entity_view_mode.collection: path: '/admin/structure/display-modes/view' defaults: _entity_list: 'entity_view_mode' @@ -54,7 +54,7 @@ entity.entity_view_mode.delete_form: requirements: _entity_access: 'entity_view_mode.delete' -field_ui.entity_form_mode_list: +entity.entity_form_mode.collection: path: '/admin/structure/display-modes/form' defaults: _entity_list: 'entity_form_mode' diff --git a/core/modules/field_ui/src/Form/EntityDisplayModeDeleteForm.php b/core/modules/field_ui/src/Form/EntityDisplayModeDeleteForm.php index 315c918aae1c..f50dbe6ba0fe 100644 --- a/core/modules/field_ui/src/Form/EntityDisplayModeDeleteForm.php +++ b/core/modules/field_ui/src/Form/EntityDisplayModeDeleteForm.php @@ -9,7 +9,6 @@ use Drupal\Core\Entity\EntityConfirmFormBase; use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Url; /** * Provides the delete form for entity display modes. @@ -20,7 +19,7 @@ class EntityDisplayModeDeleteForm extends EntityConfirmFormBase { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('field_ui.' . $this->entity->getEntityTypeId() . '_list'); + return $this->entity->urlInfo('collection'); } /** diff --git a/core/modules/field_ui/src/Form/EntityDisplayModeFormBase.php b/core/modules/field_ui/src/Form/EntityDisplayModeFormBase.php index 9b7fdd2fc05b..0bdce49df5a4 100644 --- a/core/modules/field_ui/src/Form/EntityDisplayModeFormBase.php +++ b/core/modules/field_ui/src/Form/EntityDisplayModeFormBase.php @@ -125,7 +125,7 @@ public function save(array $form, FormStateInterface $form_state) { drupal_set_message(t('Saved the %label @entity-type.', array('%label' => $this->entity->label(), '@entity-type' => $this->entityType->getLowercaseLabel()))); $this->entity->save(); \Drupal::entityManager()->clearCachedFieldDefinitions(); - $form_state->setRedirect('field_ui.' . $this->entity->getEntityTypeId() . '_list'); + $form_state->setRedirectUrl($this->entity->urlInfo('collection')); } } diff --git a/core/modules/image/image.info.yml b/core/modules/image/image.info.yml index 4a704cca36c9..6ce28ec06f7a 100644 --- a/core/modules/image/image.info.yml +++ b/core/modules/image/image.info.yml @@ -6,4 +6,4 @@ version: VERSION core: 8.x dependencies: - file -configure: image.style_list +configure: entity.image_style.collection diff --git a/core/modules/image/image.links.action.yml b/core/modules/image/image.links.action.yml index 134f3a83e5ac..2b3ce09987a3 100644 --- a/core/modules/image/image.links.action.yml +++ b/core/modules/image/image.links.action.yml @@ -2,4 +2,4 @@ image_style_add_action: route_name: image.style_add title: 'Add image style' appears_on: - - image.style_list + - entity.image_style.collection diff --git a/core/modules/image/image.links.menu.yml b/core/modules/image/image.links.menu.yml index 02b60e800d7d..235d01cc7f54 100644 --- a/core/modules/image/image.links.menu.yml +++ b/core/modules/image/image.links.menu.yml @@ -1,5 +1,5 @@ -image.style_list: +entity.image_style.collection: title: 'Image styles' description: 'Configure styles that can be used for resizing or adjusting images on display.' parent: system.admin_config_media - route_name: image.style_list + route_name: entity.image_style.collection diff --git a/core/modules/image/image.links.task.yml b/core/modules/image/image.links.task.yml index cf835eb4e00a..3e7a9af613aa 100644 --- a/core/modules/image/image.links.task.yml +++ b/core/modules/image/image.links.task.yml @@ -3,7 +3,7 @@ entity.image_style.edit_form: route_name: entity.image_style.edit_form base_route: entity.image_style.edit_form -image.style_list: +entity.image_style.collection: title: List - route_name: image.style_list - base_route: image.style_list + route_name: entity.image_style.collection + base_route: entity.image_style.collection diff --git a/core/modules/image/image.module b/core/modules/image/image.module index dfa54c6ae2f4..76710300b284 100644 --- a/core/modules/image/image.module +++ b/core/modules/image/image.module @@ -56,18 +56,18 @@ function image_help($route_name, RouteMatchInterface $route_match) { $output .= '<h3>' . t('Uses') . '</h3>'; $output .= '<dl>'; $output .= '<dt>' . t('Manipulating images') . '</dt>'; - $output .= '<dd>' . t('With the Image module you can scale, crop, resize, rotate and desaturate images without affecting the original image using <a href="@image">image styles</a>. When you change an image style, the module automatically refreshes all created images. Every image style must have a name, which will be used in the URL of the generated images. There are two common approaches to naming image styles (which you use will depend on how the image style is being applied):',array('@image' => \Drupal::url('image.style_list'))); + $output .= '<dd>' . t('With the Image module you can scale, crop, resize, rotate and desaturate images without affecting the original image using <a href="@image">image styles</a>. When you change an image style, the module automatically refreshes all created images. Every image style must have a name, which will be used in the URL of the generated images. There are two common approaches to naming image styles (which you use will depend on how the image style is being applied):',array('@image' => \Drupal::url('entity.image_style.collection'))); $output .= '<ul><li>' . t('Based on where it will be used: eg. <em>profile-picture</em>') . '</li>'; $output .= '<li>' . t('Describing its appearance: eg. <em>square-85x85</em>') . '</li></ul>'; $output .= t('After you create an image style, you can add effects: crop, scale, resize, rotate, and desaturate (other contributed modules provide additional effects). For example, by combining effects as crop, scale, and desaturate, you can create square, grayscale thumbnails.') . '<dd>'; $output .= '<dt>' . t('Attaching images to content as fields') . '</dt>'; - $output .= '<dd>' . t("Image module also allows you to attach images to content as fields. To add an image field to a <a href='@content-type'>content type</a>, go to the content type's <em>manage fields</em> page, and add a new field of type <em>Image</em>. Attaching images to content this way allows image styles to be applied and maintained, and also allows you more flexibility when theming.", array('@content-type' => \Drupal::url('node.overview_types'))) . '</dd>'; + $output .= '<dd>' . t("Image module also allows you to attach images to content as fields. To add an image field to a <a href='@content-type'>content type</a>, go to the content type's <em>manage fields</em> page, and add a new field of type <em>Image</em>. Attaching images to content this way allows image styles to be applied and maintained, and also allows you more flexibility when theming.", array('@content-type' => \Drupal::url('entity.node_type.collection'))) . '</dd>'; $output .= '<dt>' . t('Configuring image fields for accessibility') . '</dt>'; $output .= '<dd>' . t('For accessibility and search engine optimization, all images that convey meaning on web sites should have alternate text. Drupal also allows entry of title text for images, but it can lead to confusion for screen reader users and its use is not recommended. Image fields can be configured so that alternate and title text fields are enabled or disabled; if enabled, the fields can be set to be required. The recommended setting is to enable and require alternate text and disable title text.') . '</dd>'; $output .= '</dl>'; return $output; - case 'image.style_list': + case 'entity.image_style.collection': return '<p>' . t('Image styles commonly provide thumbnail sizes by scaling and cropping images, but can also add various effects before an image is displayed. When an image is displayed with a style, a new file is created and the original image is left unchanged.') . '</p>'; case 'image.effect_add_form': diff --git a/core/modules/image/image.routing.yml b/core/modules/image/image.routing.yml index 24b72d37b1f5..ffeed861a2a9 100644 --- a/core/modules/image/image.routing.yml +++ b/core/modules/image/image.routing.yml @@ -38,7 +38,7 @@ image.effect_delete: requirements: _permission: 'administer image styles' -image.style_list: +entity.image_style.collection: path: '/admin/config/media/image-styles' defaults: _entity_list: 'image_style' diff --git a/core/modules/image/src/Entity/ImageStyle.php b/core/modules/image/src/Entity/ImageStyle.php index a87554c99f60..cf9c861a0235 100644 --- a/core/modules/image/src/Entity/ImageStyle.php +++ b/core/modules/image/src/Entity/ImageStyle.php @@ -46,7 +46,8 @@ * links = { * "flush-form" = "/admin/config/media/image-styles/manage/{image_style}/flush", * "edit-form" = "/admin/config/media/image-styles/manage/{image_style}", - * "delete-form" = "/admin/config/media/image-styles/manage/{image_style}/delete" + * "delete-form" = "/admin/config/media/image-styles/manage/{image_style}/delete", + * "collection" = "/admin/config/media/image-styles", * } * ) */ diff --git a/core/modules/image/src/Form/ImageStyleDeleteForm.php b/core/modules/image/src/Form/ImageStyleDeleteForm.php index 65dddacf200e..05939fbd54dc 100644 --- a/core/modules/image/src/Form/ImageStyleDeleteForm.php +++ b/core/modules/image/src/Form/ImageStyleDeleteForm.php @@ -9,7 +9,6 @@ use Drupal\Core\Entity\EntityConfirmFormBase; use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Url; /** * Creates a form to delete an image style. @@ -34,7 +33,7 @@ public function getConfirmText() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('image.style_list'); + return $this->entity->urlInfo('collection'); } /** diff --git a/core/modules/image/src/Form/ImageStyleFlushForm.php b/core/modules/image/src/Form/ImageStyleFlushForm.php index d5f0ea55f740..9cc5586f8751 100644 --- a/core/modules/image/src/Form/ImageStyleFlushForm.php +++ b/core/modules/image/src/Form/ImageStyleFlushForm.php @@ -9,7 +9,6 @@ use Drupal\Core\Entity\EntityConfirmFormBase; use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Url; /** * Form controller for image style flush. @@ -41,7 +40,7 @@ public function getConfirmText() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('image.style_list'); + return $this->entity->urlInfo('collection'); } /** diff --git a/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php b/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php index 3b47a3bf6943..dd34fc4811d1 100644 --- a/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php +++ b/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php @@ -44,13 +44,6 @@ class ImageFormatter extends ImageFormatterBase implements ContainerFactoryPlugi */ protected $linkGenerator; - /** - * The url generator service. - * - * @var \Drupal\Core\Routing\UrlGeneratorInterface - */ - protected $urlGenerator; - /** * Constructs an ImageFormatter object. * @@ -72,14 +65,11 @@ class ImageFormatter extends ImageFormatterBase implements ContainerFactoryPlugi * The current user. * @param \Drupal\Core\Utility\LinkGeneratorInterface $link_generator * The link generator service. - * @param \Drupal\Core\Routing\UrlGeneratorInterface $url_generator - * The url generator service. */ - public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, AccountInterface $current_user, LinkGeneratorInterface $link_generator, UrlGeneratorInterface $url_generator) { + public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, AccountInterface $current_user, LinkGeneratorInterface $link_generator) { parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings); $this->currentUser = $current_user; $this->linkGenerator = $link_generator; - $this->urlGenerator = $url_generator; } /** @@ -95,8 +85,7 @@ public static function create(ContainerInterface $container, array $configuratio $configuration['view_mode'], $configuration['third_party_settings'], $container->get('current_user'), - $container->get('link_generator'), - $container->get('url_generator') + $container->get('link_generator') ); } @@ -122,7 +111,7 @@ public function settingsForm(array $form, FormStateInterface $form_state) { '#empty_option' => t('None (original image)'), '#options' => $image_styles, '#description' => array( - '#markup' => $this->linkGenerator->generate($this->t('Configure Image Styles', array('@url' => $this->urlGenerator->generateFromRoute('image.style_list'))), new Url('image.style_list')), + '#markup' => $this->linkGenerator->generate($this->t('Configure Image Styles'), new Url('entity.image_style.collection')), '#access' => $this->currentUser->hasPermission('administer image styles'), ), ); diff --git a/core/modules/image/src/Tests/ImageFieldDisplayTest.php b/core/modules/image/src/Tests/ImageFieldDisplayTest.php index f0b04cbfdef8..4fef5f59cc7b 100644 --- a/core/modules/image/src/Tests/ImageFieldDisplayTest.php +++ b/core/modules/image/src/Tests/ImageFieldDisplayTest.php @@ -55,7 +55,7 @@ function _testImageFieldFormatters($scheme) { // Test for existence of link to image styles configuration. $this->drupalPostAjaxForm(NULL, array(), "{$field_name}_settings_edit"); - $this->assertLinkByHref(\Drupal::url('image.style_list'), 0, 'Link to image styles configuration is found'); + $this->assertLinkByHref(\Drupal::url('entity.image_style.collection'), 0, 'Link to image styles configuration is found'); // Remove 'administer image styles' permission from testing admin user. $admin_user_roles = $this->adminUser->getRoles(TRUE); @@ -66,7 +66,7 @@ function _testImageFieldFormatters($scheme) { // Test for absence of link to image styles configuration. $this->drupalPostAjaxForm(NULL, array(), "{$field_name}_settings_edit"); - $this->assertNoLinkByHref(\Drupal::url('image.style_list'), 'Link to image styles configuration is absent when permissions are insufficient'); + $this->assertNoLinkByHref(\Drupal::url('entity.image_style.collection'), 'Link to image styles configuration is absent when permissions are insufficient'); // Restore 'administer image styles' permission to testing admin user user_role_change_permissions(reset($admin_user_roles), array('administer image styles' => TRUE)); diff --git a/core/modules/language/language.info.yml b/core/modules/language/language.info.yml index c1cf7ffbd76f..30770401ad6a 100644 --- a/core/modules/language/language.info.yml +++ b/core/modules/language/language.info.yml @@ -4,4 +4,4 @@ description: 'Allows users to configure languages and apply them to content.' package: Multilingual version: VERSION core: 8.x -configure: language.admin_overview +configure: entity.configurable_language.collection diff --git a/core/modules/language/language.links.action.yml b/core/modules/language/language.links.action.yml index ad09aa11d6ab..18fd382e3d0c 100644 --- a/core/modules/language/language.links.action.yml +++ b/core/modules/language/language.links.action.yml @@ -2,4 +2,4 @@ language_add_local_action: route_name: language.add title: 'Add language' appears_on: - - language.admin_overview + - entity.configurable_language.collection diff --git a/core/modules/language/language.links.menu.yml b/core/modules/language/language.links.menu.yml index 26f9f9a7a9e9..3b012283863c 100644 --- a/core/modules/language/language.links.menu.yml +++ b/core/modules/language/language.links.menu.yml @@ -1,7 +1,7 @@ -language.admin_overview: +entity.configurable_language.collection: title: Languages description: 'Configure languages for content and the user interface.' - route_name: language.admin_overview + route_name: entity.configurable_language.collection parent: system.admin_config_regional language.content_settings_page: title: 'Content language' diff --git a/core/modules/language/language.links.task.yml b/core/modules/language/language.links.task.yml index 76f5406e54d8..e9b6ca56e684 100644 --- a/core/modules/language/language.links.task.yml +++ b/core/modules/language/language.links.task.yml @@ -1,11 +1,11 @@ -language.admin_overview: +entity.configurable_language.collection: title: 'List' - route_name: language.admin_overview - base_route: language.admin_overview + route_name: entity.configurable_language.collection + base_route: entity.configurable_language.collection language.negotiation: title: 'Detection and selection' route_name: language.negotiation - base_route: language.admin_overview + base_route: entity.configurable_language.collection entity.configurable_language.edit_form: title: 'Edit' diff --git a/core/modules/language/language.module b/core/modules/language/language.module index 89ab28b5212a..01f3d0b35c94 100644 --- a/core/modules/language/language.module +++ b/core/modules/language/language.module @@ -32,7 +32,7 @@ function language_help($route_name, RouteMatchInterface $route_match) { $output .= '<h3>' . t('Uses') . '</h3>'; $output .= '<dl>'; $output .= '<dt>' . t('Adding languages') . '</dt>'; - $output .= '<dd>' . t('You can add languages on the <a href="!language_list">Languages</a> page by selecting <em>Add language</em> and choosing a language from the drop-down menu. This language is then displayed in the languages list, where it can be configured further. If the <a href="!interface">Interface translation module</a> is enabled, and the <em>translation server</em> is set as a translation source, then the interface translation for this language is automatically downloaded as well.' , array('!language_list' => \Drupal::url('language.admin_overview'), '!interface' => (\Drupal::moduleHandler()->moduleExists('locale')) ? \Drupal::url('help.page', array('name' => 'locale')) : '#')) . '</dd>'; + $output .= '<dd>' . t('You can add languages on the <a href="!language_list">Languages</a> page by selecting <em>Add language</em> and choosing a language from the drop-down menu. This language is then displayed in the languages list, where it can be configured further. If the <a href="!interface">Interface translation module</a> is enabled, and the <em>translation server</em> is set as a translation source, then the interface translation for this language is automatically downloaded as well.' , array('!language_list' => \Drupal::url('entity.configurable_language.collection'), '!interface' => (\Drupal::moduleHandler()->moduleExists('locale')) ? \Drupal::url('help.page', array('name' => 'locale')) : '#')) . '</dd>'; $output .= '<dt>' . t('Adding custom languages') . '</dt>'; $output .= '<dd>' . t('You can add a language that is not provided in the drop-down list by choosing <em>Custom language</em> at the end of the list. You then have to configure its language code, name, and direction in the form provided.') . '</dd>'; $output .= '<dt>' . t('Configuring content languages') . '</dt>'; @@ -48,13 +48,13 @@ function language_help($route_name, RouteMatchInterface $route_match) { $output .= '<ul><li>' . t('<em>URL</em> sets the interface language based on a path prefix or domain (for example specifying <em>de</em> for German would result in URLs like <em>example.com/de/contact</em>). The default language does not require a path prefix, but can have one assigned as well. If the language detection is done by domain name, a domain needs to be specified for each language.') . '</li>'; $output .= '<li>' . t('<em>Session</em> determines the interface language from a request or session parameter (for example <em>example.com?language=de</em> would set the interface language to German based on the use of <em>de</em> as the <em>language</em> parameter).') . '</li>'; $output .= '<li>' . t('<em>User</em> follows the language configuration set on the user\'s profile page.') . '</li>'; - $output .= '<li>' . t('<em>Browser</em> sets the interface language based on the browser\'s language settings. Since browsers use different language codes to refer to the same languages, you can add and edit languages codes to map the browser language codes to the <a href="!language_list">language codes</a> used on your site.', array('!language_list' => \Drupal::url('language.admin_overview'))) . '</li>'; + $output .= '<li>' . t('<em>Browser</em> sets the interface language based on the browser\'s language settings. Since browsers use different language codes to refer to the same languages, you can add and edit languages codes to map the browser language codes to the <a href="!language_list">language codes</a> used on your site.', array('!language_list' => \Drupal::url('entity.configurable_language.collection'))) . '</li>'; $output .= '<li>' . t('<em>Account administration pages</em> follows the configuration set as <em>Administration pages language</em> on the profile page of an administrative user. This method is similar to the <em>User</em> method, but only sets the interface text language on administration pages, independent of the interface text language on other pages.') . '</li>'; $output .= '<li>' . t('<em>Selected language</em> allows you to specify the site\'s default language or a specific language as the fall-back language. This method should be listed last.') . '</li></ul></dd>'; $output .= '</dl>'; return $output; - case 'language.admin_overview': + case 'entity.configurable_language.collection': return '<p>' . t('Reorder the added languages to set their order in the language switcher block and, when editing content, in the list of selectable languages. This ordering does not impact <a href="@detection">detection and selection</a>.', array('@detection' => \Drupal::url('language.negotiation'))) . '</p>'; case 'language.add': @@ -69,11 +69,11 @@ function language_help($route_name, RouteMatchInterface $route_match) { return $output; case 'language.negotiation_browser': - $output = '<p>' . t('Browsers use different language codes to refer to the same languages. Internally, a best effort is made to determine the correct language based on the code that the browser sends. You can add and edit additional mappings from browser language codes to <a href="!configure-languages">site languages</a>.', array('!configure-languages' => \Drupal::url('language.admin_overview'))) . '</p>'; + $output = '<p>' . t('Browsers use different language codes to refer to the same languages. Internally, a best effort is made to determine the correct language based on the code that the browser sends. You can add and edit additional mappings from browser language codes to <a href="!configure-languages">site languages</a>.', array('!configure-languages' => \Drupal::url('entity.configurable_language.collection'))) . '</p>'; return $output; case 'language.negotiation_selected': - $output = '<p>' . t('Changing the selected language here (and leaving this option as the last among the detection and selection options) is the easiest way to change the fallback language for the website, if you need to change how your site works by default (e.g., when using an empty path prefix or using the default domain). <a href="!admin-change-language">Changing the site\'s default language</a> itself might have other undesired side effects.', array('!admin-change-language' => \Drupal::url('language.admin_overview'))) . '</p>'; + $output = '<p>' . t('Changing the selected language here (and leaving this option as the last among the detection and selection options) is the easiest way to change the fallback language for the website, if you need to change how your site works by default (e.g., when using an empty path prefix or using the default domain). <a href="!admin-change-language">Changing the site\'s default language</a> itself might have other undesired side effects.', array('!admin-change-language' => \Drupal::url('entity.configurable_language.collection'))) . '</p>'; return $output; case 'entity.block.edit_form': diff --git a/core/modules/language/language.routing.yml b/core/modules/language/language.routing.yml index 4d78d6d40d65..d21941d40a82 100644 --- a/core/modules/language/language.routing.yml +++ b/core/modules/language/language.routing.yml @@ -38,7 +38,7 @@ entity.configurable_language.edit_form: requirements: _entity_access: 'configurable_language.update' -language.admin_overview: +entity.configurable_language.collection: path: '/admin/config/regional/language' defaults: _entity_list: 'configurable_language' diff --git a/core/modules/language/src/Element/LanguageConfiguration.php b/core/modules/language/src/Element/LanguageConfiguration.php index ad998f71ada9..02c17887f157 100644 --- a/core/modules/language/src/Element/LanguageConfiguration.php +++ b/core/modules/language/src/Element/LanguageConfiguration.php @@ -47,7 +47,7 @@ public static function processLanguageConfiguration(&$element, FormStateInterfac '#type' => 'select', '#title' => t('Default language'), '#options' => $options + static::getDefaultOptions(), - '#description' => t('Explanation of the language options is found on the <a href="@languages_list_page">languages list page</a>.', array('@languages_list_page' => \Drupal::url('language.admin_overview'))), + '#description' => t('Explanation of the language options is found on the <a href="@languages_list_page">languages list page</a>.', array('@languages_list_page' => \Drupal::url('entity.configurable_language.collection'))), '#default_value' => ($default_config != NULL) ? $default_config->getDefaultLangcode() : LanguageInterface::LANGCODE_SITE_DEFAULT, ); diff --git a/core/modules/language/src/Entity/ConfigurableLanguage.php b/core/modules/language/src/Entity/ConfigurableLanguage.php index e52f763946c4..a754654b9a4a 100644 --- a/core/modules/language/src/Entity/ConfigurableLanguage.php +++ b/core/modules/language/src/Entity/ConfigurableLanguage.php @@ -39,7 +39,8 @@ * }, * links = { * "delete-form" = "/admin/config/regional/language/delete/{configurable_language}", - * "edit-form" = "/admin/config/regional/language/edit/{configurable_language}" + * "edit-form" = "/admin/config/regional/language/edit/{configurable_language}", + * "collection" = "/admin/config/regional/language", * } * ) */ diff --git a/core/modules/language/src/Form/LanguageAddForm.php b/core/modules/language/src/Form/LanguageAddForm.php index f78bb839e9b8..fc27626aeb8c 100644 --- a/core/modules/language/src/Form/LanguageAddForm.php +++ b/core/modules/language/src/Form/LanguageAddForm.php @@ -97,7 +97,7 @@ public function save(array $form, FormStateInterface $form_state) { // to their theme so they can switch between the languages. drupal_set_message($this->t('Use one of the language switcher blocks to allow site visitors to switch between languages. You can enable these blocks on the <a href="@block-admin">block administration page</a>.', array('@block-admin' => $this->url('block.admin_display')))); } - $form_state->setRedirect('language.admin_overview'); + $form_state->setRedirectUrl($this->entity->urlInfo('collection')); } /** diff --git a/core/modules/language/src/Form/LanguageDeleteForm.php b/core/modules/language/src/Form/LanguageDeleteForm.php index 384237214e3d..f26948abdb97 100644 --- a/core/modules/language/src/Form/LanguageDeleteForm.php +++ b/core/modules/language/src/Form/LanguageDeleteForm.php @@ -10,11 +10,9 @@ use Drupal\Core\Entity\EntityConfirmFormBase; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Routing\UrlGeneratorInterface; -use Drupal\Core\Url; use Drupal\Core\Language\LanguageManagerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\RedirectResponse; -use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** @@ -70,7 +68,7 @@ public function getQuestion() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('language.admin_overview'); + return $this->entity->urlInfo('collection'); } /** diff --git a/core/modules/language/src/Form/LanguageEditForm.php b/core/modules/language/src/Form/LanguageEditForm.php index 58b9951966e4..79a3a171efd3 100644 --- a/core/modules/language/src/Form/LanguageEditForm.php +++ b/core/modules/language/src/Form/LanguageEditForm.php @@ -49,7 +49,7 @@ public function actions(array $form, FormStateInterface $form_state) { */ public function save(array $form, FormStateInterface $form_state) { parent::save($form, $form_state); - $form_state->setRedirect('language.admin_overview'); + $form_state->setRedirectUrl($this->entity->urlInfo('collection')); $this->logger('language')->notice('The %language (%langcode) language has been updated.', array('%language' => $this->entity->label(), '%langcode' => $this->entity->id())); } diff --git a/core/modules/language/src/Tests/LanguageConfigurationTest.php b/core/modules/language/src/Tests/LanguageConfigurationTest.php index 27abc6b9cec8..9a43437c84b6 100644 --- a/core/modules/language/src/Tests/LanguageConfigurationTest.php +++ b/core/modules/language/src/Tests/LanguageConfigurationTest.php @@ -43,7 +43,7 @@ function testLanguageConfiguration() { ); $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add language'); $this->assertText('French'); - $this->assertUrl(\Drupal::url('language.admin_overview', [], ['absolute' => TRUE]), [], 'Correct page redirection.'); + $this->assertUrl(\Drupal::url('entity.configurable_language.collection', [], ['absolute' => TRUE]), [], 'Correct page redirection.'); // Langcode for Languages is always 'en'. $language = $this->config('language.entity.fr')->get(); $this->assertEqual($language['langcode'], 'en'); diff --git a/core/modules/language/src/Tests/LanguageCustomLanguageConfigurationTest.php b/core/modules/language/src/Tests/LanguageCustomLanguageConfigurationTest.php index a4878d3e802d..fb7487825e32 100644 --- a/core/modules/language/src/Tests/LanguageCustomLanguageConfigurationTest.php +++ b/core/modules/language/src/Tests/LanguageCustomLanguageConfigurationTest.php @@ -76,7 +76,7 @@ public function testLanguageConfiguration() { 'The language %language has been created and can now be used.', array('%language' => $edit['label']) )); - $this->assertUrl(\Drupal::url('language.admin_overview', array(), array('absolute' => TRUE)), [], 'Correct page redirection.'); + $this->assertUrl(\Drupal::url('entity.configurable_language.collection', array(), array('absolute' => TRUE)), [], 'Correct page redirection.'); // Test validation of existing language values. $edit = array( @@ -92,7 +92,7 @@ public function testLanguageConfiguration() { 'The language %language has been created and can now be used.', array('%language' => $edit['label']) )); - $this->assertUrl(\Drupal::url('language.admin_overview', array(), array('absolute' => TRUE)), [], 'Correct page redirection.'); + $this->assertUrl(\Drupal::url('entity.configurable_language.collection', array(), array('absolute' => TRUE)), [], 'Correct page redirection.'); // Add the language a second time and confirm that this is not allowed. $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language')); diff --git a/core/modules/language/src/Tests/LanguageListTest.php b/core/modules/language/src/Tests/LanguageListTest.php index c27f98126eef..52f6e4cf0e79 100644 --- a/core/modules/language/src/Tests/LanguageListTest.php +++ b/core/modules/language/src/Tests/LanguageListTest.php @@ -41,7 +41,7 @@ function testLanguageList() { ); $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language')); $this->assertText('French', 'Language added successfully.'); - $this->assertUrl(\Drupal::url('language.admin_overview', [], ['absolute' => TRUE])); + $this->assertUrl(\Drupal::url('entity.configurable_language.collection', [], ['absolute' => TRUE])); // Add custom language. $langcode = 'xx'; @@ -53,7 +53,7 @@ function testLanguageList() { 'direction' => Language::DIRECTION_LTR, ); $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language')); - $this->assertUrl(\Drupal::url('language.admin_overview', [], ['absolute' => TRUE])); + $this->assertUrl(\Drupal::url('entity.configurable_language.collection', [], ['absolute' => TRUE])); $this->assertRaw('"edit-languages-' . $langcode .'-weight"', 'Language code found.'); $this->assertText(t($name), 'Test language added.'); @@ -75,7 +75,7 @@ function testLanguageList() { // Ensure we can't delete the default language. $this->drupalGet('admin/config/regional/language/delete/' . $langcode); - $this->assertUrl(\Drupal::url('language.admin_overview', [], ['absolute' => TRUE, 'language' => $language])); + $this->assertUrl(\Drupal::url('entity.configurable_language.collection', [], ['absolute' => TRUE, 'language' => $language])); $this->assertText(t('The default language cannot be deleted.'), 'Failed to delete the default language.'); // Ensure 'Edit' link works. @@ -88,7 +88,7 @@ function testLanguageList() { ); $this->drupalPostForm('admin/config/regional/language/edit/' . $langcode, $edit, t('Save language')); $this->assertRaw($name, 'The language has been updated.'); - $this->assertUrl(\Drupal::url('language.admin_overview', [], ['absolute' => TRUE, 'language' => $language])); + $this->assertUrl(\Drupal::url('entity.configurable_language.collection', [], ['absolute' => TRUE, 'language' => $language])); // Change back the default language. $edit = array( @@ -104,7 +104,7 @@ function testLanguageList() { $this->drupalGet('admin/config/regional/language/delete/' . $langcode); // First test the 'cancel' link. $this->clickLink(t('Cancel')); - $this->assertUrl(\Drupal::url('language.admin_overview', [], ['absolute' => TRUE, 'language' => $english])); + $this->assertUrl(\Drupal::url('entity.configurable_language.collection', [], ['absolute' => TRUE, 'language' => $english])); $this->assertRaw($name, 'The language was not deleted.'); // Delete the language for real. This a confirm form, we do not need any // fields changed. @@ -112,7 +112,7 @@ function testLanguageList() { // We need raw here because %language and %langcode will add HTML. $t_args = array('%language' => $name, '%langcode' => $langcode); $this->assertRaw(t('The %language (%langcode) language has been removed.', $t_args), 'The test language has been removed.'); - $this->assertUrl(\Drupal::url('language.admin_overview', [], ['absolute' => TRUE, 'language' => $english])); + $this->assertUrl(\Drupal::url('entity.configurable_language.collection', [], ['absolute' => TRUE, 'language' => $english])); // Verify that language is no longer found. $this->drupalGet('admin/config/regional/language/delete/' . $langcode); $this->assertResponse(404, 'Language no longer found.'); @@ -124,7 +124,7 @@ function testLanguageList() { // We need raw here because %language and %langcode will add HTML. $t_args = array('%language' => 'French', '%langcode' => 'fr'); $this->assertRaw(t('The %language (%langcode) language has been removed.', $t_args), 'The French language has been removed.'); - $this->assertUrl(\Drupal::url('language.admin_overview', [], ['absolute' => TRUE])); + $this->assertUrl(\Drupal::url('entity.configurable_language.collection', [], ['absolute' => TRUE])); // Verify that language is no longer found. $this->drupalGet('admin/config/regional/language/delete/fr'); $this->assertResponse(404, 'Language no longer found.'); @@ -142,7 +142,7 @@ function testLanguageList() { 'direction' => Language::DIRECTION_LTR, ); $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language')); - $this->assertUrl(\Drupal::url('language.admin_overview', [], ['absolute' => TRUE])); + $this->assertUrl(\Drupal::url('entity.configurable_language.collection', [], ['absolute' => TRUE])); $this->assertText($name, 'Name found.'); // Check if we can change the default language. diff --git a/core/modules/language/tests/src/Unit/Menu/LanguageLocalTasksTest.php b/core/modules/language/tests/src/Unit/Menu/LanguageLocalTasksTest.php index dd1eff607953..6e35abbb4786 100644 --- a/core/modules/language/tests/src/Unit/Menu/LanguageLocalTasksTest.php +++ b/core/modules/language/tests/src/Unit/Menu/LanguageLocalTasksTest.php @@ -37,8 +37,8 @@ public function testLanguageAdminLocalTasks($route, $expected) { */ public function getLanguageAdminOverviewRoutes() { return array( - array('language.admin_overview', array(array('language.admin_overview', 'language.negotiation'))), - array('language.negotiation', array(array('language.admin_overview', 'language.negotiation'))), + array('entity.configurable_language.collection', array(array('entity.configurable_language.collection', 'language.negotiation'))), + array('language.negotiation', array(array('entity.configurable_language.collection', 'language.negotiation'))), ); } diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module index 52a5eb9e2dca..c7cc9db33e95 100644 --- a/core/modules/locale/locale.module +++ b/core/modules/locale/locale.module @@ -149,15 +149,15 @@ function locale_help($route_name, RouteMatchInterface $route_match) { $output .= '<h3>' . t('Uses') . '</h3>'; $output .= '<dl>'; $output .= '<dt>' . t('Importing translation files') . '</dt>'; - $output .= '<dd>' . t('Translation files with translated interface text are imported automatically when languages are added on the <a href="!languages">Languages</a> page, or when modules or themes are enabled. On the <a href="!locale-settings">Settings</a> page, the <em>Translation source</em> can be restricted to local files only, or to include the <a href="!server">Drupal translation server</a>. Although modules and themes may not be fully translated in all languages, new translations become available frequently. You can specify whether and how often to check for translation file updates and whether to overwrite existing translations on the <a href="!locale-settings">Settings</a> page. You can also manually import a translation file on the <a title="User interface translation import" href="!import">Import</a> page.', array('!import' => \Drupal::url('locale.translate_import'), '!locale-settings' => \Drupal::url('locale.settings'), '!languages' => \Drupal::url('language.admin_overview'), '!server' => 'https://localize.drupal.org')) . '</dd>'; + $output .= '<dd>' . t('Translation files with translated interface text are imported automatically when languages are added on the <a href="!languages">Languages</a> page, or when modules or themes are enabled. On the <a href="!locale-settings">Settings</a> page, the <em>Translation source</em> can be restricted to local files only, or to include the <a href="!server">Drupal translation server</a>. Although modules and themes may not be fully translated in all languages, new translations become available frequently. You can specify whether and how often to check for translation file updates and whether to overwrite existing translations on the <a href="!locale-settings">Settings</a> page. You can also manually import a translation file on the <a title="User interface translation import" href="!import">Import</a> page.', array('!import' => \Drupal::url('locale.translate_import'), '!locale-settings' => \Drupal::url('locale.settings'), '!languages' => \Drupal::url('entity.configurable_language.collection'), '!server' => 'https://localize.drupal.org')) . '</dd>'; $output .= '<dt>' . t('Checking the translation status') . '</dt>'; - $output .= '<dd>' . t('You can check how much of the interface on your site is translated into which language on the <a href="!languages">Languages</a> page. On the <a href="!translation-updates">Available translation updates</a> page, you can check whether interface translation updates are available on the <a href="!server">Drupal translation server</a>.', array('!languages' => \Drupal::url('language.admin_overview'), '!translation-updates' => \Drupal::url('locale.translate_status'), '!server' => 'https://localize.drupal.org')) . '<dd>'; + $output .= '<dd>' . t('You can check how much of the interface on your site is translated into which language on the <a href="!languages">Languages</a> page. On the <a href="!translation-updates">Available translation updates</a> page, you can check whether interface translation updates are available on the <a href="!server">Drupal translation server</a>.', array('!languages' => \Drupal::url('entity.configurable_language.collection'), '!translation-updates' => \Drupal::url('locale.translate_status'), '!server' => 'https://localize.drupal.org')) . '<dd>'; $output .= '<dt>' . t('Translating individual strings') . '</dt>'; $output .= '<dd>' . t('You can translate individual strings directly on the <a href="!translate">User interface translation</a> page, or download the currently-used translation file for a specific language on the <a title="User interface translation export" href="!export">Export</a> page. Once you have edited the translation file, you can then import it again on the <a title="User interface translation import" href="!import">Import</a> page.', array('!translate' => \Drupal::url('locale.translate_page'), '!export' => \Drupal::url('locale.translate_export'), '!import' => \Drupal::url('locale.translate_import'))) . '</dd>'; $output .= '</dl>'; return $output; - case 'language.admin_overview': + case 'entity.configurable_language.collection': return '<p>' . t('Interface translations are automatically imported when a language is added, or when new modules or themes are enabled. The report <a href="!update">Available translation updates</a> shows the status. Interface text can be customized in the <a href="!translate">user interface translation</a> page.', array('!update' => \Drupal::url('locale.translate_status'), '!translate' => \Drupal::url('locale.translate_page'))) . '</p>'; case 'locale.translate_page': @@ -165,7 +165,7 @@ function locale_help($route_name, RouteMatchInterface $route_match) { return $output; case 'locale.translate_import': - $output = '<p>' . t('Translation files are automatically downloaded and imported when <a title="Languages" href="!language">languages</a> are added, or when modules or themes are enabled.', array('!language' => \Drupal::url('language.admin_overview'))) . '</p>'; + $output = '<p>' . t('Translation files are automatically downloaded and imported when <a title="Languages" href="!language">languages</a> are added, or when modules or themes are enabled.', array('!language' => \Drupal::url('entity.configurable_language.collection'))) . '</p>'; $output .= '<p>' . t('This page allows translators to manually import translated strings contained in a Gettext Portable Object (.po) file. Manual import may be used for customized translations or for the translation of custom modules and themes. To customize translations you can download a translation file from the <a href="!url">Drupal translation server</a> or <a title="User interface translation export" href="!export">export</a> translations from the site, customize the translations using a Gettext translation editor, and import the result using this page.', array('!url' => 'https://localize.drupal.org', '!export' => \Drupal::url('locale.translate_export'))) . '</p>'; $output .= '<p>' . t('Note that importing large .po files may take several minutes.') . '</p>'; return $output; diff --git a/core/modules/locale/src/Form/TranslationStatusForm.php b/core/modules/locale/src/Form/TranslationStatusForm.php index b779ca70bb3f..ee0702990a3d 100644 --- a/core/modules/locale/src/Form/TranslationStatusForm.php +++ b/core/modules/locale/src/Form/TranslationStatusForm.php @@ -135,7 +135,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { if (!$languages) { $empty = $this->t('No translatable languages available. <a href="@add_language">Add a language</a> first.', array( - '@add_language' => $this->url('language.admin_overview'), + '@add_language' => $this->url('entity.configurable_language.collection'), )); } elseif ($status) { diff --git a/core/modules/locale/src/Tests/LocaleUpdateInterfaceTest.php b/core/modules/locale/src/Tests/LocaleUpdateInterfaceTest.php index 248e35c90f52..d26a0705cc94 100644 --- a/core/modules/locale/src/Tests/LocaleUpdateInterfaceTest.php +++ b/core/modules/locale/src/Tests/LocaleUpdateInterfaceTest.php @@ -45,7 +45,7 @@ public function testInterface() { $this->assertNoText(t('Translation update status'), 'No status message'); $this->drupalGet('admin/reports/translations'); - $this->assertRaw(t('No translatable languages available. <a href="@add_language">Add a language</a> first.', array('@add_language' => \Drupal::url('language.admin_overview'))), 'Language message'); + $this->assertRaw(t('No translatable languages available. <a href="@add_language">Add a language</a> first.', array('@add_language' => \Drupal::url('entity.configurable_language.collection'))), 'Language message'); // Add German language. $this->addLanguage('de'); diff --git a/core/modules/menu_link_content/src/Tests/MenuLinkContentUITest.php b/core/modules/menu_link_content/src/Tests/MenuLinkContentUITest.php index a876fb3ffb49..65404e85142e 100644 --- a/core/modules/menu_link_content/src/Tests/MenuLinkContentUITest.php +++ b/core/modules/menu_link_content/src/Tests/MenuLinkContentUITest.php @@ -56,7 +56,7 @@ protected function getAdministratorPermissions() { */ protected function createEntity($values, $langcode, $bundle_name = NULL) { $values['menu_name'] = 'tools'; - $values['route_name'] = 'menu_ui.overview_page'; + $values['route_name'] = 'entity.menu.collection'; $values['title'] = 'Test title'; return parent::createEntity($values, $langcode, $bundle_name); diff --git a/core/modules/menu_ui/menu_ui.info.yml b/core/modules/menu_ui/menu_ui.info.yml index f3bf1beb772c..5ac594e24fb2 100644 --- a/core/modules/menu_ui/menu_ui.info.yml +++ b/core/modules/menu_ui/menu_ui.info.yml @@ -4,6 +4,6 @@ description: 'Allows administrators to customize the site navigation menu.' package: Core version: VERSION core: 8.x -configure: menu_ui.overview_page +configure: entity.menu.collection dependencies: - menu_link_content diff --git a/core/modules/menu_ui/menu_ui.links.action.yml b/core/modules/menu_ui/menu_ui.links.action.yml index 848bcbefdd7e..c82f1eae04c2 100644 --- a/core/modules/menu_ui/menu_ui.links.action.yml +++ b/core/modules/menu_ui/menu_ui.links.action.yml @@ -9,4 +9,4 @@ entity.menu.add_form: route_name: entity.menu.add_form title: 'Add menu' appears_on: - - menu_ui.overview_page + - entity.menu.collection diff --git a/core/modules/menu_ui/menu_ui.links.menu.yml b/core/modules/menu_ui/menu_ui.links.menu.yml index 03023356db23..6142abe4f943 100644 --- a/core/modules/menu_ui/menu_ui.links.menu.yml +++ b/core/modules/menu_ui/menu_ui.links.menu.yml @@ -1,5 +1,5 @@ -menu_ui.overview_page: +entity.menu.collection: title: Menus description: 'Add new menus to your site, edit existing menus, and rename and reorganize menu links.' - route_name: menu_ui.overview_page + route_name: entity.menu.collection parent: system.admin_structure diff --git a/core/modules/menu_ui/menu_ui.links.task.yml b/core/modules/menu_ui/menu_ui.links.task.yml index 10dd8d01b968..5fa7af223ddc 100644 --- a/core/modules/menu_ui/menu_ui.links.task.yml +++ b/core/modules/menu_ui/menu_ui.links.task.yml @@ -3,7 +3,7 @@ entity.menu.edit_form: route_name: entity.menu.edit_form base_route: entity.menu.edit_form -menu_ui.overview_page: +entity.menu.collection: title: 'List' - route_name: menu_ui.overview_page - base_route: menu_ui.overview_page + route_name: entity.menu.collection + base_route: entity.menu.collection diff --git a/core/modules/menu_ui/menu_ui.module b/core/modules/menu_ui/menu_ui.module index 3656e5fe7c43..14975f118add 100644 --- a/core/modules/menu_ui/menu_ui.module +++ b/core/modules/menu_ui/menu_ui.module @@ -39,7 +39,7 @@ function menu_ui_help($route_name, RouteMatchInterface $route_match) { $output .= '<h3>' . t('Uses') . '</h3>'; $output .= '<dl>'; $output .= '<dt>' . t('Managing menus') . '</dt>'; - $output .= '<dd>' . t('Users with the <em>Administer menus and menu items</em> permission can add, edit, and delete custom menus on the <a href="!menu">Menus page</a>. Custom menus can be special site menus, menus of external links, or any combination of internal and external links. You may create an unlimited number of additional menus, each of which will automatically have an associated block (if you have the <a href="!block_help">Block module</a> installed). By selecting <em>Edit menu</em>, you can add, edit, or delete links for a given menu. The links listing page provides a drag-and-drop interface for controlling the order of links, and creating a hierarchy within the menu.', array('!block_help' => \Drupal::url('help.page', array('name' => 'block')), '!menu' => \Drupal::url('menu_ui.overview_page'))) . '</dd>'; + $output .= '<dd>' . t('Users with the <em>Administer menus and menu items</em> permission can add, edit, and delete custom menus on the <a href="!menu">Menus page</a>. Custom menus can be special site menus, menus of external links, or any combination of internal and external links. You may create an unlimited number of additional menus, each of which will automatically have an associated block (if you have the <a href="!block_help">Block module</a> installed). By selecting <em>Edit menu</em>, you can add, edit, or delete links for a given menu. The links listing page provides a drag-and-drop interface for controlling the order of links, and creating a hierarchy within the menu.', array('!block_help' => \Drupal::url('help.page', array('name' => 'block')), '!menu' => \Drupal::url('entity.menu.collection'))) . '</dd>'; $output .= '<dt>' . t('Displaying menus') . '</dt>'; $output .= '<dd>' . t('If you have the Block module enabled, then each menu that you create is rendered in a block that you enable and position on the <a href="!blocks">Block layout page</a>. In some <a href="!themes">themes</a>, the main menu and possibly the secondary menu will be output automatically; you may be able to disable this behavior on the <a href="!themes">theme\'s settings page</a>.', array('!blocks' => (\Drupal::moduleHandler()->moduleExists('block')) ? \Drupal::url('block.admin_display') : '#', '!themes' => \Drupal::url('system.themes_page'), '!theme_settings' => \Drupal::url('system.theme_settings'))) . '</dd>'; $output .= '</dl>'; @@ -48,7 +48,7 @@ function menu_ui_help($route_name, RouteMatchInterface $route_match) { if ($route_name == 'entity.menu.add_form' && \Drupal::moduleHandler()->moduleExists('block')) { return '<p>' . t('You can enable the newly-created block for this menu on the <a href="!blocks">Block layout page</a>.', array('!blocks' => \Drupal::url('block.admin_display'))) . '</p>'; } - elseif ($route_name == 'menu_ui.overview_page' && \Drupal::moduleHandler()->moduleExists('block')) { + elseif ($route_name == 'entity.menu.collection' && \Drupal::moduleHandler()->moduleExists('block')) { return '<p>' . t('Each menu has a corresponding block that is managed on the <a href="!blocks">Block layout page</a>.', array('!blocks' => \Drupal::url('block.admin_display'))) . '</p>'; } } @@ -66,7 +66,8 @@ function menu_ui_entity_type_build(array &$entity_types) { ->setLinkTemplate('add-form', '/admin/structure/menu/add') ->setLinkTemplate('delete-form', '/admin/structure/menu/manage/{menu}/delete') ->setLinkTemplate('edit-form', '/admin/structure/menu/manage/{menu}') - ->setLinkTemplate('add-link-form', '/admin/structure/menu/manage/{menu}/add'); + ->setLinkTemplate('add-link-form', '/admin/structure/menu/manage/{menu}/add') + ->setLinkTemplate('collection', '/admin/structure/menu'); } /** diff --git a/core/modules/menu_ui/menu_ui.routing.yml b/core/modules/menu_ui/menu_ui.routing.yml index 97fd744e261b..7f94a6d7157f 100644 --- a/core/modules/menu_ui/menu_ui.routing.yml +++ b/core/modules/menu_ui/menu_ui.routing.yml @@ -1,4 +1,4 @@ -menu_ui.overview_page: +entity.menu.collection: path: '/admin/structure/menu' defaults: _entity_list: 'menu' diff --git a/core/modules/menu_ui/src/Form/MenuDeleteForm.php b/core/modules/menu_ui/src/Form/MenuDeleteForm.php index b2899707de03..17185d00525e 100644 --- a/core/modules/menu_ui/src/Form/MenuDeleteForm.php +++ b/core/modules/menu_ui/src/Form/MenuDeleteForm.php @@ -93,7 +93,7 @@ public function getConfirmText() { * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { - $form_state->setRedirect('menu_ui.overview_page'); + $form_state->setRedirectUrl($this->entity->urlInfo('collection')); // Locked menus may not be deleted. if ($this->entity->isLocked()) { diff --git a/core/modules/node/node.info.yml b/core/modules/node/node.info.yml index ab8e3c3c8019..cdbef85a4ccc 100644 --- a/core/modules/node/node.info.yml +++ b/core/modules/node/node.info.yml @@ -4,7 +4,7 @@ description: 'Allows content to be submitted to the site and displayed on pages. package: Core version: VERSION core: 8.x -configure: node.overview_types +configure: entity.node_type.collection dependencies: - text - entity_reference diff --git a/core/modules/node/node.links.action.yml b/core/modules/node/node.links.action.yml index b7b1577512cf..22079cd60027 100644 --- a/core/modules/node/node.links.action.yml +++ b/core/modules/node/node.links.action.yml @@ -2,7 +2,7 @@ node.type_add: route_name: node.type_add title: 'Add content type' appears_on: - - node.overview_types + - entity.node_type.collection node.add_page: route_name: node.add_page title: 'Add content' diff --git a/core/modules/node/node.links.menu.yml b/core/modules/node/node.links.menu.yml index a19749466297..b4edf2348c8f 100644 --- a/core/modules/node/node.links.menu.yml +++ b/core/modules/node/node.links.menu.yml @@ -1,8 +1,8 @@ -node.overview_types: +entity.node_type.collection: title: 'Content types' parent: system.admin_structure description: 'Manage content types, including default status, front page promotion, comment settings, etc.' - route_name: node.overview_types + route_name: entity.node_type.collection node.add_page: title: 'Add content' route_name: node.add_page diff --git a/core/modules/node/node.links.task.yml b/core/modules/node/node.links.task.yml index 88271e884a4c..7da46bf961e6 100644 --- a/core/modules/node/node.links.task.yml +++ b/core/modules/node/node.links.task.yml @@ -20,7 +20,7 @@ entity.node_type.edit_form: title: 'Edit' route_name: entity.node_type.edit_form base_route: entity.node_type.edit_form -node.overview_types: +entity.node_type.collection: title: List - route_name: node.overview_types - base_route: node.overview_types + route_name: entity.node_type.collection + base_route: entity.node_type.collection diff --git a/core/modules/node/node.module b/core/modules/node/node.module index a1f2c3b4e685..c14fb14beb19 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -85,7 +85,7 @@ function node_help($route_name, RouteMatchInterface $route_match) { $output .= '<h3>' . t('Uses') . '</h3>'; $output .= '<dl>'; $output .= '<dt>' . t('Creating content') . '</dt>'; - $output .= '<dd>' . t('When new content is created, the Node module records basic information about the content, including the author, date of creation, and the <a href="!content-type">Content type</a>. It also manages the <em>publishing options</em>, which define whether or not the content is published, promoted to the front page of the site, and/or sticky at the top of content lists. Default settings can be configured for each <a href="!content-type">type of content</a> on your site.', array('!content-type' => \Drupal::url('node.overview_types'))) . '</dd>'; + $output .= '<dd>' . t('When new content is created, the Node module records basic information about the content, including the author, date of creation, and the <a href="!content-type">Content type</a>. It also manages the <em>publishing options</em>, which define whether or not the content is published, promoted to the front page of the site, and/or sticky at the top of content lists. Default settings can be configured for each <a href="!content-type">type of content</a> on your site.', array('!content-type' => \Drupal::url('entity.node_type.collection'))) . '</dd>'; $output .= '<dt>' . t('Creating custom content types') . '</dt>'; $output .= '<dd>' . t('The Node module gives users with the <em>Administer content types</em> permission the ability to <a href="!content-new">create new content types</a> in addition to the default ones already configured. Creating custom content types allows you the flexibility to add <a href="!field">fields</a> and configure default settings that suit the differing needs of various site content.', array('!content-new' => \Drupal::url('node.type_add'), '!field' => \Drupal::url('help.page', array('name' => 'field')))) . '</dd>'; $output .= '<dt>' . t('Administering content') . '</dt>'; diff --git a/core/modules/node/node.routing.yml b/core/modules/node/node.routing.yml index 2eff2f0e5fdc..0b90a33f06a6 100644 --- a/core/modules/node/node.routing.yml +++ b/core/modules/node/node.routing.yml @@ -80,7 +80,7 @@ node.revision_delete_confirm: options: _node_operation_route: TRUE -node.overview_types: +entity.node_type.collection: path: '/admin/structure/types' defaults: _controller: '\Drupal\Core\Entity\Controller\EntityListController::listing' diff --git a/core/modules/node/src/Entity/NodeType.php b/core/modules/node/src/Entity/NodeType.php index 8f55f795b511..8a08d2670aae 100644 --- a/core/modules/node/src/Entity/NodeType.php +++ b/core/modules/node/src/Entity/NodeType.php @@ -36,7 +36,8 @@ * }, * links = { * "edit-form" = "/admin/structure/types/manage/{node_type}", - * "delete-form" = "/admin/structure/types/manage/{node_type}/delete" + * "delete-form" = "/admin/structure/types/manage/{node_type}/delete", + * "collection" = "/admin/structure/types", * } * ) */ diff --git a/core/modules/node/src/Form/NodeTypeDeleteConfirm.php b/core/modules/node/src/Form/NodeTypeDeleteConfirm.php index 2d662c1e7a77..31c44610a5a9 100644 --- a/core/modules/node/src/Form/NodeTypeDeleteConfirm.php +++ b/core/modules/node/src/Form/NodeTypeDeleteConfirm.php @@ -10,7 +10,6 @@ use Drupal\Core\Entity\EntityConfirmFormBase; use Drupal\Core\Entity\Query\QueryFactory; use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Url; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -55,7 +54,7 @@ public function getQuestion() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('node.overview_types'); + return $this->entity->urlInfo('collection'); } /** diff --git a/core/modules/node/src/NodeTypeForm.php b/core/modules/node/src/NodeTypeForm.php index cbfe841e609d..2292cf0fa568 100644 --- a/core/modules/node/src/NodeTypeForm.php +++ b/core/modules/node/src/NodeTypeForm.php @@ -233,7 +233,7 @@ public function save(array $form, FormStateInterface $form_state) { elseif ($status == SAVED_NEW) { node_add_body_field($type); drupal_set_message(t('The content type %name has been added.', $t_args)); - $context = array_merge($t_args, array('link' => $this->l(t('View'), new Url('node.overview_types')))); + $context = array_merge($t_args, array('link' => $type->link($this->t('View'), 'collection'))); $this->logger('node')->notice('Added content type %name.', $context); } @@ -256,7 +256,7 @@ public function save(array $form, FormStateInterface $form_state) { } $this->entityManager->clearCachedFieldDefinitions(); - $form_state->setRedirect('node.overview_types'); + $form_state->setRedirectUrl($type->urlInfo('collection')); } } diff --git a/core/modules/responsive_image/responsive_image.info.yml b/core/modules/responsive_image/responsive_image.info.yml index 1991dc3361d0..dec6feeec444 100644 --- a/core/modules/responsive_image/responsive_image.info.yml +++ b/core/modules/responsive_image/responsive_image.info.yml @@ -7,4 +7,4 @@ core: 8.x dependencies: - breakpoint - image -configure: responsive_image.mapping_page +configure: entity.responsive_image_mapping.collection diff --git a/core/modules/responsive_image/responsive_image.links.action.yml b/core/modules/responsive_image/responsive_image.links.action.yml index 302437e006db..6308cd1c3e9f 100644 --- a/core/modules/responsive_image/responsive_image.links.action.yml +++ b/core/modules/responsive_image/responsive_image.links.action.yml @@ -2,4 +2,4 @@ responsive_image.mapping_page_add: route_name: responsive_image.mapping_page_add title: 'Add responsive image mapping' appears_on: - - responsive_image.mapping_page + - entity.responsive_image_mapping.collection diff --git a/core/modules/responsive_image/responsive_image.links.menu.yml b/core/modules/responsive_image/responsive_image.links.menu.yml index 796e1f5c472b..c72d4ee23703 100644 --- a/core/modules/responsive_image/responsive_image.links.menu.yml +++ b/core/modules/responsive_image/responsive_image.links.menu.yml @@ -1,6 +1,6 @@ -responsive_image.mapping_page: +entity.responsive_image_mapping.collection: title: 'Responsive image mappings' description: 'Manage responsive image mappings' weight: 10 - route_name: responsive_image.mapping_page + route_name: entity.responsive_image_mapping.collection parent: system.admin_config_media diff --git a/core/modules/responsive_image/responsive_image.module b/core/modules/responsive_image/responsive_image.module index b02e523b8c89..a8200684c178 100644 --- a/core/modules/responsive_image/responsive_image.module +++ b/core/modules/responsive_image/responsive_image.module @@ -29,13 +29,13 @@ function responsive_image_help($route_name, RouteMatchInterface $route_match) { $output .= '<h3>' . t('Uses') . '</h3>'; $output .= '<dl>'; $output .= '<dt>' . t('Defining responsive image mappings') . '</dt>'; - $output .= '<dd>' . t('By creating responsive image mappings you define the image styles that are being used to output images at certain breakpoints. On the <a href="!responsive_image_mapping">Responsive image mappings</a> page, click <em>Add responsive image mapping</em> to create a new mapping. First chose a label and a breakpoint group and click Save. After that you can choose the image styles that will be used for each breakpoint. Image styles can be defined on the <a href="!image_styles">Image styles page</a> that is provided by the <a href="!image_help">Image module</a>. Breakpoints are defined in the configuration files of the theme. See the <a href="!breakpoint_help">help page of the Breakpoint module</a> for more information.', array('!responsive_image_mapping' => \Drupal::url('responsive_image.mapping_page'), '!image_styles' => \Drupal::url('image.style_list'),'!image_help' => \Drupal::url('help.page', array('name' => 'image')), '!breakpoint_help' => \Drupal::url('help.page', array('name' => 'breakpoint')))) . '</dd>'; + $output .= '<dd>' . t('By creating responsive image mappings you define the image styles that are being used to output images at certain breakpoints. On the <a href="!responsive_image_mapping">Responsive image mappings</a> page, click <em>Add responsive image mapping</em> to create a new mapping. First chose a label and a breakpoint group and click Save. After that you can choose the image styles that will be used for each breakpoint. Image styles can be defined on the <a href="!image_styles">Image styles page</a> that is provided by the <a href="!image_help">Image module</a>. Breakpoints are defined in the configuration files of the theme. See the <a href="!breakpoint_help">help page of the Breakpoint module</a> for more information.', array('!responsive_image_mapping' => \Drupal::url('entity.responsive_image_mapping.collection'), '!image_styles' => \Drupal::url('entity.image_style.collection'),'!image_help' => \Drupal::url('help.page', array('name' => 'image')), '!breakpoint_help' => \Drupal::url('help.page', array('name' => 'breakpoint')))) . '</dd>'; $output .= '<dt>' . t('Using responsive image mappings in Image fields') . '</dt>'; $output .= '<dd>' . t('After defining responsive image mappings, you can use them in the display settings for your Image fields, so that the site displays responsive images using the HTML5 picture tag. Open the Manage display page for the entity type (content type, taxonomy vocabulary, etc.) that the Image field is attached to. Choose the format <em>Responsive image</em>, click the Edit icon, and select one of the responsive image mappings that you have created. For general information on how to manage fields and their display see the <a href="!field_ui">Field UI module help page</a>. For background information about entities and fields see the <a href="!field_help">Field module help page</a>.', array('!field_ui' => \Drupal::url('help.page', array('name' => 'field_ui')),'!field_help' => \Drupal::url('help.page', array('name' => 'field')))) . '</dd>'; $output .= '</dl>'; break; - case 'responsive_image.mapping_page': + case 'entity.responsive_image_mapping.collection': $output .= '<p>' . t('A responsive image mapping associates an image style with each breakpoint defined by your theme.') . '</p>'; break; @@ -53,7 +53,7 @@ function responsive_image_menu() { 'title' => 'Responsive image mappings', 'description' => 'Manage responsive image mappings', 'weight' => 10, - 'route_name' => 'responsive_image.mapping_page', + 'route_name' => 'entity.responsive_image_mapping.collection', ); $items['admin/config/media/responsive-image-mapping/%responsive_image_mapping'] = array( 'title' => 'Edit responsive image mapping', diff --git a/core/modules/responsive_image/responsive_image.routing.yml b/core/modules/responsive_image/responsive_image.routing.yml index 09b14b5cf35f..2cf9926d2930 100644 --- a/core/modules/responsive_image/responsive_image.routing.yml +++ b/core/modules/responsive_image/responsive_image.routing.yml @@ -1,4 +1,4 @@ -responsive_image.mapping_page: +entity.responsive_image_mapping.collection: path: '/admin/config/media/responsive-image-mapping' defaults: _entity_list: 'responsive_image_mapping' diff --git a/core/modules/responsive_image/src/Entity/ResponsiveImageMapping.php b/core/modules/responsive_image/src/Entity/ResponsiveImageMapping.php index f866656c90c1..87c087875687 100644 --- a/core/modules/responsive_image/src/Entity/ResponsiveImageMapping.php +++ b/core/modules/responsive_image/src/Entity/ResponsiveImageMapping.php @@ -34,7 +34,8 @@ * }, * links = { * "edit-form" = "/admin/config/media/responsive-image-mapping/{responsive_image_mapping}", - * "duplicate-form" = "/admin/config/media/responsive-image-mapping/{responsive_image_mapping}/duplicate" + * "duplicate-form" = "/admin/config/media/responsive-image-mapping/{responsive_image_mapping}/duplicate", + * "collection" = "/admin/config/media/responsive-image-mapping", * } * ) */ diff --git a/core/modules/responsive_image/src/Form/ResponsiveImageMappingDeleteForm.php b/core/modules/responsive_image/src/Form/ResponsiveImageMappingDeleteForm.php index d5526b55e7de..5384134d0299 100644 --- a/core/modules/responsive_image/src/Form/ResponsiveImageMappingDeleteForm.php +++ b/core/modules/responsive_image/src/Form/ResponsiveImageMappingDeleteForm.php @@ -24,7 +24,7 @@ public function getQuestion() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('responsive_image.mapping_page'); + return $this->entity->urlInfo('collection'); } /** diff --git a/core/modules/responsive_image/src/ResponsiveImageMappingForm.php b/core/modules/responsive_image/src/ResponsiveImageMappingForm.php index 0ad61cae00e3..1f47865e38d8 100644 --- a/core/modules/responsive_image/src/ResponsiveImageMappingForm.php +++ b/core/modules/responsive_image/src/ResponsiveImageMappingForm.php @@ -162,7 +162,7 @@ public function save(array $form, FormStateInterface $form_state) { ); } else { - $form_state->setRedirect('responsive_image.mapping_page'); + $form_state->setRedirectUrl($this->entity->urlInfo('collection')); } } diff --git a/core/modules/search/search.info.yml b/core/modules/search/search.info.yml index 4675b0badb91..97b7d3fe7731 100644 --- a/core/modules/search/search.info.yml +++ b/core/modules/search/search.info.yml @@ -4,4 +4,4 @@ description: 'Enables site-wide keyword searching.' package: Core version: VERSION core: 8.x -configure: search.settings +configure: entity.search_page.collection diff --git a/core/modules/search/search.links.menu.yml b/core/modules/search/search.links.menu.yml index 2bb0a1895e76..ea5cfaba1c13 100644 --- a/core/modules/search/search.links.menu.yml +++ b/core/modules/search/search.links.menu.yml @@ -2,9 +2,9 @@ search.view: title: Search route_name: search.view enabled: 0 -search.settings: +entity.search_page.collection: title: 'Search pages' parent: system.admin_config_search description: 'Configure search pages and search indexing options.' - route_name: search.settings + route_name: entity.search_page.collection weight: -10 diff --git a/core/modules/search/search.module b/core/modules/search/search.module index 4e62b099663c..e05576d421dd 100644 --- a/core/modules/search/search.module +++ b/core/modules/search/search.module @@ -78,10 +78,10 @@ function search_help($route_name, RouteMatchInterface $route_match) { $output .= '<h3>' . t('Uses') . '</h3>'; $output .= '<dl>'; $output .= '<dt>' . t('Configuring search pages') . '</dt>'; - $output .= '<dd>' . t('To configure search pages, visit the <a href="!search-settings">Search pages page</a>. In the Search pages section, you can add a new search page, edit the configuration of existing search pages, enable and disable search pages, and choose the default search page. Each enabled search page has a URL path starting with <em>search</em>, and each will appear as a tab or local task link on the <a href="!search-url">search page</a>; you can configure the text that is shown in the tab. In addition, some search page plugins have additional settings that you can configure for each search page.', array('!search-settings' => \Drupal::url('search.settings'), '!search-url' => \Drupal::url('search.view'))) . '</dd>'; + $output .= '<dd>' . t('To configure search pages, visit the <a href="!search-settings">Search pages page</a>. In the Search pages section, you can add a new search page, edit the configuration of existing search pages, enable and disable search pages, and choose the default search page. Each enabled search page has a URL path starting with <em>search</em>, and each will appear as a tab or local task link on the <a href="!search-url">search page</a>; you can configure the text that is shown in the tab. In addition, some search page plugins have additional settings that you can configure for each search page.', array('!search-settings' => \Drupal::url('entity.search_page.collection'), '!search-url' => \Drupal::url('search.view'))) . '</dd>'; $output .= '<dt>' . t('Managing the search index') . '</dt>'; - $output .= '<dd>' . t('Some search page plugins, such as the core Content search page, index searchable text using the Drupal core search index, and will not work unless content is indexed. Indexing is done during <em>cron</em> runs, so it requires a <a href="!cron">cron maintenance task</a> to be set up. There are also several settings affecting indexing that can be configured on the <a href="!search-settings">Search pages page</a>: the number of items to index per cron run, the minimum word length to index, and how to handle Chinese, Japanese, and Korean characters.', array('!cron' => \Drupal::url('system.cron_settings'), '!search-settings' => \Drupal::url('search.settings'))) . '</dd>'; - $output .= '<dd>' . t('Modules providing search page plugins generally ensure that content-related actions on your site (creating, editing, or deleting content and comments) automatically cause affected content items to be marked for indexing or reindexing at the next cron run. When content is marked for reindexing, the previous content remains in the index until cron runs, at which time it is replaced by the new content. However, there are some actions related to the structure of your site that do not cause affected content to be marked for reindexing. Examples of structure-related actions that affect content include deleting or editing taxonomy terms, enabling or disabling modules that add text to content (such as Taxonomy, Comment, and field-providing modules), and modifying the fields or display parameters of your content types. If you take one of these actions and you want to ensure that the search index is updated to reflect your changed site structure, you can mark all content for reindexing by clicking the "Re-index site" button on the <a href="!search-settings">Search pages page</a>. If you have a lot of content on your site, it may take several cron runs for the content to be reindexed.', array('!search-settings' => \Drupal::url('search.settings'))) . '</dd>'; + $output .= '<dd>' . t('Some search page plugins, such as the core Content search page, index searchable text using the Drupal core search index, and will not work unless content is indexed. Indexing is done during <em>cron</em> runs, so it requires a <a href="!cron">cron maintenance task</a> to be set up. There are also several settings affecting indexing that can be configured on the <a href="!search-settings">Search pages page</a>: the number of items to index per cron run, the minimum word length to index, and how to handle Chinese, Japanese, and Korean characters.', array('!cron' => \Drupal::url('system.cron_settings'), '!search-settings' => \Drupal::url('entity.search_page.collection'))) . '</dd>'; + $output .= '<dd>' . t('Modules providing search page plugins generally ensure that content-related actions on your site (creating, editing, or deleting content and comments) automatically cause affected content items to be marked for indexing or reindexing at the next cron run. When content is marked for reindexing, the previous content remains in the index until cron runs, at which time it is replaced by the new content. However, there are some actions related to the structure of your site that do not cause affected content to be marked for reindexing. Examples of structure-related actions that affect content include deleting or editing taxonomy terms, enabling or disabling modules that add text to content (such as Taxonomy, Comment, and field-providing modules), and modifying the fields or display parameters of your content types. If you take one of these actions and you want to ensure that the search index is updated to reflect your changed site structure, you can mark all content for reindexing by clicking the "Re-index site" button on the <a href="!search-settings">Search pages page</a>. If you have a lot of content on your site, it may take several cron runs for the content to be reindexed.', array('!search-settings' => \Drupal::url('entity.search_page.collection'))) . '</dd>'; $output .= '<dt>' . t('Displaying the Search block') . '</dt>'; $output .= '<dd>' . t('The Search module includes a block, which can be enabled and configured on the <a href="!blocks">Block layout page</a>, if you have the Block module enabled; the default block title is Search, and it is the Search form block in the Forms category, if you wish to add another instance. The block is available to users with the <a href="!search_permission">Use search</a> permission, and it performs a search using the configured default search page.', array('!blocks' => (\Drupal::moduleHandler()->moduleExists('block')) ? \Drupal::url('block.admin_display') : '#', '!search_permission' => \Drupal::url('user.admin_permissions', array(), array('fragment' => 'module-search')))) . '</dd>'; $output .= '<dt>' . t('Searching your site') . '</dt>'; @@ -91,7 +91,7 @@ function search_help($route_name, RouteMatchInterface $route_match) { $output .= '</dl>'; return $output; - case 'search.settings': + case 'entity.search_page.collection': return '<p>' . t('The search engine maintains an index of words found in your site\'s content. To build and maintain this index, a correctly configured <a href="!cron">cron maintenance task</a> is required. Indexing behavior can be adjusted using the settings below.', array('!cron' => \Drupal::url('system.status'))) . '</p>'; } } diff --git a/core/modules/search/search.routing.yml b/core/modules/search/search.routing.yml index 479ebe8b4d71..ec273f166882 100644 --- a/core/modules/search/search.routing.yml +++ b/core/modules/search/search.routing.yml @@ -1,4 +1,4 @@ -search.settings: +entity.search_page.collection: path: '/admin/config/search/pages' defaults: _entity_list: 'search_page' diff --git a/core/modules/search/src/Controller/SearchController.php b/core/modules/search/src/Controller/SearchController.php index 4e79f79f63a3..f3e0e0628e58 100644 --- a/core/modules/search/src/Controller/SearchController.php +++ b/core/modules/search/src/Controller/SearchController.php @@ -191,7 +191,8 @@ public function performOperation(SearchPageInterface $search_page, $op) { drupal_set_message($this->t('The %label search page has been disabled.', array('%label' => $search_page->label()))); } - return $this->redirect('search.settings'); + $url = $search_page->urlInfo('collection'); + return $this->redirect($url->getRouteName(), $url->getRouteParameters(), $url->getOptions()); } /** @@ -208,7 +209,7 @@ public function setAsDefault(SearchPageInterface $search_page) { $this->searchPageRepository->setDefaultSearchPage($search_page); drupal_set_message($this->t('The default search page is now %label. Be sure to check the ordering of your search pages.', array('%label' => $search_page->label()))); - return $this->redirect('search.settings'); + return $this->redirect('entity.search_page.collection'); } } diff --git a/core/modules/search/src/Entity/SearchPage.php b/core/modules/search/src/Entity/SearchPage.php index 1ca1b54b9c5b..48379067d6ce 100644 --- a/core/modules/search/src/Entity/SearchPage.php +++ b/core/modules/search/src/Entity/SearchPage.php @@ -39,7 +39,8 @@ * "delete-form" = "/admin/config/search/pages/manage/{search_page}/delete", * "enable" = "/admin/config/search/pages/manage/{search_page}/enable", * "disable" = "/admin/config/search/pages/manage/{search_page}/disable", - * "set-default" = "/admin/config/search/pages/manage/{search_page}/set-default" + * "set-default" = "/admin/config/search/pages/manage/{search_page}/set-default", + * "collection" = "/admin/config/search/pages", * }, * config_prefix = "page", * entity_keys = { diff --git a/core/modules/search/src/Form/ReindexConfirm.php b/core/modules/search/src/Form/ReindexConfirm.php index 84948a20ad78..cc4194db1cac 100644 --- a/core/modules/search/src/Form/ReindexConfirm.php +++ b/core/modules/search/src/Form/ReindexConfirm.php @@ -55,7 +55,7 @@ public function getCancelText() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('search.settings'); + return new Url('entity.search_page.collection'); } /** diff --git a/core/modules/search/src/Form/SearchPageDeleteForm.php b/core/modules/search/src/Form/SearchPageDeleteForm.php index 5518d59c36f8..53974fbc02cb 100644 --- a/core/modules/search/src/Form/SearchPageDeleteForm.php +++ b/core/modules/search/src/Form/SearchPageDeleteForm.php @@ -9,7 +9,6 @@ use Drupal\Core\Entity\EntityConfirmFormBase; use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Url; /** * Provides a deletion confirm form for search. @@ -27,7 +26,7 @@ public function getQuestion() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('search.settings'); + return $this->entity->urlInfo('collection'); } /** diff --git a/core/modules/search/src/Form/SearchPageFormBase.php b/core/modules/search/src/Form/SearchPageFormBase.php index c2aa6ed41be9..95afb4ba962d 100644 --- a/core/modules/search/src/Form/SearchPageFormBase.php +++ b/core/modules/search/src/Form/SearchPageFormBase.php @@ -179,7 +179,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) { public function save(array $form, FormStateInterface $form_state) { $this->entity->save(); - $form_state->setRedirect('search.settings'); + $form_state->setRedirectUrl($this->entity->urlInfo('collection')); } } diff --git a/core/modules/shortcut/shortcut.info.yml b/core/modules/shortcut/shortcut.info.yml index dde0e9c6e1f0..f51d30bf476b 100644 --- a/core/modules/shortcut/shortcut.info.yml +++ b/core/modules/shortcut/shortcut.info.yml @@ -4,4 +4,4 @@ description: 'Allows users to manage customizable lists of shortcut links.' package: Core version: VERSION core: 8.x -configure: shortcut.set_admin +configure: entity.shortcut_set.collection diff --git a/core/modules/shortcut/shortcut.links.action.yml b/core/modules/shortcut/shortcut.links.action.yml index 05b431acfc4b..23471d9ec5ae 100644 --- a/core/modules/shortcut/shortcut.links.action.yml +++ b/core/modules/shortcut/shortcut.links.action.yml @@ -2,7 +2,7 @@ shortcut_set_add_local_action: route_name: shortcut.set_add title: 'Add shortcut set' appears_on: - - shortcut.set_admin + - entity.shortcut_set.collection shortcut.link_add: route_name: shortcut.link_add title: 'Add shortcut' diff --git a/core/modules/shortcut/shortcut.links.menu.yml b/core/modules/shortcut/shortcut.links.menu.yml index 8c9ded56b8d7..5e4be81647fd 100644 --- a/core/modules/shortcut/shortcut.links.menu.yml +++ b/core/modules/shortcut/shortcut.links.menu.yml @@ -1,5 +1,5 @@ -shortcut.set_admin: +entity.shortcut_set.collection: title: Shortcuts description: 'Add and modify shortcut sets.' - route_name: shortcut.set_admin + route_name: entity.shortcut_set.collection parent: system.admin_config_ui diff --git a/core/modules/shortcut/shortcut.module b/core/modules/shortcut/shortcut.module index 88c64dd0af9d..c095934eae51 100644 --- a/core/modules/shortcut/shortcut.module +++ b/core/modules/shortcut/shortcut.module @@ -24,7 +24,7 @@ function shortcut_help($route_name, RouteMatchInterface $route_match) { $output .= '<p>' . t('The Shortcut module allows users to create sets of <em>shortcut</em> links to commonly-visited pages of the site. Shortcuts are contained within <em>sets</em>. Each user with <em>Select any shortcut set</em> permission can select a shortcut set created by anyone at the site. For more information, see the online handbook entry for <a href="!shortcut">Shortcut module</a>.', array('!shortcut' => 'http://drupal.org/documentation/modules/shortcut')) . '</p>'; $output .= '<h3>' . t('Uses') . '</h3>'; $output .= '<dl><dt>' . t('Administering shortcuts') . '</dt>'; - $output .= '<dd>' . t('Users with the <em>Administer shortcuts</em> permission can manage shortcut sets and edit the shortcuts within sets from the <a href="!shortcuts">Shortcuts administration page</a>.', array('!shortcuts' => \Drupal::url('shortcut.set_admin'))) . '</dd>'; + $output .= '<dd>' . t('Users with the <em>Administer shortcuts</em> permission can manage shortcut sets and edit the shortcuts within sets from the <a href="!shortcuts">Shortcuts administration page</a>.', array('!shortcuts' => \Drupal::url('entity.shortcut_set.collection'))) . '</dd>'; $output .= '<dt>' . t('Choosing shortcut sets') . '</dt>'; $output .= '<dd>' . t('Users with permission to switch shortcut sets can choose a shortcut set to use from the Shortcuts tab of their user account page.') . '</dd>'; $output .= '<dt>' . t('Adding and removing shortcuts') . '</dt>'; @@ -34,7 +34,7 @@ function shortcut_help($route_name, RouteMatchInterface $route_match) { $output .= '</dl>'; return $output; - case 'shortcut.set_admin': + case 'entity.shortcut_set.collection': case 'shortcut.set_add': case 'entity.shortcut_set.edit_form': $user = \Drupal::currentUser(); @@ -373,7 +373,7 @@ function shortcut_toolbar() { 'tab' => array( '#type' => 'link', '#title' => t('Shortcuts'), - '#url' => Url::fromRoute('shortcut.set_admin'), + '#url' => $shortcut_set->urlInfo('collection'), '#attributes' => array( 'title' => t('Shortcuts'), 'class' => array('toolbar-icon', 'toolbar-icon-shortcut'), diff --git a/core/modules/shortcut/shortcut.routing.yml b/core/modules/shortcut/shortcut.routing.yml index 7fb1c0962c1f..d6c0e1ad2bcc 100644 --- a/core/modules/shortcut/shortcut.routing.yml +++ b/core/modules/shortcut/shortcut.routing.yml @@ -6,7 +6,7 @@ entity.shortcut_set.delete_form: requirements: _entity_access: 'shortcut_set.delete' -shortcut.set_admin: +entity.shortcut_set.collection: path: '/admin/config/user-interface/shortcut' defaults: _entity_list: 'shortcut_set' diff --git a/core/modules/shortcut/src/Entity/ShortcutSet.php b/core/modules/shortcut/src/Entity/ShortcutSet.php index 2b862c5cf5e2..aa0ccfc8a4c1 100644 --- a/core/modules/shortcut/src/Entity/ShortcutSet.php +++ b/core/modules/shortcut/src/Entity/ShortcutSet.php @@ -38,7 +38,8 @@ * links = { * "customize-form" = "/admin/config/user-interface/shortcut/manage/{shortcut_set}/customize", * "delete-form" = "/admin/config/user-interface/shortcut/manage/{shortcut_set}/delete", - * "edit-form" = "/admin/config/user-interface/shortcut/manage/{shortcut_set}" + * "edit-form" = "/admin/config/user-interface/shortcut/manage/{shortcut_set}", + * "collection" = "/admin/config/user-interface/shortcut", * } * ) */ diff --git a/core/modules/shortcut/src/Form/ShortcutSetDeleteForm.php b/core/modules/shortcut/src/Form/ShortcutSetDeleteForm.php index 036005304db9..c38d191a6b42 100644 --- a/core/modules/shortcut/src/Form/ShortcutSetDeleteForm.php +++ b/core/modules/shortcut/src/Form/ShortcutSetDeleteForm.php @@ -103,7 +103,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { */ public function submitForm(array &$form, FormStateInterface $form_state) { $this->entity->delete(); - $form_state->setRedirect('shortcut.set_admin'); + $form_state->setRedirectUrl($this->entity->urlInfo('collection')); drupal_set_message(t('The shortcut set %title has been deleted.', array('%title' => $this->entity->label()))); } diff --git a/core/modules/system/src/Form/DateFormatDeleteForm.php b/core/modules/system/src/Form/DateFormatDeleteForm.php index 0cb872945248..b71eb494a5b9 100644 --- a/core/modules/system/src/Form/DateFormatDeleteForm.php +++ b/core/modules/system/src/Form/DateFormatDeleteForm.php @@ -10,7 +10,6 @@ use Drupal\Core\Datetime\DateFormatter; use Drupal\Core\Entity\EntityConfirmFormBase; use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Url; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -65,7 +64,7 @@ public function getConfirmText() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('system.date_format_list'); + return $this->entity->urlInfo('collection'); } /** diff --git a/core/modules/system/src/Form/DateFormatFormBase.php b/core/modules/system/src/Form/DateFormatFormBase.php index cb2fde2ca499..c843ba24210e 100644 --- a/core/modules/system/src/Form/DateFormatFormBase.php +++ b/core/modules/system/src/Form/DateFormatFormBase.php @@ -174,7 +174,6 @@ public function validate(array $form, FormStateInterface $form_state) { * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { - $form_state->setRedirect('system.date_format_list'); $form_state->setValue('pattern', trim($form_state->getValue('date_format_pattern'))); parent::submitForm($form, $form_state); } @@ -190,6 +189,7 @@ public function save(array $form, FormStateInterface $form_state) { else { drupal_set_message(t('Custom date format added.')); } + $form_state->setRedirectUrl($this->entity->urlInfo('collection')); } } diff --git a/core/modules/system/src/Tests/System/DateTimeTest.php b/core/modules/system/src/Tests/System/DateTimeTest.php index fa87fc918728..f01f8c069e9f 100644 --- a/core/modules/system/src/Tests/System/DateTimeTest.php +++ b/core/modules/system/src/Tests/System/DateTimeTest.php @@ -87,7 +87,7 @@ function testDateFormatConfiguration() { 'date_format_pattern' => $date_format, ); $this->drupalPostForm('admin/config/regional/date-time/formats/add', $edit, t('Add format')); - $this->assertUrl(\Drupal::url('system.date_format_list', [], ['absolute' => TRUE]), [], 'Correct page redirection.'); + $this->assertUrl(\Drupal::url('entity.date_format.collection', [], ['absolute' => TRUE]), [], 'Correct page redirection.'); $this->assertText(t('Custom date format added.'), 'Date format added confirmation message appears.'); $this->assertText($date_format_id, 'Custom date format appears in the date format list.'); $this->assertText(t('Delete'), 'Delete link for custom date format appears.'); @@ -106,13 +106,13 @@ function testDateFormatConfiguration() { 'date_format_pattern' => 'Y m', ); $this->drupalPostForm($this->getUrl(), $edit, t('Save format')); - $this->assertUrl(\Drupal::url('system.date_format_list', [], ['absolute' => TRUE]), [], 'Correct page redirection.'); + $this->assertUrl(\Drupal::url('entity.date_format.collection', [], ['absolute' => TRUE]), [], 'Correct page redirection.'); $this->assertText(t('Custom date format updated.'), 'Custom date format successfully updated.'); // Delete custom date format. $this->clickLink(t('Delete')); $this->drupalPostForm('admin/config/regional/date-time/formats/manage/' . $date_format_id . '/delete', array(), t('Remove')); - $this->assertUrl(\Drupal::url('system.date_format_list', [], ['absolute' => TRUE]), [], 'Correct page redirection.'); + $this->assertUrl(\Drupal::url('entity.date_format.collection', [], ['absolute' => TRUE]), [], 'Correct page redirection.'); $this->assertRaw(t('Removed date format %format.', array('%format' => $name)), 'Custom date format removed.'); // Make sure the date does not exist in config. diff --git a/core/modules/system/system.links.action.yml b/core/modules/system/system.links.action.yml index c08a2cfc781b..447a5e6393f0 100644 --- a/core/modules/system/system.links.action.yml +++ b/core/modules/system/system.links.action.yml @@ -3,4 +3,4 @@ system.date_format_add: title: 'Add format' weight: -10 appears_on: - - system.date_format_list + - entity.date_format.collection diff --git a/core/modules/system/system.links.menu.yml b/core/modules/system/system.links.menu.yml index 9563f83626ef..ba21cee14e40 100644 --- a/core/modules/system/system.links.menu.yml +++ b/core/modules/system/system.links.menu.yml @@ -94,11 +94,11 @@ system.regional_settings: description: 'Settings for the site''s default time zone and country.' route_name: system.regional_settings weight: -20 -system.date_format_list: +entity.date_format.collection: title: 'Date and time formats' parent: system.admin_config_regional description: 'Configure display format strings for date and time.' - route_name: system.date_format_list + route_name: entity.date_format.collection weight: -9 system.admin_config_search: title: 'Search and metadata' diff --git a/core/modules/system/system.links.task.yml b/core/modules/system/system.links.task.yml index 3d5564735fff..a151835a40e9 100644 --- a/core/modules/system/system.links.task.yml +++ b/core/modules/system/system.links.task.yml @@ -55,9 +55,9 @@ system.admin_index: title: 'Index' weight: -18 -system.date_format_list: - route_name: system.date_format_list - base_route: system.date_format_list +entity.date_format.collection: + route_name: entity.date_format.collection + base_route: entity.date_format.collection title: 'List' entity.date_format.edit_form: title: 'Edit' diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 7c6771471ca5..458815422b60 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -86,7 +86,7 @@ function system_help($route_name, RouteMatchInterface $route_match) { $output .= '<dt>' . t('Performing system maintenance') . '</dt>'; $output .= '<dd>' . t('In order for the site and its modules to continue to operate well, a set of routine administrative operations must run on a regular basis. The System module manages this task by making use of a system cron job. You can verify the status of cron tasks by visiting the <a href="@status">Status report page</a>. For more information, see the online handbook entry for <a href="@handbook">configuring cron jobs</a>. You can set up cron job by visiting <a href="@cron">Cron configuration</a> page', array('@status' => \Drupal::url('system.status'), '@handbook' => 'http://drupal.org/cron', '@cron' => \Drupal::url('system.cron_settings'))) . '</dd>'; $output .= '<dt>' . t('Configuring basic site settings') . '</dt>'; - $output .= '<dd>' . t('The System module also handles basic configuration options for your site, including <a href="@date-time-settings">Date and time settings</a>, <a href="@file-system">File system settings</a>, <a href="@site-info">Site name and other information</a>, and a <a href="@maintenance-mode">Maintenance mode</a> for taking your site temporarily offline.', array('@date-time-settings' => \Drupal::url('system.date_format_list'), '@file-system' => \Drupal::url('system.file_system_settings'), '@site-info' => \Drupal::url('system.site_information_settings'), '@maintenance-mode' => \Drupal::url('system.site_maintenance_mode'))) . '</dd>'; + $output .= '<dd>' . t('The System module also handles basic configuration options for your site, including <a href="@date-time-settings">Date and time settings</a>, <a href="@file-system">File system settings</a>, <a href="@site-info">Site name and other information</a>, and a <a href="@maintenance-mode">Maintenance mode</a> for taking your site temporarily offline.', array('@date-time-settings' => \Drupal::url('entity.date_format.collection'), '@file-system' => \Drupal::url('system.file_system_settings'), '@site-info' => \Drupal::url('system.site_information_settings'), '@maintenance-mode' => \Drupal::url('system.site_maintenance_mode'))) . '</dd>'; $output .= '<dt>' . t('Disabling drag-and-drop functionality') . '</dt>'; $output .= '<dd>' . t('The default drag-and-drop user interface for ordering tables in Drupal presents a challenge for some users, including users of screen readers and other assistive technology. The drag-and-drop interface can be disabled in a table by clicking a link labeled "Show row weights" above the table. The replacement interface allows users to order the table by choosing numerical weights instead of dragging table rows.') . '</dd>'; $output .= '</dl>'; @@ -1309,7 +1309,8 @@ function system_entity_type_build(array &$entity_types) { ->setFormClass('delete', 'Drupal\system\Form\DateFormatDeleteForm') ->setListBuilderClass('Drupal\system\DateFormatListBuilder') ->setLinkTemplate('edit-form', '/admin/config/regional/date-time/formats/manage/{date_format}') - ->setLinkTemplate('delete-form', '/admin/config/regional/date-time/formats/manage/{date_format}/delete'); + ->setLinkTemplate('delete-form', '/admin/config/regional/date-time/formats/manage/{date_format}/delete') + ->setLinkTemplate('collection', '/admin/config/regional/date-time/formats'); } /** diff --git a/core/modules/system/system.routing.yml b/core/modules/system/system.routing.yml index 77489f5c4fb9..798cc899de3b 100644 --- a/core/modules/system/system.routing.yml +++ b/core/modules/system/system.routing.yml @@ -220,7 +220,7 @@ system.run_cron: requirements: _permission: 'administer site configuration' -system.date_format_list: +entity.date_format.collection: path: '/admin/config/regional/date-time' defaults: _entity_list: 'date_format' diff --git a/core/modules/system/tests/modules/entity_test/entity_test.routing.yml b/core/modules/system/tests/modules/entity_test/entity_test.routing.yml index 7b4ccbc15f92..78551c68fa33 100644 --- a/core/modules/system/tests/modules/entity_test/entity_test.routing.yml +++ b/core/modules/system/tests/modules/entity_test/entity_test.routing.yml @@ -24,7 +24,7 @@ entity.entity_test.render_no_view_mode: requirements: _access: 'TRUE' -entity.entity_test.list_referencing_entities: +entity.entity_test.collection_referencing_entities: path: '/entity_test/list/{entity_reference_field_name}/{referenced_entity_type}/{referenced_entity_id}' defaults: _controller: '\Drupal\entity_test\Controller\EntityTestController::listReferencingEntities' @@ -32,7 +32,7 @@ entity.entity_test.list_referencing_entities: requirements: _access: 'TRUE' -entity.entity_test.list_labels_alphabetically: +entity.entity_test.collection_labels_alphabetically: path: '/entity_test/list_labels_alphabetically/{entity_type_id}' defaults: _controller: '\Drupal\entity_test\Controller\EntityTestController::listEntitiesAlphabetically' @@ -40,7 +40,7 @@ entity.entity_test.list_labels_alphabetically: requirements: _access: 'TRUE' -entity.entity_test.list_empty: +entity.entity_test.collection_empty: path: '/entity_test/list_empty/{entity_type_id}' defaults: _controller: '\Drupal\entity_test\Controller\EntityTestController::listEntitiesEmpty' diff --git a/core/modules/taxonomy/src/Entity/Vocabulary.php b/core/modules/taxonomy/src/Entity/Vocabulary.php index ef831de2ec6f..4f21f8a781fd 100644 --- a/core/modules/taxonomy/src/Entity/Vocabulary.php +++ b/core/modules/taxonomy/src/Entity/Vocabulary.php @@ -40,7 +40,8 @@ * "delete-form" = "/admin/structure/taxonomy/manage/{taxonomy_vocabulary}/delete", * "reset-form" = "/admin/structure/taxonomy/manage/{taxonomy_vocabulary}/reset", * "overview-form" = "/admin/structure/taxonomy/manage/{taxonomy_vocabulary}/overview", - * "edit-form" = "/admin/structure/taxonomy/manage/{taxonomy_vocabulary}" + * "edit-form" = "/admin/structure/taxonomy/manage/{taxonomy_vocabulary}", + * "collection" = "/admin/structure/taxonomy", * } * ) */ diff --git a/core/modules/taxonomy/src/Form/TermDeleteForm.php b/core/modules/taxonomy/src/Form/TermDeleteForm.php index 77a3644c9683..eaccb2bb34bf 100644 --- a/core/modules/taxonomy/src/Form/TermDeleteForm.php +++ b/core/modules/taxonomy/src/Form/TermDeleteForm.php @@ -8,9 +8,6 @@ namespace Drupal\taxonomy\Form; use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Url; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\Entity\ContentEntityConfirmFormBase; /** @@ -36,7 +33,7 @@ public function getQuestion() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('taxonomy.vocabulary_list'); + return $this->entity->urlInfo('collection'); } /** diff --git a/core/modules/taxonomy/src/Form/VocabularyDeleteForm.php b/core/modules/taxonomy/src/Form/VocabularyDeleteForm.php index 16ae28545e0f..3f937b80a54c 100644 --- a/core/modules/taxonomy/src/Form/VocabularyDeleteForm.php +++ b/core/modules/taxonomy/src/Form/VocabularyDeleteForm.php @@ -9,7 +9,6 @@ use Drupal\Core\Entity\EntityConfirmFormBase; use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Url; /** * Provides a deletion confirmation form for taxonomy vocabulary. @@ -34,7 +33,7 @@ public function getQuestion() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('taxonomy.vocabulary_list'); + return $this->entity->urlInfo('collection'); } /** diff --git a/core/modules/taxonomy/src/VocabularyForm.php b/core/modules/taxonomy/src/VocabularyForm.php index fa726259287f..ffedfdad92d0 100644 --- a/core/modules/taxonomy/src/VocabularyForm.php +++ b/core/modules/taxonomy/src/VocabularyForm.php @@ -156,7 +156,7 @@ public function save(array $form, FormStateInterface $form_state) { case SAVED_UPDATED: drupal_set_message($this->t('Updated vocabulary %name.', array('%name' => $vocabulary->label()))); $this->logger('taxonomy')->notice('Updated vocabulary %name.', array('%name' => $vocabulary->label(), 'link' => $edit_link)); - $form_state->setRedirect('taxonomy.vocabulary_list'); + $form_state->setRedirectUrl($vocabulary->urlInfo('collection')); break; } diff --git a/core/modules/taxonomy/taxonomy.info.yml b/core/modules/taxonomy/taxonomy.info.yml index 3add22e26378..ceca3dd91c50 100644 --- a/core/modules/taxonomy/taxonomy.info.yml +++ b/core/modules/taxonomy/taxonomy.info.yml @@ -7,4 +7,4 @@ core: 8.x dependencies: - node - text -configure: taxonomy.vocabulary_list +configure: entity.taxonomy_vocabulary.collection diff --git a/core/modules/taxonomy/taxonomy.links.action.yml b/core/modules/taxonomy/taxonomy.links.action.yml index 102e9b716492..498c6c4e9fea 100644 --- a/core/modules/taxonomy/taxonomy.links.action.yml +++ b/core/modules/taxonomy/taxonomy.links.action.yml @@ -2,7 +2,7 @@ entity.taxonomy_vocabulary.add_form: route_name: entity.taxonomy_vocabulary.add_form title: 'Add vocabulary' appears_on: - - taxonomy.vocabulary_list + - entity.taxonomy_vocabulary.collection entity.taxonomy_term.add_form: route_name: entity.taxonomy_term.add_form diff --git a/core/modules/taxonomy/taxonomy.links.menu.yml b/core/modules/taxonomy/taxonomy.links.menu.yml index 77bb6faa2ae7..7626a2cc4ed8 100644 --- a/core/modules/taxonomy/taxonomy.links.menu.yml +++ b/core/modules/taxonomy/taxonomy.links.menu.yml @@ -1,5 +1,5 @@ -taxonomy.vocabulary_list: +entity.taxonomy_vocabulary.collection: title: Taxonomy parent: system.admin_structure description: 'Manage tagging, categorization, and classification of your content.' - route_name: taxonomy.vocabulary_list + route_name: entity.taxonomy_vocabulary.collection diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module index 95f6a6bcc392..7eeeb992c63e 100644 --- a/core/modules/taxonomy/taxonomy.module +++ b/core/modules/taxonomy/taxonomy.module @@ -56,7 +56,7 @@ function taxonomy_help($route_name, RouteMatchInterface $route_match) { $output .= '<h3>' . t('Uses') . '</h3>'; $output .= '<dl>'; $output .= '<dt>' . t('Creating vocabularies') . '</dt>'; - $output .= '<dd>' . t('Users with sufficient <a href="@perm">permissions</a> can create <em>vocabularies</em> and <em>terms</em> through the <a href="@taxo">Taxonomy page</a>. The page listing the terms provides a drag-and-drop interface for controlling the order of the terms and sub-terms within a vocabulary, in a hierarchical fashion. A <em>controlled vocabulary</em> classifying music by genre with terms and sub-terms could look as follows:', array('@taxo' => \Drupal::url('taxonomy.vocabulary_list'), '@perm' => \Drupal::url('user.admin_permissions', [], array('fragment'=>'module-taxonomy')))); + $output .= '<dd>' . t('Users with sufficient <a href="@perm">permissions</a> can create <em>vocabularies</em> and <em>terms</em> through the <a href="@taxo">Taxonomy page</a>. The page listing the terms provides a drag-and-drop interface for controlling the order of the terms and sub-terms within a vocabulary, in a hierarchical fashion. A <em>controlled vocabulary</em> classifying music by genre with terms and sub-terms could look as follows:', array('@taxo' => \Drupal::url('entity.taxonomy_vocabulary.collection'), '@perm' => \Drupal::url('user.admin_permissions', [], array('fragment'=>'module-taxonomy')))); $output .= '<ul><li>' . t('<em>vocabulary</em>: Music') . '</li>'; $output .= '<ul><li>' . t('<em>term</em>: Jazz') . '</li>'; $output .= '<ul><li>' . t('<em>sub-term</em>: Swing') . '</li>'; @@ -67,7 +67,7 @@ function taxonomy_help($route_name, RouteMatchInterface $route_match) { $output .= t('You can assign a sub-term to multiple parent terms. For example, <em>fusion</em> can be assigned to both <em>rock</em> and <em>jazz</em>.') . '</dd>'; $output .= '<dd>' . t('Terms in a <em>free-tagging vocabulary</em> can be built gradually as you create or edit content. This is often done used for blogs or photo management applications.') . '</dd>'; $output .= '<dt>' . t('Assigning vocabularies to content types') . '</dt>'; - $output .= '<dd>' . t('Before you can use a new vocabulary to classify your content, a new Taxonomy term field must be added to a <a href="@ctedit">content type</a> on its <em>manage fields</em> page. When adding a taxonomy field, you choose a <em>widget</em> to use to enter the taxonomy information on the content editing page: a select list, checkboxes, radio buttons, or an auto-complete field (to build a free-tagging vocabulary). After choosing the field type and widget, on the subsequent <em>field settings</em> page you can choose the desired vocabulary, whether one or multiple terms can be chosen from the vocabulary, and other settings. The same vocabulary can be added to multiple content types, by using the "Re-use existing field" section on the manage fields page.', array('@ctedit' => \Drupal::url('node.overview_types'))) . '</dd>'; + $output .= '<dd>' . t('Before you can use a new vocabulary to classify your content, a new Taxonomy term field must be added to a <a href="@ctedit">content type</a> on its <em>manage fields</em> page. When adding a taxonomy field, you choose a <em>widget</em> to use to enter the taxonomy information on the content editing page: a select list, checkboxes, radio buttons, or an auto-complete field (to build a free-tagging vocabulary). After choosing the field type and widget, on the subsequent <em>field settings</em> page you can choose the desired vocabulary, whether one or multiple terms can be chosen from the vocabulary, and other settings. The same vocabulary can be added to multiple content types, by using the "Re-use existing field" section on the manage fields page.', array('@ctedit' => \Drupal::url('entity.node_type.collection'))) . '</dd>'; $output .= '<dt>' . t('Classifying content') . '</dt>'; $output .= '<dd>' . t('After the vocabulary is assigned to the content type, you can start classifying content. The field with terms will appear on the content editing screen when you edit or <a href="@addnode">add new content</a>.', array('@addnode' => \Drupal::url('node.add_page'))) . '</dd>'; $output .= '<dt>' . t('Viewing listings') . '</dt>'; @@ -77,7 +77,7 @@ function taxonomy_help($route_name, RouteMatchInterface $route_match) { $output .= '</dl>'; return $output; - case 'taxonomy.vocabulary_list': + case 'entity.taxonomy_vocabulary.collection': $output = '<p>' . t('Taxonomy is for categorizing content. Terms are grouped into vocabularies. For example, a vocabulary called "Fruit" would contain the terms "Apple" and "Banana".') . '</p>'; return $output; diff --git a/core/modules/taxonomy/taxonomy.routing.yml b/core/modules/taxonomy/taxonomy.routing.yml index 6fa970fea14c..af86c9e74b67 100644 --- a/core/modules/taxonomy/taxonomy.routing.yml +++ b/core/modules/taxonomy/taxonomy.routing.yml @@ -1,4 +1,4 @@ -taxonomy.vocabulary_list: +entity.taxonomy_vocabulary.collection: path: '/admin/structure/taxonomy' defaults: _entity_list: 'taxonomy_vocabulary' diff --git a/core/modules/user/src/Entity/Role.php b/core/modules/user/src/Entity/Role.php index 9bda8d076182..b3dcdb58cbef 100644 --- a/core/modules/user/src/Entity/Role.php +++ b/core/modules/user/src/Entity/Role.php @@ -38,7 +38,8 @@ * links = { * "delete-form" = "/admin/people/roles/manage/{user_role}/delete", * "edit-form" = "/admin/people/roles/manage/{user_role}", - * "edit-permissions-form" = "/admin/people/permissions/{user_role}" + * "edit-permissions-form" = "/admin/people/permissions/{user_role}", + * "collection" = "/admin/people/roles", * } * ) */ diff --git a/core/modules/user/src/Entity/User.php b/core/modules/user/src/Entity/User.php index 98c16419e887..81386d76713a 100644 --- a/core/modules/user/src/Entity/User.php +++ b/core/modules/user/src/Entity/User.php @@ -54,6 +54,7 @@ * "canonical" = "/user/{user}", * "edit-form" = "/user/{user}/edit", * "cancel-form" = "/user/{user}/cancel", + * "collection" = "/admin/people", * }, * field_ui_base_route = "entity.user.admin_form", * ) diff --git a/core/modules/user/src/Form/UserCancelForm.php b/core/modules/user/src/Form/UserCancelForm.php index d3b69216ee6b..0297e7019bd5 100644 --- a/core/modules/user/src/Form/UserCancelForm.php +++ b/core/modules/user/src/Form/UserCancelForm.php @@ -125,7 +125,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) { if ($this->currentUser()->hasPermission('administer users') && $form_state->isValueEmpty('user_cancel_confirm') && $this->entity->id() != $this->currentUser()->id()) { user_cancel($form_state->getValues(), $this->entity->id(), $form_state->getValue('user_cancel_method')); - $form_state->setRedirect('user.admin_account'); + $form_state->setRedirectUrl($this->entity->urlInfo('collection')); } else { // Store cancelling method and whether to notify the user in diff --git a/core/modules/user/src/Form/UserMultipleCancelConfirm.php b/core/modules/user/src/Form/UserMultipleCancelConfirm.php index 45f340fdd4ff..da26ee78ea93 100644 --- a/core/modules/user/src/Form/UserMultipleCancelConfirm.php +++ b/core/modules/user/src/Form/UserMultipleCancelConfirm.php @@ -87,7 +87,7 @@ public function getQuestion() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('user.admin_account'); + return new Url('entity.user.collection'); } /** @@ -106,7 +106,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { ->get('user_user_operations_cancel') ->get($this->currentUser()->id()); if (!$accounts) { - return $this->redirect('user.admin_account'); + return $this->redirect('entity.user.collection'); } $form['accounts'] = array('#prefix' => '<ul>', '#suffix' => '</ul>', '#tree' => TRUE); @@ -130,7 +130,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { drupal_set_message($message, $redirect ? 'error' : 'warning'); // If only user 1 was selected, redirect to the overview. if ($redirect) { - return $this->redirect('user.admin_account'); + return $this->redirect('entity.user.collection'); } } @@ -197,7 +197,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) { } } } - $form_state->setRedirect('user.admin_account'); + $form_state->setRedirect('entity.user.collection'); } } diff --git a/core/modules/user/src/Form/UserRoleDelete.php b/core/modules/user/src/Form/UserRoleDelete.php index 12d9662fee0a..aa0f7d2a68f1 100644 --- a/core/modules/user/src/Form/UserRoleDelete.php +++ b/core/modules/user/src/Form/UserRoleDelete.php @@ -9,7 +9,6 @@ use Drupal\Core\Entity\EntityConfirmFormBase; use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Url; /** * Provides a deletion confirmation form for Role entity. @@ -27,7 +26,7 @@ public function getQuestion() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('user.role_list'); + return $this->entity->urlInfo('collection'); } /** diff --git a/core/modules/user/src/RoleForm.php b/core/modules/user/src/RoleForm.php index b05c164eaf96..bb801eaddeb0 100644 --- a/core/modules/user/src/RoleForm.php +++ b/core/modules/user/src/RoleForm.php @@ -68,7 +68,7 @@ public function save(array $form, FormStateInterface $form_state) { drupal_set_message($this->t('Role %label has been added.', array('%label' => $entity->label()))); $this->logger('user')->notice('Role %label has been added.', array('%label' => $entity->label(), 'link' => $edit_link)); } - $form_state->setRedirect('user.role_list'); + $form_state->setRedirect('entity.user_role.collection'); } } diff --git a/core/modules/user/tests/src/Unit/Menu/UserLocalTasksTest.php b/core/modules/user/tests/src/Unit/Menu/UserLocalTasksTest.php index 22d2ea4d9dde..fb7bb82a6ca9 100644 --- a/core/modules/user/tests/src/Unit/Menu/UserLocalTasksTest.php +++ b/core/modules/user/tests/src/Unit/Menu/UserLocalTasksTest.php @@ -35,9 +35,9 @@ public function testUserAdminLocalTasks($route, $expected) { */ public function getUserAdminRoutes() { return array( - array('user.admin_account', array(array('user.admin_account', 'user.admin_permissions', 'user.role_list'))), - array('user.admin_permissions', array(array('user.admin_account', 'user.admin_permissions', 'user.role_list'))), - array('user.role_list', array(array('user.admin_account', 'user.admin_permissions', 'user.role_list'))), + array('entity.user.collection', array(array('entity.user.collection', 'user.admin_permissions', 'entity.user_role.collection'))), + array('user.admin_permissions', array(array('entity.user.collection', 'user.admin_permissions', 'entity.user_role.collection'))), + array('entity.user_role.collection', array(array('entity.user.collection', 'user.admin_permissions', 'entity.user_role.collection'))), array('entity.user.admin_form', array(array('user.account_settings_tab'))), ); } diff --git a/core/modules/user/user.links.action.yml b/core/modules/user/user.links.action.yml index 2a1f8929be26..901c7905cac1 100644 --- a/core/modules/user/user.links.action.yml +++ b/core/modules/user/user.links.action.yml @@ -2,9 +2,9 @@ user_admin_create: route_name: user.admin_create title: 'Add user' appears_on: - - user.admin_account + - entity.user.collection user.role_add: route_name: user.role_add title: 'Add role' appears_on: - - user.role_list + - entity.user_role.collection diff --git a/core/modules/user/user.links.menu.yml b/core/modules/user/user.links.menu.yml index 62cfe51237c0..46a2947f5b0e 100644 --- a/core/modules/user/user.links.menu.yml +++ b/core/modules/user/user.links.menu.yml @@ -8,9 +8,9 @@ user.logout: route_name: user.logout weight: 10 menu_name: account -user.admin_account: +entity.user.collection: title: People - route_name: user.admin_account + route_name: entity.user.collection description: 'Manage user accounts, roles, and permissions.' parent: system.admin weight: 4 diff --git a/core/modules/user/user.links.task.yml b/core/modules/user/user.links.task.yml index be5138105719..5b0d1648f46a 100644 --- a/core/modules/user/user.links.task.yml +++ b/core/modules/user/user.links.task.yml @@ -34,18 +34,18 @@ entity.user.edit_form: base_route: entity.user.canonical title: Edit -user.admin_account: +entity.user.collection: title: List - route_name: user.admin_account - base_route: user.admin_account + route_name: entity.user.collection + base_route: entity.user.collection user.admin_permissions: title: Permissions route_name: user.admin_permissions - base_route: user.admin_account + base_route: entity.user.collection -user.role_list: +entity.user_role.collection: title: 'Roles' - route_name: user.role_list - base_route: user.admin_account + route_name: entity.user_role.collection + base_route: entity.user.collection weight: 10 diff --git a/core/modules/user/user.module b/core/modules/user/user.module index 799503199369..ebd4ced46360 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -54,9 +54,9 @@ function user_help($route_name, RouteMatchInterface $route_match) { $output .= '<h3>' . t('Uses') . '</h3>'; $output .= '<dl>'; $output .= '<dt>' . t('Creating and managing users') . '</dt>'; - $output .= '<dd>' . t('Through the <a href="!people">People administration page</a> you can add and cancel user accounts and assign users to roles. By editing one particular user you can change their username, email address, password, and information in other fields.', array('!people' => \Drupal::url('user.admin_account'))) . '</dd>'; + $output .= '<dd>' . t('Through the <a href="!people">People administration page</a> you can add and cancel user accounts and assign users to roles. By editing one particular user you can change their username, email address, password, and information in other fields.', array('!people' => \Drupal::url('entity.user.collection'))) . '</dd>'; $output .= '<dt>' . t('Configuring user roles') . '</dt>'; - $output .= '<dd>' . t('<em>Roles</em> are used to group and classify users; each user can be assigned one or more roles. Typically there are two pre-defined roles: <em>Anonymous user</em> (users that are not logged in), and <em>Authenticated user</em> (users that are registered and logged in). Depending on how your site was set up, an <em>Administrator</em> role may also be available: users with this role will automatically be assigned any new permissions whenever a module is enabled. You can create additional roles on the <a href="!roles">Roles administration page</a>.', array('!roles' => \Drupal::url('user.role_list'))) . '</dd>'; + $output .= '<dd>' . t('<em>Roles</em> are used to group and classify users; each user can be assigned one or more roles. Typically there are two pre-defined roles: <em>Anonymous user</em> (users that are not logged in), and <em>Authenticated user</em> (users that are registered and logged in). Depending on how your site was set up, an <em>Administrator</em> role may also be available: users with this role will automatically be assigned any new permissions whenever a module is enabled. You can create additional roles on the <a href="!roles">Roles administration page</a>.', array('!roles' => \Drupal::url('entity.user_role.collection'))) . '</dd>'; $output .= '<dt>' . t('Setting permissions') . '</dt>'; $output .= '<dd>' . t('After creating roles, you can set permissions for each role on the <a href="!permissions_user">Permissions page</a>. Granting a permission allows users who have been assigned a particular role to perform an action on the site, such as viewing content, editing or creating a particular type of content, administering settings for a particular module, or using a particular function of the site (such as search).', array('!permissions_user' => \Drupal::url('user.admin_permissions'))) . '</dd>'; $output .= '<dt>' . t('Managing account settings') . '</dt>'; @@ -70,9 +70,9 @@ function user_help($route_name, RouteMatchInterface $route_match) { return '<p>' . t("This web page allows administrators to register new users. Users' email addresses and usernames must be unique.") . '</p>'; case 'user.admin_permissions': - return '<p>' . t('Permissions let you control what users can do and see on your site. You can define a specific set of permissions for each role. (See the <a href="!role">Roles</a> page to create a role.) Any permissions granted to the Authenticated user role will be given to any user who is logged in to your site. From the <a href="!settings">Account settings</a> page, you can make any role into an Administrator role for the site, meaning that role will be granted all new permissions automatically. You should be careful to ensure that only trusted users are given this access and level of control of your site.', array('!role' => \Drupal::url('user.role_list'), '!settings' => \Drupal::url('entity.user.admin_form'))) . '</p>'; + return '<p>' . t('Permissions let you control what users can do and see on your site. You can define a specific set of permissions for each role. (See the <a href="!role">Roles</a> page to create a role.) Any permissions granted to the Authenticated user role will be given to any user who is logged in to your site. From the <a href="!settings">Account settings</a> page, you can make any role into an Administrator role for the site, meaning that role will be granted all new permissions automatically. You should be careful to ensure that only trusted users are given this access and level of control of your site.', array('!role' => \Drupal::url('entity.user_role.collection'), '!settings' => \Drupal::url('entity.user.admin_form'))) . '</p>'; - case 'user.role_list': + case 'entity.user_role.collection': return '<p>' . t('A role defines a group of users that have certain privileges. These privileges are defined on the <a href="!permissions">Permissions page</a>. Here, you can define the names and the display sort order of the roles on your site. It is recommended to order roles from least permissive (for example, Anonymous user) to most permissive (for example, Administrator user). Users who are not logged in have the Anonymous user role. Users who are logged in have the Authenticated user role, plus any other roles granted to their user account.', array('!permissions' => \Drupal::url('user.admin_permissions'))) . '</p>'; case 'entity.user.field_ui_fields': diff --git a/core/modules/user/user.routing.yml b/core/modules/user/user.routing.yml index e96c76c85ead..4f6a26355568 100644 --- a/core/modules/user/user.routing.yml +++ b/core/modules/user/user.routing.yml @@ -43,7 +43,7 @@ entity.user.admin_form: requirements: _permission: 'administer account settings' -user.admin_account: +entity.user.collection: path: '/admin/people' defaults: _entity_list: 'user' @@ -83,7 +83,7 @@ user.multiple_cancel_confirm: requirements: _permission: 'administer users' -user.role_list: +entity.user_role.collection: path: '/admin/people/roles' defaults: _entity_list: 'user_role' diff --git a/core/modules/views/src/Plugin/entity_reference/selection/ViewsSelection.php b/core/modules/views/src/Plugin/entity_reference/selection/ViewsSelection.php index 139f2f666905..f933ea217ca7 100644 --- a/core/modules/views/src/Plugin/entity_reference/selection/ViewsSelection.php +++ b/core/modules/views/src/Plugin/entity_reference/selection/ViewsSelection.php @@ -106,7 +106,7 @@ public static function settingsForm(FieldDefinitionInterface $field_definition) $form['view']['no_view_help'] = array( '#markup' => '<p>' . t('No eligible views were found. <a href="@create">Create a view</a> with an <em>Entity Reference</em> display, or add such a display to an <a href="@existing">existing view</a>.', array( '@create' => \Drupal::url('views_ui.add'), - '@existing' => \Drupal::url('views_ui.list'), + '@existing' => \Drupal::url('entity.view.collection'), )) . '</p>', ); } diff --git a/core/modules/views_ui/src/Controller/ViewsUIController.php b/core/modules/views_ui/src/Controller/ViewsUIController.php index b73333cd145e..b797619ed207 100644 --- a/core/modules/views_ui/src/Controller/ViewsUIController.php +++ b/core/modules/views_ui/src/Controller/ViewsUIController.php @@ -163,7 +163,7 @@ public function ajaxOperation(ViewEntityInterface $view, $op, Request $request) } // Otherwise, redirect back to the page. - return $this->redirect('views_ui.list'); + return $this->redirect('entity.view.collection'); } /** diff --git a/core/modules/views_ui/src/ViewAddForm.php b/core/modules/views_ui/src/ViewAddForm.php index d4c9410959eb..845bd676be9c 100644 --- a/core/modules/views_ui/src/ViewAddForm.php +++ b/core/modules/views_ui/src/ViewAddForm.php @@ -188,7 +188,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) { // @todo Figure out whether it really makes sense to throw and catch exceptions on the wizard. catch (WizardException $e) { drupal_set_message($e->getMessage(), 'error'); - $form_state->setRedirect('views_ui.list'); + $form_state->setRedirect('entity.view.collection'); return; } $this->entity->save(); @@ -205,7 +205,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) { * The current state of the form. */ public function cancel(array $form, FormStateInterface $form_state) { - $form_state->setRedirect('views_ui.list'); + $form_state->setRedirect('entity.view.collection'); } } diff --git a/core/modules/views_ui/src/ViewDeleteForm.php b/core/modules/views_ui/src/ViewDeleteForm.php index 918b2eff1fab..3c593ea3b377 100644 --- a/core/modules/views_ui/src/ViewDeleteForm.php +++ b/core/modules/views_ui/src/ViewDeleteForm.php @@ -9,7 +9,6 @@ use Drupal\Core\Entity\EntityConfirmFormBase; use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Url; /** * Provides a delete form for a view. @@ -27,7 +26,7 @@ public function getQuestion() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('views_ui.list'); + return $this->entity->urlInfo('collection'); } /** diff --git a/core/modules/views_ui/src/ViewEditForm.php b/core/modules/views_ui/src/ViewEditForm.php index 428775f35a38..cdacd9c17a1e 100644 --- a/core/modules/views_ui/src/ViewEditForm.php +++ b/core/modules/views_ui/src/ViewEditForm.php @@ -342,7 +342,7 @@ public function cancel(array $form, FormStateInterface $form_state) { // Remove this view from cache so edits will be lost. $view = $this->entity; $this->tempStore->delete($view->id()); - $form_state->setRedirect('views_ui.list'); + $form_state->setRedirectUrl($this->entity->urlInfo('collection')); } /** diff --git a/core/modules/views_ui/views_ui.info.yml b/core/modules/views_ui/views_ui.info.yml index 0230b6eaf6ce..71770b895094 100644 --- a/core/modules/views_ui/views_ui.info.yml +++ b/core/modules/views_ui/views_ui.info.yml @@ -4,6 +4,6 @@ description: 'Administrative interface for Views.' package: Core version: VERSION core: 8.x -configure: views_ui.list +configure: entity.view.collection dependencies: - views diff --git a/core/modules/views_ui/views_ui.links.action.yml b/core/modules/views_ui/views_ui.links.action.yml index 6a0ded0d267c..6a3c93619eae 100644 --- a/core/modules/views_ui/views_ui.links.action.yml +++ b/core/modules/views_ui/views_ui.links.action.yml @@ -2,4 +2,4 @@ views_add_local_action: route_name: views_ui.add title: 'Add new view' appears_on: - - views_ui.list + - entity.view.collection diff --git a/core/modules/views_ui/views_ui.links.menu.yml b/core/modules/views_ui/views_ui.links.menu.yml index e799469bb903..3f38307b3f9b 100644 --- a/core/modules/views_ui/views_ui.links.menu.yml +++ b/core/modules/views_ui/views_ui.links.menu.yml @@ -1,8 +1,8 @@ -views_ui.list: +entity.view.collection: title: Views parent: system.admin_structure description: 'Manage customized lists of content.' - route_name: views_ui.list + route_name: entity.view.collection views_ui.reports_plugins: title: 'Views plugins' parent: system.admin_reports diff --git a/core/modules/views_ui/views_ui.links.task.yml b/core/modules/views_ui/views_ui.links.task.yml index c7fe8b00101f..91b8c87b4a2e 100644 --- a/core/modules/views_ui/views_ui.links.task.yml +++ b/core/modules/views_ui/views_ui.links.task.yml @@ -1,7 +1,7 @@ views_ui.settings_tab: route_name: views_ui.settings_basic title: Settings - base_route: views_ui.list + base_route: entity.view.collection views_ui.settings_basic_tab: route_name: views_ui.settings_basic @@ -15,14 +15,14 @@ views_ui.settings_advanced_tab: weight: 10 views_ui.list_tab: - route_name: views_ui.list + route_name: entity.view.collection title: List - base_route: views_ui.list + base_route: entity.view.collection views_ui.reports_fields: route_name: views_ui.reports_fields title: 'Used in views' - base_route: field_ui.list + base_route: entity.field_storage_config.collection entity.view.edit_form: title: 'Edit' diff --git a/core/modules/views_ui/views_ui.module b/core/modules/views_ui/views_ui.module index c0049feb03fd..5ac6790a3fe7 100644 --- a/core/modules/views_ui/views_ui.module +++ b/core/modules/views_ui/views_ui.module @@ -28,9 +28,9 @@ function views_ui_help($route_name, RouteMatchInterface $route_match) { $output .= '<h3>' . t('Uses') . '</h3>'; $output .= '<dl>'; $output .= '<dt>' . t('Creating and managing views.') . '</dt>'; - $output .= '<dd>' . t('Views can be created from the <a href="@list">Views list page</a> by using the "Add new view" action. Existing views can be managed from the <a href="@list">Views list page</a> by locating the view in the "Enabled" or "Disabled" list and selecting the desired operation action, for example "Edit".', array('@list' => \Drupal::url('views_ui.list', array('name' => 'views_ui')))) . '</dd>'; + $output .= '<dd>' . t('Views can be created from the <a href="@list">Views list page</a> by using the "Add new view" action. Existing views can be managed from the <a href="@list">Views list page</a> by locating the view in the "Enabled" or "Disabled" list and selecting the desired operation action, for example "Edit".', array('@list' => \Drupal::url('entity.view.collection', array('name' => 'views_ui')))) . '</dd>'; $output .= '<dt>' . t('Enabling and disabling views.') . '<dt>'; - $output .= '<dd>' . t('Views can be enabled or disabled from the <a href="@list">Views list page</a>. To enable a view, find the view within the "Disabled" list and select the "Enable" operation. To disable a view find the view within the "Enabled" list and select the "Disable" operation.', array('@list' => \Drupal::url('views_ui.list', array('name' => 'views_ui')))) . '</dd>'; + $output .= '<dd>' . t('Views can be enabled or disabled from the <a href="@list">Views list page</a>. To enable a view, find the view within the "Disabled" list and select the "Enable" operation. To disable a view find the view within the "Enabled" list and select the "Disable" operation.', array('@list' => \Drupal::url('entity.view.collection', array('name' => 'views_ui')))) . '</dd>'; $output .= '<dt>' . t('Exporting and importing views.') . '</dt>'; $output .= '<dd>' . t('Views can be exported and imported as configuration files by using the <a href="@config">Configuration Manager module</a>.', array('@config' => \Drupal::url('help.page', array('name' => 'config')))) . '</dd>'; $output .= '<dt>' . t('Theming views.') . '</dt>'; @@ -60,7 +60,8 @@ function views_ui_entity_type_build(array &$entity_types) { ->setLinkTemplate('delete-form', '/admin/structure/views/view/{view}/delete') ->setLinkTemplate('enable', '/admin/structure/views/view/{view}/enable') ->setLinkTemplate('disable', '/admin/structure/views/view/{view}/disable') - ->setLinkTemplate('break-lock-form', '/admin/structure/views/view/{view}/break-lock'); + ->setLinkTemplate('break-lock-form', '/admin/structure/views/view/{view}/break-lock') + ->setLinkTemplate('collection', '/admin/structure/views'); } /** diff --git a/core/modules/views_ui/views_ui.routing.yml b/core/modules/views_ui/views_ui.routing.yml index 43e36341b8fc..0b95812f6b44 100644 --- a/core/modules/views_ui/views_ui.routing.yml +++ b/core/modules/views_ui/views_ui.routing.yml @@ -1,4 +1,4 @@ -views_ui.list: +entity.view.collection: path: '/admin/structure/views' defaults: _entity_list: 'view' -- GitLab