Skip to content

Commit

Permalink
[FIX] 0028768: Info-Page (Link) and Permanent Link
Browse files Browse the repository at this point in the history
  • Loading branch information
chfsx committed Nov 27, 2020
1 parent 085dc05 commit 6ba248e
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/UI/Implementation/Component/MainControls/Renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use ILIAS\UI\Implementation\Component\Button\Bulky as IBulky;
use ILIAS\UI\Implementation\Component\MainControls\Slate\Slate as ISlate;
use ILIAS\UI\Implementation\Render\Template as UITemplateWrapper;
use ILIAS\Data\URI;

class Renderer extends AbstractComponentRenderer
{
Expand Down Expand Up @@ -370,10 +371,20 @@ protected function renderFooter(Footer $component, RendererInterface $default_re
$tpl->setVariable('TEXT', $component->getText());

$perm_url = $component->getPermanentURL();
if ($perm_url) {
$url = $perm_url->getBaseURI() . '?' . $perm_url->getQuery();
if ($perm_url instanceof URI) {
// Since URI::__toString() is only available in ILIAS >= 7 we have to do that on our own...
$uri = $perm_url->getBaseURI();
$query = $perm_url->getQuery();
if ($query) {
$uri .= '?' . $query;
}
$fragment = $perm_url->getFragment();
if ($fragment) {
$uri .= '#' . $fragment;
}

$tpl->setVariable('PERMA_LINK_LABEL', $this->txt('perma_link'));
$tpl->setVariable('PERMANENT_URL', $url);
$tpl->setVariable('PERMANENT_URL', $uri);
}
return $tpl->get();
}
Expand Down

0 comments on commit 6ba248e

Please sign in to comment.