From bc191fdb43b09875869defbe6b81a72fb93c882d Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Fri, 17 Nov 2006 03:16:18 +0000 Subject: [PATCH] (bug 7918) "Templates used on this page" changes during preview to reflect any added or removed templates. Patch by Mark Haidar. --- RELEASE-NOTES | 2 ++ includes/EditPage.php | 9 +++++++-- languages/messages/MessagesEn.php | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index e841e8fd14..b55523a3a0 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -195,6 +195,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (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 == diff --git a/includes/EditPage.php b/includes/EditPage.php index 30cb2818be..76567eaf5b 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -32,6 +32,7 @@ class EditPage { var $allowBlankSummary = false; var $autoSumm = ''; var $hookError = ''; + var $mPreviewTemplates; # Form values var $save = false, $preview = false, $diff = false; @@ -1268,7 +1269,7 @@ END $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; @@ -1279,7 +1280,7 @@ END # Construct the HTML $outText = '
' . - wfMsgExt( 'templatesused', array( 'parse' ) ) . + wfMsgExt( ( $this->preview ? 'templatesusedpreview' : 'templatesused' ), array( 'parse' ) ) . '