use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\Object\Image;
+use Friendica\Util\Strings;
/**
* @param 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")]];
$o = Renderer::replaceMacros($tpl, [
'$type' => 'image',
- '$baseurl' => System::baseUrl(),
'$path' => $path,
'$folders' => $albums,
'$files' => $files,
$tpl = Renderer::getMarkupTemplate($template_file);
$o = Renderer::replaceMacros($tpl, [
'$type' => 'file',
- '$baseurl' => System::baseUrl(),
'$path' => [ [ "", L10n::t("Files")] ],
'$folders' => false,
'$files' => $files,