3 * Implements Special:Allmessages
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * http://www.gnu.org/copyleft/gpl.html
21 * @ingroup SpecialPage
23 use MediaWiki\MediaWikiServices
;
26 * Use this special page to get a list of the MediaWiki system messages.
29 * @ingroup SpecialPage
31 class SpecialAllMessages
extends SpecialPage
{
33 public function __construct() {
34 parent
::__construct( 'Allmessages' );
38 * Show the special page
40 * @param string $par Parameter passed to the page or null
42 public function execute( $par ) {
43 $out = $this->getOutput();
47 if ( !$this->getConfig()->get( 'UseDatabaseMessages' ) ) {
48 $out->addWikiMsg( 'allmessagesnotsupportedDB' );
53 $out->addModuleStyles( 'mediawiki.special' );
54 $this->addHelpLink( 'Help:System message' );
56 $contLang = MediaWikiServices
::getInstance()->getContentLanguage()->getCode();
57 $lang = $this->getLanguage();
59 $opts = new FormOptions();
61 $opts->add( 'prefix', '' );
62 $opts->add( 'filter', 'all' );
63 $opts->add( 'lang', $contLang );
64 $opts->add( 'limit', 50 );
66 $opts->fetchValuesFromRequest( $this->getRequest() );
67 $opts->validateIntBounds( 'limit', 0, 5000 );
69 $pager = new AllMessagesTablePager( $this->getContext(), $opts );
75 'label-message' => 'allmessages-prefix',
81 'label-message' => 'allmessages-filter',
83 $this->msg( 'allmessages-filter-unmodified' )->text() => 'unmodified',
84 $this->msg( 'allmessages-filter-all' )->text() => 'all',
85 $this->msg( 'allmessages-filter-modified' )->text() => 'modified',
94 'label-message' => 'allmessages-language',
95 'default' => $opts->getValue( 'lang' ),
99 'type' => 'limitselect',
101 'label-message' => 'table_pager_limit_label',
103 $lang->formatNum( 20 ) => 20,
104 $lang->formatNum( 50 ) => 50,
105 $lang->formatNum( 100 ) => 100,
106 $lang->formatNum( 250 ) => 250,
107 $lang->formatNum( 500 ) => 500,
108 $lang->formatNum( 5000 ) => 5000,
110 'default' => $opts->getValue( 'limit' ),
114 $htmlForm = HTMLForm
::factory( 'ooui', $formDescriptor, $this->getContext() );
117 ->setIntro( $this->msg( 'allmessagestext' ) )
118 ->setWrapperLegendMsg( 'allmessages' )
119 ->setSubmitTextMsg( 'allmessages-filter-submit' )
121 ->displayForm( false );
123 $out->addParserOutputContent( $pager->getFullOutput() );
126 protected function getGroupName() {