|
23 | 23 | return 1; |
24 | 24 | } |
25 | 25 |
|
26 | | -define( 'SFS_VERSION', '1.3.0-alpha' ); |
| 26 | +define( 'SFS_VERSION', '1.3.0' ); |
27 | 27 |
|
28 | | -//self executing anonymous function to prevent global scope assumptions |
| 28 | +/** |
| 29 | + * @codeCoverageIgnore |
| 30 | + */ |
29 | 31 | call_user_func( function() { |
30 | 32 |
|
31 | | - $GLOBALS['wgExtensionCredits'][defined( 'SEMANTIC_EXTENSION_TYPE' ) ? 'semantic' : 'specialpage'][] = array( |
| 33 | + $GLOBALS['wgExtensionCredits']['semantic'][] = array( |
32 | 34 | 'path' => __FILE__, |
33 | 35 | 'name' => 'Semantic Forms Select', |
34 | 36 | 'author' =>array( 'Jason Zhang', 'Toni Hermoso Pulido', '...' ), |
|
38 | 40 | 'license-name' => 'GPL-2.0+', |
39 | 41 | ); |
40 | 42 |
|
41 | | - //$wgAjaxExportList[] = "QueryExecution"; |
42 | | - //$wgAjaxExportList[] = "FunctionExecution"; |
43 | | - $GLOBALS['wgExtensionFunctions'][] = function() { |
44 | | - $GLOBALS['sfgFormPrinter']->setInputTypeHook( 'SF_Select', '\SFS\SemanticFormsSelect::init', array() ); |
45 | | - }; |
46 | | - |
47 | | - $GLOBALS['wgAutoloadClasses']['SFS\SemanticFormsSelect'] = __DIR__ . '/src/SemanticFormsSelect.php'; |
48 | | - $GLOBALS['wgAutoloadClasses']['SFS\ApiSemanticFormsSelect'] = __DIR__ . '/src/ApiSemanticFormsSelect.php'; |
49 | | - $GLOBALS['wgAutoloadClasses']['SFS\ApiRequestProcessor'] = __DIR__ . '/src/ApiRequestProcessor.php'; |
50 | | - $GLOBALS['wgAutoloadClasses']['SFS\Output'] = __DIR__ . '/src/Output.php'; |
51 | | - |
52 | | - // api modules |
| 43 | + // Api modules |
53 | 44 | $GLOBALS['wgAPIModules']['sformsselect'] = 'SFS\ApiSemanticFormsSelect'; |
54 | 45 |
|
55 | | - $GLOBALS['wgSF_SelectDir'] = dirname(__FILE__) ; |
56 | | - $GLOBALS['wgSF_SelectScriptPath'] = $GLOBALS['wgScriptPath'] . '/extensions/'.basename($GLOBALS['wgSF_SelectDir']); |
57 | | - |
58 | 46 | $GLOBALS['wgScriptSelectCount'] = 0; |
59 | 47 | $GLOBALS['wgSF_Select_debug'] = 0; |
60 | 48 |
|
| 49 | + // Register resource files |
| 50 | + $extensionPathParts = explode( DIRECTORY_SEPARATOR . 'extensions' . DIRECTORY_SEPARATOR , __DIR__, 2 ); |
| 51 | + |
61 | 52 | $GLOBALS['wgResourceModules']['ext.sf_select.scriptselect'] = array( |
62 | | - 'localBasePath' => $GLOBALS['wgSF_SelectDir'], |
63 | | - 'remoteExtPath' => 'SemanticFormsSelect', |
| 53 | + 'localBasePath' => __DIR__ , |
| 54 | + 'remoteExtPath' => end( $extensionPathParts ), |
| 55 | + 'position' => 'bottom', |
64 | 56 | 'scripts' => array( 'res/scriptSelect.js' ), |
65 | 57 | 'dependencies' => array( |
66 | 58 | 'ext.semanticforms.main' |
67 | 59 | ) |
68 | 60 | ); |
69 | 61 |
|
| 62 | + $GLOBALS['wgExtensionFunctions'][] = function() { |
| 63 | + $GLOBALS['sfgFormPrinter']->setInputTypeHook( 'SF_Select', '\SFS\SemanticFormsSelect::init', array() ); |
| 64 | + }; |
| 65 | + |
70 | 66 | } ); |
0 commit comments