From 6be2c61896c9afe79ad8398c2a851df99e072e7e Mon Sep 17 00:00:00 2001 From: Steven Wittens Date: Wed, 25 May 2005 06:03:18 +0000 Subject: - #20809: User-configurable, per-theme, optional favicons. --- includes/theme.inc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'includes') diff --git a/includes/theme.inc b/includes/theme.inc index 0de03afe3..53e7b38b6 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -216,7 +216,10 @@ function theme_get_settings($key = NULL) { 'mission' => '', 'default_logo' => 1, 'logo_path' => '', + 'default_favicon' => 1, + 'favicon_path' => '', 'toggle_logo' => 1, + 'toggle_favicon' => 1, 'toggle_name' => 1, 'toggle_search' => 1, 'toggle_slogan' => 0, @@ -289,6 +292,20 @@ function theme_get_setting($setting_name, $refresh = FALSE) { } } + if ($settings['toggle_favicon']) { + if ($settings['default_favicon']) { + if (file_exists($favicon = dirname($theme_object->filename) .'/favicon.ico')) { + $settings['favicon'] = $favicon; + } + else { + $settings['favicon'] = 'misc/favicon.ico'; + } + } + elseif ($settings['favicon_path']) { + $settings['favicon'] = $settings['favicon_path']; + } + } + foreach (array('primary', 'secondary') as $type) { // Get the data to populate the textfields, if the variable is not an array .. try to parse the old-style link format. $value = $settings[$type . '_links']; -- cgit v1.2.3