diff options
Diffstat (limited to 'extensions/Cite/Cite_body.php')
-rw-r--r-- | extensions/Cite/Cite_body.php | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/extensions/Cite/Cite_body.php b/extensions/Cite/Cite_body.php index 488bacbb..08c60722 100644 --- a/extensions/Cite/Cite_body.php +++ b/extensions/Cite/Cite_body.php @@ -155,6 +155,7 @@ class Cite { * @return string */ function ref( $str, $argv, $parser ) { + global $wgCiteEnablePopups; if ( $this->mInCite ) { return htmlspecialchars( "<ref>$str</ref>" ); } else { @@ -162,6 +163,12 @@ class Cite { $this->mInCite = true; $ret = $this->guardedRef( $str, $argv, $parser ); $this->mInCite = false; + $parserOutput = $parser->getOutput(); + $parserOutput->addModules( 'ext.cite' ); + if ( $wgCiteEnablePopups ) { + $parserOutput->addModules( 'ext.cite.popups' ); + } + $parserOutput->addModuleStyles( 'ext.rtlcite' ); return $ret; } } @@ -289,7 +296,7 @@ class Cite { # Not clear how we could get here, but something is probably # wrong with the types. Let's fail fast. - $this->croak( 'cite_error_key_str_invalid', serialize( "$str; $key" ) ); + throw new MWException( 'Invalid $str and/or $key: ' . serialize( array( $str, $key ) ) ); } /** @@ -443,7 +450,7 @@ class Cite { ); } } else { - $this->croak( 'cite_error_stack_invalid_input', serialize( array( $key, $str ) ) ); + throw new MWException( 'Invalid stack key: ' . serialize( $key ) ); } } @@ -1172,8 +1179,8 @@ class Cite { # We rely on the fact that PHP is okay with passing unused argu- # ments to functions. If $1 is not used in the message, wfMessage will # just ignore the extra parameter. - $ret = '<strong class="error">' . - wfMessage( 'cite_error', wfMessage( $key, $param )->plain() )->plain() . + $ret = '<strong class="error mw-ext-cite-error">' . + wfMessage( 'cite_error', wfMessage( $key, $param )->inContentLanguage()->plain() )->inContentLanguage()->plain() . '</strong>'; if ( $parse == 'parse' ) { $ret = $this->parse( $ret ); @@ -1181,17 +1188,5 @@ class Cite { return $ret; } - /** - * Die with a backtrace if something happens in the code which - * shouldn't have - * - * @param int $error ID for the error - * @param string $data Serialized error data - */ - function croak( $error, $data ) { - wfDebugDieBacktrace( wfMessage( 'cite_croak', $this->error( $error ), $data ) - ->inContentLanguage()->text() ); - } - /**#@-*/ } |