ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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. More...
 
 prepareGenerator ($config)
 Give generator necessary configuration if possible. More...
 

Additional Inherited Members

- Protected Member Functions inherited from HTMLPurifier_Printer
 start ($tag, $attr=array())
 Main function that renders object or aspect of that object. More...
 
 end ($tag)
 Returns an end tag. More...
 
 element ($tag, $contents, $attr=array(), $escape=true)
 Prints a complete element with content inside. More...
 
 elementEmpty ($tag, $attr=array())
 
 text ($text)
 
 row ($name, $value)
 Prints a simple key/value row in a table. More...
 
 escape ($string)
 Escapes a string for HTML output. More...
 
 listify ($array, $polite=false)
 Takes a list of strings and turns them into a single list. More...
 
 getClass ($obj, $sec_prefix='')
 Retrieves the class of an object without prefixes, as well as metadata. More...
 
- Protected Attributes inherited from HTMLPurifier_Printer
 $generator
 For HTML generation convenience funcs. More...
 
 $config
 For easy access. More...
 

Detailed Description

Bool form field printer.

Definition at line 381 of file ConfigForm.php.

Member Function Documentation

◆ render()

HTMLPurifier_Printer_ConfigForm_bool::render (   $ns,
  $directive,
  $value,
  $name,
  $config 
)
Parameters
string$ns
string$directive
string$value
string$name
HTMLPurifier_Config | array$config
Returns
string

Definition at line 391 of file ConfigForm.php.

392 {
393 if (is_array($config) && isset($config[0])) {
394 $gen_config = $config[0];
395 $config = $config[1];
396 } else {
397 $gen_config = $config;
398 }
399 $this->prepareGenerator($gen_config);
400 $ret = '';
401 $ret .= $this->start('div', array('id' => "$name:$ns.$directive"));
402
403 $ret .= $this->start('label', array('for' => "$name:Yes_$ns.$directive"));
404 $ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose'));
405 $ret .= $this->text(' Yes');
406 $ret .= $this->end('label');
407
408 $attr = array(
409 'type' => 'radio',
410 'name' => "$name" . "[$ns.$directive]",
411 'id' => "$name:Yes_$ns.$directive",
412 'value' => '1'
413 );
414 if ($value === true) {
415 $attr['checked'] = 'checked';
416 }
417 if ($value === null) {
418 $attr['disabled'] = 'disabled';
419 }
420 $ret .= $this->elementEmpty('input', $attr);
421
422 $ret .= $this->start('label', array('for' => "$name:No_$ns.$directive"));
423 $ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose'));
424 $ret .= $this->text(' No');
425 $ret .= $this->end('label');
426
427 $attr = array(
428 'type' => 'radio',
429 'name' => "$name" . "[$ns.$directive]",
430 'id' => "$name:No_$ns.$directive",
431 'value' => '0'
432 );
433 if ($value === false) {
434 $attr['checked'] = 'checked';
435 }
436 if ($value === null) {
437 $attr['disabled'] = 'disabled';
438 }
439 $ret .= $this->elementEmpty('input', $attr);
440
441 $ret .= $this->end('div');
442
443 return $ret;
444 }
element($tag, $contents, $attr=array(), $escape=true)
Prints a complete element with content inside.
Definition: Printer.php:78
$config
For easy access.
Definition: Printer.php:19
end($tag)
Returns an end tag.
Definition: Printer.php:63
elementEmpty($tag, $attr=array())
Definition: Printer.php:90
prepareGenerator($config)
Give generator necessary configuration if possible.
Definition: Printer.php:32
start($tag, $attr=array())
Main function that renders object or aspect of that object.
Definition: Printer.php:51

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

+ Here is the call graph for this function:

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