Index: trunk/phase3/includes/Interwiki.php |
— | — | @@ -17,7 +17,7 @@ |
18 | 18 | |
19 | 19 | protected $mPrefix, $mURL, $mLocal, $mTrans; |
20 | 20 | |
21 | | - function __construct( $prefix = null, $url = '', $local = 0, $trans = 0 ) { |
| 21 | + public function __construct( $prefix = null, $url = '', $local = 0, $trans = 0 ) { |
22 | 22 | $this->mPrefix = $prefix; |
23 | 23 | $this->mURL = $url; |
24 | 24 | $this->mLocal = $local; |
— | — | @@ -186,7 +186,7 @@ |
187 | 187 | * @param $title string What text to put for the article name |
188 | 188 | * @return string The URL |
189 | 189 | */ |
190 | | - function getURL( $title = null ) { |
| 190 | + public function getURL( $title = null ) { |
191 | 191 | $url = $this->mURL; |
192 | 192 | if( $title != null ) { |
193 | 193 | $url = str_replace( "$1", $title, $url ); |
— | — | @@ -194,12 +194,41 @@ |
195 | 195 | return $url; |
196 | 196 | } |
197 | 197 | |
198 | | - function isLocal() { |
| 198 | + /** |
| 199 | + * Is this a local link from a sister project, or is |
| 200 | + * it something outside, like Google |
| 201 | + * @return bool |
| 202 | + */ |
| 203 | + public function isLocal() { |
199 | 204 | return $this->mLocal; |
200 | 205 | } |
201 | 206 | |
202 | | - function isTranscludable() { |
| 207 | + /** |
| 208 | + * Can pages from this wiki be transcluded? |
| 209 | + * Still requires $wgEnableScaryTransclusion |
| 210 | + * @return bool |
| 211 | + */ |
| 212 | + public function isTranscludable() { |
203 | 213 | return $this->mTrans; |
204 | 214 | } |
205 | 215 | |
| 216 | + /** |
| 217 | + * Get the name for the interwiki site |
| 218 | + * @return String |
| 219 | + */ |
| 220 | + public function getName() { |
| 221 | + $key = 'interwiki-name-' . $this->mPrefix; |
| 222 | + $msg = wfMsgForContent( $key ); |
| 223 | + return wfEmptyMsg( $key, $msg ) ? '' : $msg; |
| 224 | + } |
| 225 | + |
| 226 | + /** |
| 227 | + * Get a description for this interwiki |
| 228 | + * @return String |
| 229 | + */ |
| 230 | + public function getDescription() { |
| 231 | + $key = 'interwiki-desc-' . $this->mPrefix; |
| 232 | + $msg = wfMsgForContent( $key ); |
| 233 | + return wfEmptyMsg( $key, $msg ) ? '' : $msg; |
| 234 | + } |
206 | 235 | } |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -161,6 +161,8 @@ |
162 | 162 | * (bug 19900) The "listgrouprights-key" message is now wrapped in a div with |
163 | 163 | class "mw-listgrouprights-key" |
164 | 164 | * (bug 471) Allow RSS feeds for watchlist, using an opt-in security token |
| 165 | +* (bug 10812) Interwiki links can have names and descriptions, fetched from |
| 166 | + message 'interwiki-desc-PREFIX', not really used anywhere yet though |
165 | 167 | |
166 | 168 | === Bug fixes in 1.16 === |
167 | 169 | |