4 * A limit dropdown, which accepts any valid number
6 class HTMLSelectLimitField
extends HTMLSelectField
{
8 * Basically don't do any validation. If it's a number that's fine. Also,
9 * add it to the list if it's not there already
11 * @param string $value
12 * @param array $alldata
15 public function validate( $value, $alldata ) {
20 // Let folks pick an explicit limit not from our list, as long as it's a real numbr.
21 if ( !in_array( $value, $this->mParams
['options'] )
22 && $value == intval( $value )
25 // This adds the explicitly requested limit value to the drop-down,
26 // then makes sure it's sorted correctly so when we output the list
27 // later, the custom option doesn't just show up last.
28 $this->mParams
['options'][$this->mParent
->getLanguage()->formatNum( $value )] =
30 asort( $this->mParams
['options'] );