Index: trunk/phase3/includes/SpecialListinterwikis.php |
— | — | @@ -0,0 +1,42 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * @package MediaWiki |
| 5 | + * @subpackage SpecialPage |
| 6 | + * |
| 7 | + * @author Ashar Voultoiz <hashar@altern.org> |
| 8 | + * @licence GNU General Public Licence 2.0 or later |
| 9 | + * |
| 10 | + */ |
| 11 | + |
| 12 | +class ListinterwikisPage extends QueryPage { |
| 13 | + |
| 14 | + function getName() { return( 'Listinterwikis' ); } |
| 15 | + function isExpensive() { return false; } |
| 16 | + function isSyndicated() { return false; } |
| 17 | + function sortDescending() { return false; } |
| 18 | + |
| 19 | + /** |
| 20 | + * We have a little fun with title, namespace but its required by QueryPage. |
| 21 | + */ |
| 22 | + function getSQL() { |
| 23 | + $dbr =& wfGetDB( DB_SLAVE ); |
| 24 | + $iw = $dbr->tableName( 'interwiki' ); |
| 25 | + $sql = "SELECT 'Listinterwikis' AS type, iw_url AS title, 0 AS namespace, iw_prefix AS value, iw_local, iw_trans FROM $iw"; |
| 26 | + return $sql; |
| 27 | + } |
| 28 | + |
| 29 | + function formatResult( $skin, $result ) { |
| 30 | + return |
| 31 | + $result->value |
| 32 | + . ' ... ' |
| 33 | + . $skin->makeExternalLink($result->title, $result->title); |
| 34 | + } |
| 35 | +} |
| 36 | + |
| 37 | +function wfSpecialListinterwikis() { |
| 38 | + list( $limit, $offset ) = wfCheckLimits(); |
| 39 | + $lip = new ListinterwikisPage(); |
| 40 | + $lip->doQuery( $offset, $limit ); |
| 41 | +} |
| 42 | +?> |
| 43 | + |