Index: trunk/extensions/Collection/Collection.i18n.php |
— | — | @@ -37,6 +37,7 @@ |
38 | 38 | 'coll-n_pages' => '$1 {{PLURAL:$1|page|pages}}', |
39 | 39 | 'coll-unknown_subpage_title' => 'Unknown subpage', |
40 | 40 | 'coll-unknown_subpage_text' => 'This subpage of [[Special:Collection|Collection]] does not exist', |
| 41 | + 'coll-printable_version_pdf' => 'PDF version', |
41 | 42 | 'coll-download_as' => 'Download as $1', |
42 | 43 | 'coll-noscript_text' => '<h1>JavaScript is required!</h1> |
43 | 44 | <strong>Your browser does not support JavaScript or JavaScript has been turned off. |
Index: trunk/extensions/Collection/Collection.body.php |
— | — | @@ -937,15 +937,17 @@ |
938 | 938 | if ( $skinTemplate->iscontent && ( $action == '' || $action == 'view' || $action == 'purge' ) ) { |
939 | 939 | if ( self::isCollectionPage( $skinTemplate->mTitle, $wgArticle ) ) { |
940 | 940 | $params = 'colltitle=' . wfUrlencode( $skinTemplate->mTitle->getPrefixedDBKey() ); |
941 | | - foreach ( $wgCollectionFormats as $writer => $name ) { |
942 | | - $nav_urls['download_as_' . $writer] = array( |
| 941 | + if ( isset( $wgCollectionFormats['rl'] ) ) { |
| 942 | + $nav_urls['printable_version_pdf'] = array( |
943 | 943 | 'href' => SkinTemplate::makeSpecialUrlSubpage( |
944 | 944 | 'Collection', |
945 | 945 | 'render_collection/', |
946 | | - $params . '&writer=' . $writer ), |
947 | | - 'text' => wfMsg( 'coll-download_as', $name ), |
| 946 | + $params . '&writer=rl'), |
| 947 | + 'text' => wfMsg( 'coll-printable_version_pdf' ), |
948 | 948 | ); |
949 | 949 | } |
| 950 | + foreach ( $wgCollectionFormats as $writer => $name ) { |
| 951 | + } |
950 | 952 | } else { |
951 | 953 | $params = 'arttitle=' . $skinTemplate->mTitle->getPrefixedURL(); |
952 | 954 | if( $wgArticle ) { |
— | — | @@ -954,13 +956,13 @@ |
955 | 957 | $params .= '&oldid=' . $oldid; |
956 | 958 | } |
957 | 959 | } |
958 | | - foreach ( $wgCollectionFormats as $writer => $name ) { |
959 | | - $nav_urls['download_as_' . $writer] = array( |
| 960 | + if ( isset( $wgCollectionFormats['rl'] ) ) { |
| 961 | + $nav_urls['printable_version_pdf'] = array( |
960 | 962 | 'href' => SkinTemplate::makeSpecialUrlSubpage( |
961 | 963 | 'Collection', |
962 | 964 | 'render_article/', |
963 | 965 | $params . '&writer=' . $writer ), |
964 | | - 'text' => wfMsg( 'coll-download_as', $name ) |
| 966 | + 'text' => wfMsg( 'coll-printable_version_pdf' ) |
965 | 967 | ); |
966 | 968 | } |
967 | 969 | } |
— | — | @@ -975,16 +977,13 @@ |
976 | 978 | static function insertMonoBookToolboxLink( &$skinTemplate ) { |
977 | 979 | global $wgCollectionFormats; |
978 | 980 | |
979 | | - foreach ( $wgCollectionFormats as $writer => $name ) { |
980 | | - if ( !empty( $skinTemplate->data['nav_urls']['download_as_' . $writer]['href'] ) ) { |
981 | | - $href = htmlspecialchars( $skinTemplate->data['nav_urls']['download_as_' . $writer]['href'] ); |
982 | | - $label = htmlspecialchars( $skinTemplate->data['nav_urls']['download_as_' . $writer]['text'] ); |
983 | | - print <<<EOS |
| 981 | + if ( !empty( $skinTemplate->data['nav_urls']['printable_version_pdf']['href'] ) ) { |
| 982 | + $href = htmlspecialchars( $skinTemplate->data['nav_urls']['printable_version_pdf']['href'] ); |
| 983 | + $label = htmlspecialchars( $skinTemplate->data['nav_urls']['printable_version_pdf']['text'] ); |
| 984 | + print <<<EOS |
984 | 985 | <li id="t-download-as-$writer"><a href="$href" rel="nofollow">$label</a></li> |
985 | 986 | EOS |
986 | | - ; |
987 | | - } |
988 | | - |
| 987 | + ; |
989 | 988 | } |
990 | 989 | return true; |
991 | 990 | } |