r24735 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24734‎ | r24735 | r24736 >
Date:17:18, 11 August 2007
Author:robchurch
Status:old
Tags:
Comment:
Treat slave lag warning messages as wiki text and update OutputPage::showLagWarning() documentation
Modified paths:
  • /trunk/phase3/includes/OutputPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/OutputPage.php
@@ -1283,7 +1283,7 @@
12841284 /**
12851285 * Show an "add new section" link?
12861286 *
1287 - * @return bool True if the parser output instructs us to add one
 1287+ * @return bool
12881288 */
12891289 public function showNewSectionLink() {
12901290 return $this->mNewSectionLink;
@@ -1292,22 +1292,21 @@
12931293 /**
12941294 * Show a warning about slave lag
12951295 *
1296 - * If the lag is higher than 30 seconds, then the warning is
1297 - * a bit more obvious
 1296+ * If the lag is higher than $wgSlaveLagCritical seconds,
 1297+ * then the warning is a bit more obvious. If the lag is
 1298+ * lower than $wgSlaveLagWarning, then no warning is shown.
12981299 *
12991300 * @param int $lag Slave lag
13001301 */
13011302 public function showLagWarning( $lag ) {
13021303 global $wgSlaveLagWarning, $wgSlaveLagCritical;
1303 -
1304 - if ($lag < $wgSlaveLagWarning)
1305 - return;
1306 -
1307 - $message = ($lag >= $wgSlaveLagCritical) ? 'lag-warn-high' : 'lag-warn-normal';
1308 - $warning = wfMsgHtml( $message, htmlspecialchars( $lag ) );
1309 - $this->addHtml( "<div class=\"mw-{$message}\">\n{$warning}\n</div>\n" );
 1304+ if( $lag >= $wgSlaveLagWarning ) {
 1305+ $message = $lag < $wgSlaveLagCritical
 1306+ ? 'lag-warn-normal'
 1307+ : 'lag-warn-high';
 1308+ $warning = wfMsgExt( $message, 'parse', $lag );
 1309+ $this->addHtml( "<div class=\"mw-{$message}\">\n{$warning}\n</div>\n" );
 1310+ }
13101311 }
13111312
1312 -}
1313 -
1314 -
 1313+}
\ No newline at end of file

Follow-up revisions

RevisionCommit summaryAuthorDate
r24755Merged revisions 24694-24754 via svnmerge from...david19:48, 13 August 2007

Status & tagging log