1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 18:35:57 +00:00

support loading themes from themes.local

This commit is contained in:
Andrew Dolgov
2015-06-05 18:08:19 +03:00
parent 7c0a2ab202
commit b9634eb8b8
6 changed files with 20 additions and 8 deletions

View File

@@ -2444,9 +2444,19 @@
return LABEL_BASE_INDEX - 1 + abs($feed);
}
function theme_valid($file) {
if ($file == "default.css" || $file == "night.css") return true; // needed for array_filter
$file = "themes/" . basename($file);
function get_theme_path($theme) {
$check = "themes/$theme";
if (file_exists($check)) return $check;
$check = "themes.local/$theme";
if (file_exists($check)) return $check;
}
function theme_valid($theme) {
if ($theme == "default.css" || $theme == "night.css") return true; // needed for array_filter
$file = "themes/" . basename($theme);
if (!file_exists($file)) $file = "themes.local/" . basename($theme);
if (file_exists($file) && is_readable($file)) {
$fh = fopen($file, "r");