protected $nsfromMsg = 'allpagesfrom';
/**
- * Constructor
- *
* @param string $name Name of the special page, as seen in links and URLs (default: 'Allpages')
*/
function __construct( $name = 'Allpages' ) {
* @param int $namespace A namespace constant (default NS_MAIN).
* @param string $from DbKey we are starting listing at.
* @param string $to DbKey we are ending listing at.
- * @param bool $hideRedirects Dont show redirects (default false)
+ * @param bool $hideRedirects Don't show redirects (default false)
*/
protected function outputHTMLForm( $namespace = NS_MAIN,
$from = '', $to = '', $hideRedirects = false
) {
$miserMode = (bool)$this->getConfig()->get( 'MiserMode' );
- $fields = [
+ $formDescriptor = [
'from' => [
'type' => 'text',
'name' => 'from',
'id' => 'namespace',
'label-message' => 'namespace',
'all' => null,
- 'value' => $namespace,
+ 'default' => $namespace,
],
'hideredirects' => [
'type' => 'check',
];
if ( $miserMode ) {
- unset( $fields['hideredirects'] );
+ unset( $formDescriptor['hideredirects'] );
}
- $form = HTMLForm::factory( 'table', $fields, $this->getContext() );
- $form->setMethod( 'get' )
+ $context = new DerivativeContext( $this->getContext() );
+ $context->setTitle( $this->getPageTitle() ); // Remove subpage
+ $htmlForm = HTMLForm::factory( 'ooui', $formDescriptor, $context );
+ $htmlForm
+ ->setMethod( 'get' )
->setWrapperLegendMsg( 'allpages' )
->setSubmitTextMsg( 'allpagessubmit' )
->prepareForm()
* @param int $namespace (default NS_MAIN)
* @param string $from List all pages from this name
* @param string $to List all pages to this name
- * @param bool $hideredirects Dont show redirects (default false)
+ * @param bool $hideredirects Don't show redirects (default false)
*/
function showToplevel( $namespace = NS_MAIN, $from = '', $to = '', $hideredirects = false ) {
$from = Title::makeTitleSafe( $namespace, $from );
* @param int $namespace Namespace (Default NS_MAIN)
* @param string $from List all pages from this name (default false)
* @param string $to List all pages to this name (default false)
- * @param bool $hideredirects Dont show redirects (default false)
+ * @param bool $hideredirects Don't show redirects (default false)
*/
function showChunk( $namespace = NS_MAIN, $from = false, $to = false, $hideredirects = false ) {
$output = $this->getOutput();
/**
* @param int $ns The namespace of the article
* @param string $text The name of the article
- * @return array( int namespace, string dbkey, string pagename ) or null on error
+ * @return array|null [ int namespace, string dbkey, string pagename ] or null on error
*/
protected function getNamespaceKeyAndText( $ns, $text ) {
if ( $text == '' ) {