Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3460
patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
bzimport
Nov 21 2014, 9:29 PM
2014-11-21 21:29:58 (UTC+0)
Size
2 KB
Referenced Files
None
Subscribers
None
patch
View Options
Index: includes/EditPage.php
===================================================================
--- includes/EditPage.php (revision 17594)
+++ includes/EditPage.php (working copy)
@@ -32,6 +32,7 @@
var $allowBlankSummary = false;
var $autoSumm = '';
var $hookError = '';
+ var $mPreviewTemplates;
# Form values
var $save = false, $preview = false, $diff = false;
@@ -1262,7 +1264,7 @@
$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;
@@ -1273,7 +1275,7 @@
# 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>';
@@ -1400,6 +1402,10 @@
$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;
}
Index: languages/messages/MessagesEn.php
===================================================================
--- languages/messages/MessagesEn.php (revision 17594)
+++ languages/messages/MessagesEn.php (working copy)
@@ -977,6 +978,7 @@
'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:',
+'templatesusedpreview' => 'Templates used in this preview:',
'edittools' => '<!-- Text here will be shown below edit and upload forms. -->',
'nocreatetitle' => 'Page creation limited',
'nocreatetext' => 'This site has restricted the ability to create new pages.
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3028
Default Alt Text
patch (2 KB)
Attached To
Mode
T9918: update "Pages transcluded onto ... this page:" on edit preview
Attached
Detach File
Event Timeline
Log In to Comment