SMWSpecialBrowse Class Reference
[SMWSpecialPageSpecialPage]

A factbox view on one specific article, showing all the Semantic data about it. More...

List of all members.

Public Member Functions

 __construct ()
 Constructor.
 execute ($query)
 Main entry point for Special Pages.

Static Public Attributes

static $incomingvaluescount = 8
 int How many incoming values should be asked for
static $incomingpropertiescount = 21
 int How many incoming properties should be asked for

Private Member Functions

 displayBrowse ()
 Create and output HTML including the complete factbox, based on the extracted parameters in the execute comment.
 displayData (SMWSemanticData $data, $left=true, $incoming=false)
 Creates the HTML table displaying the data of one subject.
 displayValue (SMWPropertyValue $property, SMWDataValue $dataValue, $incoming)
 Displays a value, including all relevant links (browse and search by property).
 displayHead ()
 Displays the subject that is currently being browsed to.
 displayCenter ()
 Creates the HTML for the center bar including the links with further navigation options.
 displayBottom ($more)
 Creates the HTML for the bottom bar including the links with further navigation options.
 linkHere ($text, $out, $in, $offset)
 Creates the HTML for a link to this page, with some parameters set.
 getInData ()
 Creates a Semantic Data object with the incoming properties instead of the usual outproperties.
 getPropertyLabel (SMWPropertyValue $property, $incoming=false)
 Figures out the label of the property to be used.
 queryForm ()
 Creates the query form in order to quickly switch to a specific article.
 unbreak ($text)
 Replace the last two space characters with unbreakable spaces for beautification.

Static Private Member Functions

static addAutoComplete ()
 Creates the JS needed for adding auto-completion to queryForm().

Private Attributes

 $subject = null
 SMWDataValue Topic of this page.
 $articletext = ""
 Text to be set in the query form.
 $showoutgoing = true
 bool To display outgoing values?
 $showincoming = false
 bool To display incoming values?
 $offset = 0
 int At which incoming property are we currently?


Detailed Description

A factbox view on one specific article, showing all the Semantic data about it.

Definition at line 18 of file SMW_SpecialBrowse.php.


Constructor & Destructor Documentation

SMWSpecialBrowse::__construct (  ) 

Constructor.

Definition at line 37 of file SMW_SpecialBrowse.php.

References $incomingpropertiescount, $incomingvaluescount, and $smwgBrowseShowAll.


Member Function Documentation

SMWSpecialBrowse::execute ( query  ) 

Main entry point for Special Pages.

Parameters:
[in] $query string Given by MediaWiki

Definition at line 51 of file SMW_SpecialBrowse.php.

References $smwgBrowseShowAll, SMWOutputs::commitToOutputPage(), SMWInfolink::decodeParameters(), and displayBrowse().

SMWSpecialBrowse::displayBrowse (  )  [private]

Create and output HTML including the complete factbox, based on the extracted parameters in the execute comment.

Returns:
string A HTML string with the factbox

Definition at line 96 of file SMW_SpecialBrowse.php.

References $smwgBrowseShowInverse, displayBottom(), displayCenter(), displayData(), displayHead(), getInData(), queryForm(), and smwfGetStore().

Referenced by execute().

SMWSpecialBrowse::displayData ( SMWSemanticData data,
left = true,
incoming = false 
) [private]

Creates the HTML table displaying the data of one subject.

Parameters:
[in] $data SMWSemanticData The data to be displayed
[in] $left bool Should properties be displayed on the left side?
[in] $incoming bool Is this an incoming? Or an outgoing?
Returns:
A string containing the HTML with the factbox

Definition at line 148 of file SMW_SpecialBrowse.php.

References $incomingvaluescount, displayValue(), SMWSemanticData::getProperties(), getPropertyLabel(), SMWSemanticData::getPropertyValues(), SMWDataValueFactory::newDataItemValue(), and smwfGetLinker().

Referenced by displayBrowse().

SMWSpecialBrowse::displayValue ( SMWPropertyValue property,
SMWDataValue dataValue,
incoming 
) [private]

Displays a value, including all relevant links (browse and search by property).

Parameters:
[in] $property SMWPropertyValue The property this value is linked to the subject with
[in] $value SMWDataValue The actual value
[in] $incoming bool If this is an incoming or outgoing link
Returns:
string HTML with the link to the article, browse, and search pages

Definition at line 241 of file SMW_SpecialBrowse.php.

References SMWDataValue::getInfolinkText(), SMWDataValue::getLongHTMLText(), SMWInfolink::newBrowsingLink(), SMWInfolink::newInversePropertySearchLink(), and smwfGetLinker().

Referenced by displayData().

SMWSpecialBrowse::displayHead (  )  [private]

Displays the subject that is currently being browsed to.

