Index: trunk/phase3/includes/SpecialWithoutinterwiki.php |
— | — | @@ -8,13 +8,41 @@ |
9 | 9 | * @author Rob Church <robchur@gmail.com> |
10 | 10 | */ |
11 | 11 | class WithoutInterwikiPage extends PageQueryPage { |
| 12 | + private $prefix = ''; |
12 | 13 | |
13 | 14 | function getName() { |
14 | 15 | return 'Withoutinterwiki'; |
15 | 16 | } |
16 | 17 | |
17 | 18 | function getPageHeader() { |
18 | | - return '<p>' . wfMsgExt( 'withoutinterwiki-header', array( 'parseinline' ) ) . '</p>'; |
| 19 | + global $wgScript, $wgContLang; |
| 20 | + $prefix = $this->prefix; |
| 21 | + $t = SpecialPage::getTitleFor( $this->getName() ); |
| 22 | + $align = $wgContLang->isRtl() ? 'left' : 'right'; |
| 23 | + |
| 24 | + $s = '<p>' . wfMsgExt( 'withoutinterwiki-header', array( 'parseinline' ) ) . '</p>'; |
| 25 | + $s .= Xml::openElement( 'div', array( 'class' => 'namespaceoptions' ) ); |
| 26 | + $s .= Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ); |
| 27 | + $s .= Xml::hidden( 'title', $t->getPrefixedText() ); |
| 28 | + $s .= Xml::openElement( 'table', array( 'id' => 'nsselect', 'class' => 'withoutinterwiki' ) ); |
| 29 | + $s .= "<tr> |
| 30 | + <td align='$align'>" . |
| 31 | + Xml::label( wfMsg( 'allpagesprefix' ), 'wiprefix' ) . |
| 32 | + "</td> |
| 33 | + <td>" . |
| 34 | + Xml::input( 'prefix', 20, htmlspecialchars ( $prefix ), array( 'id' => 'wiprefix' ) ) . |
| 35 | + "</td> |
| 36 | + </tr> |
| 37 | + <tr> |
| 38 | + <td align='$align'></td> |
| 39 | + <td>" . |
| 40 | + Xml::submitButton( wfMsgHtml( 'withoutinterwiki-submit' ) ) . |
| 41 | + "</td> |
| 42 | + </tr>"; |
| 43 | + $s .= Xml::closeElement( 'table' ); |
| 44 | + $s .= Xml::closeElement( 'form' ); |
| 45 | + $s .= Xml::closeElement( 'div' ); |
| 46 | + return $s; |
19 | 47 | } |
20 | 48 | |
21 | 49 | function sortDescending() { |
— | — | @@ -32,6 +60,7 @@ |
33 | 61 | function getSQL() { |
34 | 62 | $dbr = wfGetDB( DB_SLAVE ); |
35 | 63 | list( $page, $langlinks ) = $dbr->tableNamesN( 'page', 'langlinks' ); |
| 64 | + $prefix = $this->prefix ? "AND page_title LIKE '" . $dbr->escapeLike( $this->prefix ) . "%'" : ''; |
36 | 65 | return |
37 | 66 | "SELECT 'Withoutinterwiki' AS type, |
38 | 67 | page_namespace AS namespace, |
— | — | @@ -42,14 +71,22 @@ |
43 | 72 | ON ll_from = page_id |
44 | 73 | WHERE ll_title IS NULL |
45 | 74 | AND page_namespace=" . NS_MAIN . " |
46 | | - AND page_is_redirect = 0"; |
| 75 | + AND page_is_redirect = 0 |
| 76 | + {$prefix}"; |
47 | 77 | } |
48 | 78 | |
| 79 | + function setPrefix( $prefix = '' ) { |
| 80 | + $this->prefix = $prefix; |
| 81 | + } |
| 82 | + |
49 | 83 | } |
50 | 84 | |
51 | 85 | function wfSpecialWithoutinterwiki() { |
| 86 | + global $wgRequest; |
52 | 87 | list( $limit, $offset ) = wfCheckLimits(); |
| 88 | + $prefix = $wgRequest->getVal( 'prefix' ); |
53 | 89 | $wip = new WithoutInterwikiPage(); |
| 90 | + $wip->setPrefix( $prefix ); |
54 | 91 | $wip->doQuery( $offset, $limit ); |
55 | 92 | } |
56 | 93 | |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1649,6 +1649,7 @@ |
1650 | 1650 | 'withoutinterwiki' => 'Pages without language links', |
1651 | 1651 | 'withoutinterwiki-header' => 'The following pages do not link to other language versions:', |
1652 | 1652 | 'withoutinterwiki-summary' => '', # only translate this message to other languages if you have to change it |
| 1653 | +'withoutinterwiki-submit' => 'Show', |
1653 | 1654 | |
1654 | 1655 | 'fewestrevisions' => 'Pages with the fewest revisions', |
1655 | 1656 | 'fewestrevisions-summary' => '', # only translate this message to other languages if you have to change it |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -133,8 +133,8 @@ |
134 | 134 | * Add DBA caching to installer |
135 | 135 | * (bug 18585) Added a bunch of parameters to the revertpage message |
136 | 136 | * Support redirects in image namespace |
| 137 | +* (bug 10049) Prefix index search and namespaces in Special:Withoutinterwiki |
137 | 138 | |
138 | | - |
139 | 139 | === Bug fixes in 1.12 === |
140 | 140 | |
141 | 141 | * Subpages are now indexed for searching properly when using PostgreSQL |