diff --git a/core/modules/block/block.module b/core/modules/block/block.module index a08254a..3b46049 100644 --- a/core/modules/block/block.module +++ b/core/modules/block/block.module @@ -111,10 +111,14 @@ function block_permission() { function block_menu() { $default_theme = Drupal::config('system.theme')->get('default'); $items['admin/structure/block'] = array( - 'title' => 'Blocks', + 'title' => 'Block layout', 'description' => 'Configure what block content appears in your site\'s sidebars and other regions.', 'route_name' => 'block_admin_display', ); + $items['admin/structure/block/list'] = array( + 'title' => 'Blocks', + 'type' => MENU_DEFAULT_LOCAL_TASK, + ); $items['admin/structure/block/manage/%block'] = array( 'title' => 'Configure block', 'route_name' => 'block_admin_edit', diff --git a/core/modules/block/custom_block/custom_block.info.yml b/core/modules/block/custom_block/custom_block.info.yml index bde73f7..1ddf936 100644 --- a/core/modules/block/custom_block/custom_block.info.yml +++ b/core/modules/block/custom_block/custom_block.info.yml @@ -7,4 +7,4 @@ core: 8.x dependencies: - block - text -configure: admin/structure/custom-blocks +configure: admin/structure/block/custom-blocks diff --git a/core/modules/block/custom_block/custom_block.module b/core/modules/block/custom_block/custom_block.module index 725e3e7..4603f45 100644 --- a/core/modules/block/custom_block/custom_block.module +++ b/core/modules/block/custom_block/custom_block.module @@ -16,11 +16,11 @@ function custom_block_help($path, $arg) { case 'admin/help#custom_block': return t('Allows the creation of custom blocks through the user interface.'); - case 'admin/structure/custom-blocks': + case 'admin/structure/block/custom-blocks': $output = '

' . 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.') . '

'; return $output; - case 'admin/structure/custom-blocks/types': + case 'admin/structure/block/custom-blocks/types': $output = '

' . 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.') . '

'; return $output; @@ -37,7 +37,7 @@ function custom_block_menu_local_tasks(&$data, $router_item, $root_path) { $item = menu_get_item('block/add'); if ($item['access']) { // Add a destination parameter. - $item['localized_options']['query']['destination'] = 'admin/structure/custom-blocks'; + $item['localized_options']['query']['destination'] = 'admin/structure/block/custom-blocks'; $data['actions']['block/add'] = array( '#theme' => 'menu_local_action', '#link' => $item, @@ -63,37 +63,38 @@ function custom_block_menu_local_actions_alter(&$actions) { * Implements hook_menu(). */ function custom_block_menu() { - $items['admin/structure/custom-blocks'] = array( - 'title' => 'Custom blocks', + $items['admin/structure/block/custom-blocks'] = array( + 'title' => 'Custom block library', 'description' => 'Manage custom blocks.', 'route_name' => 'custom_block_list', + 'type' => MENU_LOCAL_TASK | MENU_NORMAL_ITEM, ); - $items['admin/structure/custom-blocks/list'] = array( + $items['admin/structure/block/custom-blocks/list'] = array( 'title' => 'Blocks', 'type' => MENU_DEFAULT_LOCAL_TASK, ); - $items['admin/structure/custom-blocks/types'] = array( + $items['admin/structure/block/custom-blocks/types'] = array( 'title' => 'Types', 'route_name' => 'custom_block_type_list', 'type' => MENU_LOCAL_TASK, ); - $items['admin/structure/custom-blocks/types/add'] = array( + $items['admin/structure/block/custom-blocks/types/add'] = array( 'route_name' => 'custom_block_type_add', 'type' => MENU_SIBLING_LOCAL_TASK, 'weight' => 1, ); - $items['admin/structure/custom-blocks/manage/%custom_block_type'] = array( + $items['admin/structure/block/custom-blocks/manage/%custom_block_type'] = array( 'title' => 'Edit custom block type', 'title callback' => 'entity_page_label', 'title arguments' => array(4), 'route_name' => 'custom_block_type_edit', ); - $items['admin/structure/custom-blocks/manage/%custom_block_type/edit'] = array( + $items['admin/structure/block/custom-blocks/manage/%custom_block_type/edit'] = array( 'title' => 'Edit', 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10, ); - $items['admin/structure/custom-blocks/manage/%custom_block_type/delete'] = array( + $items['admin/structure/block/custom-blocks/manage/%custom_block_type/delete'] = array( 'title' => 'Delete', 'type' => MENU_LOCAL_TASK, 'weight' => 10, @@ -251,7 +252,7 @@ function custom_block_admin_paths() { 'block/add/*' => TRUE, 'block/*' => TRUE, 'block/*/delete' => TRUE, - 'admin/structure/custom-blocks/*' => TRUE, + 'admin/structure/block/custom-blocks/*' => TRUE, ); return $paths; } diff --git a/core/modules/block/custom_block/custom_block.routing.yml b/core/modules/block/custom_block/custom_block.routing.yml index ac3cf6e..f3e7a79 100644 --- a/core/modules/block/custom_block/custom_block.routing.yml +++ b/core/modules/block/custom_block/custom_block.routing.yml @@ -1,5 +1,5 @@ custom_block_type_list: - pattern: '/admin/structure/custom-blocks/types' + pattern: '/admin/structure/block/custom-blocks/types' defaults: _entity_list: 'custom_block_type' requirements: @@ -20,7 +20,7 @@ custom_block_add_form: _permission: 'administer blocks' custom_block_type_delete: - pattern: '/admin/structure/custom-blocks/manage/{custom_block_type}/delete' + pattern: '/admin/structure/block/custom-blocks/manage/{custom_block_type}/delete' defaults: _entity_form: 'custom_block_type.delete' requirements: @@ -42,21 +42,21 @@ custom_block_delete: _entity_access: 'custom_block.delete' custom_block_type_add: - pattern: '/admin/structure/custom-blocks/types/add' + pattern: '/admin/structure/block/custom-blocks/types/add' defaults: _entity_form: 'custom_block_type.add' requirements: _permission: 'administer blocks' custom_block_type_edit: - pattern: '/admin/structure/custom-blocks/manage/{custom_block_type}' + pattern: '/admin/structure/block/custom-blocks/manage/{custom_block_type}' defaults: _entity_form: 'custom_block_type.edit' requirements: _entity_access: 'custom_block_type.update' custom_block_list: - pattern: '/admin/structure/custom-blocks' + pattern: '/admin/structure/block/custom-blocks' defaults: _entity_list: 'custom_block' requirements: diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php index eb58dd6..d64e3de 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php @@ -191,7 +191,7 @@ public function save(array $form, array &$form_state) { } } else { - $form_state['redirect'] = 'admin/structure/custom-blocks'; + $form_state['redirect'] = 'admin/structure/block/custom-blocks'; } } else { diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockListController.php b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockListController.php index 43d773f..efa31b3 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockListController.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockListController.php @@ -40,7 +40,7 @@ public function getOperations(EntityInterface $entity) { if (isset($operations['edit'])) { $uri = $entity->uri(); $operations['edit']['href'] = $uri['path']; - $operations['edit']['query']['destination'] = 'admin/structure/custom-blocks'; + $operations['edit']['query']['destination'] = 'admin/structure/block/custom-blocks'; } return $operations; } diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeFormController.php b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeFormController.php index 06e92a5..a3e143f 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeFormController.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeFormController.php @@ -101,7 +101,7 @@ public function save(array $form, array &$form_state) { watchdog('custom_block', 'Custom block type %label has been added.', array('%label' => $block_type->label()), WATCHDOG_NOTICE, l(t('Edit'), $uri['path'] . '/edit')); } - $form_state['redirect'] = 'admin/structure/custom-blocks/types'; + $form_state['redirect'] = 'admin/structure/block/custom-blocks/types'; } /** @@ -109,7 +109,7 @@ public function save(array $form, array &$form_state) { */ public function delete(array $form, array &$form_state) { $block_type = $this->entity; - $form_state['redirect'] = 'admin/structure/custom-blocks/manage/' . $block_type->id() . '/delete'; + $form_state['redirect'] = 'admin/structure/block/custom-blocks/manage/' . $block_type->id() . '/delete'; } } diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php index 698c39c..3493c86 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php @@ -36,7 +36,7 @@ * }, * base_table = "custom_block", * revision_table = "custom_block_revision", - * route_base_path = "admin/structure/custom-blocks/manage/{bundle}", + * route_base_path = "admin/structure/block/custom-blocks/manage/{bundle}", * menu_base_path = "block/%custom_block", * menu_edit_path = "block/%custom_block", * fieldable = TRUE, diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlockType.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlockType.php index b74c1d7..cb1a57e 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlockType.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlockType.php @@ -82,7 +82,7 @@ class CustomBlockType extends ConfigEntityBase implements CustomBlockTypeInterfa */ public function uri() { return array( - 'path' => 'admin/structure/custom-blocks/manage/' . $this->id(), + 'path' => 'admin/structure/block/custom-blocks/manage/' . $this->id(), 'options' => array( 'entity_type' => $this->entityType, 'entity' => $this, diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Form/CustomBlockDeleteForm.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Form/CustomBlockDeleteForm.php index 0cc6f05..6a1751b 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Form/CustomBlockDeleteForm.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Form/CustomBlockDeleteForm.php @@ -59,7 +59,7 @@ public function submit(array $form, array &$form_state) { $this->entity->delete(); drupal_set_message($this->t('Custom block %label has been deleted.', array('%label' => $this->entity->label()))); watchdog('custom_block', 'Custom block %label has been deleted.', array('%label' => $this->entity->label()), WATCHDOG_NOTICE); - $form_state['redirect'] = 'admin/structure/custom-blocks'; + $form_state['redirect'] = 'admin/structure/block/custom-blocks'; } } diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Form/CustomBlockTypeDeleteForm.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Form/CustomBlockTypeDeleteForm.php index eac3ab6..b21d556 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Form/CustomBlockTypeDeleteForm.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Form/CustomBlockTypeDeleteForm.php @@ -53,7 +53,7 @@ public function getQuestion() { * {@inheritdoc} */ public function getCancelPath() { - return 'admin/structure/custom-blocks/types'; + return 'admin/structure/block/custom-blocks/types'; } /** @@ -83,7 +83,7 @@ public function buildForm(array $form, array &$form_state) { */ public function submit(array $form, array &$form_state) { $this->entity->delete(); - $form_state['redirect'] = 'admin/structure/custom-blocks/types'; + $form_state['redirect'] = 'admin/structure/block/custom-blocks/types'; drupal_set_message(t('Custom block type %label has been deleted.', array('%label' => $this->entity->label()))); watchdog('custom_block', 'Custom block type %label has been deleted.', array('%label' => $this->entity->label()), WATCHDOG_NOTICE); } diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockListTest.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockListTest.php index 438b4f9..698157a 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockListTest.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockListTest.php @@ -37,7 +37,7 @@ public static function getInfo() { */ public function testListing() { $this->drupalLogin($this->drupalCreateUser(array('administer blocks'))); - $this->drupalGet('admin/structure/custom-blocks'); + $this->drupalGet('admin/structure/block/custom-blocks'); // Test for the page title. $this->assertTitle(t('Custom blocks') . ' | Drupal'); diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockTypeTest.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockTypeTest.php index d5322e1..8c8e44b 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockTypeTest.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockTypeTest.php @@ -61,7 +61,7 @@ public function testCustomBlockTypeCreation() { 'id' => 'foo', 'label' => 'title for foo', ); - $this->drupalPost('admin/structure/custom-blocks/types/add', $edit, t('Save')); + $this->drupalPost('admin/structure/block/custom-blocks/types/add', $edit, t('Save')); $block_type = entity_load('custom_block_type', 'foo'); $this->assertTrue($block_type, 'The new block type has been created.'); @@ -90,7 +90,7 @@ public function testCustomBlockTypeEditing() { $edit = array( 'label' => 'Bar', ); - $this->drupalPost('admin/structure/custom-blocks/manage/basic', $edit, t('Save')); + $this->drupalPost('admin/structure/block/custom-blocks/manage/basic', $edit, t('Save')); field_info_cache_clear(); $this->drupalGet('block/add'); @@ -99,9 +99,9 @@ public function testCustomBlockTypeEditing() { $this->assertEqual(url('block/add/basic', array('absolute' => TRUE)), $this->getUrl(), 'Original machine name was used in URL.'); // Remove the body field. - $this->drupalPost('admin/structure/custom-blocks/manage/basic/fields/custom_block.basic.block_body/delete', array(), t('Delete')); + $this->drupalPost('admin/structure/block/custom-blocks/manage/basic/fields/custom_block.basic.block_body/delete', array(), t('Delete')); // Resave the settings for this type. - $this->drupalPost('admin/structure/custom-blocks/manage/basic', array(), t('Save')); + $this->drupalPost('admin/structure/block/custom-blocks/manage/basic', array(), t('Save')); // Check that the body field doesn't exist. $this->drupalGet('block/add/basic'); $this->assertNoRaw('Block body', 'Body field was not found.'); @@ -119,7 +119,7 @@ public function testCustomBlockTypeDeletion() { // Add a new block of this type. $block = $this->createCustomBlock(FALSE, 'foo'); // Attempt to delete the block type, which should not be allowed. - $this->drupalGet('admin/structure/custom-blocks/manage/' . $type->id() . '/delete'); + $this->drupalGet('admin/structure/block/custom-blocks/manage/' . $type->id() . '/delete'); $this->assertRaw( t('%label is used by 1 custom block on your site. You can not remove this block type until you have removed all of the %label blocks.', array('%label' => $type->label())), 'The block type will not be deleted until all blocks of that type are removed.' @@ -129,7 +129,7 @@ public function testCustomBlockTypeDeletion() { // Delete the block. $block->delete(); // Attempt to delete the block type, which should now be allowed. - $this->drupalGet('admin/structure/custom-blocks/manage/' . $type->id() . '/delete'); + $this->drupalGet('admin/structure/block/custom-blocks/manage/' . $type->id() . '/delete'); $this->assertRaw( t('Are you sure you want to delete %type?', array('%type' => $type->id())), 'The block type is available for deletion.' @@ -173,7 +173,7 @@ public function testsCustomBlockAddTypes() { // Test that adding a block from the 'custom blocks list' doesn't send you // to the block configure form. - $this->drupalGet('admin/structure/custom-blocks'); + $this->drupalGet('admin/structure/block/custom-blocks'); $this->clickLink(t('Add custom block')); $this->clickLink('foo'); $edit = array('info' => $this->randomName(8)); @@ -182,7 +182,7 @@ public function testsCustomBlockAddTypes() { if (!empty($blocks)) { $block = reset($blocks); $destination = 'admin/structure/block/add/custom_block:' . $block->uuid() . '/' . $theme; - $this->assertUrl(url('admin/structure/custom-blocks', array( + $this->assertUrl(url('admin/structure/block/custom-blocks', array( 'absolute' => TRUE ))); }