Semantic MediaWiki and related extensions
Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
SMWURIValue Class Reference
Inheritance diagram for SMWURIValue:
Inheritance graph
[legend]
Collaboration diagram for SMWURIValue:
Collaboration graph
[legend]

Public Member Functions

 __construct ( $typeid)
 
 getShortWikiText ( $linked=null)
 
 getShortHTMLText ( $linker=null)
 
 getLongWikiText ( $linker=null)
 
 getLongHTMLText ( $linker=null)
 
 getWikiValue ()
 
 getURI ()
 
 getURL ()
 
- 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)
 
 getCallable ( $key)
 
 clearCallable ( $key)
 
 copyOptions (Options $options=null)
 
 setOption ( $key, $value)
 
 getOption ( $key, $default=false)
 
 hasFeature ( $feature)
 
 isEnabledFeature ( $feature)
 

Public Attributes

const VALUE_RAW = 'uri.value.raw'
 
- 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 ()
 
 getUriDataitem ()
 
 makeNonlinkedWikiText ( $url)
 
- Protected Member Functions inherited from SMWDataValue
 getOptions ()
 
 parseUserValue ( $value)
 
 loadDataItem (SMWDataItem $dataItem)
 
 getServiceLinkParams ()
 
 checkAllowedValues ()
 

Static Protected Member Functions

static isValidTelURI ( $s)
 

Protected Attributes

 $m_wikitext
 
- 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)
 

Detailed Description

This datavalue implements URL/URI/ANNURI/PHONE/EMAIL datavalues suitable for defining the respective types of properties.

Author
Nikolas Iwan
Markus Krötzsch
Bug:
Correctly create safe HTML and Wiki text.

Member Function Documentation

◆ getUriDataitem()

SMWURIValue::getUriDataitem ( )
protected

Helper function to get the current dataitem, or some dummy URI dataitem if the dataitem was not set. This makes it easier to write code that avoids errors even if the data was not initialized properly.

Returns
SMWDIUri

◆ getURL()

SMWURIValue::getURL ( )

Get a URL for hyperlinking this URI, or the empty string if this URI is not hyperlinked in MediaWiki.

Returns
string

◆ isValidTelURI()

static SMWURIValue::isValidTelURI (   $s)
staticprotected

Returns true if the argument is a valid RFC 3966 phone number. Only global phone numbers are supported, and no full validation of parameters (appended via ;param=value) is performed.

◆ loadDataItem()

SMWURIValue::loadDataItem ( SMWDataItem  $dataItem)
protected
See also
SMWDataValue::loadDataItem()
Parameters
$dataitemSMWDataItem
Returns
boolean

◆ makeNonlinkedWikiText()

SMWURIValue::makeNonlinkedWikiText (   $url)
protected

Helper function that changes a URL string in such a way that it can be used in wikitext without being turned into a hyperlink, while still displaying the same characters. The use of <nowiki> is avoided, since the resulting strings may be inserted during parsing, after this has been stripped.

Since
1.8

◆ parseUserValue()

SMWURIValue::parseUserValue (   $value)
protected

NOTE: we do not support raw [ (%5D) and ] (%5E), although they are needed for ldap:// (but rarely in a wiki) NOTE: "+" gets encoded, as it is interpreted as space by most browsers when part of a URL; this prevents tel: from working directly, but we have a datatype for this anyway.

TODO: introduce error-message for "bad" phone number

TODO: introduce error-message for "bad" email

Member Data Documentation

◆ VALUE_RAW

const SMWURIValue::VALUE_RAW = 'uri.value.raw'

Raw value without encoding


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

About | General disclaimer | Privacy policy