blueshoes php application framework and cms            core_net
[ class tree: core_net ] [ index: core_net ] [ all elements ]

Class: Bs_EmailUtil

Source Location: /core/net/email/Bs_EmailUtil.class.php

Class Overview

Bs_Object
   |
   --Bs_EmailUtil

General pseudo-static email utility class.


Author(s):

Version:

  • 4.3.$Revision: 1.3 $ $Date: 2003/10/29 17:48:41 $

Copyright:

  • blueshoes.org

Variables

Methods


Inherited Variables

Inherited Methods

Class: Bs_Object

Bs_Object::Bs_Object()
Bs_Object::getErrors()
Basic error handling: Get *all* errors as string array from the global Bs_Error-error stack.
Bs_Object::getLastError()
Basic error handling: Get last error string from the global Bs_Error-error stack.
Bs_Object::getLastErrors()
Basic error handling: Get last errors string array from the global Bs_Error-error stack sinc last call of getLastErrors().
Bs_Object::persist()
Persists this object by serializing it and saving it to a file with unique name.
Bs_Object::setError()
Basic error handling: Push an error string on the global Bs_Error-error stack.
Bs_Object::toHtml()
Dumps the content of this object to a string using PHP's var_dump().
Bs_Object::toString()
Dumps the content of this object to a string using PHP's var_dump().
Bs_Object::unpersist()
Fetches an object that was persisted with persist()

Class Details

[line 29]
General pseudo-static email utility class.

features: - missing: -

dependencies: Bs_HtmlUtil




Tags:

pattern:  singleton: (pseudostatic)
access:  public
version:  4.3.$Revision: 1.3 $ $Date: 2003/10/29 17:48:41 $
copyright:  blueshoes.org
author:  Andrej Arn <at blueshoes dot org>


[ Top ]


Class Variables

$Bs_HtmlUtil =

[line 36]

reference to the pseudo-static instance.


Type:   object


[ Top ]



Class Methods


constructor Bs_EmailUtil [line 43]

Bs_EmailUtil Bs_EmailUtil( )

Constructor



Tags:

access:  public


[ Top ]

method emailHidingWithJsOnMouseOver [line 130]

string emailHidingWithJsOnMouseOver( string $email)



Tags:

return:  (html code)
see:  Bs_EmailUtil::hideEmailWithJsDocumentWrite()
throws:  bool FALSE (if the given email address is invalid.)
access:  public


Parameters:

string   $email  

[ Top ]

method hideEmailWithJsDocumentWrite [line 95]

string hideEmailWithJsDocumentWrite( string $email, [string $name = NULL], [string $cssClass = NULL])

uses javascripts document.write() function to spit out the address as link.

non-js browsers will see a readable version of the address using the noscript tag.

this is browser-safe and emailspider safe. most, like 98% of the web users won't notice a difference, and most, like 99.9% of the email spiders won't catch the address. use it!




Tags:

return:  (html code)
see:  Bs_EmailUtil::emailHidingWithJsOnMouseOver()
throws:  bool FALSE (if the given email address is invalid.)
access:  public


Parameters:

string   $email  
string   $name   (default is NULL, which means use the $email address as 'caption' aswell.)
string   $cssClass   (if you want to apply a style sheet to the tag.)

[ Top ]

method htmlEncode [line 205]

string htmlEncode( string $email)

html-encodes the address.

this is just a wrapper for Bs_HtmlUtil->charToHtml().




Tags:

access:  public


Parameters:

string   $email  

[ Top ]

method parse [line 57]

array parse( string $email)

Validates the syntax of a given email address and parses it into it's elements.



Tags:

return:  a zerobased array. 0=user 1=host
see:  Bs->EmailValidator->validateSyntax()
throws:  bool FALSE


Parameters:

string   $email  

[ Top ]

method toPronounceable [line 178]

void toPronounceable( string $email, [mixed $lang = 'en'])

converts the given email address into a "pronounceable" string.

these languages are supported: (texts are written in lower case here) CHARACTER LANGUAGE @ . _ - 'en' at dot underscore dash 'de' at punkt unterstrich strich 'de2' affenschwanz punkt unterstrich minus

you can pass an array (vector with 4 elements) as param 2 ($lang) to use your own text. make sure you use a space in front and at the end of the strings, or feel free to use something else.

EXAMPLES: (the results are not html-encoded here for better reading) htmlEncode('tom.jones@hotmail.com') => tom DOT jones AT hotmail DOT com htmlEncode('tom.jones@hotmail.com', 'de2') => tom PUNKT jones AFFENSCHWANZ hotmail PUNKT com




Tags:

access:  public


Parameters:

string   $email  
mixed   $lang   (default is 'en', see above)

[ Top ]


Documentation generated on Mon, 29 Dec 2003 21:08:54 +0100 by phpDocumentor 1.2.3