Index: trunk/phase3/includes/SkinLegacy.php |
— | — | @@ -430,34 +430,18 @@ |
431 | 431 | * Show a drop-down box of special pages |
432 | 432 | */ |
433 | 433 | function specialPagesList() { |
434 | | - global $wgContLang, $wgServer, $wgRedirectScript; |
| 434 | + global $wgScript; |
435 | 435 | |
| 436 | + $select = new XmlSelect( 'title' ); |
436 | 437 | $pages = SpecialPageFactory::getUsablePages(); |
437 | | - |
438 | | - foreach ( $pages as $name => $page ) { |
439 | | - $pages[$name] = $page->getDescription(); |
| 438 | + array_unshift( $pages, SpecialPageFactory::getPage( 'SpecialPages' ) ); |
| 439 | + foreach ( $pages as $obj ) { |
| 440 | + $select->addOption( $obj->getDescription(), |
| 441 | + $obj->getTitle()->getPrefixedDBkey() ); |
440 | 442 | } |
441 | 443 | |
442 | | - $go = wfMsg( 'go' ); |
443 | | - $sp = wfMsg( 'specialpages' ); |
444 | | - $spp = $wgContLang->specialPage( 'Specialpages' ); |
445 | | - |
446 | | - $s = '<form id="specialpages" method="get" ' . |
447 | | - 'action="' . htmlspecialchars( "{$wgServer}{$wgRedirectScript}" ) . "\">\n"; |
448 | | - $s .= "<select name=\"wpDropdown\">\n"; |
449 | | - $s .= "<option value=\"{$spp}\">{$sp}</option>\n"; |
450 | | - |
451 | | - |
452 | | - foreach ( $pages as $name => $desc ) { |
453 | | - $p = $wgContLang->specialPage( $name ); |
454 | | - $s .= "<option value=\"{$p}\">{$desc}</option>\n"; |
455 | | - } |
456 | | - |
457 | | - $s .= "</select>\n"; |
458 | | - $s .= "<input type='submit' value=\"{$go}\" name='redirect' />\n"; |
459 | | - $s .= "</form>\n"; |
460 | | - |
461 | | - return $s; |
| 444 | + return Html::rawElement( 'form', array( 'id' => 'specialpages', 'method' => 'get', |
| 445 | + 'action' => $wgScript ), $select->getHTML() . Xml::submitButton( wfMsg( 'go' ) ) ); |
462 | 446 | } |
463 | 447 | |
464 | 448 | function pageTitleLinks() { |