r111116 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111115‎ | r111116 | r111117 >
Date:22:42, 9 February 2012
Author:foxtrott
Status:deferred
Tags:
Comment:
bugfix (menuselect does not use links)
Modified paths:
  • /trunk/extensions/SemanticFormsInputs/includes/SFI_MenuSelect.php (modified) (history)
  • /trunk/extensions/SemanticFormsInputs/libs/menuselect.js (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticFormsInputs/includes/SFI_MenuSelect.php
@@ -88,7 +88,7 @@
8989 */
9090 public function getHtmlText(){
9191
92 - global $wgUser, $wgTitle;
 92+ global $wgUser, $wgTitle, $wgParser;
9393 global $sfigSettings;
9494
9595 // first: set up HTML attributes
@@ -113,14 +113,13 @@
114114
115115 // parse menu structure
116116
117 - $parser = new Parser();
118 -
119117 // FIXME: SF does not parse options correctly. Users have to replace | by {{!}}
120118 $structure = str_replace( '{{!}}', '|', $this->mOtherArgs['structure'] );
121119 $options = ParserOptions::newFromUser( $wgUser );
122120
123 - $structure = $parser->parse( $structure, $wgTitle, $options )->getText();
124 -
 121+ $structure = $wgParser->doBlockLevels( $structure, true );
 122+ $wgParser->replaceLinkHolders( $structure );
 123+
125124 $html .= str_replace( '<li', '<li class=\'ui-state-default\'', $structure );
126125
127126 $html .= "</span>";
Index: trunk/extensions/SemanticFormsInputs/libs/menuselect.js
@@ -87,6 +87,7 @@
8888 res = regexp.exec( link.attr( 'href' ) );
8989
9090 title = unescape( res[1] );
 91+ title = title.replace('_', ' ', 'g');
9192
9293 link.data( 'title', title ); // save title in data
9394