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 = '';
// Click on album link\r
$(".fbrowser").on("click", ".folders a, .path a", function(e) {\r
e.preventDefault();\r
- var url = baseurl + "/fbrowser/" + FileBrowser.type + "/" + this.dataset.folder + "?mode=none";\r
+ var url = baseurl + "/fbrowser/" + FileBrowser.type + "/" + this.dataset.folder + "?mode=none&theme=frio";\r
FileBrowser.folder = this.dataset.folder;\r
\r
FileBrowser.loadContent(url);\r
\r
console.log(FileBrowser.event, this.dataset.filename, embed, FileBrowser.id);\r
\r
- parent.$("body").trigger(FileBrowser.event, [\r
+ $("body").trigger(FileBrowser.event, [\r
this.dataset.filename,\r
embed,\r
FileBrowser.id,\r
e.preventDefault();\r
FileBrowser.type = this.getAttribute("data-mode");\r
$(".fbrowser").removeClass().addClass("fbrowser " + FileBrowser.type);\r
- url = baseurl + "/fbrowser/" + FileBrowser.type + "?mode=none";\r
+ url = baseurl + "/fbrowser/" + FileBrowser.type + "?mode=none&theme=frio";\r
\r
FileBrowser.loadContent(url);\r
});\r
return;\r
}\r
\r
-// location = baseurl + "/fbrowser/image/?mode=none"+location['hash'];\r
-// location.reload(true);\r
-\r
- var url = baseurl + "/fbrowser/" + FileBrowser.type + "/" + FileBrowser.folder + "?mode=none";\r
+ var url = baseurl + "/fbrowser/" + FileBrowser.type + "/" + FileBrowser.folder + "?mode=none&theme=frio";\r
// load new content to fbrowser window\r
FileBrowser.loadContent(url);\r
}\r
return;\r
}\r
\r
-// location = baseurl + "/fbrowser/file/?mode=none"+location['hash'];\r
-// location.reload(true);\r
-\r
- var url = baseurl + "/fbrowser/" + FileBrowser.type + "?mode=none";\r
+ var url = baseurl + "/fbrowser/" + FileBrowser.type + "?mode=none&theme=frio";\r
// Load new content to fbrowser window\r
FileBrowser.loadContent(url);\r
}\r
Dialog._get_url = function(type, name, id) {
var hash = name;
if (id !== undefined) hash = hash + "-" + id;
- return "fbrowser/"+type+"/?mode=none#"+hash;
+ return "fbrowser/"+type+"/?mode=none&theme=frio#"+hash;
};
// Does load the filebrowser into the jot modal.
var type = $("#fb-type").attr("value");
// Try to fetch the hash form the url.
- var match = url.match(/fbrowser\/[a-z]+\/\?mode=none(.*)/);
+ var match = url.match(/fbrowser\/[a-z]+\/.*(#.*)/);
if (match===null) return; //not fbrowser
var hash = match[1];