Index: trunk/extensions/SemanticForms/includes/SF_Utils.php |
— | — | @@ -10,6 +10,19 @@ |
11 | 11 | class SFUtils { |
12 | 12 | |
13 | 13 | /** |
| 14 | + * Creates a link to a special page, using that page's top-level description as the link text. |
| 15 | + */ |
| 16 | + public static function linkForSpecialPage( $skin, $specialPageName ) { |
| 17 | + $specialPage = SpecialPage::getPage( $specialPageName ); |
| 18 | + // link() method was added in MW 1.16 |
| 19 | + if ( method_exists( $skin, 'link' ) ) { |
| 20 | + return $skin->link( $specialPage->getTitle(), $specialPage->getDescription() ); |
| 21 | + } else { |
| 22 | + return $skin->makeKnownLinkObj( $specialPage->getTitle(), $specialPage->getDescription() ); |
| 23 | + } |
| 24 | + } |
| 25 | + |
| 26 | + /** |
14 | 27 | * Creates the name of the page that appears in the URL; |
15 | 28 | * this method is necessary because Title::getPartialURL(), for |
16 | 29 | * some reason, doesn't include the namespace |