r89661 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89660‎ | r89661 | r89662 >
Date:17:33, 7 June 2011
Author:foxtrott
Status:deferred
Tags:
Comment:
small fixes (css, file path, message log)
Modified paths:
  • /trunk/extensions/Lingo/LingoElement.php (modified) (history)
  • /trunk/extensions/Lingo/LingoMessageLog.php (modified) (history)
  • /trunk/extensions/Lingo/skins/Lingo.css (modified) (history)

Diff [purge]

Index: trunk/extensions/Lingo/LingoMessageLog.php
@@ -22,26 +22,26 @@
2323 class LingoMessageLog {
2424
2525 private $mMessages = array();
26 - private $parser = null;
 26+ private $mParser = null;
2727
2828 const MESSAGE_ERROR = 1;
2929 const MESSAGE_WARNING = 2;
3030 const MESSAGE_NOTICE = 3;
3131
3232 function addMessage( $message, $severity = self::MESSAGE_NOTICE ) {
33 - $this->mMessages[] = array( $message, $severity );
 33+ $this->mMessages[] = array($message, $severity);
3434 }
3535
3636 function addError( $message ) {
37 - $this->mMessages[] = array( $message, self::MESSAGE_ERROR );
 37+ $this->mMessages[] = array($message, self::MESSAGE_ERROR);
3838 }
3939
4040 function addWarning( $message ) {
41 - $this->mMessages[] = array( $message, self::MESSAGE_WARNING );
 41+ $this->mMessages[] = array($message, self::MESSAGE_WARNING);
4242 }
4343
4444 function addNotice( $message ) {
45 - $this->mMessages[] = array( $message, self::MESSAGE_NOTICE );
 45+ $this->mMessages[] = array($message, self::MESSAGE_NOTICE);
4646 }
4747
4848 function getMessagesFormatted( $severity = self::MESSAGE_WARNING, $header = null ) {
@@ -49,10 +49,6 @@
5050
5151 $ret = '';
5252
53 - if ( $header == null ) {
54 - $header = wfMsg( 'semanticglossary-messageheader' );
55 - }
56 -
5753 foreach ( $this->mMessages as $message ) {
5854 if ( $message[1] <= $severity ) {
5955 $ret .= '* ' . $message[0] . "\n";
@@ -60,12 +56,18 @@
6157 }
6258
6359 if ( $ret != '' ) {
64 - if ( !$this->parser ) {
 60+ if ( !$this->mParser ) {
6561 $parser = new Parser();
6662 }
6763
68 - $ret = Html::rawElement( 'div', array( 'class' => 'messages' ),
69 - Html::rawElement( 'div', array( 'class' => 'heading' ), $header ) .
 64+ if ( $header == null ) {
 65+ $header = '';
 66+ } elseif ( $header != '' ) {
 67+ $header = Html::rawElement( 'div', array('class' => 'heading'), $header );
 68+ }
 69+
 70+ $ret = Html::rawElement( 'div', array('class' => 'messages'),
 71+ $header .
7072 $parser->parse( $ret, $wgTitle, ParserOptions::newFromUser( $wgUser ) )->getText()
7173 );
7274 }
Index: trunk/extensions/Lingo/skins/Lingo.css
@@ -23,7 +23,7 @@
2424 width: 23em;
2525
2626 font-weight: normal;
27 - font-size: medium;
 27+ font-size: small;
2828 line-height: 1.2em;
2929
3030 z-index: 2;
Index: trunk/extensions/Lingo/LingoElement.php
@@ -119,7 +119,7 @@
120120 global $wgScriptPath;
121121
122122 $linkimage = $doc->createElement( 'img' );
123 - $linkimage->setAttribute( 'src', $wgScriptPath . '/extensions/SemanticLingo/skins/linkicon.png' );
 123+ $linkimage->setAttribute( 'src', $wgScriptPath . '/extensions/Lingo/skins/linkicon.png' );
124124
125125 self::$mLinkTemplate = $doc->createElement( 'a' );
126126 self::$mLinkTemplate->appendChild( $linkimage );

Status & tagging log