SMWURIValue Class Reference
[SMWDataValues]

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

Inherits SMWDataValue.

List of all members.

Public Member Functions

 __construct ($typeid)
 Constructor.
 getShortWikiText ($linked=null)
 Returns a short textual representation for this data value.
 getShortHTMLText ($linker=null)
 Returns a short textual representation for this data value.
 getLongWikiText ($linked=null)
 Return the long textual description of the value, as printed for example in the factbox.
 getLongHTMLText ($linker=null)
 Return the long textual description of the value, as printed for example in the factbox.
 getWikiValue ()
 Return the plain wiki version of the value, or FALSE if no such version is available.
 getURI ()
 getURL ()
 Get a URL for hyperlinking this URI, or the empty string if this URI is not hyperlinked in MediaWiki.

Static Public Member Functions

static validateEmail ($addr)
 This is a copy of.

Protected Member Functions

 parseUserValue ($value)
 Initialise the datavalue from the given value string.
 loadDataItem (SMWDataItem $dataItem)
 getServiceLinkParams ()
 Overwritten by callers to supply an array of parameters that can be used for creating servicelinks.

Static Protected Member Functions

static isValidTelURI ($s)
 Returns true if the argument is a valid RFC 3966 phone number.

Protected Attributes

 $m_wikitext

Private Attributes

 $m_mode


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.

Definition at line 21 of file SMW_DV_URI.php.


Constructor & Destructor Documentation

SMWURIValue::__construct ( typeid  ) 

Constructor.

Parameters:
string $typeid

Reimplemented from SMWDataValue.

Definition at line 35 of file SMW_DV_URI.php.


Member Function Documentation

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

Parameters:
string $value

Reimplemented from SMWDataValue.

Definition at line 53 of file SMW_DV_URI.php.

References SMWDataValue::addError(), and isValidTelURI().

static SMWURIValue::isValidTelURI ( s  )  [static, protected]

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.

Definition at line 155 of file SMW_DV_URI.php.

Referenced by parseUserValue().

SMWURIValue::loadDataItem ( SMWDataItem dataItem  )  [protected]

See also:
SMWDataValue::loadDataItem()
Parameters:
$dataitem SMWDataItem
Returns:
boolean

Reimplemented from SMWDataValue.

Definition at line 165 of file SMW_DV_URI.php.

References getURI(), and SMWDataItem::TYPE_URI.

SMWURIValue::getShortWikiText ( linked = null  ) 

Returns a short textual representation for this data value.

If the value was initialised from a user supplied string, then this original string should be reflected in this short version (i.e. no normalisation should normally happen). There might, however, be additional parts such as code for generating tooltips. The output is in wiki text.

The parameter $linked controls linking of values such as titles and should be non-NULL and non-false if this is desired.

Reimplemented from SMWDataValue.

Definition at line 182 of file SMW_DV_URI.php.

References getURL().

SMWURIValue::getShortHTMLText ( linker = null  ) 

Returns a short textual representation for this data value.

If the value was initialised from a user supplied string, then this original string should be reflected in this short version (i.e. no normalisation should normally happen). There might, however, be additional parts such as code for generating tooltips. The output is in HTML text.

The parameter $linker controls linking of values such as titles and should be some Linker object (or NULL for no linking).

Reimplemented from SMWDataValue.

Definition at line 191 of file SMW_DV_URI.php.

References getURL(), and SMWDataValue::isValid().

SMWURIValue::getLongWikiText ( linked = null  ) 

Return the long textual description of the value, as printed for example in the factbox.

If errors occurred, return the error message The result always is a wiki-source string.

The parameter $linked controls linking of values such as titles and should be non-NULL and non-false if this is desired.

Reimplemented from SMWDataValue.

Definition at line 200 of file SMW_DV_URI.php.

References SMWDataValue::getErrorText(), getURL(), and SMWDataValue::isValid().

SMWURIValue::getLongHTMLText ( linker = null  ) 

Return the long textual description of the value, as printed for example in the factbox.

If errors occurred, return the error message The result always is an HTML string.

The parameter $linker controls linking of values such as titles and should be some Linker object (or NULL for no linking).

Reimplemented from SMWDataValue.

Definition at line 213 of file SMW_DV_URI.php.

References SMWDataValue::getErrorText(), getURL(), and SMWDataValue::isValid().

SMWURIValue::getWikiValue (  ) 

Return the plain wiki version of the value, or FALSE if no such version is available.

The returned string suffices to reobtain the same DataValue when passing it as an input string to setUserValue().

Reimplemented from SMWDataValue.

Definition at line 227 of file SMW_DV_URI.php.

SMWURIValue::getURI (  ) 

Definition at line 231 of file SMW_DV_URI.php.

Referenced by loadDataItem().

SMWURIValue::getServiceLinkParams (  )  [protected]

Overwritten by callers to supply an array of parameters that can be used for creating servicelinks.

The number and content of values in the parameter array may vary, depending on the concrete datatype.

Reimplemented from SMWDataValue.

Definition at line 235 of file SMW_DV_URI.php.

SMWURIValue::getURL (  ) 

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

Returns:
string

Definition at line 247 of file SMW_DV_URI.php.

Referenced by getLongHTMLText(), getLongWikiText(), getShortHTMLText(), and getShortWikiText().

static SMWURIValue::validateEmail ( addr  )  [static]

This is a copy of.

See also:
Sanitizer::validateEmail which was introduced in MW 1.18, and is thus used for compatibility with earlier versions.

Definition at line 264 of file SMW_DV_URI.php.


Member Data Documentation

SMWURIValue::$m_wikitext [protected]

Definition at line 27 of file SMW_DV_URI.php.

SMWURIValue::$m_mode [private]

Definition at line 33 of file SMW_DV_URI.php.


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

Generated on Thu Feb 9 07:15:43 2012 for Semantic MediaWiki by  doxygen 1.5.6