* 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__ );
$toolbar = '';
}
-
$wgOut->addHTML( $this->editFormPageTop );
if ( $wgUser->getOption( 'previewontop' ) ) {
$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 );
<div class='templatesUsed'>
{$formattedtemplates}
</div>
+HTML
+);
+
+ if ( $wgEnableInterwikiTranscluding && $wgEnableInterwikiTemplatesTracking ) {
+ $wgOut->addHTML( <<<HTML
+{$this->editFormTextAfterTools}
+<div class='distantTemplatesUsed'>
+{$formattedDistantTemplates}
+</div>
+HTML
+);
+ }
+
+ $wgOut->addHTML( <<<HTML
+{$this->editFormTextAfterTools}
<div class='hiddencats'>
{$formattedhiddencats}
</div>
}
}
+ 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
*/