mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-04 13:18:00 +02:00
Convert to PHP 5 only codebase, adding visibility modifiers to all members and methods in the main library area (function only for test methods)
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1458 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
@@ -7,36 +7,32 @@ class HTMLPurifier_Printer_ConfigForm extends HTMLPurifier_Printer
|
||||
|
||||
/**
|
||||
* Printers for specific fields
|
||||
* @protected
|
||||
*/
|
||||
var $fields = array();
|
||||
protected $fields = array();
|
||||
|
||||
/**
|
||||
* Documentation URL, can have fragment tagged on end
|
||||
* @protected
|
||||
*/
|
||||
var $docURL;
|
||||
protected $docURL;
|
||||
|
||||
/**
|
||||
* Name of form element to stuff config in
|
||||
* @protected
|
||||
*/
|
||||
var $name;
|
||||
protected $name;
|
||||
|
||||
/**
|
||||
* Whether or not to compress directive names, clipping them off
|
||||
* after a certain amount of letters. False to disable or integer letters
|
||||
* before clipping.
|
||||
* @protected
|
||||
*/
|
||||
var $compress = false;
|
||||
protected $compress = false;
|
||||
|
||||
/**
|
||||
* @param $name Form element name for directives to be stuffed into
|
||||
* @param $doc_url String documentation URL, will have fragment tagged on
|
||||
* @param $compress Integer max length before compressing a directive name, set to false to turn off
|
||||
*/
|
||||
function HTMLPurifier_Printer_ConfigForm(
|
||||
public function HTMLPurifier_Printer_ConfigForm(
|
||||
$name, $doc_url = null, $compress = false
|
||||
) {
|
||||
parent::HTMLPurifier_Printer();
|
||||
@@ -53,7 +49,7 @@ class HTMLPurifier_Printer_ConfigForm extends HTMLPurifier_Printer
|
||||
* @param $cols Integer columns of textarea, null to use default
|
||||
* @param $rows Integer rows of textarea, null to use default
|
||||
*/
|
||||
function setTextareaDimensions($cols = null, $rows = null) {
|
||||
public function setTextareaDimensions($cols = null, $rows = null) {
|
||||
if ($cols) $this->fields['default']->cols = $cols;
|
||||
if ($rows) $this->fields['default']->rows = $rows;
|
||||
}
|
||||
@@ -61,14 +57,14 @@ class HTMLPurifier_Printer_ConfigForm extends HTMLPurifier_Printer
|
||||
/**
|
||||
* Retrieves styling, in case it is not accessible by webserver
|
||||
*/
|
||||
function getCSS() {
|
||||
public function getCSS() {
|
||||
return file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/Printer/ConfigForm.css');
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves JavaScript, in case it is not accessible by webserver
|
||||
*/
|
||||
function getJavaScript() {
|
||||
public function getJavaScript() {
|
||||
return file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/Printer/ConfigForm.js');
|
||||
}
|
||||
|
||||
@@ -77,7 +73,7 @@ class HTMLPurifier_Printer_ConfigForm extends HTMLPurifier_Printer
|
||||
* @param $config Configuration object of current form state
|
||||
* @param $allowed Optional namespace(s) and directives to restrict form to.
|
||||
*/
|
||||
function render($config, $allowed = true, $render_controls = true) {
|
||||
public function render($config, $allowed = true, $render_controls = true) {
|
||||
$this->config = $config;
|
||||
$this->prepareGenerator($config);
|
||||
|
||||
@@ -117,9 +113,8 @@ class HTMLPurifier_Printer_ConfigForm extends HTMLPurifier_Printer
|
||||
* Renders a single namespace
|
||||
* @param $ns String namespace name
|
||||
* @param $directive Associative array of directives to values
|
||||
* @protected
|
||||
*/
|
||||
function renderNamespace($ns, $directives) {
|
||||
protected function renderNamespace($ns, $directives) {
|
||||
$ret = '';
|
||||
$ret .= $this->start('tbody', array('class' => 'namespace'));
|
||||
$ret .= $this->start('tr');
|
||||
@@ -178,15 +173,15 @@ class HTMLPurifier_Printer_ConfigForm_NullDecorator extends HTMLPurifier_Printer
|
||||
/**
|
||||
* Printer being decorated
|
||||
*/
|
||||
var $obj;
|
||||
protected $obj;
|
||||
/**
|
||||
* @param $obj Printer to decorate
|
||||
*/
|
||||
function HTMLPurifier_Printer_ConfigForm_NullDecorator($obj) {
|
||||
public function HTMLPurifier_Printer_ConfigForm_NullDecorator($obj) {
|
||||
parent::HTMLPurifier_Printer();
|
||||
$this->obj = $obj;
|
||||
}
|
||||
function render($ns, $directive, $value, $name, $config) {
|
||||
public function render($ns, $directive, $value, $name, $config) {
|
||||
$this->prepareGenerator($config);
|
||||
$ret = '';
|
||||
$ret .= $this->start('label', array('for' => "$name:Null_$ns.$directive"));
|
||||
@@ -214,9 +209,9 @@ class HTMLPurifier_Printer_ConfigForm_NullDecorator extends HTMLPurifier_Printer
|
||||
* Swiss-army knife configuration form field printer
|
||||
*/
|
||||
class HTMLPurifier_Printer_ConfigForm_default extends HTMLPurifier_Printer {
|
||||
var $cols = 18;
|
||||
var $rows = 5;
|
||||
function render($ns, $directive, $value, $name, $config) {
|
||||
public $cols = 18;
|
||||
public $rows = 5;
|
||||
public function render($ns, $directive, $value, $name, $config) {
|
||||
$this->prepareGenerator($config);
|
||||
// this should probably be split up a little
|
||||
$ret = '';
|
||||
@@ -282,7 +277,7 @@ class HTMLPurifier_Printer_ConfigForm_default extends HTMLPurifier_Printer {
|
||||
* Bool form field printer
|
||||
*/
|
||||
class HTMLPurifier_Printer_ConfigForm_bool extends HTMLPurifier_Printer {
|
||||
function render($ns, $directive, $value, $name, $config) {
|
||||
public function render($ns, $directive, $value, $name, $config) {
|
||||
$this->prepareGenerator($config);
|
||||
$ret = '';
|
||||
$ret .= $this->start('div', array('id' => "$name:$ns.$directive"));
|
||||
|
Reference in New Issue
Block a user