|
|
|
@ -1,8 +1,9 @@
|
|
|
|
|
<?php
|
|
|
|
|
namespace Isekai\Widgets;
|
|
|
|
|
|
|
|
|
|
use Html;
|
|
|
|
|
use MediaWiki\MediaWikiServices;
|
|
|
|
|
use MediaWiki\Parser\Parser;
|
|
|
|
|
use MediaWiki\Html\Html;
|
|
|
|
|
use PPFrame;
|
|
|
|
|
|
|
|
|
|
class InformationWidget {
|
|
|
|
|
public static function parseContent($content, $dataMap, $title) {
|
|
|
|
@ -86,7 +87,7 @@ class InformationWidget {
|
|
|
|
|
return $finalData;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static function buildText(\Parser $parser, \PPFrame $frame, array $dataMap, $title, $picture, $float) {
|
|
|
|
|
public static function buildText(Parser $parser, PPFrame $frame, array $dataMap, $title, $picture, $float) {
|
|
|
|
|
global $wgIsekaiWidgetInformationTextSeparator;
|
|
|
|
|
$sep = $wgIsekaiWidgetInformationTextSeparator;
|
|
|
|
|
|
|
|
|
@ -102,7 +103,7 @@ class InformationWidget {
|
|
|
|
|
return [$html, 'markerType' => 'nowiki'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static function buildInfoBox(\Parser $parser, \PPFrame $frame, array $dataMap, $title, $picture, $float) {
|
|
|
|
|
public static function buildInfoBox(Parser $parser, PPFrame $frame, array $dataMap, $title, $picture, $float) {
|
|
|
|
|
$parser->getOutput()->addModules(['ext.isekai.information.infobox']);
|
|
|
|
|
|
|
|
|
|
$tableClasses = ['wikitable-container', 'infobox'];
|
|
|
|
@ -155,11 +156,11 @@ class InformationWidget {
|
|
|
|
|
/**
|
|
|
|
|
* @param string $content
|
|
|
|
|
* @param array $args
|
|
|
|
|
* @param \Parser $parser
|
|
|
|
|
* @param \PPFrame $frame
|
|
|
|
|
* @param Parser $parser
|
|
|
|
|
* @param PPFrame $frame
|
|
|
|
|
* @return array|string
|
|
|
|
|
*/
|
|
|
|
|
public static function create(string $content, array $args, \Parser $parser, \PPFrame $frame) {
|
|
|
|
|
public static function create(string $content, array $args, Parser $parser, PPFrame $frame) {
|
|
|
|
|
$configKeys = ['type', 'float', 'title_key', 'picture'];
|
|
|
|
|
$configArgs = [];
|
|
|
|
|
$infoArgs = [];
|
|
|
|
|