Index: trunk/extensions/WikiObjectModel/WikiObjectModel.php |
— | — | @@ -0,0 +1,54 @@ |
| 2 | +<?php |
| 3 | +/* |
| 4 | + * Created on 22.11.2010 |
| 5 | + * |
| 6 | + * Author: ning |
| 7 | + */ |
| 8 | +if ( !defined( 'MEDIAWIKI' ) ) die; |
| 9 | + |
| 10 | +define( 'WOM_VERSION', '1.0.1 alpha' ); |
| 11 | + |
| 12 | +$wgExtensionCredits['parserhook'][] = array( |
| 13 | + 'path' => __FILE__, |
| 14 | + 'name' => 'Wiki ObjectModel Extension', |
| 15 | + 'version' => WOM_VERSION, |
| 16 | + 'author' => "Ning Hu, Justin Zhang, [http://smwforum.ontoprise.com/smwforum/index.php/Jesse_Wang Jesse Wang], sponsored by [http://projecthalo.com Project Halo], [http://www.vulcan.com Vulcan Inc.]", |
| 17 | + 'url' => 'http://wiking.vulcan.com/dev', |
| 18 | + 'descriptionmsg' => 'wom-desc' |
| 19 | +); |
| 20 | + |
| 21 | +$wgOMIP = $IP . '/extensions/WikiObjectModel'; |
| 22 | +$wgOMScriptPath = $wgScriptPath . '/extensions/WikiObjectModel'; |
| 23 | + |
| 24 | +$wgExtensionFunctions[] = 'smwfOMInitLanguage'; |
| 25 | +$wgExtensionMessagesFiles['WikiObjectModel'] = $wgOMIP . '/languages/Messages.php'; |
| 26 | + |
| 27 | +require_once( $wgOMIP . '/includes/WOM_Setup.php' ); |
| 28 | + |
| 29 | +function smwfOMInitLanguageObject( $langcode, $fallback = null ) { |
| 30 | + global $wgOMIP; |
| 31 | + |
| 32 | + $langClass = 'WOMLanguage' . str_replace( '-', '_', ucfirst( $langcode ) ); |
| 33 | + |
| 34 | + if ( file_exists( $wgOMIP . '/languages/' . $langClass . '.php' ) ) { |
| 35 | + include_once( $wgOMIP . '/languages/' . $langClass . '.php' ); |
| 36 | + } |
| 37 | + |
| 38 | + // fallback if language not supported |
| 39 | + if ( !class_exists( $langClass ) ) { |
| 40 | + if ( $fallback ) { |
| 41 | + return $fallback; |
| 42 | + } |
| 43 | + include_once( $wgOMIP . '/languages/WOMLanguageEn.php' ); |
| 44 | + $langClass = 'WOMLanguageEn'; |
| 45 | + } |
| 46 | + return new $langClass(); |
| 47 | +} |
| 48 | + |
| 49 | +function smwfOMInitLanguage() { |
| 50 | + global $wgLanguageCode, $wgLang; |
| 51 | + global $wgOMContLang, $wgOMLang; |
| 52 | + |
| 53 | + $wgOMContLang = smwfOMInitLanguageObject( $wgLanguageCode ); |
| 54 | + $wgOMLang = smwfOMInitLanguageObject( $wgLang->getCode(), $wgOMContLang ); |
| 55 | +} |
Property changes on: trunk/extensions/WikiObjectModel/WikiObjectModel.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 56 | + native |
Index: trunk/extensions/WikiObjectModel/INSTALL |
— | — | @@ -1,7 +1,7 @@ |
2 | 2 | == Requirements == |
3 | 3 | |
4 | 4 | * MediaWiki 1.13.5 |
5 | | -* Semantic MediaWiki 1.4.3 (optional) |
| 5 | +* Semantic MediaWiki >1.4.3 and < 1.6 (optional) |
6 | 6 | * PHP 5.x or greater installed and working |
7 | 7 | * MySQL >= 4.0.14 (version required by MediaWiki) |
8 | 8 | |
— | — | @@ -9,4 +9,4 @@ |
10 | 10 | |
11 | 11 | Edit $IP/LocalSettings.php and add: |
12 | 12 | |
13 | | - include_once('extensions/WikiObjectModel/includes/WOM_Initialize.php'); |
| 13 | + include_once('extensions/WikiObjectModel/WikiObjectModel.php'); |
Index: trunk/extensions/WikiObjectModel/includes/WOM_Initialize.php |
— | — | @@ -1,54 +1,7 @@ |
2 | 2 | <?php |
3 | | -/* |
4 | | - * Created on 22.11.2010 |
5 | | - * |
6 | | - * Author: ning |
| 3 | + |
| 4 | +/** |
| 5 | + * Deprecated entry point, use WikiObjectModel/WikiObjectModel.php instead. |
7 | 6 | */ |
8 | | -if ( !defined( 'MEDIAWIKI' ) ) die; |
9 | 7 | |
10 | | -define( 'WOM_VERSION', '1.0' ); |
11 | | - |
12 | | -$wgExtensionCredits['parserhook'][] = array( |
13 | | - 'path' => __FILE__, |
14 | | - 'name' => 'Wiki ObjectModel Extension', |
15 | | - 'version' => WOM_VERSION, |
16 | | - 'author' => "Ning Hu, Justin Zhang, [http://smwforum.ontoprise.com/smwforum/index.php/Jesse_Wang Jesse Wang], sponsored by [http://projecthalo.com Project Halo], [http://www.vulcan.com Vulcan Inc.]", |
17 | | - 'url' => 'http://wiking.vulcan.com/dev', |
18 | | - 'descriptionmsg' => 'wom-desc' |
19 | | -); |
20 | | - |
21 | | -$wgOMIP = $IP . '/extensions/WikiObjectModel'; |
22 | | -$wgOMScriptPath = $wgScriptPath . '/extensions/WikiObjectModel'; |
23 | | - |
24 | | -$wgExtensionFunctions[] = 'smwfOMInitLanguage'; |
25 | | -$wgExtensionMessagesFiles['WikiObjectModel'] = $wgOMIP . '/languages/Messages.php'; |
26 | | - |
27 | | -require_once( $wgOMIP . '/includes/WOM_Setup.php' ); |
28 | | - |
29 | | -function smwfOMInitLanguageObject( $langcode, $fallback = null ) { |
30 | | - global $wgOMIP; |
31 | | - |
32 | | - $langClass = 'WOMLanguage' . str_replace( '-', '_', ucfirst( $langcode ) ); |
33 | | - |
34 | | - if ( file_exists( $wgOMIP . '/languages/' . $langClass . '.php' ) ) { |
35 | | - include_once( $wgOMIP . '/languages/' . $langClass . '.php' ); |
36 | | - } |
37 | | - |
38 | | - // fallback if language not supported |
39 | | - if ( !class_exists( $langClass ) ) { |
40 | | - if ( $fallback ) { |
41 | | - return $fallback; |
42 | | - } |
43 | | - include_once( $wgOMIP . '/languages/WOMLanguageEn.php' ); |
44 | | - $langClass = 'WOMLanguageEn'; |
45 | | - } |
46 | | - return new $langClass(); |
47 | | -} |
48 | | - |
49 | | -function smwfOMInitLanguage() { |
50 | | - global $wgLanguageCode, $wgLang; |
51 | | - global $wgOMContLang, $wgOMLang; |
52 | | - |
53 | | - $wgOMContLang = smwfOMInitLanguageObject( $wgLanguageCode ); |
54 | | - $wgOMLang = smwfOMInitLanguageObject( $wgLang->getCode(), $wgOMContLang ); |
55 | | -} |
| 8 | +include_once '../WikiObjectModel.php'; |
\ No newline at end of file |