r54519 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r54518‎ | r54519 | r54520 >
Date:13:53, 6 August 2009
Author:jojo
Status:deferred
Tags:
Comment:
introduced $wgCollectionPortletFormats to control "Download as..." links
Modified paths:
  • /trunk/extensions/Collection/Collection.hooks.php (modified) (history)
  • /trunk/extensions/Collection/Collection.php (modified) (history)
  • /trunk/extensions/Collection/README.txt (modified) (history)

Diff [purge]

Index: trunk/extensions/Collection/Collection.php
@@ -93,6 +93,8 @@
9494 'rl' => 'PDF',
9595 );
9696
 97+$wgCollectionPortletFormats = array( 'pdf' );
 98+
9799 $wgCollectionPortletForLoggedInUsersOnly = false;
98100
99101 $wgCollectionNavPopups = true;
Index: trunk/extensions/Collection/Collection.hooks.php
@@ -65,6 +65,7 @@
6666 global $wgUser;
6767 global $wgCollectionArticleNamespaces;
6868 global $wgCollectionFormats;
 69+ global $wgCollectionPortletFormats;
6970 global $wgScriptPath;
7071
7172 $namespace = $wgTitle->getNamespace();
@@ -110,16 +111,16 @@
111112 }
112113 }
113114
114 - foreach ( $wgCollectionFormats as $writer => $name ) {
 115+ foreach ( $wgCollectionPortletFormats as $writer ) {
115116 $params['writer'] = $writer;
116117 $out .= Xml::tags( 'li',
117118 array( 'id' => 'coll-download-as-' . $writer ),
118119 $sk->link(
119120 SpecialPage::getTitleFor( 'Book', 'render_article/' ),
120 - wfMsgHtml( 'coll-download_as', htmlspecialchars( $name ) ),
 121+ wfMsgHtml( 'coll-download_as', htmlspecialchars( $wgCollectionFormats[$writer] ) ),
121122 array(
122123 'rel' => 'nofollow',
123 - 'title' => wfMsg( 'coll-download_as_tooltip', $name )
 124+ 'title' => wfMsg( 'coll-download_as_tooltip', $wgCollectionFormats[$writer] )
124125 ),
125126 $params,
126127 array( 'known', 'noclasses' )
Index: trunk/extensions/Collection/README.txt
@@ -118,6 +118,15 @@
119119
120120 $ mw-render --list-writers
121121
 122+ *$wgCollectionPortletFormats (array)*
 123+ An array containing formats (keys in $wgCollectionFormats) that shall be
 124+ displayed as "Download as XYZ" links in the "Print/export" portlet.
 125+ The default value is::
 126+
 127+ array( 'pdf' );
 128+
 129+ i.e. there's one link "Download as PDF".
 130+
122131 *$wgCollectionArticleNamespaces (array)*
123132 List of namespace numbers for pages which can be added to a collection.
124133 Category pages (NS_CATEGORY) are always an exception (all articles in a

Status & tagging log