Index: trunk/extensions/SemanticWebBrowser/SWB_Settings.php |
— | — | @@ -10,28 +10,26 @@ |
11 | 11 | # CHANGING THE CONFIGURATION FOR SEMANTIC WEBBROWSER # |
12 | 12 | ################################################################# |
13 | 13 | # Do not change this file directly, but copy custom settings # |
14 | | -# into your LocalSettings.php. Most settings should be make # |
| 14 | +# into your LocalSettings.php. Most settings should be made # |
15 | 15 | # between including this file and the call to enableSemantics().# |
16 | 16 | # Exceptions that need to be set before are documented below. # |
17 | 17 | ################################################################# |
18 | 18 | $swbgIP = dirname( __FILE__ ) . '/'; |
19 | 19 | |
20 | | -// TODO: description does not look nice. |
21 | 20 | $wgExtensionCredits['semantic'][] = array( |
22 | | - 'path' => __FILE__, |
23 | | - 'name' => 'Semantic Web Browser', |
24 | | - 'version' => '0.2', |
25 | | - 'author' => array( 'Benedikt Kaempgen', 'Anna Kantorovitch' ), |
26 | | - 'url' => 'http://semantic-mediawiki.org', |
27 | | - 'descriptionmsg' => 'swb_desc' |
| 21 | + 'path' => __FILE__, |
| 22 | + 'name' => 'Semantic Web Browser', |
| 23 | + 'version' => '0.2', |
| 24 | + 'author' => array( 'Benedikt Kaempgen', 'Anna Kantorovitch' ), |
| 25 | + 'url' => 'http://semantic-mediawiki.org', |
| 26 | + 'descriptionmsg' => 'swb_desc' |
28 | 27 | ); |
29 | 28 | |
30 | 29 | /** |
31 | 30 | * The toolbox of each content page show a link to browse the semantic web |
32 | | - *of that page using Special:Browse Wiki & Semantic Web |
| 31 | + * of that page using Special:Browse Wiki & Semantic Web |
33 | 32 | */ |
34 | | - |
35 | 33 | $swbgToolboxBrowseSemWeb = true; |
36 | 34 | |
37 | 35 | // load global constants and setup functions |
38 | | -require_once( $swbgIP.'SemanticWebBrowser.php' ); |
\ No newline at end of file |
| 36 | +require_once( $swbgIP . 'SemanticWebBrowser.php' ); |
\ No newline at end of file |
Index: trunk/extensions/SemanticWebBrowser/SemanticWebBrowser.php |
— | — | @@ -1,13 +1,11 @@ |
2 | 2 | <?php |
3 | | - |
4 | 3 | /** |
5 | 4 | * Main entry point for the Semantic Web Browser extension. |
6 | 5 | * @author Anna Kantorovitch and Benedikt Kämpgen |
7 | | - * @file SemanticWebBrowser.php |
| 6 | + * @file SemanticWebBrowser.php |
8 | 7 | * @ingroup SWB |
9 | 8 | */ |
10 | 9 | |
11 | | - |
12 | 10 | require_once dirname( __FILE__ ) . '/SWB_Settings.php'; |
13 | 11 | |
14 | 12 | /** |
— | — | @@ -15,19 +13,15 @@ |
16 | 14 | * |
17 | 15 | */ |
18 | 16 | // include for toolbox |
19 | | -global $swbgToolboxBrowseSemWeb, $wgHooks, $wgAutoloadClasses, $swbgIP, |
20 | | - $wgFooterIcons, $wgExtensionFunctions, $wgSpecialPageGroups, |
21 | | - $wgExtensionMessagesFiles, $wgExtensionAliasesFiles, $wgSpecialPages, |
22 | | - $smwgNamespace, $wgServer, $wgAPIModules, $wgExtensionAliasesFiles; |
| 17 | +global $swbgToolboxBrowseSemWeb, $wgHooks, $wgAutoloadClasses, $swbgIP, |
| 18 | + $wgFooterIcons, $wgExtensionFunctions, $wgSpecialPageGroups, |
| 19 | + $wgExtensionMessagesFiles, $wgExtensionAliasesFiles, $wgSpecialPages, |
| 20 | + $smwgNamespace, $wgServer, $wgAPIModules, $wgExtensionAliasesFiles; |
23 | 21 | |
24 | | -$wgExtensionMessagesFiles['SemanticWebBrowser'] = $swbgIP . 'SemanticWebBrowser.i18n.php'; // register messages (requires MW=>1.11) |
25 | | - |
26 | | -// Register special pages aliases file |
| 22 | +$wgExtensionMessagesFiles['SemanticWebBrowser'] = $swbgIP . 'SemanticWebBrowser.i18n.php'; |
27 | 23 | $wgExtensionAliasesFiles['SemanticWebBrowser'] = $swbgIP . 'SemanticWebBrowser.alias.php'; |
28 | 24 | |
29 | | -/* |
30 | | - * create Special Page for Browse Wiki |
31 | | - */ |
| 25 | +// Special Page for Browse Wiki |
32 | 26 | $wgAutoloadClasses['SWBSpecialBrowseWiki'] = $swbgIP . 'specials/SearchTriple/SWB_SpecialBrowseWiki.php'; |
33 | 27 | $wgSpecialPages['BrowseWiki'] = 'SWBSpecialBrowseWiki'; |
34 | 28 | $wgSpecialPageGroups['BrowseWiki'] = 'smw_group'; |
— | — | @@ -46,33 +40,28 @@ |
47 | 41 | |
48 | 42 | |
49 | 43 | function registerPropertyTypes() { |
50 | | - // 5 means uri |
51 | | - SMWDataValueFactory::registerDatatype( "_rur", |
52 | | - "SWBResolvableUriValue", |
53 | | - SMWDataItem::TYPE_URI, |
54 | | - $label = false ); |
| 44 | + SMWDataValueFactory::registerDatatype( "_rur", "SWBResolvableUriValue", |
| 45 | + SMWDataItem::TYPE_URI, $label = false ); |
55 | 46 | |
56 | 47 | return true; |
57 | 48 | } |
58 | 49 | |
59 | | -/**include in toolbox for show the last article in "Browsing Semantic Web" |
60 | | - *has the same functionality as 'Browse properties' in the toolbox |
61 | | -**/ |
62 | | - |
| 50 | +/* |
| 51 | + * Include in toolbox to show the last article in "Browsing Semantic Web". |
| 52 | + * Has the same functionality as 'Browse properties' in the toolbox. |
| 53 | + */ |
63 | 54 | if ( $swbgToolboxBrowseSemWeb ) { |
64 | | - $wgHooks['SkinTemplateToolboxEnd'][] = 'swbfShowBrowseSemWeb'; |
| 55 | + $wgHooks['SkinTemplateToolboxEnd'][] = 'swbfShowBrowseSemWeb'; |
65 | 56 | } |
66 | 57 | |
67 | 58 | |
68 | | - function swbfShowBrowseSemWeb( $skintemplate ) { |
69 | | - if ( $skintemplate -> data['isarticle'] ) { |
70 | | - smwfLoadExtensionMessages( 'SemanticWebBrowser' ); |
| 59 | +function swbfShowBrowseSemWeb( $skintemplate ) { |
| 60 | + if ( $skintemplate->data['isarticle'] ) { |
71 | 61 | $browselink = SWBInfolink::newBrowsingLink( wfMsg( 'swb_browse_semantic_web' ), |
72 | | - $skintemplate->data['titleprefixeddbkey'], false ); |
73 | | - |
| 62 | + $skintemplate->data['titleprefixeddbkey'], false ); |
74 | 63 | echo '<li id="t-smwbrowselink">' . $browselink->getHTML() . '</li>'; |
75 | | - |
76 | 64 | } |
| 65 | + |
77 | 66 | return true; |
78 | | - } |
| 67 | +} |
79 | 68 | |