SMWFactbox Class Reference
[Semantic MediaWiki]

Static class for printing semantic data in a "Factbox". More...

List of all members.

Static Public Member Functions

static getFactboxText (SMWSemanticData $semdata, $showfactbox=SMW_FACTBOX_NONEMPTY)
 This function creates wiki text suitable for rendering a Factbox for a given SMWSemanticData object that holds all relevant data.
static getFactboxTextFromOutput (ParserOutput $parseroutput, Title $title)
 This function creates wiki text suitable for rendering a Factbox based on the information found in a given ParserOutput object.
static onOutputPageParserOutput (OutputPage $outputpage, ParserOutput $parseroutput)
 This hook copies SMW's custom data from the given ParserOutput object to the given OutputPage object, since otherwise it is not possible to access it later on to build a Factbox.
static onOutputPageBeforeHTML (OutputPage $outputpage, &$text)
 This hook is used for inserting the Factbox text directly after the wiki page.
static onSkinAfterContent (&$data, Skin $skin=null)
 This hook is used for inserting the Factbox text after the article contents (including categories).


Detailed Description

Static class for printing semantic data in a "Factbox".

Definition at line 13 of file SMW_Factbox.php.


Member Function Documentation

static SMWFactbox::getFactboxText ( SMWSemanticData semdata,
showfactbox = SMW_FACTBOX_NONEMPTY 
) [static]

This function creates wiki text suitable for rendering a Factbox for a given SMWSemanticData object that holds all relevant data.

It also checks whether the given setting of $showfactbox requires displaying the given data at all.

Parameters:
SMWSemanticData $semdata
boolean $showfactbox
Returns:
string

NOTE: the preg_replace is a slight hack to ensure that the left column does not get too narrow

Definition at line 25 of file SMW_Factbox.php.

References SMWSemanticData::getPropertyValues(), SMWInfolink::newBrowsingLink(), SMWDataValueFactory::newDataItemValue(), SMWInfolink::newInternalLink(), and SMWOutputs::requireResource().

Referenced by getFactboxTextFromOutput().

static SMWFactbox::getFactboxTextFromOutput ( ParserOutput $  parseroutput,
Title $  title 
) [static]

This function creates wiki text suitable for rendering a Factbox based on the information found in a given ParserOutput object.

If the required custom data is not found in the given ParserOutput, then semantic data for the provided Title object is retreived from the store.

Parameters:
ParserOutput $parseroutput
Title $title
Returns:
string

Definition at line 125 of file SMW_Factbox.php.

References $smwgShowFactbox, $smwgShowFactboxEdit, getFactboxText(), SMWDIWikiPage::newFromTitle(), and smwfGetStore().

Referenced by onOutputPageParserOutput().

static SMWFactbox::onOutputPageParserOutput ( OutputPage $  outputpage,
ParserOutput $  parseroutput 
) [static]

This hook copies SMW's custom data from the given ParserOutput object to the given OutputPage object, since otherwise it is not possible to access it later on to build a Factbox.

Parameters:
OutputPage $outputpage
ParserOutput $parseroutput
Returns:
true

Definition at line 164 of file SMW_Factbox.php.

References $wgTitle, SMWOutputs::commitToOutputPage(), getFactboxTextFromOutput(), and SMWOutputs::requireFromParserOutput().

static SMWFactbox::onOutputPageBeforeHTML ( OutputPage $  outputpage,
&$  text 
) [static]

This hook is used for inserting the Factbox text directly after the wiki page.

Parameters:
OutputPage $outputpage
string $text
Returns:
true

Definition at line 188 of file SMW_Factbox.php.

static SMWFactbox::onSkinAfterContent ( &$  data,
Skin $  skin = null 
) [static]

This hook is used for inserting the Factbox text after the article contents (including categories).

Parameters:
string $data
Skin|null $skin
Returns:
true

Definition at line 204 of file SMW_Factbox.php.


The documentation for this class was generated from the following file:

Generated on Sun Mar 18 07:15:43 2012 for Semantic MediaWiki by  doxygen 1.5.6