From: Wil Mahan Date: Fri, 15 Oct 2004 17:33:51 +0000 (+0000) Subject: Change editSectionLink() and editSectionScript() to take a X-Git-Tag: 1.5.0alpha1~1536 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=50108154bf7b00a0703b58b6dd3a89317a1d24bf;p=lhc%2Fweb%2Fwiklou.git Change editSectionLink() and editSectionScript() to take a title object instead of using a global; we want to keep $wgTitle and $wgUser out of the parser --- diff --git a/includes/Skin.php b/includes/Skin.php index 8f1cbfd276..f7b6a3575e 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -636,7 +636,7 @@ class Skin { global $wgOut, $wgTitle, $wgUser; $s = '

' . htmlspecialchars( $wgOut->getPageTitle() ) . '

'; - if($wgUser->getOption( 'editsectiononrightclick' ) && $wgTitle->userCanEdit()) { $s=$this->editSectionScript(0,$s);} + if($wgUser->getOption( 'editsectiononrightclick' ) && $wgTitle->userCanEdit()) { $s=$this->editSectionScript($wgTitle, 0,$s);} return $s; } @@ -2585,18 +2585,18 @@ class Skin { return ''.$head.''; } - function editSectionScript( $section, $head ) { - global $wgTitle, $wgRequest; + function editSectionScript( $nt, $section, $head ) { + global $wgRequest; if( $wgRequest->getInt( 'oldid' ) && ( $wgRequest->getVal( 'diff' ) != '0' ) ) { return $head; } - $url = $wgTitle->escapeLocalURL( 'action=edit§ion='.$section ); + $url = $nt->escapeLocalURL( 'action=edit§ion='.$section ); return ''.$head.''; } function editSectionLinkForOther( $title, $section ) { global $wgRequest; - global $wgUser, $wgContLang; + global $wgContLang; $title = Title::newFromText($title); $editurl = '§ion='.$section; @@ -2613,9 +2613,9 @@ class Skin { } - function editSectionLink( $section ) { + function editSectionLink( $nt, $section ) { global $wgRequest; - global $wgTitle, $wgUser, $wgContLang; + global $wgContLang; if( $wgRequest->getInt( 'oldid' ) && ( $wgRequest->getVal( 'diff' ) != '0' ) ) { # Section edit links would be out of sync on an old page. @@ -2625,7 +2625,7 @@ class Skin { } $editurl = '§ion='.$section; - $url = $this->makeKnownLink($wgTitle->getPrefixedText(),wfMsg('editsection'),'action=edit'.$editurl); + $url = $this->makeKnownLink($nt->getPrefixedText(),wfMsg('editsection'),'action=edit'.$editurl); if( $wgContLang->isRTL() ) { $farside = 'left';