Index: trunk/extensions/GlobalBlocking/SpecialRemoveGlobalBlock.php |
— | — | @@ -15,6 +15,7 @@ |
16 | 16 | $this->loadParameters(); |
17 | 17 | |
18 | 18 | $wgOut->setPageTitle( wfMsg( 'globalblocking-unblock' ) ); |
| 19 | + $wgOut->setSubtitle( GlobalBlocking::buildSubtitleLinks( 'RemoveGlobalBlock' ) ); |
19 | 20 | $wgOut->setRobotPolicy( "noindex,nofollow" ); |
20 | 21 | $wgOut->setArticleRelated( false ); |
21 | 22 | $wgOut->enableClientCache( false ); |
Index: trunk/extensions/GlobalBlocking/SpecialGlobalBlock.php |
— | — | @@ -17,6 +17,7 @@ |
18 | 18 | $this->loadParameters( $par ); |
19 | 19 | |
20 | 20 | $wgOut->setPageTitle( wfMsg( 'globalblocking-block' ) ); |
| 21 | + $wgOut->setSubtitle( GlobalBlocking::buildSubtitleLinks( 'GlobalBlock' ) ); |
21 | 22 | $wgOut->setRobotPolicy( "noindex,nofollow" ); |
22 | 23 | $wgOut->setArticleRelated( false ); |
23 | 24 | $wgOut->enableClientCache( false ); |
Index: trunk/extensions/GlobalBlocking/GlobalBlocking.class.php |
— | — | @@ -318,4 +318,38 @@ |
319 | 319 | ); |
320 | 320 | return true; |
321 | 321 | } |
| 322 | + /** |
| 323 | + * Build links to other global blocking special pages, shown in the subtitle |
| 324 | + * @param string $pagetype The calling special page name |
| 325 | + * @return string links to special pages |
| 326 | + */ |
| 327 | + static function buildSubtitleLinks( $pagetype ) { |
| 328 | + global $wgUser, $wgLang; |
| 329 | + |
| 330 | + // Add a few useful links |
| 331 | + $links = array(); |
| 332 | + $sk = $wgUser->getSkin(); |
| 333 | + |
| 334 | + // Don't show a link to a special page on the special page itself. |
| 335 | + // Show the links only if the user has sufficient rights |
| 336 | + if( $pagetype != 'GlobalBlockList' ) { |
| 337 | + $title = SpecialPage::getTitleFor( 'GlobalBlockList' ); |
| 338 | + $links[] = $sk->linkKnown( $title, wfMsg( 'globalblocklist' ) ); |
| 339 | + } |
| 340 | + |
| 341 | + if( $pagetype != 'GlobalBlock' && $wgUser->isAllowed( 'globalblock' ) ) { |
| 342 | + $title = SpecialPage::getTitleFor( 'GlobalBlock' ); |
| 343 | + $links[] = $sk->linkKnown( $title, wfMsg( 'globalblocking-goto-block' ) ); |
| 344 | + } |
| 345 | + if( $pagetype != 'RemoveGlobalBlock' && $wgUser->isAllowed( 'globalunblock' ) ) { |
| 346 | + $title = SpecialPage::getTitleFor( 'RemoveGlobalBlock' ); |
| 347 | + $links[] = $sk->linkKnown( $title, wfMsg( 'globalblocking-goto-unblock' ) ); |
| 348 | + } |
| 349 | + if( $pagetype != 'GlobalBlockStatus' && $wgUser->isAllowed( 'globalblock-whitelist' ) ) { |
| 350 | + $title = SpecialPage::getTitleFor( 'GlobalBlockStatus' ); |
| 351 | + $links[] = $sk->linkKnown( $title, wfMsg( 'globalblocking-goto-status' ) ); |
| 352 | + } |
| 353 | + $linkItems = count( $links ) ? wfMsg( 'parentheses', $wgLang->pipeList( $links ) ) : ''; |
| 354 | + return $linkItems; |
| 355 | + } |
322 | 356 | } |
Index: trunk/extensions/GlobalBlocking/SpecialGlobalBlockStatus.php |
— | — | @@ -15,6 +15,7 @@ |
16 | 16 | $this->loadParameters(); |
17 | 17 | |
18 | 18 | $wgOut->setPageTitle( wfMsg( 'globalblocking-whitelist' ) ); |
| 19 | + $wgOut->setSubtitle( GlobalBlocking::buildSubtitleLinks( 'GlobalBlockStatus' ) ); |
19 | 20 | $wgOut->setRobotPolicy( "noindex,nofollow" ); |
20 | 21 | $wgOut->setArticleRelated( false ); |
21 | 22 | $wgOut->enableClientCache( false ); |
Index: trunk/extensions/GlobalBlocking/SpecialGlobalBlockList.php |
— | — | @@ -16,6 +16,7 @@ |
17 | 17 | $this->loadParameters( $ip ); |
18 | 18 | |
19 | 19 | $wgOut->setPageTitle( wfMsg( 'globalblocking-list' ) ); |
| 20 | + $wgOut->setSubtitle( GlobalBlocking::buildSubtitleLinks( 'GlobalBlockList' ) ); |
20 | 21 | $wgOut->setRobotPolicy( "noindex,nofollow" ); |
21 | 22 | $wgOut->setArticleRelated( false ); |
22 | 23 | $wgOut->enableClientCache( false ); |
— | — | @@ -36,16 +37,6 @@ |
37 | 38 | |
38 | 39 | $wgOut->addWikiMsg( 'globalblocking-list-intro' ); |
39 | 40 | |
40 | | - // Add a few useful links |
41 | | - $link_list = /*message-->title*/array( 'globalblocking-goto-block' => 'GlobalBlock', 'globalblocking-goto-unblock' => 'RemoveGlobalBlock', 'globalblocking-goto-status' => 'GlobalBlockStatus' ); |
42 | | - $links = ''; |
43 | | - $sk = $wgUser->getSkin(); |
44 | | - foreach( $link_list as $msg => $pagename ) { |
45 | | - $title = SpecialPage::getTitleFor( $pagename ); |
46 | | - $links .= Xml::tags( 'li', null, $sk->makeKnownLinkObj( $title, wfMsg( $msg ) ) ); |
47 | | - } |
48 | | - |
49 | | - $wgOut->addHTML( Xml::tags( 'ul', null, $links ) ); |
50 | 41 | |
51 | 42 | // Build the search form |
52 | 43 | $searchForm = ''; |