Index: trunk/extensions/InterwikiList/InterwikiList_body.php |
— | — | @@ -9,9 +9,6 @@ |
10 | 10 | |
11 | 11 | class InterwikiList extends SpecialPage { |
12 | 12 | |
13 | | - // Privates |
14 | | - private $mTitle; // The title for this specialpage |
15 | | - |
16 | 13 | /** |
17 | 14 | * Constructor |
18 | 15 | */ |
— | — | @@ -24,39 +21,21 @@ |
25 | 22 | * Execute |
26 | 23 | */ |
27 | 24 | public function execute( $par ) { |
28 | | - global $wgOut, $wgRequest; |
| 25 | + global $wgOut; |
29 | 26 | $wgOut->setPagetitle( wfMsg( 'interwikilist' ) ); |
30 | | - $this->mTitle = SpecialPage::getTitleFor( 'InterwikiList' ); |
31 | | - $prefix = $wgRequest->getText( 'iwsearch', $par ); |
32 | | - $wgOut->addHTML( $this->getInterwikis( $prefix ) ); |
| 27 | + $selfTitle = Title::makeTitle( NS_SPECIAL, 'InterwikiList' ); |
| 28 | + $wgOut->addHTML( $this->getInterwikis() ); |
33 | 29 | } |
34 | 30 | |
35 | 31 | /** |
36 | 32 | * Get all Interwiki Links - the heart of the function |
37 | | - * @param $prefix string Prefix to search for in list |
38 | | - * @return string HTML |
39 | 33 | */ |
40 | | - private function getInterwikis( $prefix = null ) { |
41 | | - global $wgScript; |
| 34 | + private function getInterwikis() { |
42 | 35 | $dbr = wfGetDB( DB_SLAVE ); |
43 | | - |
44 | | - $conds = array(); |
45 | | - if ( !is_null( $prefix ) ) { |
46 | | - $conds[] = "iw_prefix LIKE " . $dbr->addQuotes( $dbr->escapeLike( $prefix ) . "%" ); |
47 | | - } |
48 | | - |
49 | | - $results = $dbr->select( 'interwiki', array( 'iw_prefix', 'iw_url' ), $conds ); |
50 | | - |
51 | | - $text = "<fieldset>\n" . |
52 | | - "<legend>" . wfMsg('interwikilist-filter') . "</legend>\n" . |
53 | | - "<form action=\"". $wgScript . "\" method=\"get\" id=\"interwikilist-search\">\n" . |
54 | | - "<input type=\"hidden\" name=\"title\" value=\"" . $this->mTitle->getPrefixedText() . "\">\n" . |
55 | | - wfMsg('interwikilist-prefix') . " <input type=\"text\" name=\"iwsearch\" id=\"interwikilist-prefix\" value=\"" . |
56 | | - htmlspecialchars( $prefix ) . "\"><br />\n" . |
57 | | - "<input type=\"submit\" value=\"" . wfMsg('search') . "\">\n" . |
58 | | - "</form>\n</fieldset>"; |
59 | | - |
60 | | - $text .= "<table id=\"sv-software\"<tr> |
| 36 | + |
| 37 | + $results = $dbr->select( 'interwiki', array( 'iw_prefix', 'iw_url' ) ); |
| 38 | + |
| 39 | + $text = Xml::openElement( 'table', array( 'id' => 'sv-software' ) ) . "<tr> |
61 | 40 | <th>" . wfMsg( 'interwikilist-linkname' ) . "</th> |
62 | 41 | <th>" . wfMsg( 'interwikilist-target' ) . "</th> |
63 | 42 | </tr>\n"; |
— | — | @@ -69,7 +48,7 @@ |
70 | 49 | } |
71 | 50 | $text .= "</table>\n"; |
72 | 51 | $dbr->freeResult( $results ); |
73 | | - |
| 52 | + |
74 | 53 | return $text; |
75 | 54 | } |
76 | | -} |
| 55 | +} |
\ No newline at end of file |
Index: trunk/extensions/InterwikiList/InterwikiList.i18n.php |
— | — | @@ -9,8 +9,6 @@ |
10 | 10 | 'interwikilist-desc' => 'Adds a [[Special:Interwikilist|special page]] to view available interwiki links', |
11 | 11 | 'interwikilist-linkname' => 'Interwiki link', |
12 | 12 | 'interwikilist-target' => 'Target URL', |
13 | | - 'interwikilist-filter' => 'Filter list', |
14 | | - 'interwikilist-prefix' => 'Interwiki prefix:', |
15 | 13 | ); |
16 | 14 | |
17 | 15 | /** Arabic (العربية) |
Index: trunk/extensions/InterwikiList/InterwikiList.php |
— | — | @@ -11,10 +11,10 @@ |
12 | 12 | * @author Chad Horohoe <innocentkiller@gmail.com> |
13 | 13 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
14 | 14 | */ |
15 | | - |
| 15 | + |
16 | 16 | $wgExtensionCredits['specialpage'][] = array( |
17 | 17 | 'name' => 'Interwiki List', |
18 | | - 'version' => '0.3', |
| 18 | + 'version' => '0.2', |
19 | 19 | 'url' => 'http://mediawiki.org/wiki/Extension:InterwikiList', |
20 | 20 | 'description' => 'Adds a [[Special:Interwikilist|special page]] to view available interwiki links', |
21 | 21 | 'author' => '[mailto:innocentkiller@gmail.com Chad Horohoe]', |
— | — | @@ -25,4 +25,5 @@ |
26 | 26 | $wgSpecialPages['InterwikiList'] = 'InterwikiList'; |
27 | 27 | $wgAutoloadClasses['InterwikiList'] = $dir . 'InterwikiList_body.php'; |
28 | 28 | $wgExtensionMessagesFiles['InterwikiList'] = $dir . 'InterwikiList.i18n.php'; |
| 29 | +$wgExtensionAliasesFiles['InterwikiList'] = $dir . 'InterwikiList.alias.php'; |
29 | 30 | $wgSpecialPageGroups['InterwikiList'] = 'wiki'; |