// Redirects to an URL and if neccessarry extends it with own base URL
function redirectToUrl ($url, $allowSpider = true) {
+ // Is the output mode -2?
+ if (getScriptOutputMode() == -2) {
+ // This is always (!) an AJAX request and shall not be redirected
+ return;
+ } // END - if
+
// Remove {%url=
if (substr($url, 0, 6) == '{%url=') {
$url = substr($url, 6, -2);
// The default theme is 'default'... ;-)
$ret = 'default';
- // Do we have ext-theme installed and active?
- if (isExtensionActive('theme')) {
+ // Do we have ext-theme installed and active or is 'theme' in URL or POST data?
+ if ((isPostRequestElementSet('theme')) && (isIncludeReadable(sprintf("theme/%s/theme.php", postRequestElement('theme'))))) {
+ // Use value from POST data
+ $ret = postRequestElement('theme');
+ } elseif ((isGetRequestElementSet('theme')) && (isIncludeReadable(sprintf("theme/%s/theme.php", getRequestElement('theme'))))) {
+ // Use value from GET data
+ $ret = getRequestElement('theme');
+ } elseif (isExtensionActive('theme')) {
// Call inner method
$ret = getActualTheme();
- } // END - if
+ }
// Return theme value
return $ret;
$OUT = '<link rel="stylesheet" type="text/css" href="{%url=css.php';
if ((isInstallationPhase())) {
// Default theme first
- $newTheme = 'default';
- if (isPostRequestElementSet('theme')) {
- $newTheme = postRequestElement('theme');
- } elseif (isGetRequestElementSet('theme')) {
- $newTheme = getRequestElement('theme');
- }
- $OUT .= '?theme=' . $newTheme . '&installing=1';
+ $OUT .= '?theme=' . getCurrentTheme() . '&installing=1';
} else {
// Add SVN revision to bypass caching problems
$OUT .= '?rev=' . getCurrentRepositoryRevision();