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
Collaboration diagram for SMWURIValue:
Collaboration graph
[legend]

Public Member Functions

 __construct ($typeid)
 
 getShortWikiText ($linked=null)
 
 getShortHTMLText ($linker=null)
 
 getLongWikiText ($linked=null)
 
 getLongHTMLText ($linker=null)
 
 getWikiValue ()
 
 getURI ()
 
 getURL ()
 
- Public Member Functions inherited from SMWDataValue
 __construct ($typeid)
 
 setUserValue ($value, $caption=false)
 
 setDataItem (SMWDataItem $dataItem)
 
 setDataValueServiceFactory ($dataValueServiceFactory)
 
 setProperty (SMWDIProperty $property)
 
 getProperty ()
 
 setContextPage (SMWDIWikiPage $contextPage=null)
 
 getContextPage ()
 
 setOptions (Options $options=null)
 
 setOption ($key, $value)
 
 getOption ($key)
 
 isEnabledFeature ($feature)
 
 setCaption ($caption)
 
 getCaption ()
 
 getPreferredCaption ()
 
 setOutputFormat ($formatString)
 
 getOutputFormat ()
 
 addError ($error)
 
 addErrorMsg ($parameters, $type=null)
 
 clearErrors ()
 
 getQueryDescription ($value)
 
 getDataItem ()
 
 __toString ()
 
 getShortWikiText ($linked=null)
 
 getShortHTMLText ($linker=null)
 
 getLongWikiText ($linked=null)
 
 getLongHTMLText ($linker=null)
 
 getShortText ($outputformat, $linker=null)
 
 getLongText ($outputformat, $linker=null)
 
 getInfolinkText ($outputformat, $linker=null)
 
 getWikiValue ()
 
 getTypeID ()
 
 getInfolinks ()
 
 getHash ()
 
 isNumeric ()
 
 isValid ()
 
 canUse ()
 
 getExtraneousFunctionFor ($name, array $parameters=array())
 
 getErrorText ()
 
 getErrors ()
 

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'
 

Protected Member Functions

 parseUserValue ($value)
 
 loadDataItem (SMWDataItem $dataItem)
 
 getServiceLinkParams ()
 
 getUriDataitem ()
 
 makeNonlinkedWikiText ($url)
 
- Protected Member Functions inherited from SMWDataValue
 parseUserValue ($value)
 
 loadDataItem (SMWDataItem $dataItem)
 
 getServiceLinkParams ()
 
 checkAllowedValues ()
 
 getOptions ()
 

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
 
 $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.

Constructor & Destructor Documentation

SMWURIValue::__construct (   $typeid)

Member Function Documentation

SMWURIValue::getLongHTMLText (   $linker = null)
SMWURIValue::getLongWikiText (   $linked = null)
SMWURIValue::getServiceLinkParams ( )
protected
SMWURIValue::getShortHTMLText (   $linker = null)
SMWURIValue::getShortWikiText (   $linked = null)
SMWURIValue::getURI ( )
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
SMWURIValue::getURL ( )

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

Returns
string
SMWURIValue::getWikiValue ( )
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.

SMWURIValue::loadDataItem ( SMWDataItem  $dataItem)
protected
See also
SMWDataValue::loadDataItem()
Parameters
$dataitemSMWDataItem
Returns
boolean
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
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

SMWURIValue::$m_wikitext
protected
const SMWURIValue::VALUE_RAW = 'uri.value.raw'

Raw value without encoding


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