Commit 99670f08 authored by webchick's avatar webchick

Issue #1981368 by tim.plunkett, Crell, webchick: Convert all routes to...

Issue #1981368 by tim.plunkett, Crell, webchick: Convert all routes to 'module_name().foo_bar()' naming convention.
parent a40399f2
......@@ -455,7 +455,7 @@ public static function linkGenerator() {
* 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('node.overview_types')));
* @endcode
* This keeps the context of the link title ('settings' in the example) for
* translators.
......
......@@ -434,7 +434,7 @@ public function getAdminRouteInfo($entity_type, $bundle) {
$bundle = str_replace($entity_info['bundle_prefix'], '', $bundle);
}
return array(
'route_name' => 'field_ui.overview.' . $entity_type,
'route_name' => "field_ui.overview_$entity_type",
'route_parameters' => array(
'bundle' => $bundle,
)
......
......@@ -22,7 +22,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('node.overview_types')));
* @endcode
* This keeps the context of the link title ('settings' in the example) for
* translators.
......
......@@ -51,7 +51,7 @@ function action_menu() {
$items['admin/config/system/actions'] = array(
'title' => 'Actions',
'description' => 'Manage the actions defined for your site.',
'route_name' => 'action_admin',
'route_name' => 'action.admin',
);
$items['admin/config/system/actions/manage'] = array(
'title' => 'Manage actions',
......@@ -61,17 +61,17 @@ function action_menu() {
$items['admin/config/system/actions/add'] = array(
'title' => 'Create an advanced action',
'type' => MENU_VISIBLE_IN_BREADCRUMB,
'route_name' => 'action_admin_add',
'route_name' => 'action.admin_add',
);
$items['admin/config/system/actions/configure'] = array(
'title' => 'Configure an advanced action',
'type' => MENU_VISIBLE_IN_BREADCRUMB,
'route_name' => 'action_admin_configure',
'route_name' => 'action.admin_configure',
);
$items['admin/config/system/actions/configure/%/delete'] = array(
'title' => 'Delete action',
'description' => 'Delete an action.',
'route_name' => 'action_delete',
'route_name' => 'action.delete',
);
return $items;
}
......
action_admin:
action.admin:
pattern: '/admin/config/system/actions'
defaults:
_entity_list: 'action'
requirements:
_permission: 'administer actions'
action_admin_add:
action.admin_add:
pattern: '/admin/config/system/actions/add/{action_id}'
defaults:
_entity_form: 'action.add'
requirements:
_permission: 'administer actions'
action_admin_configure:
action.admin_configure:
pattern: '/admin/config/system/actions/configure/{action}'
defaults:
_entity_form: 'action.edit'
requirements:
_permission: 'administer actions'
action_delete:
action.delete:
pattern: 'admin/config/system/actions/configure/{action}/delete'
defaults:
_entity_form: 'action.delete'
......
......@@ -33,7 +33,7 @@ public function getConfirmText() {
*/
public function getCancelRoute() {
return array(
'route_name' => 'action_admin',
'route_name' => 'action.admin',
);
}
......
......@@ -92,31 +92,31 @@ function aggregator_menu() {
$items['admin/config/services/aggregator'] = array(
'title' => 'Feed aggregator',
'description' => "Configure which content your site aggregates from other sites, how often it polls them, and how they're categorized.",
'route_name' => 'aggregator_admin_overview',
'route_name' => 'aggregator.admin_overview',
'weight' => 10,
);
$items['admin/config/services/aggregator/add/feed'] = array(
'title' => 'Add feed',
'route_name' => 'aggregator_feed_add',
'route_name' => 'aggregator.feed_add',
'type' => MENU_LOCAL_ACTION,
);
$items['admin/config/services/aggregator/add/category'] = array(
'title' => 'Add category',
'type' => MENU_LOCAL_ACTION,
'route_name' => 'aggregator_category_add',
'route_name' => 'aggregator.category_add',
);
$items['admin/config/services/aggregator/add/opml'] = array(
'title' => 'Import OPML',
'type' => MENU_LOCAL_ACTION,
'route_name' => 'aggregator_opml_add',
'route_name' => 'aggregator.opml_add',
);
$items['admin/config/services/aggregator/remove/%aggregator_feed'] = array(
'title' => 'Remove items',
'route_name' => 'aggregator_feed_items_delete',
'route_name' => 'aggregator.feed_items_delete',
);
$items['admin/config/services/aggregator/update/%aggregator_feed'] = array(
'title' => 'Update items',
'route_name' => 'aggregator_feed_refresh',
'route_name' => 'aggregator.feed_refresh',
);
$items['admin/config/services/aggregator/list'] = array(
'title' => 'List',
......@@ -125,22 +125,22 @@ function aggregator_menu() {
$items['admin/config/services/aggregator/settings'] = array(
'title' => 'Settings',
'description' => 'Configure the behavior of the feed aggregator, including when to discard feed items and how to present feed items and categories.',
'route_name' => 'aggregator_admin_settings',
'route_name' => 'aggregator.admin_settings',
'type' => MENU_LOCAL_TASK,
'weight' => 100,
);
$items['aggregator'] = array(
'title' => 'Feed aggregator',
'weight' => 5,
'route_name' => 'aggregator_page_last',
'route_name' => 'aggregator.page_last',
);
$items['aggregator/sources'] = array(
'title' => 'Sources',
'route_name' => 'aggregator_sources',
'route_name' => 'aggregator.sources',
);
$items['aggregator/categories'] = array(
'title' => 'Categories',
'route_name' => 'aggregator_categories',
'route_name' => 'aggregator.categories',
);
$items['aggregator/opml'] = array(
'title' => 'OPML feed',
......@@ -152,7 +152,7 @@ function aggregator_menu() {
$items['aggregator/categories/%aggregator_category'] = array(
'title callback' => '_aggregator_category_title',
'title arguments' => array(2),
'route_name' => 'aggregator_category_view',
'route_name' => 'aggregator.category_view',
);
$items['aggregator/categories/%aggregator_category/view'] = array(
'title' => 'View',
......@@ -161,18 +161,18 @@ function aggregator_menu() {
$items['aggregator/categories/%aggregator_category/categorize'] = array(
'title' => 'Categorize',
'type' => MENU_LOCAL_TASK,
'route_name' => 'aggregator_categorize_category_form',
'route_name' => 'aggregator.categorize_category_form',
);
$items['aggregator/categories/%aggregator_category/configure'] = array(
'title' => 'Configure',
'type' => MENU_LOCAL_TASK,
'weight' => 10,
'route_name' => 'aggregator_category_edit',
'route_name' => 'aggregator.category_edit',
);
$items['aggregator/sources/%aggregator_feed'] = array(
'title callback' => 'entity_page_label',
'title arguments' => array(2),
'route_name' => 'aggregator_feed_view',
'route_name' => 'aggregator.feed_view',
);
$items['aggregator/sources/%aggregator_feed/view'] = array(
'title' => 'View',
......@@ -180,30 +180,30 @@ function aggregator_menu() {
);
$items['aggregator/sources/%aggregator_feed/categorize'] = array(
'title' => 'Categorize',
'route_name' => 'aggregator_categorize_feed_form',
'route_name' => 'aggregator.categorize_feed_form',
'type' => MENU_LOCAL_TASK,
);
$items['aggregator/sources/%aggregator_feed/configure'] = array(
'title' => 'Configure',
'route_name' => 'aggregator_feed_configure',
'route_name' => 'aggregator.feed_configure',
'type' => MENU_LOCAL_TASK,
'weight' => 10,
);
$items['admin/config/services/aggregator/edit/feed/%aggregator_feed'] = array(
'title' => 'Edit feed',
'route_name' => 'aggregator_feed_edit',
'route_name' => 'aggregator.feed_edit',
);
$items['admin/config/services/aggregator/delete/feed/%aggregator_feed'] = array(
'title' => 'Delete feed',
'route_name' => 'aggregator_feed_delete',
'route_name' => 'aggregator.feed_delete',
);
$items['admin/config/services/aggregator/edit/category/%aggregator_category'] = array(
'title' => 'Edit category',
'route_name' => 'aggregator_category_admin_edit',
'route_name' => 'aggregator.category_admin_edit',
);
$items['admin/config/services/aggregator/delete/category/%aggregator_category'] = array(
'title' => 'Delete category',
'route_name' => 'aggregator_category_delete',
'route_name' => 'aggregator.category_delete',
);
return $items;
......
aggregator_admin_overview:
aggregator.admin_overview:
pattern: '/admin/config/services/aggregator'
defaults:
_content: '\Drupal\aggregator\Controller\AggregatorController::adminOverview'
requirements:
_permission: 'administer news feeds'
aggregator_admin_settings:
aggregator.admin_settings:
pattern: '/admin/config/services/aggregator/settings'
defaults:
_form: '\Drupal\aggregator\Form\SettingsForm'
requirements:
_permission: 'administer news feeds'
aggregator_feed_items_delete:
aggregator.feed_items_delete:
pattern: '/admin/config/services/aggregator/remove/{aggregator_feed}'
defaults:
_entity_form: 'aggregator_feed.remove_items'
requirements:
_permission: 'administer news feeds'
aggregator_feed_delete:
aggregator.feed_delete:
pattern: '/admin/config/services/aggregator/delete/feed/{aggregator_feed}'
defaults:
_entity_form: 'aggregator_feed.delete'
requirements:
_permission: 'administer news feeds'
aggregator_feed_add:
aggregator.feed_add:
pattern: '/admin/config/services/aggregator/add/feed'
defaults:
_content: '\Drupal\aggregator\Controller\AggregatorController::feedAdd'
requirements:
_permission: 'administer news feeds'
aggregator_feed_configure:
aggregator.feed_configure:
pattern: '/aggregator/sources/{aggregator_feed}/configure'
defaults:
_entity_form: 'aggregator_feed.default'
requirements:
_permission: 'administer news feeds'
aggregator_feed_edit:
aggregator.feed_edit:
pattern: '/admin/config/services/aggregator/edit/feed/{aggregator_feed}'
defaults:
_entity_form: 'aggregator_feed.default'
requirements:
_permission: 'administer news feeds'
aggregator_feed_refresh:
aggregator.feed_refresh:
pattern: '/admin/config/services/aggregator/update/{aggregator_feed}'
defaults:
_controller: '\Drupal\aggregator\Controller\AggregatorController::feedRefresh'
requirements:
_permission: 'administer news feeds'
aggregator_opml_add:
aggregator.opml_add:
pattern: '/admin/config/services/aggregator/add/opml'
defaults:
_form: '\Drupal\aggregator\Form\OpmlFeedAdd'
requirements:
_permission: 'administer news feeds'
aggregator_feed_view:
aggregator.feed_view:
pattern: '/aggregator/sources/{aggregator_feed}'
defaults:
_content: '\Drupal\aggregator\Controller\AggregatorController::viewFeed'
requirements:
_permission: 'access news feeds'
aggregator_page_last:
aggregator.page_last:
pattern: '/aggregator'
defaults:
_controller: '\Drupal\aggregator\Controller\AggregatorController::pageLast'
requirements:
_permission: 'access news feeds'
aggregator_sources:
aggregator.sources:
pattern: '/aggregator/sources'
defaults:
_content: '\Drupal\aggregator\Controller\AggregatorController::sources'
requirements:
_permission: 'access news feeds'
aggregator_categories:
aggregator.categories:
pattern: '/aggregator/categories'
defaults:
_content: '\Drupal\aggregator\Controller\AggregatorController::categories'
requirements:
_access_aggregator_categories: 'TRUE'
aggregator_category_view:
aggregator.category_view:
pattern: '/aggregator/categories/{cid}'
defaults:
_content: '\Drupal\aggregator\Controller\AggregatorController::viewCategory'
requirements:
_permission: 'access news feeds'
aggregator_category_edit:
aggregator.category_edit:
pattern: '/aggregator/categories/{cid}/configure'
defaults:
_form: '\Drupal\aggregator\Form\CategoryAdminForm'
requirements:
_permission: 'administer news feeds'
aggregator_category_admin_edit:
aggregator.category_admin_edit:
pattern: '/admin/config/services/aggregator/edit/category/{cid}'
defaults:
_form: '\Drupal\aggregator\Form\CategoryAdminForm'
requirements:
_permission: 'administer news feeds'
aggregator_category_delete:
aggregator.category_delete:
pattern: '/admin/config/services/aggregator/delete/category/{cid}'
defaults:
_form: '\Drupal\aggregator\Form\CategoryDeleteForm'
requirements:
_permission: 'administer news feeds'
aggregator_category_add:
aggregator.category_add:
pattern: '/admin/config/services/aggregator/add/category'
defaults:
_form: '\Drupal\aggregator\Form\CategoryAdminForm'
requirements:
_permission: 'administer news feeds'
aggregator_categorize_category_form:
aggregator.categorize_category_form:
pattern: '/aggregator/categories/{cid}/categorize'
defaults:
_form: '\Drupal\aggregator\Form\CategorizeCategoryForm'
requirements:
_permission: 'administer news feeds'
aggregator_categorize_feed_form:
aggregator.categorize_feed_form:
pattern: '/aggregator/sources/{aggregator_feed}/categorize'
defaults:
_form: '\Drupal\aggregator\Form\CategorizeFeedForm'
......
......@@ -164,7 +164,7 @@ public function feedRefresh(FeedInterface $aggregator_feed, Request $request) {
// @todo after https://drupal.org/node/1972246 find a new place for it.
aggregator_refresh($aggregator_feed);
return $this->redirect('aggregator_admin_overview');
return $this->redirect('aggregator.admin_overview');
}
/**
......@@ -331,7 +331,7 @@ public function sources() {
->viewMultiple($items, 'summary');
}
}
$feed->url = $this->urlGenerator()->generateFromRoute('aggregator_feed_view', array('aggregator_feed' => $feed->id()));
$feed->url = $this->urlGenerator()->generateFromRoute('aggregator.feed_view', array('aggregator_feed' => $feed->id()));
$build[$feed->id()] = array(
'#theme' => 'aggregator_summary_items',
'#summary_items' => $summary_items,
......
......@@ -87,7 +87,7 @@ public function getQuestion() {
*/
public function getCancelRoute() {
return array(
'route_name' => 'aggregator_admin_overview',
'route_name' => 'aggregator.admin_overview',
);
}
......
......@@ -26,7 +26,7 @@ public function getQuestion() {
*/
public function getCancelRoute() {
return array(
'route_name' => 'aggregator_admin_overview',
'route_name' => 'aggregator.admin_overview',
);
}
......
......@@ -26,7 +26,7 @@ public function getQuestion() {
*/
public function getCancelRoute() {
return array(
'route_name' => 'aggregator_admin_overview',
'route_name' => 'aggregator.admin_overview',
);
}
......
aggregator_test_feed:
aggregator_test.feed:
pattern: '/aggregator/test-feed/{use_last_modified}/{use_etag}'
defaults:
_controller: '\Drupal\aggregator_test\Controller\AggregatorTestRssController::testFeed'
......@@ -8,7 +8,7 @@ aggregator_test_feed:
requirements:
_permission: 'access content'
aggregator_redirect:
aggregator_test.redirect:
pattern: '/aggregator/redirect'
defaults:
_controller: '\Drupal\aggregator_test\Controller\AggregatorTestRssController::testRedirect'
......
......@@ -74,7 +74,7 @@ public function testFeed($use_last_modified, $use_etag, Request $request) {
* A response that redirects users to the test feed.
*/
public function testRedirect() {
return $this->redirect('aggregator_test_feed', array(), 301);
return $this->redirect('aggregator_test.feed', array(), 301);
}
}
......@@ -44,12 +44,12 @@ function ban_menu() {
$items['admin/config/people/ban'] = array(
'title' => 'IP address bans',
'description' => 'Manage banned IP addresses.',
'route_name' => 'ban_admin_page',
'route_name' => 'ban.admin_page',
'weight' => 10,
);
$items['admin/config/people/ban/delete/%'] = array(
'title' => 'Delete IP address',
'route_name' => 'ban_delete',
'route_name' => 'ban.delete',
);
return $items;
}
ban_admin_page:
ban.admin_page:
pattern: '/admin/config/people/ban/{default_ip}'
defaults:
_form: '\Drupal\ban\Form\BanAdmin'
......@@ -6,7 +6,7 @@ ban_admin_page:
requirements:
_permission: 'ban IP addresses'
ban_delete:
ban.delete:
pattern: '/admin/config/people/ban/delete/{ban_id}'
defaults:
_form: '\Drupal\ban\Form\BanDelete'
......
......@@ -69,7 +69,7 @@ public function getConfirmText() {
*/
public function getCancelRoute() {
return array(
'route_name' => 'ban_admin_page',
'route_name' => 'ban.admin_page',
);
}
......
......@@ -102,7 +102,7 @@ function block_menu() {
$items['admin/structure/block'] = array(
'title' => 'Block layout',
'description' => 'Configure what block content appears in your site\'s sidebars and other regions.',
'route_name' => 'block_admin_display',
'route_name' => 'block.admin_display',
);
$items['admin/structure/block/list'] = array(
'title' => 'Block layout',
......@@ -110,7 +110,7 @@ function block_menu() {
);
$items['admin/structure/block/manage/%block'] = array(
'title' => 'Configure block',
'route_name' => 'block_admin_edit',
'route_name' => 'block.admin_edit',
);
$items['admin/structure/block/manage/%block/configure'] = array(
'title' => 'Configure block',
......@@ -121,12 +121,12 @@ function block_menu() {
'title' => 'Delete block',
'type' => MENU_LOCAL_TASK,
'context' => MENU_CONTEXT_NONE,
'route_name' => 'block_admin_block_delete',
'route_name' => 'block.admin_block_delete',
);
$items['admin/structure/block/add/%/%'] = array(
'title' => 'Place block',
'type' => MENU_VISIBLE_IN_BREADCRUMB,
'route_name' => 'block_admin_add',
'route_name' => 'block.admin_add',
);
// Block administration is tied to the theme and plugin definition so
// that the plugin can appropriately attach to this URL structure.
......@@ -138,7 +138,7 @@ function block_menu() {
$items["admin/structure/block/list/$key"] = array(
'title' => check_plain($theme->info['name']),
'type' => $key == $default_theme ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK,
'route_name' => "block_admin_display.$key",
'route_name' => "block.admin_display_$key",
);
$items["admin/structure/block/demo/$key"] = array(
'title' => check_plain($theme->info['name']),
......
block_admin_block_delete:
block.admin_block_delete:
pattern: '/admin/structure/block/manage/{block}/delete'
defaults:
_entity_form: 'block.delete'
requirements:
_permission: 'administer blocks'
block_admin_edit:
block.admin_edit:
pattern: '/admin/structure/block/manage/{block}'
defaults:
_entity_form: 'block.default'
requirements:
_entity_access: 'block.update'
block_admin_display:
block.admin_display:
pattern: '/admin/structure/block'
defaults:
_content: '\Drupal\block\Controller\BlockListController::listing'
......@@ -20,7 +20,7 @@ block_admin_display:
requirements:
_permission: 'administer blocks'
block_admin_add:
block.admin_add:
pattern: '/admin/structure/block/add/{plugin_id}/{theme}'
defaults:
_content: '\Drupal\block\Controller\BlockAddController::blockAddConfigureForm'
......
custom_block_type_add:
route_name: custom_block_type_add
route_name: custom_block.type_add
title: 'Add custom block type'
appears_on:
- custom_block_type_list
- custom_block.type_list
custom_block_add_action:
route_name: custom_block_add_page
route_name: custom_block.add_page
title: 'Add custom block'
appears_on:
- block_admin_display
- block.admin_display
......@@ -31,7 +31,7 @@ function custom_block_help($path, $arg) {
* Implements hook_menu_local_tasks().
*/
function custom_block_menu_local_tasks(&$data, $router_item, $root_path) {
if ($router_item['route_name'] == 'custom_block_list') {
if ($router_item['route_name'] == 'custom_block.list') {
// @todo Move to a LocalAction plugin when https://drupal.org/node/2045267
// allows local actions to work with query strings.
$item = menu_get_item('block/add');
......@@ -46,7 +46,7 @@ function custom_block_menu_local_tasks(&$data, $router_item, $root_path) {
}
$routes = array_map(function ($theme) {
return "block_admin_display.$theme";
return "block.admin_display_$theme";
}, array_keys(list_themes()));
if (in_array($router_item['route_name'], $routes)) {
// @todo Move to a LocalAction plugin when https://drupal.org/node/2045267
......@@ -70,7 +70,7 @@ function custom_block_menu() {
$items['admin/structure/block/custom-blocks'] = array(
'title' => 'Custom block library',
'description' => 'Manage custom blocks.',
'route_name' => 'custom_block_list',
'route_name' => 'custom_block.list',
'type' => MENU_LOCAL_TASK | MENU_NORMAL_ITEM,
);
$items['admin/structure/block/custom-blocks/list'] = array(
......@@ -79,11 +79,11 @@ function custom_block_menu() {
);
$items['admin/structure/block/custom-blocks/types'] = array(
'title' => 'Types',
'route_name' => 'custom_block_type_list',
'route_name' => 'custom_block.type_list',
'type' => MENU_LOCAL_TASK,
);
$items['admin/structure/block/custom-blocks/types/add'] = array(
'route_name' => 'custom_block_type_add',
'route_name' => 'custom_block.type_add',
'type' => MENU_SIBLING_LOCAL_TASK,
'weight' => 1,
);
......@@ -91,7 +91,7 @@ function custom_block_menu() {
'title' => 'Edit custom block type',
'title callback' => 'entity_page_label',
'title arguments' => array(5),
'route_name' => 'custom_block_type_edit',
'route_name' => 'custom_block.type_edit',
);
$items['admin/structure/block/custom-blocks/manage/%custom_block_type/edit'] = array(
'title' => 'Edit',
......@@ -102,21 +102,21 @@ function custom_block_menu() {
'title' => 'Delete',