Index: trunk/phase3/includes/User.php |
— | — | @@ -1120,7 +1120,6 @@ |
1121 | 1121 | $confstr .= '!' . $this->getOption( 'stubthreshold' ); |
1122 | 1122 | $confstr .= '!' . $this->getOption( 'editsection' ); |
1123 | 1123 | $confstr .= '!' . $this->getOption( 'editsectiononrightclick' ); |
1124 | | - $confstr .= '!' . $this->getOption( 'showtoc' ); |
1125 | 1124 | $confstr .= '!' . $this->getOption( 'date' ); |
1126 | 1125 | $confstr .= '!' . $this->getOption( 'numberheadings' ); |
1127 | 1126 | $confstr .= '!' . $this->getOption( 'language' ); |
Index: trunk/phase3/includes/Parser.php |
— | — | @@ -2191,7 +2191,7 @@ |
2192 | 2192 | global $wgInputEncoding, $wgMaxTocLevel, $wgContLang, $wgLinkHolders, $wgInterwikiLinkHolders; |
2193 | 2193 | |
2194 | 2194 | $doNumberHeadings = $this->mOptions->getNumberHeadings(); |
2195 | | - $doShowToc = $this->mOptions->getShowToc(); |
| 2195 | + $doShowToc = true; |
2196 | 2196 | $forceTocHere = false; |
2197 | 2197 | if( !$this->mTitle->userCanEdit() ) { |
2198 | 2198 | $showEditLink = 0; |
— | — | @@ -2210,7 +2210,7 @@ |
2211 | 2211 | # do not add TOC |
2212 | 2212 | $mw =& MagicWord::get( MAG_NOTOC ); |
2213 | 2213 | if( $mw->matchAndRemove( $text ) ) { |
2214 | | - $doShowToc = 0; |
| 2214 | + $doShowToc = false; |
2215 | 2215 | } |
2216 | 2216 | |
2217 | 2217 | # Get all headlines for numbering them and adding funky stuff like [edit] |
— | — | @@ -2219,7 +2219,7 @@ |
2220 | 2220 | |
2221 | 2221 | # if there are fewer than 4 headlines in the article, do not show TOC |
2222 | 2222 | if( $numMatches < 4 ) { |
2223 | | - $doShowToc = 0; |
| 2223 | + $doShowToc = false; |
2224 | 2224 | } |
2225 | 2225 | |
2226 | 2226 | # if the string __TOC__ (not case-sensitive) occurs in the HTML, |
— | — | @@ -2227,20 +2227,20 @@ |
2228 | 2228 | |
2229 | 2229 | $mw =& MagicWord::get( MAG_TOC ); |
2230 | 2230 | if($mw->match( $text ) ) { |
2231 | | - $doShowToc = 1; |
| 2231 | + $doShowToc = true; |
2232 | 2232 | $forceTocHere = true; |
2233 | 2233 | } else { |
2234 | 2234 | # if the string __FORCETOC__ (not case-sensitive) occurs in the HTML, |
2235 | 2235 | # override above conditions and always show TOC above first header |
2236 | 2236 | $mw =& MagicWord::get( MAG_FORCETOC ); |
2237 | 2237 | if ($mw->matchAndRemove( $text ) ) { |
2238 | | - $doShowToc = 1; |
| 2238 | + $doShowToc = true; |
2239 | 2239 | } |
2240 | 2240 | } |
2241 | 2241 | |
2242 | 2242 | # Never ever show TOC if no headers |
2243 | 2243 | if( $numMatches < 1 ) { |
2244 | | - $doShowToc = 0; |
| 2244 | + $doShowToc = false; |
2245 | 2245 | } |
2246 | 2246 | |
2247 | 2247 | # We need this to perform operations on the HTML |
— | — | @@ -2990,7 +2990,6 @@ |
2991 | 2991 | var $mEditSection; # Create "edit section" links |
2992 | 2992 | var $mEditSectionOnRightClick; # Generate JavaScript to edit section on right click |
2993 | 2993 | var $mNumberHeadings; # Automatically number headings |
2994 | | - var $mShowToc; # Show table of contents |
2995 | 2994 | |
2996 | 2995 | function getUseTeX() { return $this->mUseTeX; } |
2997 | 2996 | function getUseDynamicDates() { return $this->mUseDynamicDates; } |
— | — | @@ -3001,7 +3000,6 @@ |
3002 | 3001 | function getEditSection() { return $this->mEditSection; } |
3003 | 3002 | function getEditSectionOnRightClick() { return $this->mEditSectionOnRightClick; } |
3004 | 3003 | function getNumberHeadings() { return $this->mNumberHeadings; } |
3005 | | - function getShowToc() { return $this->mShowToc; } |
3006 | 3004 | |
3007 | 3005 | function setUseTeX( $x ) { return wfSetVar( $this->mUseTeX, $x ); } |
3008 | 3006 | function setUseDynamicDates( $x ) { return wfSetVar( $this->mUseDynamicDates, $x ); } |
— | — | @@ -3011,7 +3009,6 @@ |
3012 | 3010 | function setEditSection( $x ) { return wfSetVar( $this->mEditSection, $x ); } |
3013 | 3011 | function setEditSectionOnRightClick( $x ) { return wfSetVar( $this->mEditSectionOnRightClick, $x ); } |
3014 | 3012 | function setNumberHeadings( $x ) { return wfSetVar( $this->mNumberHeadings, $x ); } |
3015 | | - function setShowToc( $x ) { return wfSetVar( $this->mShowToc, $x ); } |
3016 | 3013 | |
3017 | 3014 | function setSkin( &$x ) { $this->mSkin =& $x; } |
3018 | 3015 | |
— | — | @@ -3048,7 +3045,6 @@ |
3049 | 3046 | $this->mEditSection = $user->getOption( 'editsection' ); |
3050 | 3047 | $this->mEditSectionOnRightClick = $user->getOption( 'editsectiononrightclick' ); |
3051 | 3048 | $this->mNumberHeadings = $user->getOption( 'numberheadings' ); |
3052 | | - $this->mShowToc = $user->getOption( 'showtoc' ); |
3053 | 3049 | wfProfileOut( $fname ); |
3054 | 3050 | } |
3055 | 3051 | } |
Index: trunk/phase3/includes/Skin.php |
— | — | @@ -299,6 +299,9 @@ |
300 | 300 | if( $wgUser->getOption( 'justify' ) ) { |
301 | 301 | $s .= "#article { text-align: justify; }\n"; |
302 | 302 | } |
| 303 | + if( !$wgUser->getOption( 'showtoc' ) ) { |
| 304 | + $s .= "#toc { display: none; }\n"; |
| 305 | + } |
303 | 306 | return $s; |
304 | 307 | } |
305 | 308 | |