diff --git a/core/modules/taxonomy/taxonomy.admin.inc b/core/modules/taxonomy/taxonomy.admin.inc index 4e7c5c2..bd8a2b5 100644 --- a/core/modules/taxonomy/taxonomy.admin.inc +++ b/core/modules/taxonomy/taxonomy.admin.inc @@ -8,18 +8,6 @@ use Drupal\taxonomy\Entity\Vocabulary; /** - * Page callback: provides the vocabulary creation form. - */ -function taxonomy_vocabulary_add() { - $vocabulary = entity_create('taxonomy_vocabulary', array( - // Default the new vocabulary to the site's default language. This is the - // most likely default value until we have better flexible settings. - 'langcode' => language_default()->id, - )); - return Drupal::entityManager()->getForm($vocabulary); -} - -/** * Form builder for the taxonomy terms overview. * * Display a tree of all the terms in a vocabulary, with options to edit diff --git a/core/modules/taxonomy/taxonomy.local_actions.yml b/core/modules/taxonomy/taxonomy.local_actions.yml new file mode 100644 index 0000000..a04a0ba --- /dev/null +++ b/core/modules/taxonomy/taxonomy.local_actions.yml @@ -0,0 +1,5 @@ +taxonomy_add_vocabulary_local_action: + route_name: taxonomy_vocabulary_add + title: 'Add vocabulary' + appears_on: + - taxonomy_vocabulary_list diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module index 0bfa84d..d9f2e2e 100644 --- a/core/modules/taxonomy/taxonomy.module +++ b/core/modules/taxonomy/taxonomy.module @@ -241,12 +241,8 @@ function taxonomy_menu() { 'type' => MENU_DEFAULT_LOCAL_TASK, ); $items['admin/structure/taxonomy/add'] = array( - 'title' => 'Add vocabulary', - 'page callback' => 'taxonomy_vocabulary_add', - 'access callback' => 'entity_page_create_access', - 'access arguments' => array('taxonomy_vocabulary'), - 'type' => MENU_LOCAL_ACTION, - 'file' => 'taxonomy.admin.inc', + 'route_name' => 'taxonomy_vocabulary_add', + 'type' => MENU_SIBLING_LOCAL_TASK, ); $items['taxonomy/term/%taxonomy_term'] = array( diff --git a/core/modules/taxonomy/taxonomy.routing.yml b/core/modules/taxonomy/taxonomy.routing.yml index 09dc6d0..a3bfd3d 100644 --- a/core/modules/taxonomy/taxonomy.routing.yml +++ b/core/modules/taxonomy/taxonomy.routing.yml @@ -19,6 +19,13 @@ taxonomy_term_delete: requirements: _entity_access: 'taxonomy_term.delete' +taxonomy_vocabulary_add: + pattern: '/admin/structure/taxonomy/add' + defaults: + _entity_form: 'taxonomy_vocabulary' + requirements: + _entity_create_access: 'taxonomy_vocabulary' + taxonomy_vocabulary_delete: pattern: '/admin/structure/taxonomy/manage/{taxonomy_vocabulary}/delete' defaults: