Inherits SMWDataValue.
Public Member Functions | |
| __construct ($typeid) | |
| Constructor. | |
| getShortWikiText ($linked=null) | |
| Display the value on a wiki page. | |
| getShortHTMLText ($linker=null) | |
| Display the value as in getShortWikiText() but create HTML. | |
| getLongWikiText ($linked=null) | |
| Display the "long" value on a wiki page. | |
| getLongHTMLText ($linker=null) | |
| Display the "long" value in HTML. | |
| getWikiValue () | |
| Return a string that could be used in an in-page property assignment for setting this value. | |
| getHash () | |
| Return a string that identifies the value of the object, and that can be used to compare different value objects. | |
| getTitle () | |
| Return according Title object or null if no valid value was set. | |
| getArticleID () | |
| Get MediaWiki's ID for this value or 0 if not available. | |
| getNamespace () | |
| Get namespace constant for this value. | |
| getDBkey () | |
| Get DBKey for this value. | |
| getText () | |
| Get text label for this value, just like Title::getText(). | |
| getPrefixedText () | |
| Get the prefixed text for this value, including a localized namespace prefix. | |
| getInterwiki () | |
| Get interwiki prefix or empty string. | |
| getSortKey () | |
| Find the sortkey for this object. | |
Static Public Member Functions | |
| static | makePage ($dbkey, $namespace, $ignoredParameter= '', $interwiki= '') |
| Static function for creating a new wikipage object from data as it is typically stored internally. | |
| static | makePageFromTitle (Title $title) |
| Static function for creating a new wikipage object from a MediaWiki Title object. | |
Protected Member Functions | |
| parseUserValue ($value) | |
| Initialise the datavalue from the given value string. | |
| loadDataItem (SMWDataItem $dataItem) | |
| getServiceLinkParams () | |
| Create links to mapping services based on a wiki-editable message. | |
| getShortCaptionText () | |
| Get a short caption used to label this value. | |
| getLongCaptionText () | |
| Get a long caption used to label this value. | |
| getWikiLinkTarget () | |
| Compute a text that can be used in wiki text to link to this datavalue. | |
Protected Attributes | |
| $m_fragment = '' | |
| $m_prefixedtext = '' | |
| $m_id = -1 | |
| $m_title = null | |
| $m_fixNamespace = NS_MAIN | |
The class can support general wiki pages, or pages of a fixed namespace, Whether a namespace is fixed is decided based on the type ID when the object is constructed.
The short display simulates the behaviour of the MediaWiki "pipe trick" but always includes fragments. This can be overwritten by setting a caption, which is also done by default when generating a value from user input. The long display always includes all relevant information. Only if a fixed namespace is used for the datatype, the namespace prefix is omitted. This behavior has changed in SMW 1.7: up to this time, short displays have always inlcuded the namespace and long displays used the pipe trick, leading to a paradoxical confusion of "long" and "short".
Definition at line 28 of file SMW_DV_WikiPage.php.
| SMWWikiPageValue::__construct | ( | $ | typeid | ) |
Constructor.
| string | $typeid |
Reimplemented from SMWDataValue.
Definition at line 67 of file SMW_DV_WikiPage.php.
| SMWWikiPageValue::parseUserValue | ( | $ | value | ) | [protected] |
Initialise the datavalue from the given value string.
The format of this strings might be any acceptable user input and especially includes the output of getWikiValue().
| string | $value |
Reimplemented from SMWDataValue.
Definition at line 87 of file SMW_DV_WikiPage.php.
References SMWDataValue::addError(), and SMWDIWikiPage::newFromTitle().
| SMWWikiPageValue::loadDataItem | ( | SMWDataItem $ | dataItem | ) | [protected] |
| $dataitem | SMWDataItem |
Reimplemented from SMWDataValue.
Definition at line 135 of file SMW_DV_WikiPage.php.
References SMWDataValue::addError(), getNamespace(), SMWDataItem::TYPE_CONTAINER, and SMWDataItem::TYPE_WIKIPAGE.
| SMWWikiPageValue::getShortWikiText | ( | $ | linked = null |
) |
Display the value on a wiki page.
This is used to display the value in the place where it was annotated on a wiki page. The desired behavior is that the display in this case looks as if no property annotation had been given, i.e. an annotation [[property::page|foo]] should display like [[page|foo]] in MediaWiki. But this should lead to a link, not to a category assignment. This means that:
(1) If Image: is used (instead of Media:) then let MediaWiki embed the image.
(2) If Category: is used, treat it as a page and link to it (do not categorize the page)
(3) Preserve everything given after "|" for display (caption, image parameters, ...)
(4) Use the (default) caption for display. When the value comes from user input, this includes the full value that one would also see in MediaWiki.
| $linked | mixed generate links if not null or false |
Reimplemented from SMWDataValue.
Definition at line 185 of file SMW_DV_WikiPage.php.
References getShortCaptionText(), getWikiLinkTarget(), getWikiValue(), and SMWDataValue::isValid().
| SMWWikiPageValue::getShortHTMLText | ( | $ | linker = null |
) |
Display the value as in getShortWikiText() but create HTML.
The only difference is that images are not embedded.
| $linker | mixed the Linker object to use or null if no linking is desired |
Reimplemented from SMWDataValue.
Definition at line 213 of file SMW_DV_WikiPage.php.
References getNamespace(), getShortCaptionText(), getTitle(), getWikiValue(), and SMWDataValue::isValid().
| SMWWikiPageValue::getLongWikiText | ( | $ | linked = null |
) |
Display the "long" value on a wiki page.
This behaves largely like getShortWikiText() but does not use the caption. Instead, it always takes the long display form (wiki value).
| $linked | mixed if true the result will be linked |
Reimplemented from SMWDataValue.
Definition at line 242 of file SMW_DV_WikiPage.php.
References SMWDataValue::getErrorText(), getLongCaptionText(), getWikiLinkTarget(), getWikiValue(), and SMWDataValue::isValid().
| SMWWikiPageValue::getLongHTMLText | ( | $ | linker = null |
) |
Display the "long" value in HTML.
This behaves largely like getLongWikiText() but does not embed images.
| $linker | mixed if a Linker is given, the result will be linked |
Reimplemented from SMWDataValue.
Definition at line 268 of file SMW_DV_WikiPage.php.
References SMWDataValue::getErrorText(), getLongCaptionText(), getNamespace(), getTitle(), getWikiValue(), and SMWDataValue::isValid().
| SMWWikiPageValue::getWikiValue | ( | ) |
Return a string that could be used in an in-page property assignment for setting this value.
This does not include initial ":" for escaping things like Category: links since the property value does not include such escapes either. Fragment information is included. Namespaces are omitted if a fixed namespace is used, since they are not needed in this case when making a property assignment.
Reimplemented from SMWDataValue.
Definition at line 298 of file SMW_DV_WikiPage.php.
References getPrefixedText(), and getText().
Referenced by getLongHTMLText(), getLongWikiText(), getShortHTMLText(), and getShortWikiText().
| SMWWikiPageValue::getHash | ( | ) |
Return a string that identifies the value of the object, and that can be used to compare different value objects.
Possibly overwritten by subclasses (e.g. to ensure that returned value is normalized first)
Reimplemented from SMWDataValue.
Definition at line 303 of file SMW_DV_WikiPage.php.
References SMWDataValue::getErrors(), getPrefixedText(), and SMWDataValue::isValid().
| SMWWikiPageValue::getServiceLinkParams | ( | ) | [protected] |
Create links to mapping services based on a wiki-editable message.
The parameters available to the message are: $1: urlencoded article name (no namespace)
Reimplemented from SMWDataValue.
Definition at line 314 of file SMW_DV_WikiPage.php.
References SMWDataValue::isValid().
| SMWWikiPageValue::getTitle | ( | ) |
Return according Title object or null if no valid value was set.
null can be returned even if this object returns true for isValid(), since the latter function does not check whether MediaWiki can really make a Title out of the given data. However, isValid() will return false *after* this function failed in trying to create a title.
Definition at line 334 of file SMW_DV_WikiPage.php.
References SMWDataValue::addError(), and SMWDataValue::isValid().
Referenced by SMWSQLStoreLight::deleteSemanticData(), getArticleID(), getLongHTMLText(), getShortHTMLText(), and SMQueryHandler::handleResultSubject().
| SMWWikiPageValue::getArticleID | ( | ) |
Get MediaWiki's ID for this value or 0 if not available.
Definition at line 352 of file SMW_DV_WikiPage.php.
References getTitle().
| SMWWikiPageValue::getNamespace | ( | ) |
Get namespace constant for this value.
Definition at line 365 of file SMW_DV_WikiPage.php.
Referenced by getLongHTMLText(), getShortHTMLText(), and loadDataItem().
| SMWWikiPageValue::getDBkey | ( | ) |
Get DBKey for this value.
Subclasses that allow for values that do not correspond to wiki pages may choose a DB key that is not a legal title DB key but rather another suitable internal ID. Thus it is not suitable to use this method in places where only MediaWiki Title keys are allowed.
Definition at line 377 of file SMW_DV_WikiPage.php.
| SMWWikiPageValue::getText | ( | ) |
Get text label for this value, just like Title::getText().
Definition at line 386 of file SMW_DV_WikiPage.php.
Referenced by getLongCaptionText(), getPrefixedText(), getShortCaptionText(), and getWikiValue().
| SMWWikiPageValue::getPrefixedText | ( | ) |
Get the prefixed text for this value, including a localized namespace prefix.
Definition at line 396 of file SMW_DV_WikiPage.php.
References getText(), and SMWDataValue::isValid().
Referenced by getHash(), getLongCaptionText(), getWikiLinkTarget(), and getWikiValue().
| SMWWikiPageValue::getInterwiki | ( | ) |
Get interwiki prefix or empty string.
Definition at line 417 of file SMW_DV_WikiPage.php.
| SMWWikiPageValue::getShortCaptionText | ( | ) | [protected] |
Get a short caption used to label this value.
In particular, this omits namespace and interwiki prefixes (similar to the MediaWiki "pipe trick"). Fragments are included unless they start with an underscore (used for generated fragment names that are not helpful for users and that might change easily).
Definition at line 431 of file SMW_DV_WikiPage.php.
References getText().
Referenced by getShortHTMLText(), and getShortWikiText().
| SMWWikiPageValue::getLongCaptionText | ( | ) | [protected] |
Get a long caption used to label this value.
In particular, this includes namespace and interwiki prefixes, while fragments are only included if they do not start with an underscore (used for generated fragment names that are not helpful for users and that might change easily).
Definition at line 450 of file SMW_DV_WikiPage.php.
References getPrefixedText(), and getText().
Referenced by getLongHTMLText(), and getLongWikiText().
| SMWWikiPageValue::getWikiLinkTarget | ( | ) | [protected] |
Compute a text that can be used in wiki text to link to this datavalue.
Processing includes some escaping and adding the fragment.
Definition at line 467 of file SMW_DV_WikiPage.php.
References getPrefixedText().
Referenced by getLongWikiText(), and getShortWikiText().
| SMWWikiPageValue::getSortKey | ( | ) |
Find the sortkey for this object.
Definition at line 479 of file SMW_DV_WikiPage.php.
References smwfGetStore().
| static SMWWikiPageValue::makePage | ( | $ | dbkey, | |
| $ | namespace, | |||
| $ | ignoredParameter = '', |
|||
| $ | interwiki = '' | |||
| ) | [static] |
Static function for creating a new wikipage object from data as it is typically stored internally.
In particular, the title string is supposed to be in DB key form.
Definition at line 496 of file SMW_DV_WikiPage.php.
Referenced by SDBrowseDataPage::addSemanticResultWrapper(), and SMWSQLStoreLight::getPropertySubjects().
| static SMWWikiPageValue::makePageFromTitle | ( | Title $ | title | ) | [static] |
Static function for creating a new wikipage object from a MediaWiki Title object.
Definition at line 511 of file SMW_DV_WikiPage.php.
References SMWDIWikiPage::newFromTitle().
Referenced by SMWSQLStoreLight::deleteSubject(), SMWQueryUIHelper::execute(), and SMWSQLStoreLight::getSemanticData().
SMWWikiPageValue::$m_fragment = '' [protected] |
Definition at line 35 of file SMW_DV_WikiPage.php.
SMWWikiPageValue::$m_prefixedtext = '' [protected] |
Definition at line 42 of file SMW_DV_WikiPage.php.
SMWWikiPageValue::$m_id = -1 [protected] |
Definition at line 49 of file SMW_DV_WikiPage.php.
SMWWikiPageValue::$m_title = null [protected] |
Definition at line 56 of file SMW_DV_WikiPage.php.
SMWWikiPageValue::$m_fixNamespace = NS_MAIN [protected] |
Definition at line 65 of file SMW_DV_WikiPage.php.
1.5.6