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