$found = false;
$nowiki = false;
$noparse = false;
- $brokenlink = false;
+ $itcamefromthedatabase = false;
$title = NULL;
if ( $articleContent !== false ) {
$found = true;
$text = $articleContent;
+ $itcamefromthedatabase = true;
}
}
if ( $this->mOutputType == OT_HTML && !$found ) {
$text = '[['.$title->getPrefixedText().']]';
$found = true;
- $brokenlink = true;
}
# Template cache array insertion
# Empties the template path
$this->mTemplatePath = array();
-
if ( !$found ) {
return $matches[0];
} else {
# replace ==section headers==
# XXX this needs to go away once we have a better parser.
- if ( $this->mOutputType != OT_WIKI && !$brokenlink ) {
+ if ( $this->mOutputType != OT_WIKI && $itcamefromthedatabase ) {
if( !is_null( $title ) )
$encodedname = base64_encode($title->getPrefixedDBkey());
else
# Add the edit section span
if( $rightClickHack ) {
- $headline = $sk->editSectionScript($sectionCount+1,$headline);
+ if( $istemplate )
+ $headline = $sk->editSectionScriptForOther($templatetitle, $templatesection, $headline);
+ else
+ $headline = $sk->editSectionScript($sectionCount+1,$headline);
}
# give headline the correct <h#> tag
* These two do not check for permissions: check $wgTitle->userCanEdit
* before calling them
*/
+ function editSectionScriptForOther( $title, $section, $head ) {
+ $ttl = Title::newFromText( $title );
+ $url = $ttl->escapeLocalURL( 'action=edit§ion='.$section );
+ return '<span oncontextmenu=\'document.location="'.$url.'";return false;\'>'.$head.'</span>';
+ }
+
function editSectionScript( $section, $head ) {
global $wgTitle, $wgRequest;
if( $wgRequest->getInt( 'oldid' ) && ( $wgRequest->getVal( 'diff' ) != '0' ) ) {