Index: trunk/phase3/includes/XmlFunctions.php |
— | — | @@ -18,9 +18,6 @@ |
19 | 19 | function HTMLnamespaceselector($selected = '', $allnamespaces = null, $includehidden=false) { |
20 | 20 | return Xml::namespaceSelector( $selected, $allnamespaces, $includehidden ); |
21 | 21 | } |
22 | | -function HTMLmonthelector($selected = '', $allmonths = null) { |
23 | | - return Xml::monthSelector( $selected, $allmonths ); |
24 | | -} |
25 | 22 | function wfSpan( $text, $class, $attribs=array() ) { |
26 | 23 | return Xml::span( $text, $class, $attribs ); |
27 | 24 | } |
Index: trunk/phase3/includes/Xml.php |
— | — | @@ -123,28 +123,6 @@ |
124 | 124 | $s .= "</select>\n"; |
125 | 125 | return $s; |
126 | 126 | } |
127 | | - |
128 | | - /** |
129 | | - * Create a date selector |
130 | | - * |
131 | | - * @param $selected Mixed: the month which should be selected, default '' |
132 | | - * @param $allmonths String: value of a special item denoting all month. Null to not include (default) |
133 | | - * @param string $id Element identifier |
134 | | - * @return String: Html string containing the month selector |
135 | | - */ |
136 | | - public static function monthSelector( $selected = '', $allmonths = null, $id = 'month' ) { |
137 | | - global $wgLang; |
138 | | - $options = array(); |
139 | | - if( is_null( $selected ) ) |
140 | | - $selected = ''; |
141 | | - if( !is_null( $allmonths ) ) |
142 | | - $options[] = self::option( wfMsg( 'monthsall' ), $allmonths, $selected === $allmonths ); |
143 | | - for( $i = 1; $i < 13; $i++ ) |
144 | | - $options[] = self::option( $wgLang->getMonthName( $i ), $i, $selected === $i ); |
145 | | - return self::openElement( 'select', array( 'id' => $id, 'name' => 'month' ) ) |
146 | | - . implode( "\n", $options ) |
147 | | - . self::closeElement( 'select' ); |
148 | | - } |
149 | 127 | |
150 | 128 | /** |
151 | 129 | * |
Index: trunk/phase3/includes/SpecialContributions.php |
— | — | @@ -9,19 +9,13 @@ |
10 | 10 | var $messages, $target; |
11 | 11 | var $namespace = '', $mDb; |
12 | 12 | |
13 | | - function __construct( $target, $namespace = false, $year = false, $month = false ) { |
| 13 | + function __construct( $target, $namespace = false ) { |
14 | 14 | parent::__construct(); |
15 | 15 | foreach( explode( ' ', 'uctop diff newarticle rollbacklink diff hist minoreditletter' ) as $msg ) { |
16 | 16 | $this->messages[$msg] = wfMsgExt( $msg, array( 'escape') ); |
17 | 17 | } |
18 | 18 | $this->target = $target; |
19 | 19 | $this->namespace = $namespace; |
20 | | - |
21 | | - $year = intval($year); |
22 | | - $month = intval($month); |
23 | | - |
24 | | - $this->year = ($year > 0 && $year < 10000) ? $year : false; |
25 | | - $this->month = ($month > 0 && $month < 13) ? $month : false; |
26 | 20 | $this->mDb = wfGetDB( DB_SLAVE, 'contributions' ); |
27 | 21 | } |
28 | 22 | |
— | — | @@ -33,7 +27,7 @@ |
34 | 28 | |
35 | 29 | function getQueryInfo() { |
36 | 30 | list( $index, $userCond ) = $this->getUserCond(); |
37 | | - $conds = array_merge( array('page_id=rev_page'), $userCond, $this->getNamespaceCond(), $this->GetDateCond() ); |
| 31 | + $conds = array_merge( array('page_id=rev_page'), $userCond, $this->getNamespaceCond() ); |
38 | 32 | |
39 | 33 | return array( |
40 | 34 | 'tables' => array( 'page', 'revision' ), |
— | — | @@ -69,39 +63,6 @@ |
70 | 64 | } |
71 | 65 | } |
72 | 66 | |
73 | | - function getDateCond() { |
74 | | - $condition = array(); |
75 | | - |
76 | | - if ( $this->year || $this->month ) { |
77 | | - // Assume this year if only a month is given |
78 | | - if ( $this->year ) { |
79 | | - $year_start = $this->year; |
80 | | - } else { |
81 | | - $year_start = substr( wfTimestampNow(), 0, 4 ); |
82 | | - } |
83 | | - |
84 | | - if ( $this->month ) { |
85 | | - $month_start = str_pad($this->month, 2, '0', STR_PAD_LEFT); |
86 | | - $month_end = str_pad($this->month + 1, 2, '0', STR_PAD_LEFT); |
87 | | - $year_end = $year_start; |
88 | | - } else { |
89 | | - $month_start = 0; |
90 | | - $month_end = 0; |
91 | | - $year_end = $year_start + 1; |
92 | | - } |
93 | | - |
94 | | - $ts_start = str_pad($year_start . $month_start, 14, '0' ); |
95 | | - $ts_end = str_pad($year_end . $month_end, 14, '0' ); |
96 | | - |
97 | | - $condition[] = "rev_timestamp >= $ts_start"; |
98 | | - # If just given the year 9999, we need not enforce an upper bound |
99 | | - if( strlen($year_end) <= 4 ) |
100 | | - $condition[] = "rev_timestamp < $ts_end"; |
101 | | - } |
102 | | - |
103 | | - return $condition; |
104 | | - } |
105 | | - |
106 | 67 | function getIndexField() { |
107 | 68 | return 'rev_timestamp'; |
108 | 69 | } |
— | — | @@ -273,25 +234,11 @@ |
274 | 235 | $options['bot'] = '1'; |
275 | 236 | } |
276 | 237 | |
277 | | - if ( ( $month = $wgRequest->getVal( 'month', null ) ) !== null && $month !== '' ) { |
278 | | - $options['month'] = intval( $month ); |
279 | | - } else { |
280 | | - $options['month'] = ''; |
281 | | - } |
282 | | - |
283 | | - if ( ( $year = $wgRequest->getVal( 'year', null ) ) !== null && $year !== '' ) { |
284 | | - $options['year'] = intval( $year ); |
285 | | - } else if( $month ) { |
286 | | - $options['year'] = intval( substr( wfTimestampNow(), 0, 4 ) ); |
287 | | - } else { |
288 | | - $options['year'] = ''; |
289 | | - } |
290 | | - |
291 | 238 | wfRunHooks( 'SpecialContributionsBeforeMainOutput', $id ); |
292 | 239 | |
293 | 240 | $wgOut->addHTML( contributionsForm( $options ) ); |
294 | 241 | |
295 | | - $pager = new ContribsPager( $target, $options['namespace'], $options['year'], $options['month'] ); |
| 242 | + $pager = new ContribsPager( $target, $options['namespace'] ); |
296 | 243 | if ( !$pager->getNumRows() ) { |
297 | 244 | $wgOut->addWikiText( wfMsg( 'nocontribs' ) ); |
298 | 245 | return; |
— | — | @@ -388,14 +335,6 @@ |
389 | 336 | $options['contribs'] = 'user'; |
390 | 337 | } |
391 | 338 | |
392 | | - if ( !isset( $options['year'] ) ) { |
393 | | - $options['year'] = ''; |
394 | | - } |
395 | | - |
396 | | - if ( !isset( $options['month'] ) ) { |
397 | | - $options['month'] = ''; |
398 | | - } |
399 | | - |
400 | 339 | if ( $options['contribs'] == 'newbie' ) { |
401 | 340 | $options['target'] = ''; |
402 | 341 | } |
— | — | @@ -416,13 +355,7 @@ |
417 | 356 | Xml::input( 'target', 20, $options['target']) . ' '. |
418 | 357 | Xml::label( wfMsg( 'namespace' ), 'namespace' ) . |
419 | 358 | Xml::namespaceSelector( $options['namespace'], '' ) . |
420 | | - Xml::openElement( 'p' ) . |
421 | | - Xml::label( wfMsg( 'year' ), 'year' ) . ' '. |
422 | | - Xml::input( 'year', 4, $options['year'], array('id' => 'year', 'maxlength' => 4) ) . ' '. |
423 | | - Xml::label( wfMsg( 'month' ), 'month' ) . ' '. |
424 | | - xml::monthSelector( $options['month'], -1 ) . |
425 | 359 | Xml::submitButton( wfMsg( 'sp-contributions-submit' ) ) . |
426 | | - Xml::closeElement( 'p' ) . |
427 | 360 | '</fieldset>' . |
428 | 361 | Xml::closeElement( 'form' ); |
429 | 362 | return $f; |