Index: trunk/extensions/SemanticMediaWiki/includes/SMW_GlobalFunctions.php |
— | — | @@ -216,7 +216,7 @@ |
217 | 217 | */ |
218 | 218 | function smwfSetupExtension() { |
219 | 219 | wfProfileIn('smwfSetupExtension (SMW)'); |
220 | | - global $smwgIP, $smwgStoreActive, $wgHooks, $wgParser, $wgExtensionCredits, $smwgEnableTemplateSupport, $smwgMasterStore, $smwgIQRunningNumber, $wgLanguageCode; |
| 220 | + global $smwgIP, $smwgStoreActive, $wgHooks, $wgParser, $wgExtensionCredits, $smwgEnableTemplateSupport, $smwgMasterStore, $smwgIQRunningNumber, $wgLanguageCode, $wgVersion, $smwgToolboxBrowseLink; |
221 | 221 | |
222 | 222 | /** |
223 | 223 | * Setting this to false prevents any new data from being stored in |
— | — | @@ -264,6 +264,13 @@ |
265 | 265 | } |
266 | 266 | smwfRegisterParserFunctions( $wgParser ); |
267 | 267 | } |
| 268 | + if ($smwgToolboxBrowseLink) { |
| 269 | + if (version_compare($wgVersion,'1.12','>')) { |
| 270 | + $wgHooks['SkinTemplateToolboxEnd'][] = 'smwfShowBrowseLink'; // introduced only in 1.13 |
| 271 | + } else { |
| 272 | + $wgHooks['MonoBookTemplateToolboxEnd'][] = 'smwfShowBrowseLink'; |
| 273 | + } |
| 274 | + } |
268 | 275 | |
269 | 276 | ///// credits (see "Special:Version") ///// |
270 | 277 | $wgExtensionCredits['parserhook'][]= array('name'=>'Semantic MediaWiki', 'version'=>SMW_VERSION, 'author'=>"Klaus Lassleben, [http://korrekt.org Markus Krötzsch], [http://simia.net Denny Vrandecic], S Page, and others. Maintained by [http://www.aifb.uni-karlsruhe.de/Forschungsgruppen/WBS/english AIFB Karlsruhe].", 'url'=>'http://semantic-mediawiki.org', 'description' => 'Making your wiki more accessible – for machines \'\'and\'\' humans. [http://semantic-mediawiki.org/wiki/Help:User_manual View online documentation.]'); |
— | — | @@ -386,6 +393,21 @@ |
387 | 394 | return smwfEncodeMessages(array($content), 'info'); |
388 | 395 | } |
389 | 396 | |
| 397 | +/** |
| 398 | + * Add a link to the toobox to view the properties of the current page in Special:Browse. |
| 399 | + * The links has the CSS id "t-smwbrowselink" so that it can be skinned or hidden with all |
| 400 | + * standard mechanisms (also by individual users with custom CSS). |
| 401 | + */ |
| 402 | +function smwfShowBrowseLink($skintemplate) { |
| 403 | + if($skintemplate->data['isarticle']) { |
| 404 | + wfLoadExtensionMessages('SemanticMediaWiki'); |
| 405 | + $browselink = SMWInfolink::newBrowsingLink(wfMsg('smw_browselink'), |
| 406 | + $skintemplate->data['titleprefixeddbkey'],false); |
| 407 | + echo "<li id=\"t-smwbrowselink\">" . $browselink->getHTML() . "</li>"; |
| 408 | + } |
| 409 | + return true; |
| 410 | +} |
| 411 | + |
390 | 412 | /**********************************************/ |
391 | 413 | /***** Header modifications *****/ |
392 | 414 | /**********************************************/ |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Settings.php |
— | — | @@ -66,14 +66,13 @@ |
67 | 67 | |
68 | 68 | ### |
69 | 69 | # This setting allows you to select in which cases you want to have a factbox |
70 | | -# appear below an article. The default setting is "SMW_FACTBOX_NONEMPTY" which |
71 | | -# shows only those factboxes that have some content. Note that the Magic Words |
72 | | -# __SHOWFACTBOX__ and __HIDEFACTBOX__ can be used to control Factbox display |
73 | | -# for individual pages. Other options for this setting include: |
| 70 | +# appear below an article. Note that the Magic Words __SHOWFACTBOX__ and |
| 71 | +# __HIDEFACTBOX__ can be used to control Factbox display for individual pages. |
| 72 | +# Other options for this setting include: |
74 | 73 | ## |
75 | | -$smwgShowFactbox = SMW_FACTBOX_NONEMPTY; |
| 74 | +//$smwgShowFactbox = SMW_FACTBOX_NONEMPTY; # show only those factboxes that have some content |
76 | 75 | //$smwgShowFactbox = SMW_FACTBOX_SPECIAL # show only if special properties were set |
77 | | -//$smwgShowFactbox = SMW_FACTBOX_HIDDEN; # hide always |
| 76 | +$smwgShowFactbox = SMW_FACTBOX_HIDDEN; # hide always |
78 | 77 | //$smwgShowFactbox = SMW_FACTBOX_SHOWN; # show always, buggy and not recommended |
79 | 78 | ## |
80 | 79 | |
— | — | @@ -84,6 +83,14 @@ |
85 | 84 | ## |
86 | 85 | |
87 | 86 | ### |
| 87 | +# Should the toolbox of each content page show a link to browse the properties |
| 88 | +# of that page using Special:Browse? This is a useful way to access properties |
| 89 | +# and it is somewhat more subtle than showing a Factbox on every page. |
| 90 | +## |
| 91 | +$smwgToolboxBrowseLink = true; |
| 92 | +## |
| 93 | + |
| 94 | +### |
88 | 95 | # Should warnings be displayed in wikitexts right after the problematic input? |
89 | 96 | # This affects only semantic annotations, not warnings that are displayed by |
90 | 97 | # inline queries or other features. |
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_Messages.php |
— | — | @@ -227,6 +227,7 @@ |
228 | 228 | |
229 | 229 | // Messages for the browsing special |
230 | 230 | 'browse' => 'Browse wiki', |
| 231 | + 'smw_browselink' => 'Browse properties', |
231 | 232 | 'smw_browse_article' => 'Enter the name of the page to start browsing from.', |
232 | 233 | 'smw_browse_go' => 'Go', |
233 | 234 | 'smw_browse_more' => '…', |
— | — | @@ -895,6 +896,7 @@ |
896 | 897 | 'smw_sbv_value' => 'Wert', |
897 | 898 | 'smw_sbv_submit' => 'Finde Ergebnisse', |
898 | 899 | 'browse' => 'Wiki browsen', |
| 900 | + 'smw_browselink' => 'Attribute anzeigen', |
899 | 901 | 'smw_browse_article' => 'Bitte gib den Titel einer Seite ein.', |
900 | 902 | 'smw_browse_go' => 'Los', |
901 | 903 | 'smw_browse_show_incoming' => 'zeige Attribute die hierhin verlinken', |