Issue #1987674 by tim.plunkett: Convert custom_block_type_list() to a new style controller.
parent
fe96498043
commit
a21ee2d711
|
@ -7,18 +7,6 @@
|
|||
|
||||
use Drupal\custom_block\Plugin\Core\Entity\CustomBlockType;
|
||||
|
||||
/**
|
||||
* Page callback: Lists custom block types.
|
||||
*
|
||||
* @return array
|
||||
* A build array in the format expected by drupal_render().
|
||||
*
|
||||
* @see custom_block_menu()
|
||||
*/
|
||||
function custom_block_type_list() {
|
||||
return Drupal::entityManager()->getListController('custom_block_type')->render();
|
||||
}
|
||||
|
||||
/**
|
||||
* Page callback: Presents the custom block type creation form.
|
||||
*
|
||||
|
|
|
@ -34,9 +34,7 @@ function custom_block_menu() {
|
|||
$items['admin/structure/custom-blocks'] = array(
|
||||
'title' => 'Custom block types',
|
||||
'description' => 'Manage custom block types.',
|
||||
'page callback' => 'custom_block_type_list',
|
||||
'access arguments' => array('administer blocks'),
|
||||
'file' => 'custom_block.admin.inc',
|
||||
'route_name' => 'custom_block_type_list',
|
||||
);
|
||||
$items['admin/structure/custom-blocks/add'] = array(
|
||||
'title' => 'Add custom block type',
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
custom_block_type_list:
|
||||
pattern: '/admin/structure/custom-blocks'
|
||||
defaults:
|
||||
_content: '\Drupal\Core\Entity\Controller\EntityListController::listing'
|
||||
entity_type: 'custom_block_type'
|
||||
requirements:
|
||||
_permission: 'administer blocks'
|
||||
|
||||
custom_block_add_page:
|
||||
pattern: block/add
|
||||
defaults:
|
||||
|
|
Loading…
Reference in New Issue