dmString Class Reference

Static Public Member Functions


Detailed Description

Definition at line 19 of file dmString.class.php.


Member Function Documentation

static dmString::camelCaseToUnderscore ( str  )  [static, final]
Parameters:
string str
Returns:
string
Since:
0.4

Definition at line 344 of file dmString.class.php.

static dmString::getString ( key,
lang = 'en' 
) [static, final]
static dmString::highlight ( term,
str,
class = 'dmHighlightedTerm' 
) [static, final]

"Highlights" all occurrences of $term in $str by enclosing them in <span> elements with class $class.

Parameters:
string term
string str
string class
Returns:
string

Definition at line 380 of file dmString.class.php.

Referenced by ObjectDraw::highlightedFullText(), and ObjectResultsDraw::results().

static dmString::hyperlink ( str,
DOMDocument $  dxml = null 
) [static]

Searches through text strings and adds HTML anchor tags around any words beginning with http://, https://, ftp://, or gopher://.

Parameters:
string str
DOMDocument dxml
Returns:
If dxml is null, a string; otherwise a DOMDocumentFragment
Since:
0.1

Definition at line 406 of file dmString.class.php.

Referenced by ObjectDraw::metadataAsDL().

static dmString::isValidHostname ( str  )  [static, final]

Adapted from EmailAddressValidator::check_domain_portion() by Dave Child.

Supposedly RFC2822-compliant.

Parameters:
string str
Author:
Dave Child
See also:
http://code.google.com/p/php-email-address-validation/
Since:
0.1

Definition at line 480 of file dmString.class.php.

Referenced by dmEmailMessage::isValidEmail().

static dmString::isValidIPv4Address ( str,
allow_ranges = false 
) [static, final]
Parameters:
string str
Boolean allow_ranges
Returns:
Boolean
Since:
0.1

Definition at line 519 of file dmString.class.php.

static dmString::isValidPathname ( str,
check_exists = false 
) [static, final]
Parameters:
string str
Boolean check_exists
Returns:
Boolean
Since:
0.1

Definition at line 539 of file dmString.class.php.

static dmString::paranoid ( str,
allowed = array() 
) [static, final]

Strips all non-alphanumerics from a string, optionally sparing any characters in the $allowed array.

This should be an indexed array with one character per element. This method inspired by and partially stolen from CakePHP's paranoid().

Parameters:
string str
array allowed Array of characters that will be retained in the string
Returns:
string
Author:
CakePHP Foundation
Since:
0.1

Definition at line 361 of file dmString.class.php.

Referenced by ResultsDraw::facetsAsUL(), dmTemplateSet::getPath(), ObjectDraw::highlightedFullText(), and isValidPathname().

static dmString::truncate ( str,
max_words 
) [static, final]

Truncates a text string to the desired word length, appending an ellipsis (.

..) at the end.

Parameters:
string str
int max_words
Returns:
string
Since:
0.1

Definition at line 462 of file dmString.class.php.

Referenced by ResultsDraw::resultsAsGrid(), ResultsDraw::resultsAsList(), and ResultsDraw::resultsAsTiles().

static dmString::underscoreToCamelCase ( str,
capitalize_first_char = false 
) [static, final]
Parameters:
string str
Boolean capitalize_first_char
Returns:
string CamelCase string
Since:
0.4

Definition at line 557 of file dmString.class.php.

Referenced by dmRoute::setMethod().

static dmString::websafe ( str  )  [static, final]

Strips all HTML tags from a string and HTML-escapes it.

Use this where absolutely no HTML should be allowed (i.e. most places). The page encoding must be UTF-8 for this method to work properly - otherwise, you may be open to cross-site scripting attacks.

Parameters:
string str
Returns:
string
Since:
0.3

Definition at line 582 of file dmString.class.php.

Referenced by ObjectDraw::addFavoriteButton(), ObjectDraw::childLinksAsList(), ObjectDraw::childLinksAsPulldown(), Draw::collectionsAsPulldown(), ObjectDraw::commentsSection(), ObjectDraw::compoundObjectPageNumbersInSearchResultsAsString(), ObjectDraw::compoundObjectSearchForm(), ObjectDraw::compoundPageFlipLinks(), Draw::downloadImageLink(), Draw::exception(), ResultsDraw::facetsAsUL(), SearchDraw::fieldSearch(), Draw::flash(), Draw::formattedFlash(), dmQuickTimeViewer::getHTMLTag(), dmGenericPDFViewer::getHTMLTag(), dmGenericObjectViewer::getHTMLTag(), dmGenericImageViewer::getHTMLTag(), dmFileLinkViewer::getHTMLTag(), ObjectDraw::highlightedFullText(), Draw::loginPageLink(), ObjectDraw::metadataAsDL(), ObjectDraw::metadataAsMetaTags(), ResultsDraw::pageLinks(), ObjectDraw::previousNextLinks(), SearchDraw::proximitySearch(), ObjectDraw::ratingsSection(), ObjectResultsDraw::results(), ResultsDraw::resultsAsGrid(), ResultsDraw::resultsAsList(), ResultsDraw::resultsAsTiles(), ObjectDraw::resultsAsUL(), ResultsDraw::searchTerms(), dmEmailMessage::setSenderName(), ResultsDraw::sortLinksAsUL(), ObjectDraw::taggingSection(), Draw::tagsAsCloud(), Draw::vocabularyAsCloud(), Draw::vocabularyAsList(), and Draw::vocabularyForSelect().

static dmString::xmlentities ( str  )  [static, final]

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

Generated on Fri Aug 20 13:16:50 2010 for dmBridge PHP API by  doxygen 1.6.1