Skip to content

Commit

Permalink
Use legend for RottenLinks
Browse files Browse the repository at this point in the history
  • Loading branch information
AgentIsai authored Feb 19, 2024
1 parent 0f935d9 commit d152de0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
2 changes: 2 additions & 0 deletions i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
"rottenlinks": "Status of external links",
"rottenlinks-desc": "Shows the [[Special:RottenLinks|state of all external links]] on the wiki",
"rottenlinks-extensionname": "RottenLinks",
"rottenlinks-header": "Refine external link results display",
"rottenlinks-header-info": "You may select what statistics you want displayed or how many results you want displayed per page.",
"rottenlinks-table-external": "External Link",
"rottenlinks-table-response": "HTTP Response",
"rottenlinks-table-usage": "Page Usage",
Expand Down
17 changes: 15 additions & 2 deletions includes/SpecialRottenLinks.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ public function execute( $par ) {
$pager = new RottenLinksPager( $this->getContext(), $this->config, $showBad );

$formDescriptor = [
'info' => [
'type' => 'info',
'default' => $this->msg( 'rottenlinks-header-info' )->text(),
],
'showBad' => [
'type' => 'check',
'name' => 'showBad',
Expand All @@ -67,11 +71,20 @@ public function execute( $par ) {
];

$htmlForm = HTMLForm::factory( 'ooui', $formDescriptor, $this->getContext() );
$htmlForm->setMethod( 'get' )->prepareForm()->displayForm( false );
$htmlForm
->setMethod( 'get' )
->setWrapperLegendMsg( 'rottenlinks-header' )
->setSubmitTextMsg( 'search' )
->prepareForm()
->displayForm( false );

if ( $stats ) {
$statForm = HTMLForm::factory( 'ooui', $this->showStatistics(), $this->getContext(), 'rottenlinks' );
$statForm->setMethod( 'get' )->suppressDefaultSubmit()->prepareForm()->displayForm( false );
$statForm
->setMethod( 'get' )
->suppressDefaultSubmit()
->prepareForm()
->displayForm( false );
return;
}

Expand Down

0 comments on commit d152de0

Please sign in to comment.