From: <Cra...@nt...> - 2005-07-21 16:55:47
|
Author: CrawfordCurrie Date: 2005-07-21 23:25:27 -0700 (Thu, 21 Jul 2005) New Revision: 4683 Modified: twiki/branches/DEVELOP/lib/TWiki.cfg twiki/branches/DEVELOP/lib/TWiki/Prefs.pm Log: Item129: added simple mechanism to support local site preferences more cleanly. Modified: twiki/branches/DEVELOP/lib/TWiki/Prefs.pm =================================================================== --- twiki/branches/DEVELOP/lib/TWiki/Prefs.pm 2005-07-22 05:32:48 UTC (rev 4682) +++ twiki/branches/DEVELOP/lib/TWiki/Prefs.pm 2005-07-22 06:25:27 UTC (rev 4683) @@ -61,11 +61,12 @@ my $globs = new TWiki::Prefs::PrefsCache( $session, undef ); $globs->loadPrefsFromTopic( $TWiki::cfg{SystemWebName}, $TWiki::cfg{SitePrefsTopicName} ); - $globs->loadPrefsFromTopic( $TWiki::cfg{UsersWebName}, - $TWiki::cfg{SitePrefsTopicName} ); + my $local = $TWiki::cfg{LocalSitePreferences}; + if( $local && $local =~ /^(\w+)\.(\w+)$/ ) { + $globs->loadPrefsFromTopic( $1, $2 ); + } $this->{GLOBAL} = $globs; - my @webPath=split(/[\/\.]/,$web); my $tmpWebPath=""; my $prevWebPrefs=$globs; Modified: twiki/branches/DEVELOP/lib/TWiki.cfg =================================================================== --- twiki/branches/DEVELOP/lib/TWiki.cfg 2005-07-22 05:32:48 UTC (rev 4682) +++ twiki/branches/DEVELOP/lib/TWiki.cfg 2005-07-22 06:25:27 UTC (rev 4683) @@ -639,6 +639,15 @@ # use TWiki to manually rename the existing topic.</strong> $cfg{SitePrefsTopicName} = 'TWikiPreferences'; +# **STRING 40** +# Web.TopicName of the site-level local preferences topic. If this topic +# exists, any settings in it will <strong>override</strong> settings in +# {SitePrefsTopicName}.<br /> +# You are <b>strongly</b> recommended to keep all your local changes in +# a {LocalSitePreferences} topic rather than changing TWikiPreferences, +# as it will make upgrading a lot easier. +$cfg{LocalSitePreferences} = 'Main.TWikiPreferences'; + # **STRING 20** # Name of the web where usertopics are stored. If you # change this setting, you must make sure the web exists and contains |