Index: trunk/extensions/WikiArticleFeeds/WikiArticleFeeds_body.php |
— | — | @@ -107,19 +107,19 @@ |
108 | 108 | } |
109 | 109 | |
110 | 110 | /** |
111 | | - * Add additional attributes to links to User- or User_talk pages. |
112 | | - * These are used later in wfGenerateWikiFeed to determine signatures with timestamps |
113 | | - * for attributing author and timestamp values to the feed item. |
| 111 | + * Add additional attributes to links to User- or User_talk pages |
| 112 | + * It does this for all links on all pages |
| 113 | + * (even when we need this only for pages which generate a feed) |
114 | 114 | * |
115 | | - * Currently this method works only if the user page exists. |
| 115 | + * Attributes are used later in wfGenerateWikiFeed to determine signatures with timestamps |
| 116 | + * for attributing author and timestamp values to the feed item from the signatures. |
116 | 117 | */ |
117 | 118 | # https://www.mediawiki.org/wiki/Manual:Hooks/LinkEnd |
118 | | - static function wfWikiArticleFeedsAddSignatureMarker( $skin, $title, $options, $text, &$attribs, $ret ) { |
119 | | - global $wgWikiFeedPresent; |
120 | | - // wfDebug( "wfWikiArticleFeedsAddSignatureMarker: Text:". $title->getText() . " Namespace:".$title->getNamespace(). " exists:". $title->exists() . "\n" ); |
121 | | - if ( $title->getNamespace() == NS_USER) { |
| 119 | + static function wfWikiArticleFeedsAddSignatureMarker( $skin, Title $target, array $options, $text, array &$attribs, $ret ) { |
| 120 | + |
| 121 | + if ( $target->getNamespace() == NS_USER) { |
122 | 122 | $attribs['userpage-link'] = 'true'; |
123 | | - } elseif ( $title->getNamespace() == NS_USER_TALK ) { |
| 123 | + } elseif ( $target->getNamespace() == NS_USER_TALK ) { |
124 | 124 | $attribs['usertalkpage-link'] = 'true'; |
125 | 125 | } |
126 | 126 | return true; |
— | — | @@ -132,7 +132,7 @@ |
133 | 133 | * @param QuickTemplate $template Instance of MonoBookTemplate or other QuickTemplate |
134 | 134 | */ |
135 | 135 | static function wfWikiArticleFeedsToolboxLinks( $template ) { |
136 | | - global $wgServer, $wgScript, $wgWikiFeedPresent; |
| 136 | + global $wgServer, $wgScript, $wgStylePath, $wgWikiFeedPresent; |
137 | 137 | |
138 | 138 | # Short-circuit if there are no Feeds present |
139 | 139 | if ( !$wgWikiFeedPresent ) { |
— | — | @@ -151,6 +151,7 @@ |
152 | 152 | } |
153 | 153 | |
154 | 154 | $result = '<li id="feedlinks">'; |
| 155 | + $feedIcon = $wgServer . $wgStylePath . "/common/images/feed-icon.png"; |
155 | 156 | |
156 | 157 | # Test for feedBurner presence |
157 | 158 | $burned = false; |
— | — | @@ -166,6 +167,7 @@ |
167 | 168 | $result .= |
168 | 169 | '<span id="feed-' . htmlspecialchars( $feed ) . '">' . |
169 | 170 | '<a href="http://feeds.feedburner.com/' . urlencode( $feedBurnerName ) . '?format=xml">' . |
| 171 | + '<img style="margin-right:2px;" src="' . $feedIcon . '" border=0>' . |
170 | 172 | htmlspecialchars( $name ) . '</a> </span>'; |
171 | 173 | } |
172 | 174 | $burned = true; |
— | — | @@ -181,6 +183,7 @@ |
182 | 184 | $result .= |
183 | 185 | '<span id="feed-' . htmlspecialchars( $feed ) . '">' . |
184 | 186 | '<a href="' . htmlspecialchars( $baseUrl . $feed ) . '">' . |
| 187 | + '<img style="margin-right:2px;" src="' . $feedIcon . '" border=0>' . |
185 | 188 | htmlspecialchars( $name ) . '</a> </span>'; |
186 | 189 | } |
187 | 190 | } |
Index: trunk/extensions/WikiArticleFeeds/WikiArticleFeeds.php |
— | — | @@ -4,7 +4,7 @@ |
5 | 5 | * @author Jim R. Wilson, Thomas Gries |
6 | 6 | * @maintainer Thomas Gries |
7 | 7 | * |
8 | | - * @version 0.701 |
| 8 | + * @version 0.703 |
9 | 9 | * @copyright Copyright (C) 2007 Jim R. Wilson |
10 | 10 | * @copyright Copyright (C) 2012 Thomas Gries |
11 | 11 | * @license The MIT License - http://www.opensource.org/licenses/mit-license.php |
— | — | @@ -56,6 +56,7 @@ |
57 | 57 | * |
58 | 58 | * Versions |
59 | 59 | * |
| 60 | + * 0.703 adds the feed icon to the bottom of the toolbox in Monobook or like-minded skins. |
60 | 61 | * 0.701 version string constant renamed to make it wiki-unique |
61 | 62 | * 0.700 rewritten into a four-file version with class |
62 | 63 | * auto-discovery rss feedlinks come with the page title in it |
— | — | @@ -123,7 +124,7 @@ |
124 | 125 | die( "This is not a valid entry point.\n" ); |
125 | 126 | } |
126 | 127 | |
127 | | -define( 'EXTENSION_WIKIARTICLEFEEDS_VERSION', '0.701 20120223' ); |
| 128 | +define( 'EXTENSION_WIKIARTICLEFEEDS_VERSION', '0.703 20120312' ); |
128 | 129 | |
129 | 130 | # Bring in supporting classes |
130 | 131 | require_once( "$IP/includes/Feed.php" ); |