| Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Factbox.php |
| — | — | @@ -24,7 +24,9 @@ |
| 25 | 25 | */ |
| 26 | 26 | static public function getFactboxText( SMWSemanticData $semdata, $showfactbox = SMW_FACTBOX_NONEMPTY ) { |
| 27 | 27 | global $wgContLang; |
| | 28 | + |
| 28 | 29 | wfProfileIn( 'SMWFactbox::printFactbox (SMW)' ); |
| | 30 | + |
| 29 | 31 | switch ( $showfactbox ) { |
| 30 | 32 | case SMW_FACTBOX_HIDDEN: // never show |
| 31 | 33 | wfProfileOut( 'SMWFactbox::printFactbox (SMW)' ); |
| — | — | @@ -48,7 +50,9 @@ |
| 49 | 51 | $text = ''; |
| 50 | 52 | if ( wfRunHooks( 'smwShowFactbox', array( &$text, $semdata ) ) ) { |
| 51 | 53 | $subjectDv = SMWDataValueFactory::newDataItemValue( $semdata->getSubject(), null ); |
| | 54 | + |
| 52 | 55 | SMWOutputs::requireResource( 'ext.smw.style' ); |
| | 56 | + |
| 53 | 57 | $rdflink = SMWInfolink::newInternalLink( |
| 54 | 58 | wfMsgForContent( 'smw_viewasrdf' ), |
| 55 | 59 | $wgContLang->getNsText( NS_SPECIAL ) . ':ExportRDF/' . |
| — | — | @@ -61,6 +65,7 @@ |
| 62 | 66 | $subjectDv->getWikiValue(), |
| 63 | 67 | 'swmfactboxheadbrowse' |
| 64 | 68 | ); |
| | 69 | + |
| 65 | 70 | $text .= '<div class="smwfact">' . |
| 66 | 71 | '<span class="smwfactboxhead">' . |
| 67 | 72 | wfMsgForContent( 'smw_factbox_head', $browselink->getWikiText() ) . '</span>' . |
| — | — | @@ -119,7 +124,9 @@ |
| 120 | 125 | */ |
| 121 | 126 | static public function getFactboxTextFromOutput( ParserOutput $parseroutput, Title $title ) { |
| 122 | 127 | global $wgRequest, $smwgShowFactboxEdit, $smwgShowFactbox; |
| 123 | | - $mws = ( isset( $parseroutput->mSMWMagicWords ) ) ? $parseroutput->mSMWMagicWords : array(); |
| | 128 | + |
| | 129 | + $mws = isset( $parseroutput->mSMWMagicWords ) ? $parseroutput->mSMWMagicWords : array(); |
| | 130 | + |
| 124 | 131 | if ( in_array( 'SMW_SHOWFACTBOX', $mws ) ) { |
| 125 | 132 | $showfactbox = SMW_FACTBOX_NONEMPTY; |
| 126 | 133 | } elseif ( in_array( 'SMW_NOFACTBOX', $mws ) ) { |
| — | — | @@ -129,9 +136,11 @@ |
| 130 | 137 | } else { |
| 131 | 138 | $showfactbox = $smwgShowFactbox; |
| 132 | 139 | } |
| | 140 | + |
| 133 | 141 | if ( $showfactbox == SMW_FACTBOX_HIDDEN ) { // use shortcut |
| 134 | 142 | return ''; |
| 135 | 143 | } |
| | 144 | + |
| 136 | 145 | // Deal with complete dataset only if needed: |
| 137 | 146 | if ( !isset( $parseroutput->mSMWData ) || $parseroutput->mSMWData->stubObject ) { |
| 138 | 147 | $semdata = smwfGetStore()->getSemanticData( SMWDIWikiPage::newFromTitle( $title ) ); |