From e3bf587f6eb94ec41c4ba7ffd7a1ef011d60bea6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= <come@opensides.be> Date: Mon, 27 Jun 2016 11:34:19 +0200 Subject: [PATCH] Fixes #4897 the breezy theme should be the default one in 1.0.14 --- contrib/smarty/plugins/function.filePath.php | 11 +++++++++-- html/geticon.php | 3 ++- include/functions.inc | 14 ++++++++++++-- plugins/config/class_configInLdap.inc | 2 +- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/contrib/smarty/plugins/function.filePath.php b/contrib/smarty/plugins/function.filePath.php index f9cf22eae..55d06ce1b 100644 --- a/contrib/smarty/plugins/function.filePath.php +++ b/contrib/smarty/plugins/function.filePath.php @@ -20,12 +20,13 @@ function smarty_function_filePath($params, &$smarty) { $config = session::global_get('config'); + $default_theme = 'breezy'; /* Set theme */ if (isset ($config)) { - $theme = $config->get_cfg_value("theme", "default"); + $theme = $config->get_cfg_value('theme', $default_theme); } else { - $theme = "default"; + $theme = $default_theme; } $filename = $params['file']; @@ -40,6 +41,12 @@ function smarty_function_filePath($params, &$smarty) if (file_exists("$dir/themes/$theme/$filename")) { return "$dir/themes/$theme/$filename"; } + if (file_exists("themes/$default_theme/$filename")) { + return "themes/$default_theme/$filename"; + } + if (file_exists("$dir/themes/$default_theme/$filename")) { + return "$dir/themes/$default_theme/$filename"; + } if (file_exists("themes/default/$filename")) { return "themes/default/$filename"; } diff --git a/html/geticon.php b/html/geticon.php index 96e94cceb..90ee12531 100644 --- a/html/geticon.php +++ b/html/geticon.php @@ -34,7 +34,8 @@ if (session::global_is_set('config')) { } else { header("cache-control: no-cache"); } -IconTheme::$extensions = array('png'); +IconTheme::$default_theme = 'breezy'; +IconTheme::$extensions = array('png'); $src = IconTheme::findThemeIcon($theme, $_GET['context'], $_GET['icon'], $_GET['size']); header("Content-Type: image/png"); diff --git a/include/functions.inc b/include/functions.inc index 34e6ec75e..774f61da9 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -343,12 +343,13 @@ function get_browser_language() function get_template_path($filename = '', $plugin = FALSE, $path = '') { global $config, $BASE_DIR; + $default_theme = 'breezy'; /* Set theme */ if (isset ($config)) { - $theme = $config->get_cfg_value('theme', 'default'); + $theme = $config->get_cfg_value('theme', $default_theme); } else { - $theme = 'default'; + $theme = $default_theme; } /* Return path for empty filename */ @@ -366,6 +367,9 @@ function get_template_path($filename = '', $plugin = FALSE, $path = '') if (file_exists("$BASE_DIR/ihtml/themes/$theme/$nf")) { return "$BASE_DIR/ihtml/themes/$theme/$nf/$filename"; } + if (file_exists("$BASE_DIR/ihtml/themes/$default_theme/$nf")) { + return "$BASE_DIR/ihtml/themes/$default_theme/$nf/$filename"; + } if (file_exists("$BASE_DIR/ihtml/themes/default/$nf")) { return "$BASE_DIR/ihtml/themes/default/$nf/$filename"; } @@ -381,6 +385,12 @@ function get_template_path($filename = '', $plugin = FALSE, $path = '') if (file_exists("$BASE_DIR/ihtml/themes/$theme/$filename")) { return "$BASE_DIR/ihtml/themes/$theme/$filename"; } + if (file_exists("themes/$default_theme/$filename")) { + return "themes/$default_theme/$filename"; + } + if (file_exists("$BASE_DIR/ihtml/themes/$default_theme/$filename")) { + return "$BASE_DIR/ihtml/themes/$default_theme/$filename"; + } if (file_exists("themes/default/$filename")) { return "themes/default/$filename"; } diff --git a/plugins/config/class_configInLdap.inc b/plugins/config/class_configInLdap.inc index 49973bd3d..c525eabc6 100644 --- a/plugins/config/class_configInLdap.inc +++ b/plugins/config/class_configInLdap.inc @@ -96,7 +96,7 @@ class configInLdap extends simplePlugin _('Theme'), _('Theme to be used'), 'fdTheme', TRUE, self::get_themes(), - 'default' + 'breezy' ), new SelectAttribute ( _('Timezone'), _('Timezone to be used'), -- GitLab