From: Rob Church Date: Sat, 11 Aug 2007 17:18:20 +0000 (+0000) Subject: Treat slave lag warning messages as wiki text and update OutputPage::showLagWarning... X-Git-Tag: 1.31.0-rc.0~51793 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=90942e1269d47e3467b4992627db4f691dd0943e;p=lhc%2Fweb%2Fwiklou.git Treat slave lag warning messages as wiki text and update OutputPage::showLagWarning() documentation --- diff --git a/includes/OutputPage.php b/includes/OutputPage.php index efa0092350..20ca4402bd 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -1283,7 +1283,7 @@ class OutputPage { /** * Show an "add new section" link? * - * @return bool True if the parser output instructs us to add one + * @return bool */ public function showNewSectionLink() { return $this->mNewSectionLink; @@ -1292,22 +1292,21 @@ class OutputPage { /** * Show a warning about slave lag * - * If the lag is higher than 30 seconds, then the warning is - * a bit more obvious + * If the lag is higher than $wgSlaveLagCritical seconds, + * then the warning is a bit more obvious. If the lag is + * lower than $wgSlaveLagWarning, then no warning is shown. * * @param int $lag Slave lag */ public function showLagWarning( $lag ) { global $wgSlaveLagWarning, $wgSlaveLagCritical; - - if ($lag < $wgSlaveLagWarning) - return; - - $message = ($lag >= $wgSlaveLagCritical) ? 'lag-warn-high' : 'lag-warn-normal'; - $warning = wfMsgHtml( $message, htmlspecialchars( $lag ) ); - $this->addHtml( "
\n{$warning}\n
\n" ); + if( $lag >= $wgSlaveLagWarning ) { + $message = $lag < $wgSlaveLagCritical + ? 'lag-warn-normal' + : 'lag-warn-high'; + $warning = wfMsgExt( $message, 'parse', $lag ); + $this->addHtml( "
\n{$warning}\n
\n" ); + } } -} - - +} \ No newline at end of file