r104574 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104573‎ | r104574 | r104575 >
Date:16:51, 29 November 2011
Author:jeroendedauw
Status:ok (Comments)
Tags:
Comment:
Follow up to r104571;
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_Factbox.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Factbox.php
@@ -24,7 +24,9 @@
2525 */
2626 static public function getFactboxText( SMWSemanticData $semdata, $showfactbox = SMW_FACTBOX_NONEMPTY ) {
2727 global $wgContLang;
 28+
2829 wfProfileIn( 'SMWFactbox::printFactbox (SMW)' );
 30+
2931 switch ( $showfactbox ) {
3032 case SMW_FACTBOX_HIDDEN: // never show
3133 wfProfileOut( 'SMWFactbox::printFactbox (SMW)' );
@@ -48,7 +50,9 @@
4951 $text = '';
5052 if ( wfRunHooks( 'smwShowFactbox', array( &$text, $semdata ) ) ) {
5153 $subjectDv = SMWDataValueFactory::newDataItemValue( $semdata->getSubject(), null );
 54+
5255 SMWOutputs::requireResource( 'ext.smw.style' );
 56+
5357 $rdflink = SMWInfolink::newInternalLink(
5458 wfMsgForContent( 'smw_viewasrdf' ),
5559 $wgContLang->getNsText( NS_SPECIAL ) . ':ExportRDF/' .
@@ -61,6 +65,7 @@
6266 $subjectDv->getWikiValue(),
6367 'swmfactboxheadbrowse'
6468 );
 69+
6570 $text .= '<div class="smwfact">' .
6671 '<span class="smwfactboxhead">' .
6772 wfMsgForContent( 'smw_factbox_head', $browselink->getWikiText() ) . '</span>' .
@@ -119,7 +124,9 @@
120125 */
121126 static public function getFactboxTextFromOutput( ParserOutput $parseroutput, Title $title ) {
122127 global $wgRequest, $smwgShowFactboxEdit, $smwgShowFactbox;
123 - $mws = ( isset( $parseroutput->mSMWMagicWords ) ) ? $parseroutput->mSMWMagicWords : array();
 128+
 129+ $mws = isset( $parseroutput->mSMWMagicWords ) ? $parseroutput->mSMWMagicWords : array();
 130+
124131 if ( in_array( 'SMW_SHOWFACTBOX', $mws ) ) {
125132 $showfactbox = SMW_FACTBOX_NONEMPTY;
126133 } elseif ( in_array( 'SMW_NOFACTBOX', $mws ) ) {
@@ -129,9 +136,11 @@
130137 } else {
131138 $showfactbox = $smwgShowFactbox;
132139 }
 140+
133141 if ( $showfactbox == SMW_FACTBOX_HIDDEN ) { // use shortcut
134142 return '';
135143 }
 144+
136145 // Deal with complete dataset only if needed:
137146 if ( !isset( $parseroutput->mSMWData ) || $parseroutput->mSMWData->stubObject ) {
138147 $semdata = smwfGetStore()->getSemanticData( SMWDIWikiPage::newFromTitle( $title ) );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r104571docs++jeroendedauw16:05, 29 November 2011

Comments

#Comment by Nikerabbit (talk | contribs)   07:27, 2 December 2011

I don't see why this is a followup.

Status & tagging log