ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 385 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 395 of file ConfigForm.php.

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

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

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