wCMF
3.6
|
Public Member Functions | |
convertStorageToApplication ($data, $type, $name) | |
convertApplicationToStorage ($data, $type, $name) | |
makeUrlRelative ($url) | |
makeUrlAbsolute ($url) | |
getBaseUrl () | |
isAbsoluteUrl ($url) | |
isExternalUrl ($url) | |
Public Member Functions inherited from DataConverter | |
convertStorageToApplication ($data, $type, $name) | |
convertApplicationToStorage ($data, $type, $name) | |
LinkConverter converts internal absolute urls to relative ones when saving to the database and vice versa. Since StringUtil::getUrls() is used to detect urls, only urls in hmtl elements are detected when converting from storage to application (relative to absolute). If the url is not in an html element (e.g. if the whole data is an url) the conversion works only from application to storage (absolute to relative).
Definition at line 39 of file class.LinkConverter.php.
LinkConverter::convertStorageToApplication | ( | $data, | |
$type, | |||
$name | |||
) |
Definition at line 44 of file class.LinkConverter.php.
References StringUtil\getUrls(), isExternalUrl(), and makeUrlAbsolute().
LinkConverter::convertApplicationToStorage | ( | $data, | |
$type, | |||
$name | |||
) |
Definition at line 64 of file class.LinkConverter.php.
References StringUtil\getUrls(), isExternalUrl(), and makeUrlRelative().
LinkConverter::makeUrlRelative | ( | $url | ) |
Convert an absolute resource url on the server where the script runs to a relative one. The converted url is relative to the directory configured in the config key 'htmlBaseDir' section 'cms'
url | The url to convert |
Definition at line 92 of file class.LinkConverter.php.
References getBaseUrl().
Referenced by convertApplicationToStorage().
LinkConverter::makeUrlAbsolute | ( | $url | ) |
Convert an relative url to a absolute one.
url | The url to convert |
Definition at line 110 of file class.LinkConverter.php.
References getBaseUrl().
Referenced by convertStorageToApplication().
LinkConverter::getBaseUrl | ( | ) |
Get the absolute http url of the base directory. The relative path to that directory as seen from the script is configured in the config key 'htmlBaseDir' section 'cms'.
Definition at line 128 of file class.LinkConverter.php.
References $gLinkConverterBaseUrl, InifileParser\getInstance(), URIUtil\makeAbsolute(), and WCMFException\throwEx().
Referenced by makeUrlAbsolute(), and makeUrlRelative().
LinkConverter::isAbsoluteUrl | ( | $url | ) |
Check if an url is absolute
url | The url to check |
Definition at line 146 of file class.LinkConverter.php.
LinkConverter::isExternalUrl | ( | $url | ) |
Check if an url is external
url | The url to check |
Definition at line 155 of file class.LinkConverter.php.
Referenced by convertApplicationToStorage(), and convertStorageToApplication().