X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Ffbrowser.php;h=f2bccb085a6f0d4d93c9a981728d94698b1727cd;hb=7c87e83dcfae34c75eb8070f225edab670b81efb;hp=d302383157a372fe2e4293a4c984837c326f981f;hpb=dbc6eb5422b81c95d6e1eea63c8ace794ccd2039;p=friendica.git diff --git a/mod/fbrowser.php b/mod/fbrowser.php index d302383157..f2bccb085a 100644 --- a/mod/fbrowser.php +++ b/mod/fbrowser.php @@ -11,6 +11,7 @@ use Friendica\Core\Renderer; use Friendica\Core\System; use Friendica\Database\DBA; use Friendica\Object\Image; +use Friendica\Util\Strings; /** * @param App $a @@ -27,8 +28,16 @@ function fbrowser_content(App $a) exit(); } + // Needed to match the correct template in a module that uses a different theme than the user/site/default + $theme = Strings::sanitizeFilePathItem(defaults($_GET, 'theme', null)); + if ($theme && is_file("view/theme/$theme/config.php")) { + $a->setCurrentTheme($theme); + } + $template_file = "filebrowser.tpl"; + $o = ''; + switch ($a->argv[1]) { case "image": $path = [["", L10n::t("Photos")]]; @@ -95,7 +104,6 @@ function fbrowser_content(App $a) $o = Renderer::replaceMacros($tpl, [ '$type' => 'image', - '$baseurl' => System::baseUrl(), '$path' => $path, '$folders' => $albums, '$files' => $files, @@ -125,7 +133,6 @@ function fbrowser_content(App $a) $tpl = Renderer::getMarkupTemplate($template_file); $o = Renderer::replaceMacros($tpl, [ '$type' => 'file', - '$baseurl' => System::baseUrl(), '$path' => [ [ "", L10n::t("Files")] ], '$folders' => false, '$files' => $files,