ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
HTMLPurifier_Printer_ConfigForm_default Class Reference

Swiss-army knife configuration form field printer. More...

+ Inheritance diagram for HTMLPurifier_Printer_ConfigForm_default:
+ Collaboration diagram for HTMLPurifier_Printer_ConfigForm_default:

Public Member Functions

 render ($ns, $directive, $value, $name, $config)
- Public Member Functions inherited from HTMLPurifier_Printer
 __construct ()
 Initialize $generator.
 prepareGenerator ($config)
 Give generator necessary configuration if possible.

Data Fields

 $cols = 18
 $rows = 5

Additional Inherited Members

- Protected Member Functions inherited from HTMLPurifier_Printer
 start ($tag, $attr=array())
 Main function that renders object or aspect of that object.
 end ($tag)
 Returns an end teg.
 element ($tag, $contents, $attr=array(), $escape=true)
 Prints a complete element with content inside.
 elementEmpty ($tag, $attr=array())
 text ($text)
 row ($name, $value)
 Prints a simple key/value row in a table.
 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.
- Protected Attributes inherited from HTMLPurifier_Printer
 $generator
 Instance of HTMLPurifier_Generator for HTML generation convenience funcs.
 $config
 Instance of HTMLPurifier_Config, for easy access.

Detailed Description

Swiss-army knife configuration form field printer.

Definition at line 238 of file ConfigForm.php.

Member Function Documentation

HTMLPurifier_Printer_ConfigForm_default::render (   $ns,
  $directive,
  $value,
  $name,
  $config 
)

Definition at line 241 of file ConfigForm.php.

References $cols, HTMLPurifier_Printer\$config, $ret, $rows, HTMLPurifier_VarParser\ALIST, HTMLPurifier_Printer\element(), HTMLPurifier_Printer\elementEmpty(), HTMLPurifier_Printer\end(), HTMLPurifier_VarParser\HASH, HTMLPurifier_VarParser\ITEXT, HTMLPurifier_VarParser\LOOKUP, HTMLPurifier_VarParser\MIXED, HTMLPurifier_Printer\prepareGenerator(), HTMLPurifier_Printer\start(), HTMLPurifier_VarParser\TEXT, and HTMLPurifier_Printer\text().

{
if (is_array($config) && isset($config[0])) {
$gen_config = $config[0];
} else {
$gen_config = $config;
}
$this->prepareGenerator($gen_config);
// this should probably be split up a little
$ret = '';
$def = $config->def->info["$ns.$directive"];
if (is_int($def)) {
$type = abs($def);
} else {
$type = $def->type;
}
if (is_array($value)) {
switch ($type) {
$array = $value;
$value = array();
foreach ($array as $val => $b) {
$value[] = $val;
}
$value = implode(PHP_EOL, $value);
break;
$nvalue = '';
foreach ($value as $i => $v) {
$nvalue .= "$i:$v" . PHP_EOL;
}
$value = $nvalue;
break;
default:
$value = '';
}
}
return 'Not supported';
$value = serialize($value);
}
$attr = array(
'name' => "$name"."[$ns.$directive]",
'id' => "$name:$ns.$directive"
);
if ($value === null) $attr['disabled'] = 'disabled';
if (isset($def->allowed)) {
$ret .= $this->start('select', $attr);
foreach ($def->allowed as $val => $b) {
$attr = array();
if ($value == $val) $attr['selected'] = 'selected';
$ret .= $this->element('option', $val, $attr);
}
$ret .= $this->end('select');
} elseif (
) {
$attr['cols'] = $this->cols;
$attr['rows'] = $this->rows;
$ret .= $this->start('textarea', $attr);
$ret .= $this->text($value);
$ret .= $this->end('textarea');
} else {
$attr['value'] = $value;
$attr['type'] = 'text';
$ret .= $this->elementEmpty('input', $attr);
}
return $ret;
}

+ Here is the call graph for this function:

Field Documentation

HTMLPurifier_Printer_ConfigForm_default::$cols = 18

Definition at line 239 of file ConfigForm.php.

Referenced by render().

HTMLPurifier_Printer_ConfigForm_default::$rows = 5

Definition at line 240 of file ConfigForm.php.

Referenced by render().


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