Skip to content

Commit

Permalink
Frontend ohne page-Parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
gharlan committed Jun 3, 2018
1 parent de3e153 commit 720d730
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions boot.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,18 @@
return;
}

$page->setHref(rex_url::frontendController(['page' => 'ytraduko']));
$page->setHref(rex_url::frontend());

rex_extension::register('PAGE_CHECKED', function (rex_extension_point $ep) {
if (
'login' === $ep->getSubject() && rex_get('rex_logout', 'bool') ||
'ytraduko' === $ep->getSubject() && rex::isBackend()
) {
rex_response::sendRedirect(rex_url::frontendController(['page' => 'ytraduko'], false));
rex_response::sendRedirect(rex_url::frontend());
}
});

if (!rex::isBackend()) {
if ('ytraduko' !== rex_get('page', 'string')) {
rex_response::sendRedirect(rex_url::frontendController(['page' => 'ytraduko'], false));
}

rex_extension::register('FE_OUTPUT', function () {
$this->includeFile($this->getPath('pages/frontend.php'));
});
Expand Down
2 changes: 1 addition & 1 deletion pages/frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
$content = ob_get_clean();

// replace logo link
$content = preg_replace('/(?<=<a class="navbar-brand" href=")[^"]*(?=">)/', rex_url::frontendController(['page' => 'ytraduko']), $content);
$content = preg_replace('/(?<=<a class="navbar-brand" href=")[^"]*(?=">)/', rex_url::frontend(), $content);

// fake login page to avoid htaccess check with wrong paths
$content = str_replace('</body>', '<div id="rex-page-login" class="hidden"></div></body>', $content);
Expand Down

0 comments on commit 720d730

Please sign in to comment.