@@ -6,41 +6,41 @@ 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 ( is_readable( __DIR__ . '/extensions/SemanticForms/SemanticForms.php' ) ) { |
|
13 | +if (is_readable(__DIR__ . '/extensions/SemanticForms/SemanticForms.php')) { |
|
14 | 14 | require_once __DIR__ . '/extensions/SemanticForms/SemanticForms.php'; |
15 | 15 | } |
16 | 16 | |
17 | -if ( version_compare( $GLOBALS[ 'wgVersion' ], '1.23c', '<' ) ) { |
|
18 | - 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.' ); |
|
17 | +if (version_compare($GLOBALS['wgVersion'], '1.23c', '<')) { |
|
18 | + 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.'); |
|
19 | 19 | } |
20 | -if ( version_compare( $GLOBALS[ 'wgVersion' ], '1.26c', '>' ) ) { |
|
21 | - if ( !ExtensionRegistry::getInstance()->isLoaded( 'SemanticForms' ) ) { |
|
22 | - die( '<b>Error:</b> You need to install <a href="https://www.mediawiki.org/wiki/Extension:SemanticForms">SemanticForms</a> first.' ); |
|
20 | +if (version_compare($GLOBALS['wgVersion'], '1.26c', '>')) { |
|
21 | + if (!ExtensionRegistry::getInstance()->isLoaded('SemanticForms')) { |
|
22 | + die('<b>Error:</b> You need to install <a href="https://www.mediawiki.org/wiki/Extension:SemanticForms">SemanticForms</a> first.'); |
|
23 | 23 | } |
24 | -} elseif ( version_compare( 'SF_VERSION', '2.8', '<' ) ) { |
|
25 | - 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.' ); |
|
24 | +} elseif (version_compare('SF_VERSION', '2.8', '<')) { |
|
25 | + 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.'); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | // Do not initialize more than once. |
29 | -if ( defined( 'SFS_VERSION' ) ) { |
|
29 | +if (defined('SFS_VERSION')) { |
|
30 | 30 | return 1; |
31 | 31 | } |
32 | 32 | |
33 | -define( 'SFS_VERSION', '1.3.0' ); |
|
33 | +define('SFS_VERSION', '1.3.0'); |
|
34 | 34 | |
35 | 35 | /** |
36 | 36 | * @codeCoverageIgnore |
37 | 37 | */ |
38 | -call_user_func( function() { |
|
38 | +call_user_func(function() { |
|
39 | 39 | |
40 | 40 | $GLOBALS['wgExtensionCredits']['semantic'][] = array( |
41 | 41 | 'path' => __FILE__, |
42 | 42 | 'name' => 'Semantic Forms Select', |
43 | - 'author' =>array( 'Jason Zhang', 'Toni Hermoso Pulido', '...' ), |
|
43 | + 'author' =>array('Jason Zhang', 'Toni Hermoso Pulido', '...'), |
|
44 | 44 | 'url' => 'https://www.mediawiki.org/wiki/Extension:SemanticFormsSelect', |
45 | 45 | 'description' => 'Allows to generate a select field in a semantic form whose values are retrieved from a query', |
46 | 46 | 'version' => SFS_VERSION, |
@@ -54,20 +54,20 @@ discard block |
||
54 | 54 | $GLOBALS['wgSF_Select_debug'] = 0; |
55 | 55 | |
56 | 56 | // Register resource files |
57 | - $extensionPathParts = explode( DIRECTORY_SEPARATOR . 'extensions' . DIRECTORY_SEPARATOR , __DIR__, 2 ); |
|
57 | + $extensionPathParts = explode(DIRECTORY_SEPARATOR . 'extensions' . DIRECTORY_SEPARATOR, __DIR__, 2); |
|
58 | 58 | |
59 | 59 | $GLOBALS['wgResourceModules']['ext.sf_select.scriptselect'] = array( |
60 | - 'localBasePath' => __DIR__ , |
|
61 | - 'remoteExtPath' => end( $extensionPathParts ), |
|
60 | + 'localBasePath' => __DIR__, |
|
61 | + 'remoteExtPath' => end($extensionPathParts), |
|
62 | 62 | 'position' => 'bottom', |
63 | - 'scripts' => array( 'res/scriptSelect.js' ), |
|
63 | + 'scripts' => array('res/scriptSelect.js'), |
|
64 | 64 | 'dependencies' => array( |
65 | 65 | 'ext.semanticforms.main' |
66 | 66 | ) |
67 | 67 | ); |
68 | 68 | |
69 | 69 | $GLOBALS['wgExtensionFunctions'][] = function() { |
70 | - $GLOBALS['sfgFormPrinter']->setInputTypeHook( 'SF_Select', '\SFS\SemanticFormsSelect::init', array() ); |
|
70 | + $GLOBALS['sfgFormPrinter']->setInputTypeHook('SF_Select', '\SFS\SemanticFormsSelect::init', array()); |
|
71 | 71 | }; |
72 | 72 | |
73 | 73 | } ); |