MDL-14898 upgraded html purifier to 3.1.0 in HEAD

This commit is contained in:
skodak
2008-06-16 16:39:09 +00:00
parent b553527e99
commit eb203ee412
290 changed files with 4780 additions and 3432 deletions
@@ -1,16 +1,14 @@
<?php
require_once 'HTMLPurifier/Printer.php';
class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
{
/**
* Instance of HTMLPurifier_HTMLDefinition, for easy access
*/
var $def;
protected $def;
function render($config) {
public function render($config) {
$ret = '';
$this->config =& $config;
@@ -31,7 +29,7 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
/**
* Renders the Doctype table
*/
function renderDoctype() {
protected function renderDoctype() {
$doctype = $this->def->doctype;
$ret = '';
$ret .= $this->start('table');
@@ -48,7 +46,7 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
/**
* Renders environment table, which is miscellaneous info
*/
function renderEnvironment() {
protected function renderEnvironment() {
$def = $this->def;
$ret = '';
@@ -92,7 +90,7 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
/**
* Renders the Content Sets table
*/
function renderContentSets() {
protected function renderContentSets() {
$ret = '';
$ret .= $this->start('table');
$ret .= $this->element('caption', 'Content Sets');
@@ -109,7 +107,7 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
/**
* Renders the Elements ($info) table
*/
function renderInfo() {
protected function renderInfo() {
$ret = '';
$ret .= $this->start('table');
$ret .= $this->element('caption', 'Elements ($info)');
@@ -120,7 +118,7 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
$ret .= $this->end('tr');
foreach ($this->def->info as $name => $def) {
$ret .= $this->start('tr');
$ret .= $this->element('th', "<$name>" . ($def->safe ? '' : ' (unsafe)'), array('class'=>'heavy' . ($def->safe ? '' : ' unsafe'), 'colspan' => 2));
$ret .= $this->element('th', "<$name>", array('class'=>'heavy', 'colspan' => 2));
$ret .= $this->end('tr');
$ret .= $this->start('tr');
$ret .= $this->element('th', 'Inline content');
@@ -169,7 +167,7 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
* Renders a row describing the allowed children of an element
* @param $def HTMLPurifier_ChildDef of pertinent element
*/
function renderChildren($def) {
protected function renderChildren($def) {
$context = new HTMLPurifier_Context();
$ret = '';
$ret .= $this->start('tr');
@@ -220,7 +218,7 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
* Listifies a tag lookup table.
* @param $array Tag lookup array in form of array('tagname' => true)
*/
function listifyTagLookup($array) {
protected function listifyTagLookup($array) {
ksort($array);
$list = array();
foreach ($array as $name => $discard) {
@@ -235,7 +233,7 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
* @param $array List of objects
* @todo Also add information about internal state
*/
function listifyObjectList($array) {
protected function listifyObjectList($array) {
ksort($array);
$list = array();
foreach ($array as $discard => $obj) {
@@ -248,7 +246,7 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
* Listifies a hash of attributes to AttrDef classes
* @param $array Array hash in form of array('attrname' => HTMLPurifier_AttrDef)
*/
function listifyAttr($array) {
protected function listifyAttr($array) {
ksort($array);
$list = array();
foreach ($array as $name => $obj) {
@@ -261,7 +259,7 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
/**
* Creates a heavy header row
*/
function heavyHeader($text, $num = 1) {
protected function heavyHeader($text, $num = 1) {
$ret = '';
$ret .= $this->start('tr');
$ret .= $this->element('th', $text, array('colspan' => $num, 'class' => 'heavy'));