r102758 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102757‎ | r102758 | r102759 >
Date:05:26, 11 November 2011
Author:juliano
Status:deferred
Tags:
Comment:
Support {{DISPLAYTITLE:...}} parser macro to customize the post title.
Modified paths:
  • /trunk/extensions/Wikilog/RELEASE-NOTES (modified) (history)
  • /trunk/extensions/Wikilog/WikilogHooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Wikilog/WikilogHooks.php
@@ -75,6 +75,17 @@
7676 $item->mParentTitle = $wi->getTitle();
7777 $item->mParent = $item->mParentTitle->getArticleId();
7878
 79+ # Override item name if {{DISPLAYTITLE:...}} was used.
 80+ $dtText = $editInfo->output->getDisplayTitle();
 81+ if ( $dtText ) {
 82+ # Tags are stripped on purpose.
 83+ $dtText = Sanitizer::stripAllTags( $dtText );
 84+ $dtParts = explode( '/', $dtText, 2 );
 85+ if ( count( $dtParts ) > 1 ) {
 86+ $item->mName = $dtParts[1];
 87+ }
 88+ }
 89+
7990 $item->resetID( $article->getId() );
8091
8192 # Check if we have any wikilog metadata available.
@@ -218,6 +229,7 @@
219230 $item = WikilogItem::newFromID( $pageid );
220231 if ( $wi && $wi->isItem() && !$wi->isTalk() && $item ) {
221232 $item->mName = $wi->getItemName();
 233+ # FIXME: need to reparse due to {{DISPLAYTITLE:...}}.
222234 $item->mTitle = $wi->getItemTitle();
223235 $item->mParentName = $wi->getName();
224236 $item->mParentTitle = $wi->getTitle();
Index: trunk/extensions/Wikilog/RELEASE-NOTES
@@ -4,8 +4,8 @@
55
66 === General notes ===
77
8 -MediaWiki requirement raised to 1.16.0 and later. MediaWiki 1.15 and earlier
9 -are no longer supported in this release.
 8+MediaWiki requirement raised to 1.17.0 and later.
 9+MediaWiki 1.16 and earlier are no longer supported in this release.
1010
1111 === New configuration options ===
1212
@@ -13,6 +13,8 @@
1414
1515 * Article and comment timestamps are now displayed in the wiki timezone
1616 (as defined by $wgLocaltimezone).
 17+* (wl:issue 11) Added support for {{DISPLAYTITLE:...}}, allows the author to
 18+ alter the title of the wikilog article.
1719
1820 === Bug fixes ===
1921
@@ -21,6 +23,7 @@
2224 * (wl:issue 12) Fixed calls to $wgParser->clearState() (which is now a private
2325 function).
2426 * Fixed a crash when creating a new wikilog post as an unlogged user.
 27+* Several fixes for compatibility with MediaWiki 1.18.
2528
2629 == Wikilog 1.1.0 ==
2730

Status & tagging log