r89231 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89230‎ | r89231 | r89232 >
Date:22:00, 31 May 2011
Author:foxtrott
Status:deferred (Comments)
Tags:
Comment:
followup r89188: markup style improved, generation of term/definition html moved completely into Element, code formatting
Modified paths:
  • /trunk/extensions/SemanticGlossary/SemanticGlossary.php (modified) (history)
  • /trunk/extensions/SemanticGlossary/SemanticGlossaryBackend.php (modified) (history)
  • /trunk/extensions/SemanticGlossary/SemanticGlossaryElement.php (modified) (history)
  • /trunk/extensions/SemanticGlossary/SemanticGlossaryParser.php (modified) (history)
  • /trunk/extensions/SemanticGlossary/SemanticGlossaryTree.php (modified) (history)
  • /trunk/extensions/SemanticGlossary/SpecialSemanticGlossaryBrowser.php (modified) (history)
  • /trunk/extensions/SemanticGlossary/skins/SemanticGlossary.css (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticGlossary/SpecialSemanticGlossaryBrowser.php
@@ -461,7 +461,7 @@
462462 /**
463463 * Checks if the user wants to perform an action, has the necessary right
464464 * and submitted a valid edit token.
465 - *
 465+ *
466466 * @return Boolean
467467 */
468468 private function isActionAllowed() {
Index: trunk/extensions/SemanticGlossary/SemanticGlossaryBackend.php
@@ -2,7 +2,7 @@
33
44 /**
55 * File holding the SemanticGlossaryBackend class
6 - *
 6+ *
77 * @author Stephan Gambke
88 * @file
99 * @ingroup SemanticGlossary
Index: trunk/extensions/SemanticGlossary/SemanticGlossaryElement.php
@@ -26,9 +26,13 @@
2727
2828 private $mFullDefinition = null;
2929 private $mDefinitions = array();
 30+ private $mTerm = null;
3031 static private $mLinkTemplate = null;
3132
32 - public function __construct( &$definition = null ) {
 33+ public function __construct( &$term, &$definition = null ) {
 34+
 35+ $this->mTerm = $term;
 36+
3337 if ( $definition ) {
3438 $this->addDefinition( $definition );
3539 }
@@ -41,8 +45,22 @@
4246 public function getFullDefinition( DOMDocument &$doc ) {
4347 // only create if not yet created
4448 if ( $this->mFullDefinition == null || $this->mFullDefinition->ownerDocument !== $doc ) {
45 - $this->mFullDefinition = $doc->createElement( 'span' );
4649
 50+ // Wrap term and definition in <span> tags
 51+ $span = $doc->createElement( 'span' );
 52+ $span->setAttribute( 'class', 'tooltip' );
 53+
 54+ // Wrap term in <span> tag, hidden
 55+ $spanTerm = $doc->createElement( 'span', $this->mTerm );
 56+ $spanTerm->setAttribute( 'class', 'tooltip_abbr' );
 57+
 58+ // Wrap definition in two <span> tags
 59+ $spanDefinitionOuter = $doc->createElement( 'span' );
 60+ $spanDefinitionOuter->setAttribute( 'class', 'tooltip_tipwrapper' );
 61+
 62+ $spanDefinitionInner = $doc->createElement( 'span' );
 63+ $spanDefinitionInner->setAttribute( 'class', 'tooltip_tip' );
 64+
4765 foreach ( $this->mDefinitions as $definition ) {
4866 $element = $doc->createElement( 'span', htmlentities( $definition[self::SG_DEFINITION], ENT_COMPAT, 'UTF-8' ) . ' ' );
4967 if ( $definition[self::SG_LINK] ) {
@@ -53,8 +71,16 @@
5472 $element->appendChild( $link );
5573 }
5674 }
57 - $this->mFullDefinition->appendChild( $element );
 75+ $spanDefinitionInner->appendChild( $element );
5876 }
 77+
 78+ // insert term and definition
 79+ $span->appendChild( $spanTerm );
 80+ $span->appendChild( $spanDefinitionOuter );
 81+ $spanDefinitionOuter->appendChild( $spanDefinitionInner );
 82+
 83+ $this->mFullDefinition = $span;
 84+
5985 }
6086
6187 return $this->mFullDefinition->cloneNode( true );
Index: trunk/extensions/SemanticGlossary/skins/SemanticGlossary.css
@@ -4,7 +4,7 @@
55
66 .tooltip {
77 display: inline;
8 - position: static;
 8+ position: relative;
99 cursor: help;
1010 }
1111
@@ -12,28 +12,44 @@
1313 border-bottom: 1px dotted #bbf;
1414 }
1515
16 -.tooltip_tip {
 16+.tooltip_tipwrapper {
1717 display: none;
1818
19 - border: 1px solid gray;
20 - background-color: white;
21 - padding: 0.1em 0.2em 0.1em 0.1em;
 19+ position: absolute;
 20+ top: 0;
 21+ left: 0;
 22+
 23+ padding: 1.5em 0 0 2em;
 24+ width: 20em;
 25+
 26+ z-index: 2;
 27+}
 28+
 29+.tooltip_tip {
 30+ display: block;
 31+
 32+ position: relative;
 33+ top: 0em;
 34+ left: 0em;
 35+
 36+ background-color: #F9F9F9;
 37+ padding: 0.5em;
2238 margin: 0;
2339 line-height: 1.2em;
2440
25 - position: absolute;
26 - top: 1.1em;
27 - left: 1em;
 41+ border: 1px solid #aaa;
 42+
 43+ -moz-border-radius: 5px;
 44+ border-radius: 5px;
 45+
 46+ -webkit-box-shadow: 3px 3px 3px #888;
 47+ box-shadow: 3px 3px 3px #888;
2848 }
2949
3050 .tooltip_tip span {
3151 display: block;
3252 }
3353
34 -.tooltip:hover {
35 - position: relative;
36 -}
37 -
38 -.tooltip:hover .tooltip_tip {
 54+.tooltip:hover .tooltip_tipwrapper {
3955 display: block;
4056 }
Index: trunk/extensions/SemanticGlossary/SemanticGlossaryParser.php
@@ -17,7 +17,7 @@
1818 * terms.
1919 *
2020 * Contains a static function to initiate the parsing.
21 - *
 21+ *
2222 * @ingroup SemanticGlossary
2323 */
2424 class SemanticGlossaryParser {
@@ -32,21 +32,21 @@
3333 * @param $text
3434 * @return Boolean
3535 */
36 - static function parse ( &$parser, &$text ) {
 36+ static function parse( &$parser, &$text ) {
3737 wfProfileIn( __METHOD__ );
3838
3939 if ( !self::$parserSingleton ) {
4040 self::$parserSingleton = new SemanticGlossaryParser();
4141 }
4242
43 - self::$parserSingleton -> realParse( $parser, $text );
 43+ self::$parserSingleton->realParse( $parser, $text );
4444
4545 wfProfileOut( __METHOD__ );
4646
4747 return true;
4848 }
4949
50 - function getBackend () {
 50+ function getBackend() {
5151 return new SemanticGlossaryBackend();
5252 }
5353
@@ -55,17 +55,17 @@
5656 *
5757 * @return Array an array mapping terms (keys) to descriptions (values)
5858 */
59 - function getGlossaryArray ( SemanticGlossaryMessageLog &$messages = null ) {
 59+ function getGlossaryArray( SemanticGlossaryMessageLog &$messages = null ) {
6060 wfProfileIn( __METHOD__ );
6161
6262 // build glossary array only once per request
63 - if ( !$this -> mGlossaryArray ) {
64 - $this -> buildGlossary( $messages );
 63+ if ( !$this->mGlossaryArray ) {
 64+ $this->buildGlossary( $messages );
6565 }
6666
6767 wfProfileOut( __METHOD__ );
6868
69 - return $this -> mGlossaryArray;
 69+ return $this->mGlossaryArray;
7070 }
7171
7272 /**
@@ -73,44 +73,44 @@
7474 *
7575 * @return Array an array mapping terms (keys) to descriptions (values)
7676 */
77 - function getGlossaryTree ( SemanticGlossaryMessageLog &$messages = null ) {
 77+ function getGlossaryTree( SemanticGlossaryMessageLog &$messages = null ) {
7878 wfProfileIn( __METHOD__ );
7979
8080 // build glossary array only once per request
81 - if ( !$this -> mGlossaryTree ) {
82 - $this -> buildGlossary( $messages );
 81+ if ( !$this->mGlossaryTree ) {
 82+ $this->buildGlossary( $messages );
8383 }
8484
8585 wfProfileOut( __METHOD__ );
8686
87 - return $this -> mGlossaryTree;
 87+ return $this->mGlossaryTree;
8888 }
8989
90 - protected function buildGlossary ( SemanticGlossaryMessageLog &$messages = null ) {
 90+ protected function buildGlossary( SemanticGlossaryMessageLog &$messages = null ) {
9191 wfProfileIn( __METHOD__ );
9292
93 - $this -> mGlossaryTree = new SemanticGlossaryTree();
 93+ $this->mGlossaryTree = new SemanticGlossaryTree();
9494
95 - $backend = $this -> getBackEnd();
 95+ $backend = $this->getBackEnd();
9696
9797 // assemble the result array
98 - $this -> mGlossaryArray = array( );
99 - while ( $backend -> next() ) {
 98+ $this->mGlossaryArray = array();
 99+ while ( $backend->next() ) {
100100
101101 $elementData = array(
102 - SemanticGlossaryElement::SG_TERM => ($term = $backend -> getTerm()),
103 - SemanticGlossaryElement::SG_DEFINITION => $backend -> getDefinition(),
104 - SemanticGlossaryElement::SG_LINK => $backend -> getLink(),
105 - SemanticGlossaryElement::SG_SOURCE => $backend -> getSource()
 102+ SemanticGlossaryElement::SG_TERM => ( $term = $backend->getTerm() ),
 103+ SemanticGlossaryElement::SG_DEFINITION => $backend->getDefinition(),
 104+ SemanticGlossaryElement::SG_LINK => $backend->getLink(),
 105+ SemanticGlossaryElement::SG_SOURCE => $backend->getSource()
106106 );
107107
108 - if ( array_key_exists( $term, $this -> mGlossaryArray ) ) {
109 - $this -> mGlossaryArray[ $term ] -> addDefinition( $elementData );
 108+ if ( array_key_exists( $term, $this->mGlossaryArray ) ) {
 109+ $this->mGlossaryArray[$term]->addDefinition( $elementData );
110110 } else {
111 - $this -> mGlossaryArray[ $term ] = new SemanticGlossaryElement( $elementData );
 111+ $this->mGlossaryArray[$term] = new SemanticGlossaryElement( $term, $elementData );
112112 }
113113
114 - $this -> mGlossaryTree -> addTerm( $term, $elementData );
 114+ $this->mGlossaryTree->addTerm( $term, $elementData );
115115 }
116116
117117 wfProfileOut( __METHOD__ );
@@ -125,18 +125,18 @@
126126 * @param $text
127127 * @return Boolean
128128 */
129 - protected function realParse ( &$parser, &$text ) {
 129+ protected function realParse( &$parser, &$text ) {
130130 global $wgRequest;
131131
132132 wfProfileIn( __METHOD__ );
133133
134 - $action = $wgRequest -> getVal( 'action', 'view' );
 134+ $action = $wgRequest->getVal( 'action', 'view' );
135135
136136 if ( $text == null ||
137137 $text == '' ||
138138 $action == 'edit' ||
139139 $action == 'ajax' ||
140 - isset( $_POST[ 'wpPreview' ] )
 140+ isset( $_POST['wpPreview'] )
141141 ) {
142142
143143 wfProfileOut( __METHOD__ );
@@ -144,7 +144,7 @@
145145 }
146146
147147 // Get array of terms
148 - $glossary = $this -> getGlossaryTree();
 148+ $glossary = $this->getGlossaryTree();
149149
150150 if ( $glossary == null ) {
151151 wfProfileOut( __METHOD__ );
@@ -166,84 +166,63 @@
167167 wfProfileIn( __METHOD__ . ' 2 xpath' );
168168 // Find all text in HTML.
169169 $xpath = new DOMXpath( $doc );
170 - $elements = $xpath -> query(
 170+ $elements = $xpath->query(
171171 "//*[not(ancestor-or-self::*[@class='noglossary'] or ancestor-or-self::a)][text()!=' ']/text()"
172172 );
173173 wfProfileOut( __METHOD__ . ' 2 xpath' );
174174
175175 // Iterate all HTML text matches
176 - $nb = $elements -> length;
 176+ $nb = $elements->length;
177177 $changedDoc = false;
178178
179179 for ( $pos = 0; $pos < $nb; $pos++ ) {
180 - $el = $elements -> item( $pos );
 180+ $el = $elements->item( $pos );
181181
182 - if ( strlen( $el -> nodeValue ) < $glossary -> getMinTermLength() ) {
 182+ if ( strlen( $el->nodeValue ) < $glossary->getMinTermLength() ) {
183183 continue;
184184 }
185185
186186 wfProfileIn( __METHOD__ . ' 3 lexer' );
187 - $matches = array( );
 187+ $matches = array();
188188 preg_match_all(
189189 '/[[:alpha:]]+|[^[:alpha:]]/u',
190 - $el -> nodeValue,
 190+ $el->nodeValue,
191191 $matches,
192192 PREG_OFFSET_CAPTURE | PREG_PATTERN_ORDER
193193 );
194194 wfProfileOut( __METHOD__ . ' 3 lexer' );
195195
196 - if ( count( $matches ) == 0 || count( $matches[ 0 ] ) == 0 ) {
 196+ if ( count( $matches ) == 0 || count( $matches[0] ) == 0 ) {
197197 continue;
198198 }
199199
200 - $lexemes = &$matches[ 0 ];
 200+ $lexemes = &$matches[0];
201201 $countLexemes = count( $lexemes );
202 - $parent = &$el -> parentNode;
 202+ $parent = &$el->parentNode;
203203 $index = 0;
204204 $changedElem = false;
205205
206206 while ( $index < $countLexemes ) {
207207 wfProfileIn( __METHOD__ . ' 4 findNextTerm' );
208 - list( $skipped, $used, $definition ) = $glossary -> findNextTerm( $lexemes, $index, $countLexemes );
 208+ list( $skipped, $used, $definition ) =
 209+ $glossary->findNextTerm( $lexemes, $index, $countLexemes );
209210 wfProfileOut( __METHOD__ . ' 4 findNextTerm' );
210211
211212 wfProfileIn( __METHOD__ . ' 5 insert' );
212213 if ( $used > 0 ) { // found a term
213214 if ( $skipped > 0 ) { // skipped some text, insert it as is
214 - $parent -> insertBefore(
215 - $doc -> createTextNode(
216 - substr( $el -> nodeValue,
217 - $currLexIndex = $lexemes[ $index ][ 1 ],
218 - $lexemes[ $index + $skipped ][ 1 ] - $currLexIndex )
 215+ $parent->insertBefore(
 216+ $doc->createTextNode(
 217+ substr( $el->nodeValue,
 218+ $currLexIndex = $lexemes[$index][1],
 219+ $lexemes[$index + $skipped][1] - $currLexIndex )
219220 ),
220221 $el
221222 );
222223 }
223224
224 - $index += $skipped;
 225+ $parent->insertBefore( $definition->getFullDefinition( $doc ), $el );
225226
226 - // Wrap abbreviation in <span> tags
227 - $span = $doc -> createElement( 'span' );
228 - $span -> setAttribute( 'class', 'tooltip' );
229 -
230 - // Wrap abbreviation in <span> tags, hidden
231 - $lastLex = $lexemes[ $index + $used - 1 ];
232 - $spanTerm = $doc -> createElement( 'span',
233 - substr( $el -> nodeValue,
234 - $currLexIndex = $lexemes[ $index ][ 1 ],
235 - $lastLex[ 1 ] - $currLexIndex + strlen( $lastLex[ 0 ] ) )
236 - );
237 - $spanTerm -> setAttribute( 'class', 'tooltip_abbr' );
238 -
239 - // Wrap definition in <span> tags, hidden
240 - $spanDefinition = $definition -> getFullDefinition( $doc );
241 - $spanDefinition -> setAttribute( 'class', 'tooltip_tip' );
242 -
243 - // insert term and definition
244 - $span -> appendChild( $spanTerm );
245 - $span -> appendChild( $spanDefinition );
246 - $parent -> insertBefore( $span, $el );
247 -
248227 $changedElem = true;
249228 } else { // did not find term, just use the rest of the text
250229 // If we found no term now and no term before, there was no
@@ -251,9 +230,9 @@
252231 // element at all.
253232 // Only change element if found term before
254233 if ( $changedElem ) {
255 - $parent -> insertBefore(
256 - $doc -> createTextNode(
257 - substr( $el -> nodeValue, $lexemes[ $index ][ 1 ] )
 234+ $parent->insertBefore(
 235+ $doc->createTextNode(
 236+ substr( $el->nodeValue, $lexemes[$index][1] )
258237 ),
259238 $el
260239 );
@@ -263,30 +242,27 @@
264243 // anyway. Might save a bit of time.
265244 break;
266245 }
267 -
268 - $index += $skipped;
269246 }
270247 wfProfileOut( __METHOD__ . ' 5 insert' );
271248
272 -
273 - $index += $used;
 249+ $index += $used + $skipped;
274250 }
275251
276252 if ( $changedElem ) {
277 - $parent -> removeChild( $el );
 253+ $parent->removeChild( $el );
278254 $changedDoc = true;
279255 }
280256 }
281257
282258 if ( $changedDoc ) {
283 - $body = $xpath -> query( '/html/body' );
 259+ $body = $xpath->query( '/html/body' );
284260
285261 $text = '';
286 - foreach ( $body -> item( 0 ) -> childNodes as $child ) {
287 - $text .= $doc -> saveXML( $child );
 262+ foreach ( $body->item( 0 )->childNodes as $child ) {
 263+ $text .= $doc->saveXML( $child );
288264 }
289265
290 - $this -> loadModules( $parser );
 266+ $this->loadModules( $parser );
291267 }
292268
293269 wfProfileOut( __METHOD__ );
@@ -294,20 +270,20 @@
295271 return true;
296272 }
297273
298 - protected function loadModules ( &$parser ) {
 274+ protected function loadModules( &$parser ) {
299275 global $wgOut, $wgScriptPath;
300276
301277 if ( defined( 'MW_SUPPORTS_RESOURCE_MODULES' ) ) {
302278 if ( !is_null( $parser ) ) {
303 - $parser -> getOutput() -> addModules( 'ext.SemanticGlossary' );
 279+ $parser->getOutput()->addModules( 'ext.SemanticGlossary' );
304280 } else {
305 - $wgOut -> addModules( 'ext.SemanticGlossary' );
 281+ $wgOut->addModules( 'ext.SemanticGlossary' );
306282 }
307283 } else {
308 - if ( !is_null( $parser ) && ( $wgOut -> isArticle() ) ) {
309 - $parser -> getOutput() -> addHeadItem( '<link rel="stylesheet" href="' . $wgScriptPath . '/extensions/SemanticGlossary/skins/SemanticGlossary.css" />', 'ext.SemanticGlossary.css' );
 284+ if ( !is_null( $parser ) && ( $wgOut->isArticle() ) ) {
 285+ $parser->getOutput()->addHeadItem( '<link rel="stylesheet" href="' . $wgScriptPath . '/extensions/SemanticGlossary/skins/SemanticGlossary.css" />', 'ext.SemanticGlossary.css' );
310286 } else {
311 - $wgOut -> addHeadItem( 'ext.SemanticGlossary.css', '<link rel="stylesheet" href="' . $wgScriptPath . '/extensions/SemanticGlossary/skins/SemanticGlossary.css" />' );
 287+ $wgOut->addHeadItem( 'ext.SemanticGlossary.css', '<link rel="stylesheet" href="' . $wgScriptPath . '/extensions/SemanticGlossary/skins/SemanticGlossary.css" />' );
312288 }
313289 }
314290 }
Index: trunk/extensions/SemanticGlossary/SemanticGlossary.php
@@ -35,7 +35,7 @@
3636 $wgExtensionCredits[defined( 'SEMANTIC_EXTENSION_TYPE' ) ? 'semantic' : 'other'][] = array(
3737 'path' => __FILE__,
3838 'name' => 'Semantic Glossary',
39 - 'author' => '[[mw:User:F.trott|Stephan Gambke]]',
 39+ 'author' => '[http://www.mediawiki.org/wiki/User:F.trott|Stephan Gambke]',
4040 'url' => 'http://www.mediawiki.org/wiki/Extension:Semantic_Glossary',
4141 'descriptionmsg' => 'semanticglossary-desc',
4242 'version' => SG_VERSION,
@@ -62,7 +62,7 @@
6363 $wgSpecialPageGroups['SemanticGlossaryBrowser'] = 'other';
6464
6565 // register hook handlers
66 -//$wgHooks['ParserFirstCallInit'][] = 'SemanticGlossarySetup'; // Define a setup function
 66+// $wgHooks['ParserFirstCallInit'][] = 'SemanticGlossarySetup'; // Define a setup function
6767 $wgHooks['ParserAfterTidy'][] = 'SemanticGlossaryParser::parse';
6868
6969 $wgHooks['smwInitProperties'][] = 'SemanticGlossaryRegisterProperties';
@@ -71,16 +71,16 @@
7272 // register resource modules with the Resource Loader
7373 $wgResourceModules['ext.SemanticGlossary'] = array(
7474 // JavaScript and CSS styles. To combine multiple file, just list them as an array.
75 - //'scripts' => 'js/ext.myExtension.js',
 75+ // 'scripts' => 'js/ext.myExtension.js',
7676 'styles' => 'css/SemanticGlossary.css',
7777
7878 // When your module is loaded, these messages will be available to mediaWiki.msg()
79 - //'messages' => array( 'myextension-hello-world', 'myextension-goodbye-world' ),
 79+ // 'messages' => array( 'myextension-hello-world', 'myextension-goodbye-world' ),
8080
8181 // If your scripts need code from other modules, list their identifiers as dependencies
8282 // and ResourceLoader will make sure they're loaded before you.
8383 // You don't need to manually list 'mediawiki' or 'jquery', which are always loaded.
84 - //'dependencies' => array( 'jquery.ui.datepicker' ),
 84+ // 'dependencies' => array( 'jquery.ui.datepicker' ),
8585
8686 // ResourceLoader needs to know where your files are; specify your
8787 // subdir relative to "extensions" or $wgExtensionAssetsPath
@@ -100,10 +100,10 @@
101101 /**
102102 * Handler for late setup of Semantic Glossary
103103 */
104 -//function SemanticGlossarySetup () {
 104+// function SemanticGlossarySetup () {
105105 //
106106 // return true;
107 -//}
 107+// }
108108
109109 define( 'SG_PROP_GLT', 'Glossary-Term' );
110110 define( 'SG_PROP_GLD', 'Glossary-Definition' );
Index: trunk/extensions/SemanticGlossary/SemanticGlossaryTree.php
@@ -2,7 +2,7 @@
33
44 /**
55 * File holding the SemanticGlossaryTree class
6 - *
 6+ *
77 * @author Stephan Gambke
88 * @file
99 * @ingroup SemanticGlossary
@@ -40,7 +40,7 @@
4141 $matches;
4242 preg_match_all( '/[[:alpha:]]+|[^[:alpha:]]/u', $term, $matches );
4343
44 - $this->addElement( $matches[0], $definition );
 44+ $this->addElement( $matches[0], $term, $definition );
4545
4646 if ( $this->mMinLength > -1 ) {
4747 $this->mMinLength = min( array( $this->mMinLength, strlen( $term ) ) );
@@ -55,10 +55,10 @@
5656 * @param array $path
5757 * @param <type> $index
5858 */
59 - protected function addElement( Array &$path, &$definition ) {
 59+ protected function addElement( Array &$path, &$term, &$definition ) {
6060 // end of path, store description; end of recursion
6161 if ( $path == null ) {
62 - $this -> addDefinition( $definition );
 62+ $this -> addDefinition( $term, $definition );
6363 } else {
6464 $step = array_shift( $path );
6565
@@ -66,7 +66,7 @@
6767 $this->mTree[$step] = new SemanticGlossaryTree();
6868 }
6969
70 - $this->mTree[$step]->addElement( $path, $definition );
 70+ $this->mTree[$step]->addElement( $path, $term, $definition );
7171 }
7272 }
7373
@@ -74,11 +74,11 @@
7575 * Adds a defintion to the treenodes list of definitions
7676 * @param <type> $definition
7777 */
78 - protected function addDefinition( &$definition ) {
 78+ protected function addDefinition( &$term, &$definition ) {
7979 if ( $this->mDefinition ) {
8080 $this->mDefinition->addDefinition( $definition );
8181 } else {
82 - $this->mDefinition = new SemanticGlossaryElement( $definition );
 82+ $this->mDefinition = new SemanticGlossaryElement( $term, $definition );
8383 }
8484 }
8585
@@ -95,7 +95,7 @@
9696 // skip until ther start of a term is found
9797 while ( $index < $countLexemes && !$definition ) {
9898 $currLex = &$lexemes[$index][0];
99 -
 99+
100100 // Did we find the start of a term?
101101 if ( array_key_exists( $currLex, $this->mTree ) ) {
102102 list( $lastindex, $definition ) = $this->mTree[$currLex]->findNextTermNoSkip( $lexemes, $index, $countLexemes );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r89188refactoring, bugfixes (only uses 50 entries; not sorted)foxtrott21:07, 30 May 2011

Comments

#Comment by Jack Phoenix (talk | contribs)   07:42, 1 June 2011

As far as coding style goes, everything's looking good now, thanks!

-	'author' => '[[mw:User:F.trott|Stephan Gambke]]',
+	'author' => '[http://www.mediawiki.org/wiki/User:F.trott|Stephan Gambke]',

The pipe is not needed and it messes up the link; it should be replaced with an ordinary space.

#Comment by F.trott (talk | contribs)   08:14, 1 June 2011

True. I always mix that up between internal and external links. Will be fixed with next commit.

Status & tagging log