Commit e3cb87a7 authored by webchick's avatar webchick

Issue #2314887 by Crell: Standardize shortcut entity route names.

parent ad41b6f8
......@@ -7,4 +7,4 @@ shortcut.link_add:
route_name: shortcut.link_add
title: 'Add shortcut'
appears_on:
- shortcut.set_customize
- entity.shortcut_set.customize_form
......@@ -3,12 +3,12 @@ shortcut.set_switch:
base_route: user.view
title: 'Shortcuts'
shortcut.set_customize:
entity.shortcut_set.customize_form:
title: 'List links'
route_name: shortcut.set_customize
base_route: shortcut.set_customize
shortcut.set_edit:
route_name: entity.shortcut_set.customize_form
base_route: entity.shortcut_set.customize_form
entity.shortcut_set.edit_form:
title: 'Edit set name'
route_name: shortcut.set_edit
base_route: shortcut.set_customize
route_name: entity.shortcut_set.edit_form
base_route: entity.shortcut_set.customize_form
weight: 10
......@@ -35,7 +35,7 @@ function shortcut_help($route_name, RouteMatchInterface $route_match) {
case 'shortcut.set_admin':
case 'shortcut.set_add':
case 'shortcut.set_edit':
case 'entity.shortcut_set.edit_form':
$user = \Drupal::currentUser();
if ($user->hasPermission('access shortcuts') && $user->hasPermission('switch shortcut sets')) {
$output = '<p>' . t('Define which shortcut set you are using on the <a href="@shortcut-link">Shortcuts tab</a> of your account page.', array('@shortcut-link' => url("user/{$user->id()}/shortcuts"))) . '</p>';
......@@ -381,7 +381,7 @@ function shortcut_preprocess_page(&$variables) {
else {
$query['id'] = $shortcut_id;
$link_text = shortcut_set_switch_access() ? t('Remove from %shortcut_set shortcuts', array('%shortcut_set' => $shortcut_set->label())) : t('Remove from shortcuts');
$route_name = 'shortcut.link_delete';
$route_name = 'entity.shortcut.delete_form';
$route_parameters = array('shortcut' => $shortcut_id);
}
......@@ -419,7 +419,7 @@ function shortcut_toolbar() {
$configure_link = array(
'#type' => 'link',
'#title' => t('Edit shortcuts'),
'#route_name' => 'shortcut.set_customize',
'#route_name' => 'entity.shortcut_set.customize_form',
'#route_parameters' => array('shortcut_set' => $shortcut_set->id()),
'#options' => array('attributes' => array('class' => array('edit-shortcuts'))),
);
......
shortcut.set_delete:
entity.shortcut_set.delete_form:
path: '/admin/config/user-interface/shortcut/manage/{shortcut_set}/delete'
defaults:
_entity_form: 'shortcut_set.delete'
......@@ -22,7 +22,7 @@ shortcut.set_add:
requirements:
_entity_create_access: 'shortcut_set'
shortcut.set_edit:
entity.shortcut_set.edit_form:
path: '/admin/config/user-interface/shortcut/manage/{shortcut_set}'
defaults:
_entity_form: 'shortcut_set.edit'
......@@ -38,7 +38,7 @@ shortcut.link_add_inline:
_entity_access: 'shortcut_set.update'
_csrf_token: 'TRUE'
shortcut.set_customize:
entity.shortcut_set.customize_form:
path: '/admin/config/user-interface/shortcut/manage/{shortcut_set}/customize'
defaults:
_entity_form: 'shortcut_set.customize'
......@@ -54,7 +54,7 @@ shortcut.link_add:
requirements:
_entity_create_access: 'shortcut:{shortcut_set}'
shortcut.link_edit:
entity.shortcut.canonical:
path: '/admin/config/user-interface/shortcut/link/{shortcut}'
defaults:
_entity_form: 'shortcut.default'
......@@ -62,7 +62,7 @@ shortcut.link_edit:
requirements:
_entity_access: 'shortcut.update'
shortcut.link_delete:
entity.shortcut.delete_form:
path: '/admin/config/user-interface/shortcut/link/{shortcut}/delete'
defaults:
_entity_form: 'shortcut.delete'
......
......@@ -41,10 +41,10 @@
* "label" = "title"
* },
* links = {
* "canonical" = "shortcut.link_edit",
* "delete-form" = "shortcut.link_delete",
* "edit-form" = "shortcut.link_edit",
* "admin-form" = "shortcut.link_edit"
* "canonical" = "entity.shortcut.canonical",
* "delete-form" = "entity.shortcut.delete_form",
* "edit-form" = "entity.shortcut.canonical",
* "admin-form" = "entity.shortcut.canonical"
* },
* bundle_entity_type = "shortcut_set"
* )
......
......@@ -35,9 +35,9 @@
* "label" = "label"
* },
* links = {
* "customize-form" = "shortcut.set_customize",
* "delete-form" = "shortcut.set_delete",
* "edit-form" = "shortcut.set_edit"
* "customize-form" = "entity.shortcut_set.customize_form",
* "delete-form" = "entity.shortcut_set.delete_form",
* "edit-form" = "entity.shortcut_set.edit_form"
* }
* )
*/
......
......@@ -34,7 +34,7 @@ public function getQuestion() {
* {@inheritdoc}
*/
public function getCancelUrl() {
return new Url('shortcut.set_customize', array(
return new Url('entity.shortcut_set.customize_form', array(
'shortcut_set' => $this->entity->bundle(),
));
}
......
......@@ -212,7 +212,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
drupal_set_message($this->t('%user is now using a new shortcut set called %set_name. You can edit it from this page.', $replacements));
}
$form_state['redirect_route'] = array(
'route_name' => 'shortcut.set_customize',
'route_name' => 'entity.shortcut_set.customize_form',
'route_parameters' => array(
'shortcut_set' => $set->id(),
),
......
......@@ -88,7 +88,7 @@ public function save(array $form, FormStateInterface $form_state) {
drupal_set_message($message);
$form_state['redirect_route'] = array(
'route_name' => 'shortcut.set_customize',
'route_name' => 'entity.shortcut_set.customize_form',
'route_parameters' => array('shortcut_set' => $entity->bundle()),
);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment