X-Git-Url: https://git.cyclocoop.org/%242?a=blobdiff_plain;f=includes%2FEditPage.php;h=20a1f4834ae1d4747d3e2a8179c1af273d553221;hb=44020e254c9fa3b60b8f0874df84490ba99bb464;hp=28032da57ef6e17a0272e170c57ba7ef2571e199;hpb=77a3987052aac525658377b702483ff8f3e431c6;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/EditPage.php b/includes/EditPage.php index 28032da57e..20a1f4834a 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1313,7 +1313,7 @@ class EditPage { * during form output near the top, for captchas and the like. */ function showEditForm( $formCallback = null ) { - global $wgOut, $wgUser; + global $wgOut, $wgUser, $wgEnableInterwikiTranscluding, $wgEnableInterwikiTemplatesTracking; wfProfileIn( __METHOD__ ); @@ -1347,7 +1347,6 @@ class EditPage { $toolbar = ''; } - $wgOut->addHTML( $this->editFormPageTop ); if ( $wgUser->getOption( 'previewontop' ) ) { @@ -1359,6 +1358,9 @@ class EditPage { $templates = $this->getTemplates(); $formattedtemplates = Linker::formatTemplates( $templates, $this->preview, $this->section != ''); + $distantTemplates = $this->getDistantTemplates(); + $formattedDistantTemplates = Linker::formatDistantTemplates( $distantTemplates, $this->preview, $this->section != '' ); + $hiddencats = $this->mArticle->getHiddenCategories(); $formattedhiddencats = Linker::formatHiddenCategories( $hiddencats ); @@ -1457,6 +1459,21 @@ HTML
{$formattedtemplates}
+HTML +); + + if ( $wgEnableInterwikiTranscluding && $wgEnableInterwikiTemplatesTracking ) { + $wgOut->addHTML( <<editFormTextAfterTools} +
+{$formattedDistantTemplates} +
+HTML +); + } + + $wgOut->addHTML( <<editFormTextAfterTools}
{$formattedhiddencats}
@@ -2118,6 +2135,28 @@ HTML } } + function getDistantTemplates() { + global $wgEnableInterwikiTemplatesTracking; + if ( !$wgEnableInterwikiTemplatesTracking ) { + return array( ); + } + if ( $this->preview || $this->section != '' ) { + $templates = array(); + if ( !isset( $this->mParserOutput ) ) return $templates; + $templatesList = $this->mParserOutput->getDistantTemplates(); + foreach( $templatesList as $prefix => $templatesbyns ) { + foreach( $templatesbyns as $ns => $template ) { + foreach( array_keys( $template ) as $dbk ) { + $templates[] = Title::makeTitle( $ns, $dbk, null, $prefix ); + } + } + } + return $templates; + } else { + return $this->mArticle->getUsedDistantTemplates(); + } + } + /** * Call the stock "user is blocked" page */