- #26822: Fix logo upload being broken (drumm)

4.7.x
Steven Wittens 2005-07-26 01:56:31 +00:00
parent 11a4aba9a6
commit f2f32820f7
2 changed files with 12 additions and 24 deletions

View File

@ -599,8 +599,6 @@ function system_site_settings($module = NULL) {
* Menu callback; display theme configuration for entire site and individual themes.
*/
function system_theme_settings($key = '') {
system_settings_save();
// Default settings are defined in theme_get_settings() in includes/theme.inc
if ($key) {
$settings = theme_get_settings($key);
@ -620,11 +618,8 @@ function system_theme_settings($key = '') {
$filename = ($key) ? str_replace('/', '_', $key) . '_logo.' . $parts['extension'] : 'logo.' . $parts['extension'];
if ($file = file_save_upload('logo_upload', $filename, 1)) {
$settings['default_logo'] = 0;
$settings['logo_path'] = $file->filepath;
// Update the variable table with the new settings so that they take effect immediately.
variable_set($var, $settings);
$_POST['edit'][$var]['default_logo'] = 0;
$_POST['edit'][$var]['logo_path'] = $file->filepath;
}
}
else {
@ -638,14 +633,13 @@ function system_theme_settings($key = '') {
$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);
$_POST['edit'][$var]['default_favicon'] = 0;
$_POST['edit'][$var]['favicon_path'] = $file->filepath;
}
}
system_settings_save();
$form = '';
// Logo settings

View File

@ -599,8 +599,6 @@ function system_site_settings($module = NULL) {
* Menu callback; display theme configuration for entire site and individual themes.
*/
function system_theme_settings($key = '') {
system_settings_save();
// Default settings are defined in theme_get_settings() in includes/theme.inc
if ($key) {
$settings = theme_get_settings($key);
@ -620,11 +618,8 @@ function system_theme_settings($key = '') {
$filename = ($key) ? str_replace('/', '_', $key) . '_logo.' . $parts['extension'] : 'logo.' . $parts['extension'];
if ($file = file_save_upload('logo_upload', $filename, 1)) {
$settings['default_logo'] = 0;
$settings['logo_path'] = $file->filepath;
// Update the variable table with the new settings so that they take effect immediately.
variable_set($var, $settings);
$_POST['edit'][$var]['default_logo'] = 0;
$_POST['edit'][$var]['logo_path'] = $file->filepath;
}
}
else {
@ -638,14 +633,13 @@ function system_theme_settings($key = '') {
$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);
$_POST['edit'][$var]['default_favicon'] = 0;
$_POST['edit'][$var]['favicon_path'] = $file->filepath;
}
}
system_settings_save();
$form = '';
// Logo settings