r16884 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r16883‎ | r16884 | r16885 >
Date:08:13, 9 October 2006
Author:brion
Status:old
Tags:
Comment:
* (bug 7526) Make $wgDefaultUserOptions work again

The globals for preference default overrides was removed in r15823,
when the defaults were moved from Language to User. Moved the settings
out to the global where they arguably belong, restoring compatibility
for site-specific overrides.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/User.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/User.php
@@ -46,48 +46,6 @@
4747 var $mVersion; //!< serialized version
4848 /**@}} */
4949
50 - /**
51 - * Default user options
52 - * To change this array at runtime, use a UserDefaultOptions hook
53 - */
54 - static public $mDefaultOptions = array(
55 - 'quickbar' => 1,
56 - 'underline' => 2,
57 - 'cols' => 80,
58 - 'rows' => 25,
59 - 'searchlimit' => 20,
60 - 'contextlines' => 5,
61 - 'contextchars' => 50,
62 - 'skin' => false,
63 - 'math' => 1,
64 - 'rcdays' => 7,
65 - 'rclimit' => 50,
66 - 'wllimit' => 250,
67 - 'highlightbroken' => 1,
68 - 'stubthreshold' => 0,
69 - 'previewontop' => 1,
70 - 'editsection' => 1,
71 - 'editsectiononrightclick'=> 0,
72 - 'showtoc' => 1,
73 - 'showtoolbar' => 1,
74 - 'date' => 'default',
75 - 'imagesize' => 2,
76 - 'thumbsize' => 2,
77 - 'rememberpassword' => 0,
78 - 'enotifwatchlistpages' => 0,
79 - 'enotifusertalkpages' => 1,
80 - 'enotifminoredits' => 0,
81 - 'enotifrevealaddr' => 0,
82 - 'shownumberswatching' => 1,
83 - 'fancysig' => 0,
84 - 'externaleditor' => 0,
85 - 'externaldiff' => 0,
86 - 'showjumplinks' => 1,
87 - 'numberheadings' => 0,
88 - 'uselivepreview' => 0,
89 - 'watchlistdays' => 3.0,
90 - );
91 -
9250 static public $mToggles = array(
9351 'highlightbroken',
9452 'justify',
@@ -502,8 +460,8 @@
503461 /**
504462 * Site defaults will override the global/language defaults
505463 */
506 - global $wgContLang;
507 - $defOpt = self::$mDefaultOptions + $wgContLang->getDefaultUserOptionOverrides();
 464+ global $wgDefaultUserOptions, $wgContLang;
 465+ $defOpt = $wgDefaultUserOptions + $wgContLang->getDefaultUserOptionOverrides();
508466
509467 /**
510468 * default language setting
Index: trunk/phase3/includes/DefaultSettings.php
@@ -1564,6 +1564,51 @@
15651565 /** See list of skins and their symbolic names in languages/Language.php */
15661566 $wgDefaultSkin = 'monobook';
15671567
 1568+/**
 1569+ * Settings added to this array will override the default globals for the user
 1570+ * preferences used by anonymous visitors and newly created accounts.
 1571+ * For instance, to disable section editing links:
 1572+ *  $wgDefaultUserOptions ['editsection'] = 0;
 1573+ *
 1574+ */
 1575+$wgDefaultUserOptions = array(
 1576+ 'quickbar' => 1,
 1577+ 'underline' => 2,
 1578+ 'cols' => 80,
 1579+ 'rows' => 25,
 1580+ 'searchlimit' => 20,
 1581+ 'contextlines' => 5,
 1582+ 'contextchars' => 50,
 1583+ 'skin' => false,
 1584+ 'math' => 1,
 1585+ 'rcdays' => 7,
 1586+ 'rclimit' => 50,
 1587+ 'wllimit' => 250,
 1588+ 'highlightbroken' => 1,
 1589+ 'stubthreshold' => 0,
 1590+ 'previewontop' => 1,
 1591+ 'editsection' => 1,
 1592+ 'editsectiononrightclick'=> 0,
 1593+ 'showtoc' => 1,
 1594+ 'showtoolbar' => 1,
 1595+ 'date' => 'default',
 1596+ 'imagesize' => 2,
 1597+ 'thumbsize' => 2,
 1598+ 'rememberpassword' => 0,
 1599+ 'enotifwatchlistpages' => 0,
 1600+ 'enotifusertalkpages' => 1,
 1601+ 'enotifminoredits' => 0,
 1602+ 'enotifrevealaddr' => 0,
 1603+ 'shownumberswatching' => 1,
 1604+ 'fancysig' => 0,
 1605+ 'externaleditor' => 0,
 1606+ 'externaldiff' => 0,
 1607+ 'showjumplinks' => 1,
 1608+ 'numberheadings' => 0,
 1609+ 'uselivepreview' => 0,
 1610+ 'watchlistdays' => 3.0,
 1611+);
 1612+
15681613 /** Whether or not to allow and use real name fields. Defaults to true. */
15691614 $wgAllowRealName = true;
15701615
Index: trunk/phase3/RELEASE-NOTES
@@ -276,6 +276,7 @@
277277 * Fix regression in Special:Watchlist text header
278278 * (bug 7510) Update article counts etc on undelete
279279 * (bug 7520) Update article counts on XML import
 280+* (bug 7526) Make $wgDefaultUserOptions work again
280281
281282
282283 == Languages updated ==

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r15823Merged localisation-work branch:...tstarling07:15, 26 July 2006