Index: trunk/phase3/includes/SpecialAllpages.php |
— | — | @@ -11,23 +11,38 @@ |
12 | 12 | */ |
13 | 13 | function wfSpecialAllpages( $par=NULL ) { |
14 | 14 | global $indexMaxperpage, $toplevelMaxperpage, $wgRequest, $wgOut, $wgContLang; |
| 15 | + # Config |
15 | 16 | $indexMaxperpage = 480; |
16 | 17 | $toplevelMaxperpage = 50; |
| 18 | + # GET values |
17 | 19 | $from = $wgRequest->getVal( 'from' ); |
18 | 20 | $namespace = $wgRequest->getInt( 'namespace' ); |
| 21 | + $invert = $wgRequest->getInt( 'invert' ); |
| 22 | + |
19 | 23 | $names = $wgContLang->getNamespaces(); |
| 24 | + |
20 | 25 | if( !isset( $names[$namespace] ) ) { |
21 | 26 | $namespace = 0; |
22 | 27 | } |
23 | | - $wgOut->setPagetitle ( $namespace > 0 ? wfMsg ( 'allpagesnamespace', $names[$namespace] ) |
24 | | - : wfMsg ( 'allarticles' ) ); |
25 | 28 | |
| 29 | + if ($invert) { |
| 30 | + $wgOut->setPagetitle( $namespace > 0 ? |
| 31 | + wfMsg( 'allnotinnamespace', $names[$namespace] ) : |
| 32 | + wfMsg( 'allnonarticles' ) |
| 33 | + ); |
| 34 | + } else { |
| 35 | + $wgOut->setPagetitle( $namespace > 0 ? |
| 36 | + wfMsg( 'allinnamespace', $names[$namespace] ) : |
| 37 | + wfMsg( 'allarticles' ) |
| 38 | + ); |
| 39 | + } |
| 40 | + |
26 | 41 | if ( $par ) { |
27 | | - indexShowChunk( $par, $namespace ); |
| 42 | + indexShowChunk( $namespace, $par, $invert ); |
28 | 43 | } elseif ( $from ) { |
29 | | - indexShowChunk( $from, $namespace ); |
| 44 | + indexShowChunk( $namespace, $from, $invert ); |
30 | 45 | } else { |
31 | | - indexShowToplevel ( $namespace ); |
| 46 | + indexShowToplevel ( $namespace, $invert ); |
32 | 47 | } |
33 | 48 | } |
34 | 49 | |
— | — | @@ -36,9 +51,8 @@ |
37 | 52 | * @param integer $namespace A namespace constant (default NS_MAIN). |
38 | 53 | * @param string $from Article name we are starting listing at. |
39 | 54 | */ |
40 | | -function namespaceForm ( $namespace = NS_MAIN, $from = '' ) { |
| 55 | +function namespaceForm ( $namespace = NS_MAIN, $from = '', $invert = 0) { |
41 | 56 | global $wgContLang, $wgScript; |
42 | | - |
43 | 57 | $t = Title::makeTitle( NS_SPECIAL, "Allpages" ); |
44 | 58 | |
45 | 59 | $namespaceselect = '<select name="namespace">'; |
— | — | @@ -55,11 +69,12 @@ |
56 | 70 | $frombox = '<input type="text" size="20" name="from" value="' |
57 | 71 | . htmlspecialchars ( $from ) . '"/>'; |
58 | 72 | $submitbutton = '<input type="submit" value="' . wfMsg( 'allpagessubmit' ) . '" />'; |
| 73 | + |
| 74 | + $invertbox = "<input type='checkbox' name='invert' value='1'" . ( $invert == 1 ? ' checked="checked"' : '' ) . ' />'; |
59 | 75 | |
60 | 76 | $out = "<div class='namespaceselector'><form method='get' action='{$wgScript}'>"; |
61 | 77 | $out .= '<input type="hidden" name="title" value="'.$t->getPrefixedText().'" />'; |
62 | | - $out .= wfMsg ( 'allpagesformtext1', $frombox ) . '<br />'; |
63 | | - $out .= wfMsg ( 'allpagesformtext2', $namespaceselect, $submitbutton ); |
| 78 | + $out .= wfMsg ( 'allpagesformtext', $frombox, $namespaceselect, $submitbutton, $invertbox ); |
64 | 79 | $out .= '</form></div>'; |
65 | 80 | return $out; |
66 | 81 | } |
— | — | @@ -68,7 +83,7 @@ |
69 | 84 | * @todo Document |
70 | 85 | * @param integer $namespace (default NS_MAIN) |
71 | 86 | */ |
72 | | -function indexShowToplevel ( $namespace = NS_MAIN ) { |
| 87 | +function indexShowToplevel ( $namespace = NS_MAIN, $invert = 0 ) { |
73 | 88 | global $wgOut, $indexMaxperpage, $toplevelMaxperpage, $wgContLang, $wgRequest, $wgUser; |
74 | 89 | $sk = $wgUser->getSkin(); |
75 | 90 | $fname = "indexShowToplevel"; |
— | — | @@ -79,7 +94,8 @@ |
80 | 95 | |
81 | 96 | $dbr =& wfGetDB( DB_SLAVE ); |
82 | 97 | $page = $dbr->tableName( 'page' ); |
83 | | - $fromwhere = "FROM $page WHERE page_namespace=$namespace"; |
| 98 | + $invsql = ($invert) ? '!' : ''; |
| 99 | + $fromwhere = "FROM $page WHERE page_namespace$invsql=$namespace"; |
84 | 100 | $order_arr = array ( 'ORDER BY' => 'page_title' ); |
85 | 101 | $order_str = 'ORDER BY page_title'; |
86 | 102 | $out = ""; |
— | — | @@ -87,11 +103,11 @@ |
88 | 104 | |
89 | 105 | $count = $dbr->selectField( 'page', 'COUNT(*)', $where, $fname ); |
90 | 106 | $sections = ceil( $count / $indexMaxperpage ); |
91 | | - |
| 107 | + |
92 | 108 | if ( $sections < 3 ) { |
93 | 109 | # If there are only two or less sections, don't even display them. |
94 | 110 | # Instead, display the first section directly. |
95 | | - indexShowChunk( '', $namespace ); |
| 111 | + indexShowChunk( $namespace, '', $invert ); |
96 | 112 | return; |
97 | 113 | } |
98 | 114 | |
— | — | @@ -110,7 +126,7 @@ |
111 | 127 | $lines = array(); |
112 | 128 | |
113 | 129 | # If we are going to show n rows, we need n+1 queries to find the relevant titles. |
114 | | - for ( $i = $offset; $i <= $stopat; $i++ ) { |
| 130 | + for ( $i = $offset; $i <= $stopat; ++$i ) { |
115 | 131 | if ( $i == $sections ) # if we're displaying the last section, we need to |
116 | 132 | $from = $count-1; # find the last page_title in the DB |
117 | 133 | else if ( $i > $offset ) |
— | — | @@ -136,9 +152,9 @@ |
137 | 153 | $out .= indexShowline ( $inpoint, $outpoint, $namespace ); |
138 | 154 | } |
139 | 155 | $out .= '</table>'; |
| 156 | + |
| 157 | + $nsForm = namespaceForm ( $namespace, '', $invert ); |
140 | 158 | |
141 | | - $nsForm = namespaceForm ( $namespace ); |
142 | | - |
143 | 159 | # Is there more? |
144 | 160 | $morelinks = ''; |
145 | 161 | if ( $offset > 0 ) { |
— | — | @@ -193,7 +209,7 @@ |
194 | 210 | return '<tr><td align="right">'.$out.'</td></tr>'; |
195 | 211 | } |
196 | 212 | |
197 | | -function indexShowChunk( $from, $namespace = NS_MAIN ) { |
| 213 | +function indexShowChunk( $namespace = NS_MAIN, $from, $invert ) { |
198 | 214 | global $wgOut, $wgUser, $indexMaxperpage, $wgContLang; |
199 | 215 | $sk = $wgUser->getSkin(); |
200 | 216 | $maxPlusOne = $indexMaxperpage + 1; |
— | — | @@ -206,7 +222,8 @@ |
207 | 223 | $fromTitle = Title::newFromURL( $from ); |
208 | 224 | $fromKey = is_null( $fromTitle ) ? '' : $fromTitle->getDBkey(); |
209 | 225 | |
210 | | - $sql = "SELECT page_title FROM $page WHERE page_namespace=$namespacee" . |
| 226 | + $invsql = ($invert) ? '!' : ''; |
| 227 | + $sql = "SELECT page_title FROM $page WHERE page_namespace$invsql=$namespacee" . |
211 | 228 | " AND page_title >= ". $dbr->addQuotes( $fromKey ) . |
212 | 229 | " ORDER BY page_title LIMIT " . $maxPlusOne; |
213 | 230 | $res = $dbr->query( $sql, 'indexShowChunk' ); |
— | — | @@ -235,8 +252,8 @@ |
236 | 253 | $out .= '</tr>'; |
237 | 254 | } |
238 | 255 | $out .= '</table>'; |
239 | | - |
240 | | - $nsForm = namespaceForm ( $namespace, $from ); |
| 256 | + |
| 257 | + $nsForm = namespaceForm ( $namespace, $from, $invert ); |
241 | 258 | $out2 = '<table style="background: inherit;" width="100%" cellpadding="0" cellspacing="0" border="0">'; |
242 | 259 | $out2 .= '<tr valign="top"><td align="left">' . $nsForm; |
243 | 260 | $out2 .= '</td><td align="right" style="font-size: smaller; margin-bottom: 1em;">' . |
— | — | @@ -244,10 +261,11 @@ |
245 | 262 | wfMsg ( 'allpages' ) ); |
246 | 263 | if ( ($n == $indexMaxperpage) && ($s = $dbr->fetchObject( $res )) ) { |
247 | 264 | $namespaceparam = $namespace ? "&namespace=$namespace" : ""; |
| 265 | + $invertparam = $invert ? "&invert=$invert" : ''; |
248 | 266 | $out2 .= " | " . $sk->makeKnownLink( |
249 | 267 | $wgContLang->specialPage( "Allpages" ), |
250 | 268 | wfMsg ( 'nextpage', $s->page_title ), |
251 | | - "from=" . wfUrlEncode ( $s->page_title ) . $namespaceparam ); |
| 269 | + "from=" . wfUrlEncode ( $s->page_title ) . $namespaceparam . $invertparam ); |
252 | 270 | } |
253 | 271 | $out2 .= "</td></tr></table><hr />"; |
254 | 272 | |
Index: trunk/phase3/includes/SpecialContributions.php |
— | — | @@ -244,7 +244,7 @@ |
245 | 245 | $out .= '<input type="hidden" name="title" value="'.$wgContLang->specialpage( 'Contributions' ).'" />'; |
246 | 246 | $out .= '<input type="hidden" name="target" value="'.htmlspecialchars( $target ).'" />'; |
247 | 247 | $out .= '<input type="hidden" name="hideminor" value="'.$hideminor.'" />'; |
248 | | - $out .= wfMsg ( 'allpagesformtext2', $namespaceselect, $submitbutton ); |
| 248 | + $out .= wfMsg ( 'contributionsformtext', $namespaceselect, $submitbutton ); |
249 | 249 | $out .= '</form></div>'; |
250 | 250 | return $out; |
251 | 251 | } |
Index: trunk/phase3/languages/LanguageZh_tw.php |
— | — | @@ -943,9 +943,7 @@ |
944 | 944 | 'allmessages' => "系統界面", //"All system messages", |
945 | 945 | 'allmessagesnotsupportedDB' => "系統界面功能處於關閉狀態 (wgUseDatabaseMessages)。", //"Special:AllMessages not supported because wgUseDatabaseMessages is off.", |
946 | 946 | 'allmessagestext' => "這裡列出所有可定製的系統界面。", //"This is a list of all system messages available in the MediaWiki: namespace.", |
947 | | -'allpagesformtext1' => "列出從 $1 起的條目", //"Display pages starting at: $1", |
948 | | -'allpagesformtext2' => "選定名字空間: $1 $2", //"Choose namespace: $1 $2", |
949 | | -'allpagesnamespace' => "所有 $1 名字空間的條目", //"All pages ($1 namespace)", |
| 947 | +'allinnamespace' => "所有 $1 名字空間的條目", //"All pages ($1 namespace)", |
950 | 948 | 'allpagesnext' => "下一頁", //"Next", |
951 | 949 | 'allpagesprev' => "上一頁", //"Previous", |
952 | 950 | 'allpagessubmit' => "提交", //"Go", |
Index: trunk/phase3/languages/LanguageEs.php |
— | — | @@ -1043,12 +1043,10 @@ |
1044 | 1044 | # Special:Allpages |
1045 | 1045 | 'nextpage' => 'Next page ($1)', |
1046 | 1046 | 'articlenamespace' => '(artículos)', |
1047 | | -'allpagesformtext1' => 'Mostrar páginas que comiencen por: $1', |
1048 | | -'allpagesformtext2' => 'Elige espacio de nombres: $1 $2', |
1049 | 1047 | 'allarticles' => 'Todos los artículos', |
1050 | 1048 | 'allpagesprev' => 'Anterior', |
1051 | 1049 | 'allpagesnext' => 'Siguiente', |
1052 | | -'allpagesnamespace' => 'Todas las páginas (espacio $1)', |
| 1050 | +'allinnamespace' => 'Todas las páginas (espacio $1)', |
1053 | 1051 | 'allpagessubmit' => 'Mostrar', |
1054 | 1052 | |
1055 | 1053 | # Patrolling |
Index: trunk/phase3/languages/LanguageIs.php |
— | — | @@ -156,7 +156,6 @@ |
157 | 157 | 'allmessages' => 'Kerfismeldingar', |
158 | 158 | 'allmessagestext' => 'Listi yfir meldingar í kerfismeldingarýminu.', |
159 | 159 | 'allpages' => 'Allar síður', |
160 | | -'allpagesformtext2' => 'Nafnrými: $1 $2', |
161 | 160 | 'alphaindexline' => '$1 til $2', |
162 | 161 | 'alreadyloggedin' => '<font color=red><b>Notandinn $1 er þegar innskráður!</b></font><br />', |
163 | 162 | 'ancientpages' => 'Elstu síður', |
Index: trunk/phase3/languages/LanguageFi.php |
— | — | @@ -709,7 +709,7 @@ |
710 | 710 | 'allarticles' => 'Kaikki artikkelit', |
711 | 711 | 'allpagesprev' => 'Edellinen', |
712 | 712 | 'allpagesnext' => 'Seuraaa', |
713 | | -'allpagesnamespace' => 'Kaikki sivut (nimiavaruudessa $1 )', |
| 713 | +'allinnamespace' => 'Kaikki sivut (nimiavaruudessa $1 )', |
714 | 714 | 'allpagessubmit' => 'Mene', |
715 | 715 | |
716 | 716 | # Email this user |
Index: trunk/phase3/languages/LanguageFr.php |
— | — | @@ -818,9 +818,7 @@ |
819 | 819 | |
820 | 820 | # All pages |
821 | 821 | # |
822 | | -'allpagesformtext1' => "Afficher les pages à partir de : $1", |
823 | | -'allpagesformtext2' => "Choisir un <i>namespace</i> : $1 $2", |
824 | | -'allpagesnamespace' => "Toutes les pages (espace $1)", |
| 822 | +'allinnamespace' => "Toutes les pages (espace $1)", |
825 | 823 | 'allpagesnext' => "Suivant", |
826 | 824 | 'allpagesprev' => "Précédent", |
827 | 825 | 'allpagessubmit' => "Valider", |
Index: trunk/phase3/languages/LanguageNn.php |
— | — | @@ -899,12 +899,10 @@ |
900 | 900 | # Special:Allpages |
901 | 901 | 'nextpage' => 'Neste side ($1)', |
902 | 902 | 'articlenamespace' => '(innhaldssider)', |
903 | | -'allpagesformtext1' => 'Vis sider frå: $1', |
904 | | -'allpagesformtext2' => 'Velj namnerom: $1 $2', |
905 | 903 | 'allarticles' => 'Alle innhaldssider', |
906 | 904 | 'allpagesprev' => 'Førre', |
907 | 905 | 'allpagesnext' => 'Neste', |
908 | | -'allpagesnamespace' => 'Alle sider ($1 namnerom)', |
| 906 | +'allinnamespace' => 'Alle sider ($1 namnerom)', |
909 | 907 | 'allpagessubmit' => 'Utfør', |
910 | 908 | |
911 | 909 | # Email this user |
Index: trunk/phase3/languages/Language.php |
— | — | @@ -1163,15 +1163,30 @@ |
1164 | 1164 | # Special:Allpages |
1165 | 1165 | 'nextpage' => 'Next page ($1)', |
1166 | 1166 | 'articlenamespace' => '(articles)', |
1167 | | -'allpagesformtext1' => 'Display pages starting at: $1', |
1168 | | -'allpagesformtext2' => 'Choose namespace: $1 $2', |
1169 | | -'allarticles' => 'All articles', |
1170 | | -'allpagesprev' => 'Previous', |
1171 | | -'allpagesnext' => 'Next', |
1172 | | -'allpagesnamespace' => 'All pages ($1 namespace)', |
1173 | | -'allpagessubmit' => 'Go', |
| 1167 | +'allpagesformtext' => ' |
| 1168 | +<table border="0"> |
| 1169 | + <tr> |
| 1170 | + <td align="right">Display pages starting at:</td> |
| 1171 | + <td align="left">$1</td> |
| 1172 | + </tr> |
| 1173 | + <tr> |
| 1174 | + <td align="right">Namespace:</td> |
| 1175 | + <td align="left">$2 $3</td> |
| 1176 | + </tr> |
| 1177 | + <tr> |
| 1178 | + <td align="right">$4</td> |
| 1179 | + <td align="left">Invert</td> |
| 1180 | + </tr> |
| 1181 | +</table>', |
| 1182 | +'allarticles' => 'All articles', |
| 1183 | +'allnonarticles' => 'All non-articles', |
| 1184 | +'allinnamespace' => 'All pages ($1 namespace)', |
| 1185 | +'allnotinnamespace' => 'All pages (not in $1 namespace)', |
| 1186 | +'allpagesprev' => 'Previous', |
| 1187 | +'allpagesnext' => 'Next', |
| 1188 | +'allpagessubmit' => 'Go', |
1174 | 1189 | |
1175 | | -# Email this user |
| 1190 | +# E this user |
1176 | 1191 | # |
1177 | 1192 | 'mailnologin' => 'No send address', |
1178 | 1193 | 'mailnologintext' => "You must be <a href=\"{{localurl:Special:Userlogin\">logged in</a> |
— | — | @@ -1354,6 +1369,13 @@ |
1355 | 1370 | 'contributions' => 'User contributions', |
1356 | 1371 | 'mycontris' => 'My contributions', |
1357 | 1372 | 'contribsub' => "For $1", |
| 1373 | +'contributionsformtext' => ' |
| 1374 | +<table border="0"> |
| 1375 | + <tr> |
| 1376 | + <td align="right">Namespace:</td> |
| 1377 | + <td align="left">$1 $2</td> |
| 1378 | + </tr> |
| 1379 | +</table>', |
1358 | 1380 | 'nocontribs' => 'No changes were found matching these criteria.', |
1359 | 1381 | 'ucnote' => "Below are this user's last <b>$1</b> changes in the last <b>$2</b> days.", |
1360 | 1382 | 'uclinks' => "View the last $1 changes; view the last $2 days.", |
— | — | @@ -1958,7 +1980,7 @@ |
1959 | 1981 | global $wgUser, $wgLocalTZoffset; |
1960 | 1982 | |
1961 | 1983 | if (!$tz) { |
1962 | | - $tz = $wgUser->getOption( 'timecorrection' ); |
| 1984 | + $tz = $wgUser->getOption( 'timecorrection' ); |
1963 | 1985 | } |
1964 | 1986 | |
1965 | 1987 | if ( $tz === '' ) { |
— | — | @@ -2026,7 +2048,7 @@ |
2027 | 2049 | } |
2028 | 2050 | return $this->formatNum( $t ); |
2029 | 2051 | } |
2030 | | - |
| 2052 | + |
2031 | 2053 | function timeanddate( $ts, $adj = false, $format = MW_DATE_USER_FORMAT, $timecorrection = false, $dateandtime = false) { |
2032 | 2054 | global $wgUser; |
2033 | 2055 | $ts=wfTimestamp(TS_MW,$ts); |
Index: trunk/phase3/languages/LanguageRu.php |
— | — | @@ -1010,12 +1010,10 @@ |
1011 | 1011 | # Special:Allpages |
1012 | 1012 | 'nextpage' => 'Следующая страница ($1)', |
1013 | 1013 | 'articlenamespace' => '(статьи)', |
1014 | | -'allpagesformtext1' => 'Показать страницы начиная с: $1', |
1015 | | -'allpagesformtext2' => 'Выберите пространство имён: $1 $2', |
1016 | 1014 | 'allarticles' => 'Все статьи', |
1017 | 1015 | 'allpagesprev' => 'Предыдущие', |
1018 | 1016 | 'allpagesnext' => 'Следующие', |
1019 | | -'allpagesnamespace' => 'Все страницы ($1 пространство имён)', |
| 1017 | +'allinnamespace' => 'Все страницы ($1 пространство имён)', |
1020 | 1018 | 'allpagessubmit' => 'Выполнить', |
1021 | 1019 | |
1022 | 1020 | # Email this user |
Index: trunk/phase3/languages/LanguageZh_cn.php |
— | — | @@ -957,9 +957,7 @@ |
958 | 958 | 'allmessages' => "系统界面", //"All system messages", |
959 | 959 | 'allmessagesnotsupportedDB' => "系统界面功能处于关闭状态 (wgUseDatabaseMessages)。", //"Special:AllMessages not supported because wgUseDatabaseMessages is off.", |
960 | 960 | 'allmessagestext' => "这里列出所有可定制的系统界面。", //"This is a list of all system messages available in the MediaWiki: namespace.", |
961 | | -'allpagesformtext1' => "列出从 $1 起的条目", //"Display pages starting at: $1", |
962 | | -'allpagesformtext2' => "选定名字空间: $1 $2", //"Choose namespace: $1 $2", |
963 | | -'allpagesnamespace' => "所有 $1 名字空间的条目", //"All pages ($1 namespace)", |
| 961 | +'allinnamespace' => "所有 $1 名字空间的条目", //"All pages ($1 namespace)", |
964 | 962 | 'allpagesnext' => "下一页", //"Next", |
965 | 963 | 'allpagesprev' => "上一页", //"Previous", |
966 | 964 | 'allpagessubmit' => "提交", //"Go", |
Index: trunk/phase3/languages/LanguageNds.php |
— | — | @@ -868,12 +868,10 @@ |
869 | 869 | # Special:Allpages |
870 | 870 | 'nextpage' => 'tokamen Siet ($1)', |
871 | 871 | 'articlenamespace' => '(Artikels)', |
872 | | -'allpagesformtext1' => 'Wies Sieten, anfungen bi: $1', |
873 | | -'allpagesformtext2' => 'Wähl Naamruum: $1 $2', |
874 | 872 | 'allarticles' => 'Alle Artikels', |
875 | 873 | 'allpagesprev' => 'vörig', |
876 | 874 | 'allpagesnext' => 'tokamen', |
877 | | -'allpagesnamespace' => 'Alle Sieten ($1 Naamruum)', |
| 875 | +'allinnamespace' => 'Alle Sieten ($1 Naamruum)', |
878 | 876 | 'allpagessubmit' => 'Los', |
879 | 877 | |
880 | 878 | # Oppasslist |