r102935 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102934‎ | r102935 | r102936 >
Date:03:32, 14 November 2011
Author:yaron
Status:deferred
Tags:
Comment:
Fixed handling for filter names with non-Latin characters, fixes for r102903
Modified paths:
  • /trunk/extensions/SemanticDrilldown/specials/SD_BrowseData.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticDrilldown/specials/SD_BrowseData.php
@@ -592,13 +592,18 @@
593593
594594 /**
595595 * Uses the ResourceLoader (available with MediaWiki 1.17 and higher)
596 - * to load all the necessary JS and CSS files for the combobox.
 596+ * to load all the necessary JS and CSS files for comboboxes.
597597 */
598598 public static function loadJavascriptAndCSS() {
599599 global $wgOut;
600600 $wgOut->addModules( 'ext.semanticdrilldown.combobox' );
601601 }
602602
 603+ /**
 604+ * Adds Javascript and CSS to the page for comboboxes, the long way.
 605+ * This method exists for backward compatibiity for MediaWiki 1.16
 606+ * and earlier.
 607+ */
603608 function addJavascriptAndCSS() {
604609 global $smwgJQueryIncluded, $smwgJQueryUIIncluded, $sdgScriptPath, $wgOut;
605610
@@ -628,8 +633,7 @@
629634 }
630635
631636 function printComboBoxInput( $filter_name, $filter_values, $cur_value = null ) {
632 - global $wgRequest, $smwgJQueryIncluded, $smwgJQueryUIIncluded;
633 - global $wgOut;
 637+ global $wgRequest, $sdgJQueryIncluded, $wgOut;
634638
635639 // MW 1.17 +
636640 if ( class_exists( 'ResourceLoader' ) ) {
@@ -640,6 +644,9 @@
641645 }
642646
643647 $filter_name = str_replace( ' ', '_', $filter_name );
 648+ // URL-decode the filter name - necessary if it contains
 649+ // any non-Latin characters.
 650+ $filter_name = urldecode( $filter_name );
644651 $input_id = "_search_$filter_name";
645652 $combobox_id = "c_search_$filter_name";
646653

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r102903Changed 'combo box' input to use jQuery and jQuery UI files from ResourceLoad...yaron18:06, 13 November 2011