Index: branches/REL1_3/phase3/includes/Parser.php |
— | — | @@ -2194,7 +2194,10 @@ |
2195 | 2195 | |
2196 | 2196 | # Add the edit section span |
2197 | 2197 | if( $rightClickHack ) { |
2198 | | - $headline = $sk->editSectionScript($sectionCount+1,$headline); |
| 2198 | + if( $istemplate ) |
| 2199 | + $headline = $sk->editSectionScriptForOther($templatetitle, $templatesection, $headline); |
| 2200 | + else |
| 2201 | + $headline = $sk->editSectionScript($sectionCount+1,$headline); |
2199 | 2202 | } |
2200 | 2203 | |
2201 | 2204 | # give headline the correct <h#> tag |
Index: branches/REL1_3/phase3/includes/Skin.php |
— | — | @@ -2588,6 +2588,12 @@ |
2589 | 2589 | } |
2590 | 2590 | |
2591 | 2591 | # These two do not check for permissions: check $wgTitle->userCanEdit before calling them |
| 2592 | + function editSectionScriptForOther( $title, $section, $head ) { |
| 2593 | + $ttl = Title::newFromText( $title ); |
| 2594 | + $url = $ttl->escapeLocalURL( 'action=edit§ion='.$section ); |
| 2595 | + return '<span oncontextmenu=\'document.location="'.$url.'";return false;\'>'.$head.'</span>'; |
| 2596 | + } |
| 2597 | + |
2592 | 2598 | function editSectionScript( $section, $head ) { |
2593 | 2599 | global $wgTitle, $wgRequest; |
2594 | 2600 | if( $wgRequest->getInt( 'oldid' ) && ( $wgRequest->getVal( 'diff' ) != '0' ) ) { |