From e3880a1c86acaa3bbd05786ad2f5c586e6511a58 Mon Sep 17 00:00:00 2001 From: Yaco Date: Tue, 19 Oct 2021 20:24:11 -0300 Subject: updates Maps to 7.13.0 --- .../Maps/src/Presentation/OutputFacade.php | 62 ++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 www/wiki/extensions/Maps/src/Presentation/OutputFacade.php (limited to 'www/wiki/extensions/Maps/src/Presentation/OutputFacade.php') diff --git a/www/wiki/extensions/Maps/src/Presentation/OutputFacade.php b/www/wiki/extensions/Maps/src/Presentation/OutputFacade.php new file mode 100644 index 00000000..119f3b1d --- /dev/null +++ b/www/wiki/extensions/Maps/src/Presentation/OutputFacade.php @@ -0,0 +1,62 @@ +outputPage = $outputPage; + return $instance; + } + + public static function newFromParserOutput( ParserOutput $parserOutput ) { + $instance = new self(); + $instance->parserOutput = $parserOutput; + return $instance; + } + + public function addHtml( string $html ) { + if ( $this->outputPage !== null ) { + $this->outputPage->addHTML( $html ); + } + + if ( $this->parserOutput !== null ) { + $this->parserOutput->setText( $this->parserOutput->getRawText() . $html ); + } + } + + public function addModules( string ...$modules ) { + if ( $this->outputPage !== null ) { + $this->outputPage->addModules( $modules ); + } + + if ( $this->parserOutput !== null ) { + $this->parserOutput->addModules( $modules ); + } + } + + public function addHeadItem( string $name, string $html ) { + if ( $this->outputPage !== null ) { + $this->outputPage->addHeadItem( $name, $html ); + } + + if ( $this->parserOutput !== null ) { + $this->parserOutput->addHeadItem( $html, $name ); + } + } + +} -- cgit v1.2.1