summaryrefslogtreecommitdiff
path: root/include/functions2.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2015-06-05 18:08:19 +0300
committerAndrew Dolgov <[email protected]>2015-06-05 18:08:19 +0300
commitb9634eb8b8cab7329dca8d8173ce381a8c1f81f4 (patch)
treeb252d90f71a975f36fc9620d5636624de3a54fe2 /include/functions2.php
parent7c0a2ab2029b98086f02da80adf6a7ebc303fd6f (diff)
support loading themes from themes.local
Diffstat (limited to 'include/functions2.php')
-rw-r--r--include/functions2.php16
1 files changed, 13 insertions, 3 deletions
diff --git a/include/functions2.php b/include/functions2.php
index 4f8a0523b..314c12873 100644
--- a/include/functions2.php
+++ b/include/functions2.php
@@ -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");