Returns:
A string containing the HTML with the subject line

Definition at line 262 of file SMW_SpecialBrowse.php.

References smwfGetLinker().

Referenced by displayBrowse().

SMWSpecialBrowse::displayCenter (  )  [private]

Creates the HTML for the center bar including the links with further navigation options.

Returns:
string HTMl with the center bar

Definition at line 279 of file SMW_SpecialBrowse.php.

References linkHere().

Referenced by displayBrowse().

SMWSpecialBrowse::displayBottom ( more  )  [private]

Creates the HTML for the bottom bar including the links with further navigation options.

Parameters:
[in] $more bool Are there more inproperties to be displayed?
Returns:
string HTMl with the bottom bar

Definition at line 295 of file SMW_SpecialBrowse.php.

References $incomingpropertiescount, $offset, $smwgBrowseShowAll, and linkHere().

Referenced by displayBrowse().

SMWSpecialBrowse::linkHere ( text,
out,
in,
offset 
) [private]

Creates the HTML for a link to this page, with some parameters set.

Parameters:
[in] $text string The anchor text for the link
[in] $out bool Should the linked to page include outgoing properties?
[in] $in bool Should the linked to page include incoming properties?
[in] $offset int What is the offset for the incoming properties?
Returns:
string HTML with the link to this page

Definition at line 324 of file SMW_SpecialBrowse.php.

References $offset.

Referenced by displayBottom(), and displayCenter().

SMWSpecialBrowse::getInData (  )  [private]

Creates a Semantic Data object with the incoming properties instead of the usual outproperties.

Returns:
array(SMWSemanticData, bool) The semantic data including all inproperties, and if there are more inproperties left

Definition at line 346 of file SMW_SpecialBrowse.php.

References $incomingpropertiescount, $incomingvaluescount, and smwfGetStore().

Referenced by displayBrowse().

SMWSpecialBrowse::getPropertyLabel ( SMWPropertyValue property,
incoming = false 
) [private]

Figures out the label of the property to be used.

For outgoing ones it is just the text, for incoming ones we try to figure out the inverse one if needed, either by looking for an explicitly stated one or by creating a default one.

Parameters:
[in] $property SMWPropertyValue The property of interest
[in] $incoming bool If it is an incoming property
Returns:
string The label of the property

Definition at line 386 of file SMW_SpecialBrowse.php.

References $smwgBrowseShowInverse, SMWPropertyValue::getWikiValue(), SMWPropertyValue::makeUserProperty(), smwfGetStore(), and unbreak().

Referenced by displayData().

SMWSpecialBrowse::queryForm (  )  [private]

Creates the query form in order to quickly switch to a specific article.

Returns:
A string containing the HTML for the form

Definition at line 406 of file SMW_SpecialBrowse.php.

Referenced by displayBrowse().

static SMWSpecialBrowse::addAutoComplete (  )  [static, private]

Creates the JS needed for adding auto-completion to queryForm().

Uses the MW API to fetch suggestions.

Definition at line 421 of file SMW_SpecialBrowse.php.

References END, SMWOutputs::requireResource(), SMWOutputs::requireScript(), and public::response().

SMWSpecialBrowse::unbreak ( text  )  [private]

Replace the last two space characters with unbreakable spaces for beautification.

Parameters:
[in] $text string Text to be transformed. Does not need to have spaces
Returns:
string Transformed text

Definition at line 449 of file SMW_SpecialBrowse.php.

Referenced by getPropertyLabel().


Member Data Documentation

SMWSpecialBrowse::$incomingvaluescount = 8 [static]

int How many incoming values should be asked for

Definition at line 20 of file SMW_SpecialBrowse.php.

Referenced by __construct(), displayData(), and getInData().

SMWSpecialBrowse::$incomingpropertiescount = 21 [static]

int How many incoming properties should be asked for

Definition at line 22 of file SMW_SpecialBrowse.php.

Referenced by __construct(), displayBottom(), and getInData().

SMWSpecialBrowse::$subject = null [private]

SMWDataValue Topic of this page.

Definition at line 24 of file SMW_SpecialBrowse.php.

SMWSpecialBrowse::$articletext = "" [private]

Text to be set in the query form.

Definition at line 26 of file SMW_SpecialBrowse.php.

SMWSpecialBrowse::$showoutgoing = true [private]

bool To display outgoing values?

Definition at line 28 of file SMW_SpecialBrowse.php.

SMWSpecialBrowse::$showincoming = false [private]

bool To display incoming values?

Definition at line 30 of file SMW_SpecialBrowse.php.

SMWSpecialBrowse::$offset = 0 [private]

int At which incoming property are we currently?

Definition at line 32 of file SMW_SpecialBrowse.php.

Referenced by displayBottom(), and linkHere().


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

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