Semantic MediaWiki and related extensions
|
Public Member Functions | |
__construct ( $typeid) | |
setLinkAttributes (array $linkAttributes) | |
setQueryParameters (array $queryParameters) | |
getShortWikiText ( $linked=null) | |
getShortHTMLText ( $linker=null) | |
getLongWikiText ( $linked=null) | |
getLongHTMLText ( $linker=null) | |
getWikiValue () | |
getHash () | |
getTitle () | |
getText () | |
getPrefixedText () | |
getPreferredCaption () | |
getDisplayTitle () | |
Public Member Functions inherited from SMWDataValue | |
__construct ( $typeid) | |
getTypeID () | |
setUserValue ( $value, $caption=false) | |
setDataItem (SMWDataItem $dataItem) | |
setDataValueServiceFactory (DataValueServiceFactory $dataValueServiceFactory) | |
setProperty (DIProperty $property) | |
getProperty () | |
setContextPage (SMWDIWikiPage $contextPage=null) | |
getContextPage () | |
setCaption ( $caption) | |
getCaption () | |
getPreferredCaption () | |
setOutputFormat ( $formatString) | |
getOutputFormat () | |
addError ( $error) | |
addErrorMsg ( $error, $type=Message::TEXT) | |
getErrorText () | |
getErrors () | |
getErrorsByType ( $type=null) | |
getRestrictionError () | |
clearErrors () | |
getQueryDescription ( $value) | |
getDataItem () | |
__toString () | |
getShortWikiText ( $linker=null) | |
getShortHTMLText ( $linker=null) | |
getLongWikiText ( $linker=null) | |
getLongHTMLText ( $linker=null) | |
getWikiValue () | |
getShortText ( $outputFormat, $linker=null) | |
getLongText ( $outputFormat, $linker=null) | |
getInfolinkText ( $outputFormat, $linker=null) | |
getInfolinks () | |
getHash () | |
isNumeric () | |
isValid () | |
canUse () | |
isRestricted () | |
addCallable ( $key, callable $callable) | |
hasCallable ( $key) | |
getCallable ( $key) | |
clearCallable ( $key) | |
copyOptions (Options $options=null) | |
setOption ( $key, $value) | |
getOption ( $key, $default=false) | |
hasFeature ( $feature) | |
isEnabledFeature ( $feature) | |
checkConstraints () | |
Public Attributes | |
const | NO_TEXT_TRANSFORMATION = 'no.text.transformation' |
const | NO_IMAGE = 'no.image' |
const | SHORT_FORM = 'form/short' |
const | PREFIXED_FORM = 'form/prefixed' |
Public Attributes inherited from SMWDataValue | |
const | OPT_USER_LANGUAGE = 'user.language' |
const | OPT_CONTENT_LANGUAGE = 'content.language' |
const | OPT_QUERY_CONTEXT = 'query.context' |
const | OPT_QUERY_COMP_CONTEXT = 'query.comparator.context' |
const | OPT_DISABLE_INFOLINKS = 'disable.infolinks' |
const | OPT_DISABLE_SERVICELINKS = 'disable.servicelinks' |
const | OPT_COMPACT_INFOLINKS = 'compact.infolinks' |
Protected Member Functions | |
parseUserValue ( $value) | |
loadDataItem (SMWDataItem $dataItem) | |
getServiceLinkParams () | |
getShortCaptionText () | |
getLongCaptionText () | |
getWikiLinkTarget () | |
Protected Member Functions inherited from SMWDataValue | |
getOptions () | |
parseUserValue ( $value) | |
loadDataItem (SMWDataItem $dataItem) | |
getServiceLinkParams () | |
checkAllowedValues () | |
Protected Attributes | |
$m_fragment = '' | |
$m_prefixedtext = '' | |
$m_id = -1 | |
$m_title = null | |
$m_fixNamespace = NS_MAIN | |
$linkAttributes = [] | |
$queryParameters = [] | |
Protected Attributes inherited from SMWDataValue | |
$m_dataitem | |
$m_property = null | |
$m_contextPage = null | |
$m_caption | |
$m_typeid | |
$m_outformat = false | |
$restrictionError = false | |
$dataValueServiceFactory | |
Additional Inherited Members | |
Static Public Member Functions inherited from SMWDataValue | |
static | prepareValue (&$value, &$comparator) |
This datavalue implements special processing suitable for defining wikipages as values of properties.
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 behavior 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 included the namespace and long displays used the pipe trick, leading to a paradoxical confusion of "long" and "short".
SMWWikiPageValue::getDisplayTitle | ( | ) |
|
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).
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 |
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 |
SMWWikiPageValue::getPreferredCaption | ( | ) |
SMWWikiPageValue::getPrefixedText | ( | ) |
Get the prefixed text for this value, including a localized namespace prefix.
|
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)
|
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).
SMWWikiPageValue::getShortHTMLText | ( | $linker = null | ) |
Display the value as in getShortWikiText() but create HTML. The only difference is that images are not embedded.
Linker | $linker | mixed the Linker object to use or null if no linking is desired |
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 |
SMWWikiPageValue::getText | ( | ) |
Get text label for this value, just like Title::getText().
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.
|
protected |
Compute a text that can be used in wiki text to link to this datavalue. Processing includes some escaping and adding the fragment.
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.
|
protected |
|
protected |
TODO: Escape the text so users can see punctuation problems (bug 11666).
SMWWikiPageValue::setLinkAttributes | ( | array | $linkAttributes | ) |
array | $linkAttributes |
SMWWikiPageValue::setQueryParameters | ( | array | $queryParameters | ) |
array | $queryParameters |
const SMWWikiPageValue::NO_IMAGE = 'no.image' |
Whether images should be displayed as media or simple link.
const SMWWikiPageValue::NO_TEXT_TRANSFORMATION = 'no.text.transformation' |
Whether text transformation should be suppressed or not.
const SMWWikiPageValue::PREFIXED_FORM = 'form/prefixed' |
Whether to use the prefixed form or not.
const SMWWikiPageValue::SHORT_FORM = 'form/short' |
Whether to use the short form or not.