ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
HTMLPurifier_URIDefinition Class Reference
+ Inheritance diagram for HTMLPurifier_URIDefinition:
+ Collaboration diagram for HTMLPurifier_URIDefinition:

Public Member Functions

 __construct ()
 registerFilter ($filter)
 addFilter ($filter, $config)
 getDefaultScheme ($config, $context)
 filter (&$uri, $config, $context)
 postFilter (&$uri, $config, $context)
- Public Member Functions inherited from HTMLPurifier_Definition
 setup ($config)
 Setup function that aborts if already setup.

Data Fields

 $type = 'URI'
 $base
 HTMLPurifier_URI object of the base specified at URI.Base.
 $host
 String host to consider "home" base, derived off of $base.
 $defaultScheme
 Name of default scheme based on URI.DefaultScheme and URI.Base.
- Data Fields inherited from HTMLPurifier_Definition
 $setup = false
 Has setup() been called yet?
 $optimized = null
 If true, write out the final definition object to the cache after setup.
 $type
 What type of definition is it?

Protected Member Functions

 doSetup ($config)
 Sets up the definition object into the final form, something not done by the constructor.
 setupFilters ($config)
 setupMemberVariables ($config)

Protected Attributes

 $filters = array()
 $postFilters = array()
 $registeredFilters = array()

Detailed Description

Definition at line 3 of file URIDefinition.php.

Constructor & Destructor Documentation

HTMLPurifier_URIDefinition::__construct ( )

Member Function Documentation

HTMLPurifier_URIDefinition::addFilter (   $filter,
  $config 
)

Definition at line 39 of file URIDefinition.php.

Referenced by setupFilters().

{
$r = $filter->prepare($config);
if ($r === false) return; // null is ok, for backwards compat
if ($filter->post) {
$this->postFilters[$filter->name] = $filter;
} else {
$this->filters[$filter->name] = $filter;
}
}

+ Here is the caller graph for this function:

HTMLPurifier_URIDefinition::doSetup (   $config)
protected

Sets up the definition object into the final form, something not done by the constructor.

Parameters
$configHTMLPurifier_Config instance

Reimplemented from HTMLPurifier_Definition.

Definition at line 49 of file URIDefinition.php.

References setupFilters(), and setupMemberVariables().

{
$this->setupMemberVariables($config);
$this->setupFilters($config);
}

+ Here is the call graph for this function:

HTMLPurifier_URIDefinition::filter ( $uri,
  $config,
  $context 
)

Definition at line 84 of file URIDefinition.php.

References $result.

{
foreach ($this->filters as $name => $f) {
$result = $f->filter($uri, $config, $context);
if (!$result) return false;
}
return true;
}
HTMLPurifier_URIDefinition::getDefaultScheme (   $config,
  $context 
)

Definition at line 80 of file URIDefinition.php.

References HTMLPurifier_URISchemeRegistry\instance().

{
return HTMLPurifier_URISchemeRegistry::instance()->getScheme($this->defaultScheme, $config, $context);
}

+ Here is the call graph for this function:

HTMLPurifier_URIDefinition::postFilter ( $uri,
  $config,
  $context 
)

Definition at line 92 of file URIDefinition.php.

References $result.

{
foreach ($this->postFilters as $name => $f) {
$result = $f->filter($uri, $config, $context);
if (!$result) return false;
}
return true;
}
HTMLPurifier_URIDefinition::registerFilter (   $filter)

Definition at line 35 of file URIDefinition.php.

Referenced by __construct().

{
$this->registeredFilters[$filter->name] = $filter;
}

+ Here is the caller graph for this function:

HTMLPurifier_URIDefinition::setupFilters (   $config)
protected

Definition at line 54 of file URIDefinition.php.

References addFilter().

Referenced by doSetup().

{
foreach ($this->registeredFilters as $name => $filter) {
if ($filter->always_load) {
$this->addFilter($filter, $config);
} else {
$conf = $config->get('URI.' . $name);
if ($conf !== false && $conf !== null) {
$this->addFilter($filter, $config);
}
}
}
unset($this->registeredFilters);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

HTMLPurifier_URIDefinition::setupMemberVariables (   $config)
protected

Definition at line 68 of file URIDefinition.php.

Referenced by doSetup().

{
$this->host = $config->get('URI.Host');
$base_uri = $config->get('URI.Base');
if (!is_null($base_uri)) {
$parser = new HTMLPurifier_URIParser();
$this->base = $parser->parse($base_uri);
$this->defaultScheme = $this->base->scheme;
if (is_null($this->host)) $this->host = $this->base->host;
}
if (is_null($this->defaultScheme)) $this->defaultScheme = $config->get('URI.DefaultScheme');
}

+ Here is the caller graph for this function:

Field Documentation

HTMLPurifier_URIDefinition::$base

HTMLPurifier_URI object of the base specified at URI.Base.

Definition at line 14 of file URIDefinition.php.

HTMLPurifier_URIDefinition::$defaultScheme

Name of default scheme based on URI.DefaultScheme and URI.Base.

Definition at line 24 of file URIDefinition.php.

HTMLPurifier_URIDefinition::$filters = array()
protected

Definition at line 7 of file URIDefinition.php.

HTMLPurifier_URIDefinition::$host

String host to consider "home" base, derived off of $base.

Definition at line 19 of file URIDefinition.php.

HTMLPurifier_URIDefinition::$postFilters = array()
protected

Definition at line 8 of file URIDefinition.php.

HTMLPurifier_URIDefinition::$registeredFilters = array()
protected

Definition at line 9 of file URIDefinition.php.

HTMLPurifier_URIDefinition::$type = 'URI'

Definition at line 6 of file URIDefinition.php.


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