Index: includes/theme.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/theme.inc,v retrieving revision 1.230 diff -u -r1.230 theme.inc --- includes/theme.inc 24 Apr 2005 16:22:30 -0000 1.230 +++ includes/theme.inc 24 Apr 2005 19:42:07 -0000 @@ -230,7 +230,10 @@ 'mission' => '', 'default_logo' => 1, 'logo_path' => '', + 'default_favicon' => 1, + 'favicon_path' => '', 'toggle_logo' => 1, + 'toggle_icon' => 1, 'toggle_name' => 1, 'toggle_search' => 1, 'toggle_slogan' => 0, @@ -303,6 +306,16 @@ } } + if ($settings['toggle_icon']) { + if ($settings['default_favicon']) { + $settings['favicon'] = 'favicon.ico'; + } + elseif ($settings['favicon_path']) { + $settings['favicon'] = $settings['favicon_path']; + } + } + + if (!$settings['toggle_primary_links']) { $settings['primary_links'] = ''; } Index: modules/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system.module,v retrieving revision 1.206 diff -u -r1.206 system.module --- modules/system.module 24 Apr 2005 16:34:35 -0000 1.206 +++ modules/system.module 24 Apr 2005 19:42:08 -0000 @@ -633,6 +633,19 @@ } } +// Check for a new uploaded favicon, and use that instead. + if ($file = file_check_upload('favicon_upload')) { + $parts = pathinfo($file->filename); + $filename = ($key) ? str_replace('/', '_', $key) . '_favicon.' . $parts['extension'] : 'favicon.' . $parts['extension']; + + if ($file = file_save_upload('favicon_upload', $filename, 1)) { + $settings['default_favicon'] = 0; + $settings['favicon_path'] = $file->filepath; + + // Update the variable table with the new settings so that they take effect immediately. + variable_set($var, $settings); + } + } $form = ''; @@ -645,8 +658,20 @@ $group .= form_file(t('Upload logo image'), 'logo_upload', 40, t("If you don't have direct file access to the server, use this field to upload your logo.")); $group .= form_button(t('Upload'), 'fileop'); - $form = form_group(t('Logo image settings'), $group); + $form .= form_group(t('Logo image settings'), $group); + } + + // Icon settings + if ((!$key) || in_array('favicon', $features)) { + $group = 'Your shortcut icon, or \'favicon\', is displayed in the address bar and bookmarks in most browsers.'; + $group .= form_checkbox(t('Use the default shortcut icon.'), "$var][default_favicon", 1, $settings['default_favicon'], t('Check here if you want the theme to use the default shortcut icon.')); + $group .= form_textfield(t('Path to custom icon'), "$var][favicon_path", $settings['favicon_path'], 50, 128, t('The path to the image file you would like to use as your custom shortcut icon.')); + + file_check_directory(variable_get('file_directory_path', 'files'), FILE_CREATE_DIRECTORY, 'file_directory_path'); + $group .= form_file(t('Upload icon image'), 'favicon_upload', 40, t("If you don't have direct file access to the server, use this field to upload your favorite icon.")); + $group .= form_button(t('Upload'), 'fileop'); + $form .= form_group(t('Shortcut icon settings'), $group); } // System wide only settings. Index: themes/bluemarine/xtemplate.xtmpl =================================================================== RCS file: /cvs/drupal/drupal/themes/bluemarine/xtemplate.xtmpl,v retrieving revision 1.6 diff -u -r1.6 xtemplate.xtmpl --- themes/bluemarine/xtemplate.xtmpl 14 Nov 2004 19:34:09 -0000 1.6 +++ themes/bluemarine/xtemplate.xtmpl 24 Apr 2005 19:42:08 -0000 @@ -6,6 +6,7 @@ {head} {styles} +
Index: themes/chameleon/chameleon.theme =================================================================== RCS file: /cvs/drupal/drupal/themes/chameleon/chameleon.theme,v retrieving revision 1.25 diff -u -r1.25 chameleon.theme --- themes/chameleon/chameleon.theme 31 Mar 2005 09:25:33 -0000 1.25 +++ themes/chameleon/chameleon.theme 24 Apr 2005 19:42:08 -0000 @@ -9,6 +9,7 @@ function chameleon_features() { return array( 'logo', + 'favicon', 'toggle_name', 'toggle_slogan', 'toggle_primary_links', @@ -26,6 +27,7 @@ $output .= "