r46008 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46007‎ | r46008 | r46009 >
Date:10:03, 22 January 2009
Author:raymond
Status:resolved (Comments)
Tags:
Comment:
* Add a special page summary/header
* Assign the special page to the 'pagetools' group
Modified paths:
  • /trunk/extensions/Drafts/Drafts.classes.php (modified) (history)
  • /trunk/extensions/Drafts/Drafts.i18n.php (modified) (history)
  • /trunk/extensions/Drafts/Drafts.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Drafts/Drafts.classes.php
@@ -276,9 +276,14 @@
277277 // Output HTML for list of drafts
278278 $drafts = Draft::getDrafts( $title, $user );
279279 if ( count( $drafts ) > 0 ) {
 280+ global $egDraftsLifeSpan;
 281+
280282 // Internationalization
281283 wfLoadExtensionMessages( 'Drafts' );
282 -
 284+
 285+ // Add a special page summary
 286+ $wgOut->wrapWikiMsg( '<div class="mw-drafts-summary">$1</div>', array( 'drafts-view-summary', $wgLang->formatNum( $egDraftsLifeSpan ) ) );
 287+
283288 // Build XML
284289 $wgOut->addHTML(
285290 Xml::openElement( 'table',
Index: trunk/extensions/Drafts/Drafts.i18n.php
@@ -15,6 +15,8 @@
1616 'drafts' => 'Drafts',
1717 'drafts-desc' => 'Adds the ability to save [[Special:Drafts|draft]] versions of a page on the server',
1818 'drafts-view' => 'ViewDraft',
 19+ 'drafts-view-summary' => 'This special page shows a list of all existing drafts.
 20+Unused drafts will be discarded after {{PLURAL:$1|$1 day|$1 days}} automatically.',
1921 'drafts-view-article' => 'Page',
2022 'drafts-view-existing' => 'Existing drafts',
2123 'drafts-view-saved' => 'Saved',
Index: trunk/extensions/Drafts/Drafts.php
@@ -58,6 +58,7 @@
5959
6060 // Register the Drafts special page
6161 $wgSpecialPages['Drafts'] = 'DraftsPage';
 62+$wgSpecialPageGroups['Drafts'] = 'pagetools';
6263 $wgAutoloadClasses['DraftsPage'] = $dir . 'Drafts.pages.php';
6364
6465 // Register save interception to detect non-javascript draft saving

Follow-up revisions

RevisionCommit summaryAuthorDate
r46071Fix for r46008: Show summary on Special:Drafts only.raymond11:38, 23 January 2009

Comments

#Comment by Brion VIBBER (talk | contribs)   02:09, 23 January 2009

This message is showing up on the edit page as well, where it's not very accurate!

#Comment by Raymond (talk | contribs)   11:39, 23 January 2009

Fixed in r46071

Status & tagging log