修正格式

main
落雨楓 8 months ago
parent 8ed8f865b1
commit 9b8aaa1d31

@ -1,4 +1,5 @@
<?php <?php
namespace Isekai\AIToolbox\Special; namespace Isekai\AIToolbox\Special;
use SpecialPage; use SpecialPage;
@ -10,61 +11,60 @@ class SpecialAIToolbox extends SpecialPage {
public function execute($subPage) { public function execute($subPage) {
$this->setHeaders(); $this->setHeaders();
$this->outputHeader(); $this->outputHeader();
$this->showForm(); $this->showForm();
} }
protected function showForm() { protected function showForm() {
$user = $this->getUser();
$out = $this->getOutput(); $out = $this->getOutput();
$out->setPageTitle($this->msg('special-isekai-ai-toolbox')); $out->setPageTitle($this->msg('special-isekai-ai-toolbox'));
$out->addModuleStyles([ $out->addModuleStyles([
'mediawiki.special', 'mediawiki.special',
'mediawiki.interface.helpers.styles', 'mediawiki.interface.helpers.styles',
]); ]);
$out->addModules([ $out->addModules([
'mediawiki.misc-authed-ooui', 'mediawiki.misc-authed-ooui',
'ext.isekai.ai-toolbox.launcher', 'ext.isekai.ai-toolbox.launcher',
]); ]);
$out->enableOOUI(); $out->enableOOUI();
$fields = []; $fields = [];
$fields[] = new \OOUI\FieldLayout( $fields[] = new \OOUI\FieldLayout(
new \OOUI\LabelWidget([ new \OOUI\LabelWidget([
'label' => $this->msg('isekai-ai-toolbox-label-continue-curaccount')->text(), 'label' => $this->msg('isekai-ai-toolbox-label-continue-curaccount')->text(),
'align' => 'top', 'align' => 'top',
]) ])
); );
$fields[] = new \OOUI\FieldLayout( $fields[] = new \OOUI\FieldLayout(
new \OOUI\ButtonWidget( [ new \OOUI\ButtonWidget([
'id' => 'btn-enter-ai-toolbox', 'id' => 'btn-enter-ai-toolbox',
'label' => $this->msg('ok')->text(), 'label' => $this->msg('ok')->text(),
'flags' => ['primary', 'progressive'], 'flags' => ['primary', 'progressive'],
'type' => 'button', 'type' => 'button',
]), ]),
[ [
'align' => 'top', 'align' => 'top',
] ]
); );
$fieldset = new \OOUI\FieldsetLayout( [ $fieldset = new \OOUI\FieldsetLayout([
'label' => $this->msg('isekai-ai-toolbox-enter-toolbox')->text(), 'label' => $this->msg('isekai-ai-toolbox-enter-toolbox')->text(),
'id' => 'mw-aitoolbox-table', 'id' => 'mw-aitoolbox-table',
'items' => $fields, 'items' => $fields,
] ); ]);
$out->addHTML( $out->addHTML(
new \OOUI\PanelLayout([ new \OOUI\PanelLayout([
'classes' => ['movepage-wrapper', 'aitoolbox-wrapper'], 'classes' => ['movepage-wrapper', 'aitoolbox-wrapper'],
'expanded' => false, 'expanded' => false,
'padded' => true, 'padded' => true,
'framed' => true, 'framed' => true,
'content' => $fieldset, 'content' => $fieldset,
]) ])
); );
} }
} }
Loading…
Cancel
Save