MDL-10937 upgraded html purifier to 2.1.1

This commit is contained in:
skodak
2007-08-21 22:06:47 +00:00
parent 3d436d8ac5
commit 5adad31057
168 changed files with 6307 additions and 2100 deletions
+27 -4
View File
@@ -4,6 +4,8 @@ require_once 'HTMLPurifier/Generator.php';
require_once 'HTMLPurifier/Token.php';
require_once 'HTMLPurifier/Encoder.php';
// OUT OF DATE, NEEDS UPDATING!
class HTMLPurifier_Printer
{
@@ -25,10 +27,20 @@ class HTMLPurifier_Printer
}
/**
* Main function that renders object or aspect of that object
* @param $config Configuration object
* Give generator necessary configuration if possible
*/
function render($config) {}
function prepareGenerator($config) {
// hack for smoketests/configForm.php
if (empty($config->conf['HTML'])) return;
$context = new HTMLPurifier_Context();
$this->generator->generateFromTokens(array(), $config, $context);
}
/**
* Main function that renders object or aspect of that object
* @note Parameters vary depending on printer
*/
// function render() {}
/**
* Returns a start tag
@@ -64,6 +76,18 @@ class HTMLPurifier_Printer
$this->end($tag);
}
function elementEmpty($tag, $attr = array()) {
return $this->generator->generateFromToken(
new HTMLPurifier_Token_Empty($tag, $attr)
);
}
function text($text) {
return $this->generator->generateFromToken(
new HTMLPurifier_Token_Text($text)
);
}
/**
* Prints a simple key/value row in a table.
* @param $name Key
@@ -146,4 +170,3 @@ class HTMLPurifier_Printer
}
?>