ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
HTMLPurifier_Printer_ConfigForm_bool Class Reference

Bool form field printer. More...

+ Inheritance diagram for HTMLPurifier_Printer_ConfigForm_bool:
+ Collaboration diagram for HTMLPurifier_Printer_ConfigForm_bool:

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.

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

Bool form field printer.

Definition at line 320 of file ConfigForm.php.

Member Function Documentation

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

Definition at line 321 of file ConfigForm.php.

References HTMLPurifier_Printer\$config, $ret, HTMLPurifier_Printer\element(), HTMLPurifier_Printer\elementEmpty(), HTMLPurifier_Printer\end(), HTMLPurifier_Printer\prepareGenerator(), HTMLPurifier_Printer\start(), and HTMLPurifier_Printer\text().

{
if (is_array($config) && isset($config[0])) {
$gen_config = $config[0];
} else {
$gen_config = $config;
}
$this->prepareGenerator($gen_config);
$ret = '';
$ret .= $this->start('div', array('id' => "$name:$ns.$directive"));
$ret .= $this->start('label', array('for' => "$name:Yes_$ns.$directive"));
$ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose'));
$ret .= $this->text(' Yes');
$ret .= $this->end('label');
$attr = array(
'type' => 'radio',
'name' => "$name"."[$ns.$directive]",
'id' => "$name:Yes_$ns.$directive",
'value' => '1'
);
if ($value === true) $attr['checked'] = 'checked';
if ($value === null) $attr['disabled'] = 'disabled';
$ret .= $this->elementEmpty('input', $attr);
$ret .= $this->start('label', array('for' => "$name:No_$ns.$directive"));
$ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose'));
$ret .= $this->text(' No');
$ret .= $this->end('label');
$attr = array(
'type' => 'radio',
'name' => "$name"."[$ns.$directive]",
'id' => "$name:No_$ns.$directive",
'value' => '0'
);
if ($value === false) $attr['checked'] = 'checked';
if ($value === null) $attr['disabled'] = 'disabled';
$ret .= $this->elementEmpty('input', $attr);
$ret .= $this->end('div');
return $ret;
}

+ Here is the call graph for this function:


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