51    protected function start($tag, $attr = array())
 
   53        return $this->generator->generateFromToken(
 
   63    protected function end($tag)
 
   65        return $this->generator->generateFromToken(
 
   80        return $this->
start($tag, $attr) .
 
   92        return $this->generator->generateFromToken(
 
  103        return $this->generator->generateFromToken(
 
  114    protected function row($name, $value)
 
  116        if (is_bool($value)) {
 
  117            $value = $value ? 
'On' : 
'Off';
 
  120            $this->
start(
'tr') . 
"\n" .
 
  121            $this->
element(
'th', $name) . 
"\n" .
 
  122            $this->
element(
'td', $value) . 
"\n" .
 
  134        $string = htmlspecialchars($string, ENT_COMPAT, 
'UTF-8');
 
  144    protected function listify($array, $polite = 
false)
 
  151        foreach ($array as $value) {
 
  154            if ($i > 0 && !($polite && $i == 1)) {
 
  157            if ($polite && $i == 1) {
 
  170    protected function getClass($obj, $sec_prefix = 
'')
 
  173        if ($five === 
null) {
 
  174            $five = version_compare(PHP_VERSION, 
'5', 
'>=');
 
  176        $prefix = 
'HTMLPurifier_' . $sec_prefix;
 
  178            $prefix = strtolower($prefix);
 
  180        $class = str_replace($prefix, 
'', get_class($obj));
 
  181        $lclass = strtolower($class);
 
  186                foreach ($obj->valid_values as $value => $bool) {
 
  189                $class .= implode(
', ', $values);
 
  191            case 'css_composite':
 
  193                foreach ($obj->defs as $def) {
 
  194                    $values[] = $this->
getClass($def, $sec_prefix);
 
  196                $class .= implode(
', ', $values);
 
  199                $class .= $this->
getClass($obj->single, $sec_prefix) . 
', ';
 
  202            case 'css_denyelementdecorator':
 
  203                $class .= $this->
getClass($obj->def, $sec_prefix) . 
', ';
 
  204                $class .= $obj->element;
 
  206            case 'css_importantdecorator':
 
  207                $class .= $this->
getClass($obj->def, $sec_prefix);
 
  209                    $class .= 
', !important';
 
An exception for terminatinating execution or to throw for unit testing.
Registry object that contains information about the current context.
static cleanUTF8($str, $force_php=false)
Cleans a UTF-8 string for well-formedness and SGML validity.
Generates HTML from tokens.
row($name, $value)
Prints a simple key/value row in a table.
element($tag, $contents, $attr=array(), $escape=true)
Prints a complete element with content inside.
$generator
For HTML generation convenience funcs.
end($tag)
Returns an end tag.
elementEmpty($tag, $attr=array())
prepareGenerator($config)
Give generator necessary configuration if possible.
escape($string)
Escapes a string for HTML output.
listify($array, $polite=false)
Takes a list of strings and turns them into a single list.
getClass($obj, $sec_prefix='')
Retrieves the class of an object without prefixes, as well as metadata.
__construct()
Initialize $generator.
start($tag, $attr=array())
Main function that renders object or aspect of that object.
Concrete empty token class.
Concrete end token class.
Concrete start token class.
Concrete text token class.