r93178 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93177‎ | r93178 | r93179 >
Date:14:16, 26 July 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
fixed usage of deprecated method and made some small tweaks
Modified paths:
  • /trunk/extensions/SemanticFormsInputs/SemanticFormsInputs.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticFormsInputs/SemanticFormsInputs.php
@@ -15,7 +15,7 @@
1616 die( 'This is a Semantic Forms extension. You need to install Semantic Forms first.' );
1717 }
1818
19 -define( 'SFI_VERSION', '0.4.1' );
 19+define( 'SFI_VERSION', '0.4.2 alpha' );
2020
2121 // create and initialize settings
2222 $sfigSettings = new SFISettings();
@@ -36,10 +36,10 @@
3737 require_once( $dir . '/SFI_Settings.php' );
3838
3939 $wgExtensionMessagesFiles['SemanticFormsInputs'] = $dir . '/SemanticFormsInputs.i18n.php';
40 -$wgExtensionFunctions[] = "wfSFISetup";
 40+$wgExtensionFunctions[] = 'wfSFISetup';
4141 $wgAutoloadClasses['SFIInputs'] = $dir . '/SFI_Inputs.php';
4242
43 -/*
 43+/**
4444 * Class to encapsulate all settings
4545 */
4646 class SFISettings {
@@ -63,11 +63,11 @@
6464 public $datePickerDayNames;
6565 }
6666
67 -/*
 67+/**
6868 * Registers the input types with Semantic Forms.
6969 */
7070 function wfSFISetup() {
71 - global $sfgFormPrinter, $wgOut;
 71+ global $sfgFormPrinter;
7272
7373 $sfgFormPrinter->setInputTypeHook( 'regexp', array( 'SFIInputs', 'regexpHTML' ), array() );
7474 $sfgFormPrinter->setInputTypeHook( 'datepicker', array( 'SFIInputs', 'jqDatePickerHTML' ), array() );
@@ -77,6 +77,8 @@
7878 // $sfgFormPrinter->setInputTypeHook( 'wysiwyg', array( 'SFIInputs', 'wysiwygHTML' ), array() );
7979 $sfgFormPrinter->setInputTypeHook( 'menuselect', array( 'SFIInputs', 'menuselectHTML' ), array() );
8080
81 - // TODO: obsolete as of MW 1.16, remove around 1.18 or so
82 - wfLoadExtensionMessages( 'SemanticFormsInputs' );
 81+ // This function has been deprecated in 1.16, but needed for earlier versions.
 82+ if ( version_compare( $wgVersion, '1.16', '<' ) ) {
 83+ wfLoadExtensionMessages( 'SemanticFormsInputs' );
 84+ }
8385 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r93274followup r93178: declared missing globalfoxtrott14:57, 27 July 2011