protected $hideRedirects = false;
+ // number of columns in output table
+ protected $columns = 3;
+
// Inherit $maxPerPage
function __construct() {
$namespace = (int)$ns; // if no namespace given, use 0 (NS_MAIN).
$this->hideRedirects = $request->getBool( 'hideredirects', $this->hideRedirects );
$this->stripPrefix = $request->getBool( 'stripprefix', $this->stripPrefix );
+ $this->columns = $request->getInt( 'columns', $this->columns );
$namespaces = $wgContLang->getNamespaces();
$out->setPageTitle(
} else {
$link = '[[' . htmlspecialchars( $s->page_title ) . ']]';
}
- if ( $n % 3 == 0 ) {
+ if ( $n % $this->columns == 0 ) {
$out .= '<tr>';
}
$out .= "<td>$link</td>";
$n++;
- if ( $n % 3 == 0 ) {
+ if ( $n % $this->columns == 0 ) {
$out .= '</tr>';
}
}
- if ( $n % 3 != 0 ) {
+ if ( $n % $this->columns != 0 ) {
$out .= '</tr>';
}
'prefix' => $prefix,
'hideredirects' => $this->hideRedirects,
'stripprefix' => $this->stripPrefix,
+ 'columns' => $this->columns,
);
if ( $namespace || $prefix == '' ) {