*
* @ingroup SpecialPage
*/
-class SpecialPrefixindex extends SpecialAllpages {
+class SpecialPrefixindex extends SpecialAllPages {
/**
* Whether to remove the searched prefix from the displayed link. Useful
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(
);
$showme = '';
- if ( isset( $par ) ) {
+ if ( $par !== null ) {
$showme = $par;
} elseif ( $prefix != '' ) {
$showme = $prefix;
* @return string
*/
protected function namespacePrefixForm( $namespace = NS_MAIN, $from = '' ) {
- global $wgScript;
-
$out = Xml::openElement( 'div', array( 'class' => 'namespaceoptions' ) );
- $out .= Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) );
+ $out .= Xml::openElement(
+ 'form',
+ array( 'method' => 'get', 'action' => $this->getConfig()->get( 'Script' ) )
+ );
$out .= Html::hidden( 'title', $this->getPageTitle()->getPrefixedText() );
$out .= Xml::openElement( 'fieldset' );
$out .= Xml::element( 'legend', null, $this->msg( 'allpages' )->text() );
/**
* @param int $namespace Default NS_MAIN
* @param string $prefix
- * @param string $from List all pages from this name (default FALSE)
+ * @param string $from List all pages from this name (default false)
*/
protected function showPrefixChunk( $namespace = NS_MAIN, $prefix, $from = null ) {
global $wgContLang;
$fromList = $this->getNamespaceKeyAndText( $namespace, $from );
$prefixList = $this->getNamespaceKeyAndText( $namespace, $prefix );
$namespaces = $wgContLang->getNamespaces();
+ $res = null;
if ( !$prefixList || !$fromList ) {
$out = $this->msg( 'allpagesbadtitle' )->parseAsBlock();
list( $namespace, $prefixKey, $prefix ) = $prefixList;
list( /* $fromNS */, $fromKey, ) = $fromList;
- ### @todo FIXME: Should complain if $fromNs != $namespace
+ # ## @todo FIXME: Should complain if $fromNs != $namespace
$dbr = wfGetDB( DB_SLAVE );
)
);
- ### @todo FIXME: Side link to previous
+ # ## @todo FIXME: Side link to previous
$n = 0;
if ( $res->numRows() > 0 ) {
- $out = Xml::openElement( 'table', array( 'class' => 'mw-prefixindex-list-table' ) );
+ $out = Html::openElement( 'div', array( 'class' => 'mw-prefixindex-body' ) );
+ $out .= Html::openElement( 'ul', array( 'class' => 'mw-prefixindex-list' ) );
$prefixLength = strlen( $prefix );
while ( ( $n < $this->maxPerPage ) && ( $s = $res->fetchObject() ) ) {
} else {
$link = '[[' . htmlspecialchars( $s->page_title ) . ']]';
}
- if ( $n % $this->columns == 0 ) {
- $out .= '<tr>';
- }
- $out .= "<td>$link</td>";
+
+ $out .= "<li> $link </li>\n";
$n++;
- if ( $n % $this->columns == 0 ) {
- $out .= '</tr>';
- }
- }
- if ( $n % $this->columns != 0 ) {
- $out .= '</tr>';
}
-
- $out .= Xml::closeElement( 'table' );
+ $out .= Html::closeElement( 'ul' );
+ $out .= Html::closeElement( 'div' );
} else {
$out = '';
}
'</td>
<td id="mw-prefixindex-nav-form" class="mw-prefixindex-nav">';
- if ( isset( $res ) && $res && ( $n == $this->maxPerPage ) &&
- ( $s = $res->fetchObject() )
- ) {
+ if ( $res && ( $n == $this->maxPerPage ) && ( $s = $res->fetchObject() ) ) {
$query = array(
'from' => $s->page_title,
'prefix' => $prefix,
'hideredirects' => $this->hideRedirects,
'stripprefix' => $this->stripPrefix,
- 'columns' => $this->columns,
);
if ( $namespace || $prefix == '' ) {