Commit 3d14a7d2 authored by alexpott's avatar alexpott

Issue #2401505 by Berdir, jibran, larowlan: Add an entity collection template for lists

parent 99377f95
......@@ -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;
}
......
......@@ -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.
......
......@@ -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
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
action.admin:
route_name: action.admin
route_name: entity.action.collection
title: 'Manage actions'
base_route: action.admin
base_route: entity.action.collection
......@@ -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');
}
action.admin:
entity.action.collection:
path: '/admin/config/system/actions'
defaults:
_title: 'Actions'
......
......@@ -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');
}
}
......@@ -34,7 +34,7 @@ public function getConfirmText() {
* {@inheritdoc}
*/
public function getCancelUrl() {
return new Url('action.admin');
return new Url('entity.action.collection');
}
/**
......
......@@ -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')));
}
}
......@@ -7,4 +7,4 @@ core: 8.x
dependencies:
- block
- text
configure: block_content.list
configure: entity.block_content.collection
......@@ -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
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:
......
......@@ -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;
......
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'
......
......@@ -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 {
......
......@@ -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'));
}
}
......@@ -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 = {
......
......@@ -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",
* }
* )
*/
......
......@@ -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'));
}
}
......@@ -55,7 +55,7 @@ public function getQuestion() {
* {@inheritdoc}
*/
public function getCancelUrl() {
return new Url('block_content.type_list');
return $this->entity->urlInfo('collection');
}
/**
......
......@@ -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;
......
......@@ -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.');
......
......@@ -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'),
);
}
......
......@@ -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
......@@ -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.'
......@@ -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;
}
......
......@@ -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'
......
......@@ -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'));
}
}
......@@ -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",
* }
* )
*/
......
......@@ -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()));
}
......
......@@ -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
config_test.list_page:
entity.config_test.collection:
path: '/admin/structure/config_test'
defaults:
_entity_list: 'config_test'
......
......@@ -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)));
}
}
......@@ -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'));
}
}
......@@ -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",
* }
* )
*/
......
......@@ -34,7 +34,7 @@ public function getConfirmText() {
* {@inheritdoc}
*/
public function getCancelUrl() {
return new Url('config_test.list_page');
return $this->entity->urlInfo('collection');
}
/**
......
......@@ -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>';
......
......@@ -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
......@@ -3,4 +3,4 @@ contact.form_add:
title: 'Add contact form'
weight: 1
appears_on:
- contact.form_list
- entity.contact_form.collection
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
......
......@@ -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;
}
......
......@@ -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'
......
......@@ -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'));
}
}
......@@ -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",
* }
* )
*/
......
......@@ -27,7 +27,7 @@ public function getQuestion() {
* {@inheritdoc}
*/
public function getCancelUrl() {
return new Url('contact.form_list');
return $this->entity->urlInfo('collection');
}
/**
......
......@@ -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');
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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
......
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: