Fix for r18893
authorAntoine Musso <hashar@users.mediawiki.org>
Sat, 6 Jan 2007 23:47:44 +0000 (23:47 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Sat, 6 Jan 2007 23:47:44 +0000 (23:47 +0000)
includes/SpecialListinterwikis.php [new file with mode: 0644]

diff --git a/includes/SpecialListinterwikis.php b/includes/SpecialListinterwikis.php
new file mode 100644 (file)
index 0000000..1c5458f
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+/**
+ * @package MediaWiki
+ * @subpackage SpecialPage
+ *
+ * @author Ashar Voultoiz <hashar@altern.org>
+ * @licence GNU General Public Licence 2.0 or later
+ *
+ */
+
+class ListinterwikisPage extends QueryPage {
+
+       function getName() { return( 'Listinterwikis' ); }
+       function isExpensive() { return false; }
+       function isSyndicated() { return false; }
+       function sortDescending() { return false; }
+
+       /**
+        * We have a little fun with title, namespace but its required by QueryPage.
+       */
+       function getSQL() {
+               $dbr =& wfGetDB( DB_SLAVE );
+               $iw = $dbr->tableName( 'interwiki' );
+               $sql = "SELECT 'Listinterwikis' AS type, iw_url AS title, 0 AS namespace, iw_prefix AS value, iw_local, iw_trans FROM $iw";
+               return $sql;
+       }
+
+       function formatResult( $skin, $result ) {
+               return
+                       $result->value
+                       . ' ... '
+                       . $skin->makeExternalLink($result->title, $result->title);
+       }
+}
+
+function wfSpecialListinterwikis() {
+       list( $limit, $offset ) = wfCheckLimits();
+       $lip = new ListinterwikisPage();
+       $lip->doQuery( $offset, $limit );
+}
+?>
+