PortableInfobox/includes/specials/SpecialPortableInfoboxBuilder.php

27 lines
698 B
PHP
Raw Normal View History

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] ?? '';
parent::__construct( 'PortableInfoboxBuilder', $restriction );
2021-12-17 18:00:14 +00:00
}
public function execute( $par ) {
$out = $this->getOutput();
$this->setHeaders();
$out->enableOOUI();
$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( '"', '&quot;', $par ) . '">' .
2022-03-11 20:35:51 +00:00
new ProgressBarWidget( [ 'progress' => false ] ) .
2021-12-17 18:00:14 +00:00
'</div>'
);
}
}