Adds support for specifying the number of output columns to use in the
table generated by Special:PrefixIndex. Can be used as follows:
{{Special:PrefixIndex/{{FULLPAGENAME}}/|columns=2}}
Bug: 60759
Change-Id: Ic824351132ec8bf7c35116f6ab19f23386ead33e
protected $hideRedirects = false;
protected $hideRedirects = false;
+ // number of columns in output table
+ protected $columns = 3;
+
// Inherit $maxPerPage
function __construct() {
// 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 );
$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(
$namespaces = $wgContLang->getNamespaces();
$out->setPageTitle(
} else {
$link = '[[' . htmlspecialchars( $s->page_title ) . ']]';
}
} else {
$link = '[[' . htmlspecialchars( $s->page_title ) . ']]';
}
+ if ( $n % $this->columns == 0 ) {
$out .= '<tr>';
}
$out .= "<td>$link</td>";
$n++;
$out .= '<tr>';
}
$out .= "<td>$link</td>";
$n++;
+ if ( $n % $this->columns == 0 ) {
+ if ( $n % $this->columns != 0 ) {
'prefix' => $prefix,
'hideredirects' => $this->hideRedirects,
'stripprefix' => $this->stripPrefix,
'prefix' => $prefix,
'hideredirects' => $this->hideRedirects,
'stripprefix' => $this->stripPrefix,
+ 'columns' => $this->columns,
);
if ( $namespace || $prefix == '' ) {
);
if ( $namespace || $prefix == '' ) {