From: Jonny B. <tw...@no...> - 2009-11-06 01:56:49
|
Hmm - switch theme is a strange place! :) I don't follow how $tikilib->get_user_preference($user, 'theme') if $prefs['feature_userPreferences'] != 'y' - maybe get_user_preference() doesn't do a feature check... anyway i don't see why someone wouldn't want that to work if they hadn't set a custom one in their prefs. It's easy to get lost down there... jb On 6 Nov 2009, at 01:29, ch...@us... wrote: > Revision: 22936 > http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=22936&view=rev > Author: chealer > Date: 2009-11-06 01:29:31 +0000 (Fri, 06 Nov 2009) > > Log Message: > ----------- > [FIX] switching theme [or theme option] through switch theme module > would do nothing for users with a custom theme [or theme option] if > feature_userPreferences was disabled > credits go to Nelson Koth for finding the actual issue and proposing > this solution > > Modified Paths: > -------------- > branches/4.x/tiki-switch_theme.php > > Modified: branches/4.x/tiki-switch_theme.php > =================================================================== > --- branches/4.x/tiki-switch_theme.php 2009-11-05 23:53:05 UTC (rev > 22935) > +++ branches/4.x/tiki-switch_theme.php 2009-11-06 01:29:31 UTC (rev > 22936) > @@ -17,7 +17,7 @@ > $_REQUEST['theme-option'] = ''; > } > if ($prefs['change_theme'] == 'y') { > - if ($prefs['feature_userPreferences'] == 'y' && $user && > $group_theme == '') { > + if ($user && ($prefs['feature_userPreferences'] == 'y' || > $tikilib->get_user_preference($user, 'theme') ) && $group_theme == > '') { > $tikilib->set_user_preference($user, 'theme', $new_theme); > } > if (empty($new_theme)) { > @@ -25,7 +25,7 @@ > $prefs['style_option'] = $prefs['site_style_option']; > $_SESSION['s_prefs']['style_option'] = $prefs['site_style_option']; > unset($_REQUEST['theme-option']); > - if ($prefs['feature_userPreferences'] == 'y' && $user && > empty($group_style)) { > + if ($user && ($prefs['feature_userPreferences'] == 'y' || > $tikilib->get_user_preference($user, 'theme-option') ) && > empty($group_style)) { > $tikilib->set_user_preference($user, 'theme-option', > $prefs['site_style_option']); > } > } else { > @@ -36,12 +36,14 @@ > } > if (isset($_REQUEST['theme-option'])) { > $new_theme_option = $_REQUEST['theme-option']; > - if ($prefs['feature_userPreferences'] == 'y' && $user && > $prefs['change_theme'] == 'y' && empty($group_style)) { > - $tikilib->set_user_preference($user, 'theme-option', > $new_theme_option); > - $prefs['style_option'] = $new_theme_option; > - } elseif ($prefs['change_theme'] == 'y') { > - $prefs['style_option'] = $new_theme_option; > - $_SESSION['s_prefs']['style_option'] = $new_theme_option; > + if ($prefs['change_theme'] == 'y') { > + if ($user && ($prefs['feature_userPreferences'] == 'y' || > $tikilib->get_user_preference($user, 'theme-option') ) && > empty($group_style)) { > + $tikilib->set_user_preference($user, 'theme-option', > $new_theme_option); > + $prefs['style_option'] = $new_theme_option; > + } else { > + $prefs['style_option'] = $new_theme_option; > + $_SESSION['s_prefs']['style_option'] = $new_theme_option; > + } > } > } > header("location: $orig_url"); > > > This was sent by the SourceForge.net collaborative development > platform, the world's largest Open Source development site. > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 > 30-Day > trial. Simplify your report design, integration and deployment - and > focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Tikiwiki-cvs mailing list > Tik...@li... > https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs |