This issue is the obvious followup to
#1446650: After installing module display link to "install another module" โ
.
Problem/Motivation
Make installing another theme easier by linking to the install page after a new theme is installed.
Proposed resolution
Add a "Install another theme" link after a new theme is installed.
Also, to match setup of core/lib/Drupal/Core/Updater/Module.php
, set up row of links in the following order:
- Install another theme
- Enable newly added theme
- Administration pages
Remaining tasks
Reviewed and Tested by the Community.
From core/lib/Drupal/Core/Updater/Module.php
:
/**
* {@inheritdoc}
*/
public function postInstallTasks() {
// Since this is being called outsite of the primary front controller,
// the base_url needs to be set explicitly to ensure that links are
// relative to the site root.
// @todo Simplify with https://www.drupal.org/node/2548095
$default_options = [
'#type' => 'link',
'#options' => [
'absolute' => TRUE,
'base_url' => $GLOBALS['base_url'],
],
];
return [
$default_options + [
'#url' => Url::fromRoute('update.module_install'),
'#title' => t('Install another module'),
],
$default_options + [
'#url' => Url::fromRoute('system.modules_list'),
'#title' => t('Enable newly added modules'),
],
$default_options + [
'#url' => Url::fromRoute('system.admin'),
'#title' => t('Administration pages'),
],
];
}
<!-- See https://drupal.org/core-mentoring/novice-tasks for tips on identifying novice tasks. Delete or add "Novice" from the Novice? column in the table below as appropriate. Uncomment tasks as the issue advances. Update the Complete? column to indicate when they are done, and maybe reference the comment number where they were done. -->
User interface changes
Before:
After:
API changes
None