#*
.idea/*
plugins.local/*
+themes.local/*
config.php
feed-icons/*
cache/*/*
lock/*
tags
-plugins/fever
cache/htmlpurifier/*/*ser
lib/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer/*/*ser
web.config\r
} else if ($pref_name == "USER_CSS_THEME") {
- $themes = array_filter(array_map("basename", glob("themes/*.css")),
- "theme_valid");
+ $themes = array_merge(glob("themes/*.css"), glob("themes.local/*.css"));
+ $themes = array_map("basename", $themes);
+ $themes = array_filter($themes, "theme_valid");
+ asort($themes);
print_select($pref_name, $value, $themes,
'dojoType="dijit.form.Select"');
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");
<?php if ($_SESSION["uid"]) {
$theme = get_pref( "USER_CSS_THEME", $_SESSION["uid"], false);
if ($theme && theme_valid("$theme")) {
- echo stylesheet_tag("themes/$theme");
+ echo stylesheet_tag(get_theme_path($theme));
} else {
echo stylesheet_tag("themes/default.css");
}
<?php if ($_SESSION["uid"]) {
$theme = get_pref( "USER_CSS_THEME", $_SESSION["uid"], false);
if ($theme && theme_valid("$theme")) {
- echo stylesheet_tag("themes/$theme");
+ echo stylesheet_tag(get_theme_path($theme));
} else {
echo stylesheet_tag("themes/default.css");
}