- $template_file = "filebrowser.tpl";
- $mode = "";
- if (!empty($_GET['mode'])) {
- $mode = "?mode=".$_GET['mode'];
+ // 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);