summaryrefslogtreecommitdiffstats
path: root/core/authorize.php
diff options
context:
space:
mode:
authorwebchick2015-08-11 22:54:49 (GMT)
committerwebchick2015-08-11 22:54:49 (GMT)
commit6bca82558cdb2c462adde9ec6f0f9831e239590b (patch)
tree8da4910e750f7e01900dd96d9dbde897e166ebb1 /core/authorize.php
parent252531f5510121edb2a32411bd2c25dd401767d7 (diff)
Issue #1885564 by joelpittet, SebCorbin, Cottser, mpdonadio, David_Rothstein, drupalninja99, jenlampton, lauriii, rteijeiro, mbrett5062, akalata, Devin Carlson, trevorkjorlien, longwave, socketwench, shanethehat, aboros: theme.maintenance.inc (authorize.php) - Convert theme_ functions to Twig
Diffstat (limited to 'core/authorize.php')
-rw-r--r--core/authorize.php28
1 files changed, 22 insertions, 6 deletions
diff --git a/core/authorize.php b/core/authorize.php
index 1138c92..fe374fa 100644
--- a/core/authorize.php
+++ b/core/authorize.php
@@ -120,15 +120,31 @@ if ($is_allowed) {
'#messages' => $results['messages'],
);
- $links = array();
if (is_array($results['tasks'])) {
- $links += $results['tasks'];
+ $links = $results['tasks'];
}
else {
- $links = array_merge($links, array(
- \Drupal::l(t('Administration pages'), new Url('system.admin')),
- \Drupal::l(t('Front page'), new Url('<front>')),
- ));
+ // 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'],
+ ],
+ ];
+ $links = [
+ $default_options + [
+ '#url' => Url::fromRoute('system.admin'),
+ '#title' => t('Administration pages'),
+ ],
+ $default_options + [
+ '#url' => Url::fromRoute('<front>'),
+ '#title' => t('Front page'),
+ ],
+ ];
}
$content['next_steps'] = array(