Author: v
Description:
I noticed that using section edit links the pages can get really messy when using deep sectioning. So i made a
small patch to MediaWiki 1.5.0 (i checked that CVS didn't have this feature yet either) to disable section links
according to a set level. With this patch you set $wgEditSectionLevel to section level that you wish to have
section edit links and everything under that level. Makes some pages much clearer to read.
I wasn't sure where i should submit this patch to get reviewed and maybe added to MediaWiki so i submitted it here.
Couldn't come to the IRC channel because i'm at work right now.
Here is the patch:
--- includes/Parser.php.orig 2005-09-18 04:21:39.000000000 +0300 +++ includes/Parser.php 2005-10-24 11:14:39.000000000 +0300 @@ -2644,10 +2644,13 @@ if ( empty( $head[$headlineCount] ) ) { $head[$headlineCount] = ''; } - if( $istemplate ) - $head[$headlineCount] .= $sk->editSectionLinkForOther($templatetitle, $templatesection); - else - $head[$headlineCount] .= $sk->editSectionLink($this->mTitle, $sectionCount+1); + global $wgEditSectionLevel; + if ( $wgEditSectionLevel == 0 || $level <= $wgEditSectionLevel ) { + if( $istemplate ) + $head[$headlineCount] .= $sk->editSectionLinkForOther($templatetitle, $templatesection); + else + $head[$headlineCount] .= $sk->editSectionLink($this->mTitle, $sectionCount+1); + } } # give headline the correct <h#> tag