* (bug 4178) MediaWiki:Common.js will now be included for all users if
$wgUseSiteJs is enabled, in addition to (if applicable) MediaWiki:Monobook.js
and user JS subpages.
+* (bug 7918) "Templates used on this page" changes during preview to reflect
+ any added or removed templates.
== Languages updated ==
var $allowBlankSummary = false;
var $autoSumm = '';
var $hookError = '';
+ var $mPreviewTemplates;
# Form values
var $save = false, $preview = false, $diff = false;
$sk =& $wgUser->getSkin();
$outText = '';
- $templates = $this->mArticle->getUsedTemplates();
+ $templates = ( $this->preview ? $this->mPreviewTemplates : $this->mArticle->getUsedTemplates() );
if ( count( $templates ) > 0 ) {
# Do a batch existence check
$batch = new LinkBatch;
# Construct the HTML
$outText = '<div class="mw-templatesUsedExplanation">' .
- wfMsgExt( 'templatesused', array( 'parse' ) ) .
+ wfMsgExt( ( $this->preview ? 'templatesusedpreview' : 'templatesused' ), array( 'parse' ) ) .
'</div><ul>';
foreach ( $templates as $titleObj ) {
$outText .= '<li>' . $sk->makeLinkObj( $titleObj ) . '</li>';
$previewHTML = $parserOutput->getText();
$wgOut->addParserOutputNoText( $parserOutput );
+ foreach ( $parserOutput->getTemplates() as $ns => $template)
+ foreach ( array_keys( $template ) as $dbk)
+ $this->mPreviewTemplates[] = Title::makeTitle($ns, $dbk);
+
wfProfileOut( $fname );
return $previewhead . $previewHTML;
}
'protectedpagewarning' => "<strong>WARNING: This page has been locked so that only users with sysop privileges can edit it.</strong>",
'semiprotectedpagewarning' => "'''Note:''' This page has been locked so that only registered users can edit it.",
'templatesused' => 'Templates used on this page:',
-'edittools' => '<!-- Text here will be shown below edit and upload forms. -->',
+'templatesusedpreview' => 'Templates used in this preview:',
'nocreatetitle' => 'Page creation limited',
'nocreatetext' => 'This site has restricted the ability to create new pages.
You can go back and edit an existing page, or [[Special:Userlogin|log in or create an account]].',