]> git.mxchange.org Git - friendica.git/blobdiff - mod/fbrowser.php
use config var in settings form
[friendica.git] / mod / fbrowser.php
index 559896acb13932ea6c690b4dd93d6dca0a385ef2..102d0c613d1a9cfb22f2d862939e0bd7b624f016 100644 (file)
@@ -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,6 +28,12 @@ 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($_GET['theme'] ?? null);
+       if ($theme && is_file("view/theme/$theme/config.php")) {
+               $a->setCurrentTheme($theme);
+       }
+
        $template_file = "filebrowser.tpl";
 
        $o = '';
@@ -97,7 +104,6 @@ function fbrowser_content(App $a)
 
                        $o =  Renderer::replaceMacros($tpl, [
                                '$type'     => 'image',
-                               '$baseurl'  => System::baseUrl(),
                                '$path'     => $path,
                                '$folders'  => $albums,
                                '$files'    => $files,
@@ -127,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,