2021-12-17 18:00:14 +00:00
|
|
|
<?php
|
|
|
|
|
2022-03-11 20:35:51 +00:00
|
|
|
use OOUI\ProgressBarWidget;
|
|
|
|
|
2021-12-17 18:00:14 +00:00
|
|
|
class SpecialPortableInfoboxBuilder extends SpecialPage {
|
|
|
|
public function __construct() {
|
2021-12-19 18:01:48 +00:00
|
|
|
$restriction = $this->getConfig()->get( 'NamespaceProtection' )[NS_TEMPLATE][0] ?? '';
|
2021-12-19 02:59:14 +00:00
|
|
|
parent::__construct( 'PortableInfoboxBuilder', $restriction );
|
2021-12-17 18:00:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function execute( $par ) {
|
|
|
|
$out = $this->getOutput();
|
|
|
|
|
|
|
|
$this->setHeaders();
|
|
|
|
$out->enableOOUI();
|
|
|
|
|
2021-12-30 22:50:10 +00:00
|
|
|
$this->checkPermissions();
|
|
|
|
|
2021-12-17 18:00:14 +00:00
|
|
|
$out->addModules( [ 'ext.PortableInfobox.styles', 'ext.PortableInfoboxBuilder' ] );
|
|
|
|
$out->addHTML(
|
|
|
|
'<div id="mw-infoboxbuilder" data-title="' . str_replace( '"', '"', $par ) . '">' .
|
2022-03-11 20:35:51 +00:00
|
|
|
new ProgressBarWidget( [ 'progress' => false ] ) .
|
2021-12-17 18:00:14 +00:00
|
|
|
'</div>'
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|