mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TemplateData
synced 2024-11-24 07:53:37 +00:00
Merge "Only enable OOUI if it will be used"
This commit is contained in:
commit
f12ac68e50
|
@ -127,18 +127,18 @@ class TemplateDataHooks {
|
|||
* @return string: HTML to insert in the page.
|
||||
*/
|
||||
public static function render( $input, $args, $parser, $frame ) {
|
||||
$parser->enableOOUI();
|
||||
$ti = TemplateDataBlob::newFromJSON( $input );
|
||||
|
||||
$status = $ti->getStatus();
|
||||
if ( !$status->isOK() ) {
|
||||
$parser->getOutput()->ext_templatedata_status = $status;
|
||||
return '<div class="errorbox">' . $status->getHtml() . '</div>';
|
||||
return '<div class="errorbox">' . $status->getHTML() . '</div>';
|
||||
}
|
||||
|
||||
$parser->getOutput()->setProperty( 'templatedata', $ti->getJSONForDatabase() );
|
||||
|
||||
$parser->getOutput()->addModuleStyles( 'ext.templateData' );
|
||||
$parser->enableOOUI();
|
||||
|
||||
return $ti->getHtml( $parser->getOptions()->getUserLangObj() );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue