Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes

Robo47_Filter_HtmlPurifier Class Reference

List of all members.

Public Member Functions

 __construct ($purifier=null)
 filter ($value)
 Filter.
 getPurifier ()
 Get Purifier.
 setPurifier ($purifier=null)

Static Public Member Functions

static getDefaultPurifier ()
 Get default Purifier.
static setDefaultPurifier (HtmlPurifier $purifier=null)
 Set default Purifier.

Protected Member Functions

 _purifierFromRegistry ($key)
 Get HtmlPurifier from Registry if found.

Protected Attributes

 $_purifier = null

Static Protected Attributes

static $_defaultPurifier

Detailed Description

Definition at line 33 of file HtmlPurifier.php.


Constructor & Destructor Documentation

Robo47_Filter_HtmlPurifier::__construct ( purifier = null  ) 
Parameters:
HtmlPurifier|string $purifier

Definition at line 51 of file HtmlPurifier.php.

References setPurifier().

    {
        $this->setPurifier($purifier);
    }

Here is the call graph for this function:


Member Function Documentation

Robo47_Filter_HtmlPurifier::_purifierFromRegistry ( key  )  [protected]

Get HtmlPurifier from Registry if found.

Parameters:
string $key
Returns:
mixed

Definition at line 85 of file HtmlPurifier.php.

Referenced by setPurifier().

    {
        if (Zend_Registry::isRegistered($key)) {
            return Zend_Registry::get($key);
        } else {
            $message = 'Registry key "' . $key .
                '" for HtmlPurifier is not registered.';
            throw new Robo47_Filter_Exception($message);
        }
    }

Here is the caller graph for this function:

Robo47_Filter_HtmlPurifier::filter ( value  ) 

Filter.

See also:
Zend_Filter_Interface::filter
Parameters:
string $value
Returns:
string

Definition at line 133 of file HtmlPurifier.php.

    {
        return $this->_purifier->purify($value);
    }

static Robo47_Filter_HtmlPurifier::getDefaultPurifier (  )  [static]

Get default Purifier.

Returns:
HtmlPurifier

Definition at line 121 of file HtmlPurifier.php.

    {
        return self::$_defaultPurifier;
    }

Robo47_Filter_HtmlPurifier::getPurifier (  ) 

Get Purifier.

Returns:
HtmlPurifier

Definition at line 101 of file HtmlPurifier.php.

    {
        return $this->_purifier;
    }

static Robo47_Filter_HtmlPurifier::setDefaultPurifier ( HtmlPurifier $  purifier = null  )  [static]

Set default Purifier.

Parameters:
HtmlPurifier $purifier

Definition at line 111 of file HtmlPurifier.php.

    {
        self::$_defaultPurifier = $purifier;
    }

Robo47_Filter_HtmlPurifier::setPurifier ( purifier = null  ) 
Parameters:
HtmlPurifier|string $purifier

Definition at line 60 of file HtmlPurifier.php.

References _purifierFromRegistry().

Referenced by __construct().

    {
        if (null === $purifier) {
            if (null === self::$_defaultPurifier) {
                $purifier = new HtmlPurifier();
            } else {
                $purifier = self::$_defaultPurifier;
            }
        } elseif (is_string($purifier)) {
            $purifier = $this->_purifierFromRegistry($purifier);
        }
        if (!$purifier instanceof HtmlPurifier) {
            $message = 'purifier is no instance of class HtmlPurifier';
            throw new Robo47_Filter_Exception($message);
        }
        $this->_purifier = $purifier;
        return $this;
    }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Robo47_Filter_HtmlPurifier::$_defaultPurifier [static, protected]

Definition at line 45 of file HtmlPurifier.php.

Robo47_Filter_HtmlPurifier::$_purifier = null [protected]

Definition at line 40 of file HtmlPurifier.php.


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