@@ -6,36 +6,36 @@ discard block |
||
6 | 6 | * |
7 | 7 | * @defgroup SFS SemanticFormsSelect |
8 | 8 | */ |
9 | -if ( !defined( 'MEDIAWIKI' ) ) { |
|
10 | - die( 'This file is part of the SemanticFormsSelect extension, it is not a valid entry point.' ); |
|
9 | +if (!defined('MEDIAWIKI')) { |
|
10 | + die('This file is part of the SemanticFormsSelect extension, it is not a valid entry point.'); |
|
11 | 11 | } |
12 | 12 | |
13 | -if ( version_compare( $GLOBALS[ 'wgVersion' ], '1.23', 'lt' ) ) { |
|
14 | - die( '<b>Error:</b> This version of <a href="https://github.com/SemanticMediaWiki/SemanticFormsSelect/">SemanticFormsSelect</a> is only compatible with MediaWiki 1.23 or above. You need to upgrade MediaWiki first.' ); |
|
13 | +if (version_compare($GLOBALS['wgVersion'], '1.23', 'lt')) { |
|
14 | + die('<b>Error:</b> This version of <a href="https://github.com/SemanticMediaWiki/SemanticFormsSelect/">SemanticFormsSelect</a> is only compatible with MediaWiki 1.23 or above. You need to upgrade MediaWiki first.'); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | $GLOBALS['wgExtensionFunctions'][] = function() { |
18 | - if ( version_compare( SF_VERSION, '2.8', '<' ) ) { |
|
19 | - die( '<b>Error:</b> This version of <a href="https://github.com/SemanticMediaWiki/SemanticFormsSelect/">SemanticFormsSelect</a> is only compatible with Semantic Forms 2.8 or above. You need to upgrade <a href="https://www.mediawiki.org/wiki/Extension:Semantic_Forms">Semantic Forms</a> first.' ); |
|
18 | + if (version_compare(SF_VERSION, '2.8', '<')) { |
|
19 | + die('<b>Error:</b> This version of <a href="https://github.com/SemanticMediaWiki/SemanticFormsSelect/">SemanticFormsSelect</a> is only compatible with Semantic Forms 2.8 or above. You need to upgrade <a href="https://www.mediawiki.org/wiki/Extension:Semantic_Forms">Semantic Forms</a> first.'); |
|
20 | 20 | } |
21 | 21 | }; |
22 | 22 | |
23 | 23 | // Do not initialize more than once. |
24 | -if ( defined( 'SFS_VERSION' ) ) { |
|
24 | +if (defined('SFS_VERSION')) { |
|
25 | 25 | return 1; |
26 | 26 | } |
27 | 27 | |
28 | -define( 'SFS_VERSION', '1.3.0' ); |
|
28 | +define('SFS_VERSION', '1.3.0'); |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * @codeCoverageIgnore |
32 | 32 | */ |
33 | -call_user_func( function() { |
|
33 | +call_user_func(function() { |
|
34 | 34 | |
35 | 35 | $GLOBALS['wgExtensionCredits']['semantic'][] = array( |
36 | 36 | 'path' => __FILE__, |
37 | 37 | 'name' => 'Semantic Forms Select', |
38 | - 'author' =>array( 'Jason Zhang', 'Toni Hermoso Pulido', '...' ), |
|
38 | + 'author' =>array('Jason Zhang', 'Toni Hermoso Pulido', '...'), |
|
39 | 39 | 'url' => 'https://www.mediawiki.org/wiki/Extension:SemanticFormsSelect', |
40 | 40 | 'description' => 'Allows to generate a select field in a semantic form whose values are retrieved from a query', |
41 | 41 | 'version' => SFS_VERSION, |
@@ -49,20 +49,20 @@ discard block |
||
49 | 49 | $GLOBALS['wgSF_Select_debug'] = 0; |
50 | 50 | |
51 | 51 | // Register resource files |
52 | - $extensionPathParts = explode( DIRECTORY_SEPARATOR . 'extensions' . DIRECTORY_SEPARATOR , __DIR__, 2 ); |
|
52 | + $extensionPathParts = explode(DIRECTORY_SEPARATOR . 'extensions' . DIRECTORY_SEPARATOR, __DIR__, 2); |
|
53 | 53 | |
54 | 54 | $GLOBALS['wgResourceModules']['ext.sf_select.scriptselect'] = array( |
55 | - 'localBasePath' => __DIR__ , |
|
56 | - 'remoteExtPath' => end( $extensionPathParts ), |
|
55 | + 'localBasePath' => __DIR__, |
|
56 | + 'remoteExtPath' => end($extensionPathParts), |
|
57 | 57 | 'position' => 'bottom', |
58 | - 'scripts' => array( 'res/scriptSelect.js' ), |
|
58 | + 'scripts' => array('res/scriptSelect.js'), |
|
59 | 59 | 'dependencies' => array( |
60 | 60 | 'ext.semanticforms.main' |
61 | 61 | ) |
62 | 62 | ); |
63 | 63 | |
64 | 64 | $GLOBALS['wgExtensionFunctions'][] = function() { |
65 | - $GLOBALS['sfgFormPrinter']->setInputTypeHook( 'SF_Select', '\SFS\SemanticFormsSelect::init', array() ); |
|
65 | + $GLOBALS['sfgFormPrinter']->setInputTypeHook('SF_Select', '\SFS\SemanticFormsSelect::init', array()); |
|
66 | 66 | }; |
67 | 67 | |
68 | 68 | } ); |