Index: trunk/extensions/Wikilog/WikilogHooks.php |
— | — | @@ -75,6 +75,17 @@ |
76 | 76 | $item->mParentTitle = $wi->getTitle(); |
77 | 77 | $item->mParent = $item->mParentTitle->getArticleId(); |
78 | 78 | |
| 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 | + |
79 | 90 | $item->resetID( $article->getId() ); |
80 | 91 | |
81 | 92 | # Check if we have any wikilog metadata available. |
— | — | @@ -218,6 +229,7 @@ |
219 | 230 | $item = WikilogItem::newFromID( $pageid ); |
220 | 231 | if ( $wi && $wi->isItem() && !$wi->isTalk() && $item ) { |
221 | 232 | $item->mName = $wi->getItemName(); |
| 233 | + # FIXME: need to reparse due to {{DISPLAYTITLE:...}}. |
222 | 234 | $item->mTitle = $wi->getItemTitle(); |
223 | 235 | $item->mParentName = $wi->getName(); |
224 | 236 | $item->mParentTitle = $wi->getTitle(); |
Index: trunk/extensions/Wikilog/RELEASE-NOTES |
— | — | @@ -4,8 +4,8 @@ |
5 | 5 | |
6 | 6 | === General notes === |
7 | 7 | |
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. |
10 | 10 | |
11 | 11 | === New configuration options === |
12 | 12 | |
— | — | @@ -13,6 +13,8 @@ |
14 | 14 | |
15 | 15 | * Article and comment timestamps are now displayed in the wiki timezone |
16 | 16 | (as defined by $wgLocaltimezone). |
| 17 | +* (wl:issue 11) Added support for {{DISPLAYTITLE:...}}, allows the author to |
| 18 | + alter the title of the wikilog article. |
17 | 19 | |
18 | 20 | === Bug fixes === |
19 | 21 | |
— | — | @@ -21,6 +23,7 @@ |
22 | 24 | * (wl:issue 12) Fixed calls to $wgParser->clearState() (which is now a private |
23 | 25 | function). |
24 | 26 | * Fixed a crash when creating a new wikilog post as an unlogged user. |
| 27 | +* Several fixes for compatibility with MediaWiki 1.18. |
25 | 28 | |
26 | 29 | == Wikilog 1.1.0 == |
27 | 30 | |