Semantic MediaWiki and related extensions
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SMW\Factbox\Factbox Class Reference

Public Member Functions

 __construct (Store $store, ParserData $parserData, MessageBuilder $messageBuilder)
 
 useInPreview ($preview)
 
 doBuild ()
 
 getTitle ()
 
 getContent ()
 
 isVisible ()
 

Protected Member Functions

 getMagicWords ()
 
 getModules ()
 
 fetchContent ($showFactbox=SMW_FACTBOX_NONEMPTY)
 
 isEmpty (SemanticData $semanticData)
 
 createTable (SemanticData $semanticData)
 
 getTableHeader (DIWikiPage $subject)
 
 getTableContent (SemanticData $semanticData)
 

Protected Attributes

 $isVisible = false
 
 $content = null
 

Detailed Description

Class handling the "Factbox" content rendering

GNU GPL v2+

Since
1.9
Author
mwjames

Constructor & Destructor Documentation

SMW\Factbox\Factbox::__construct ( Store  $store,
ParserData  $parserData,
MessageBuilder  $messageBuilder 
)
Since
1.9
Parameters
Store$store
ParserData$parserData
MessageBuilder$messageBuilder

Member Function Documentation

SMW\Factbox\Factbox::createTable ( SemanticData  $semanticData)
protected

Returns a formatted factbox table

Since
1.9
Parameters
SMWSemanticData$semanticData
Returns
string|null
SMW\Factbox\Factbox::doBuild ( )

Builds content suitable for rendering a Factbox and updating the ParserOuput accordingly

Since
1.9
Returns
Factbox
SMW\Factbox\Factbox::fetchContent (   $showFactbox = SMW_FACTBOX_NONEMPTY)
protected

Returns content found for a given ParserOutput object and if the required custom data was not available then semantic data are retrieved from the store for a given subject.

The method checks whether the given setting of $showfactbox requires displaying the given data at all.

Since
1.9
Returns
integer $showFactbox
string|null
SMW\Factbox\Factbox::getContent ( )

Returns content

Since
1.9
Returns
string|null
SMW\Factbox\Factbox::getMagicWords ( )
protected

Returns magic words attached to the ParserOutput object

Since
1.9
Returns
string|null
SMW\Factbox\Factbox::getModules ( )
protected

Returns required resource modules

Since
1.9
Returns
array
SMW\Factbox\Factbox::getTableContent ( SemanticData  $semanticData)
protected

Renders table content for a given SMWSemanticData object

Since
1.9
Parameters
SMWSemanticData$semanticData
SMW\Factbox\Factbox::getTableHeader ( DIWikiPage  $subject)
protected

Renders a table header for a given subject

Since
1.9
Parameters
DIWikiPage$subject
SMW\Factbox\Factbox::getTitle ( )

Returns Title object

Since
1.9
Returns
string|null
SMW\Factbox\Factbox::isEmpty ( SemanticData  $semanticData)
protected

Ensure that the SemanticData container is really empty and not filled with a single "pseudo" property that obscures from re-reading the data

MW's internal Parser does iterate the ParserOuput object several times which can leave a '_SKEY' property while in fact the the container is empty.

Since
1.9
Parameters
SemanticData$semanticData
Returns
boolean
SMW\Factbox\Factbox::isVisible ( )

Returns if content is visible

Since
1.9
Returns
boolean
SMW\Factbox\Factbox::useInPreview (   $preview)
Note
contains information about wpPreview
Since
2.1
Parameters
boolean

Member Data Documentation

SMW\Factbox\Factbox::$content = null
protected
SMW\Factbox\Factbox::$isVisible = false
protected

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