ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules 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. 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 teg. 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
 Instance of HTMLPurifier_Generator for HTML generation convenience funcs. More...
 
 $config
 Instance of HTMLPurifier_Config, for easy access. More...
 

Detailed Description

Bool form field printer.

Definition at line 320 of file ConfigForm.php.

Member Function Documentation

◆ render()

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().

321  {
322  if (is_array($config) && isset($config[0])) {
323  $gen_config = $config[0];
324  $config = $config[1];
325  } else {
326  $gen_config = $config;
327  }
328  $this->prepareGenerator($gen_config);
329  $ret = '';
330  $ret .= $this->start('div', array('id' => "$name:$ns.$directive"));
331 
332  $ret .= $this->start('label', array('for' => "$name:Yes_$ns.$directive"));
333  $ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose'));
334  $ret .= $this->text(' Yes');
335  $ret .= $this->end('label');
336 
337  $attr = array(
338  'type' => 'radio',
339  'name' => "$name"."[$ns.$directive]",
340  'id' => "$name:Yes_$ns.$directive",
341  'value' => '1'
342  );
343  if ($value === true) $attr['checked'] = 'checked';
344  if ($value === null) $attr['disabled'] = 'disabled';
345  $ret .= $this->elementEmpty('input', $attr);
346 
347  $ret .= $this->start('label', array('for' => "$name:No_$ns.$directive"));
348  $ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose'));
349  $ret .= $this->text(' No');
350  $ret .= $this->end('label');
351 
352  $attr = array(
353  'type' => 'radio',
354  'name' => "$name"."[$ns.$directive]",
355  'id' => "$name:No_$ns.$directive",
356  'value' => '0'
357  );
358  if ($value === false) $attr['checked'] = 'checked';
359  if ($value === null) $attr['disabled'] = 'disabled';
360  $ret .= $this->elementEmpty('input', $attr);
361 
362  $ret .= $this->end('div');
363 
364  return $ret;
365  }
start($tag, $attr=array())
Main function that renders object or aspect of that object.
Definition: Printer.php:45
elementEmpty($tag, $attr=array())
Definition: Printer.php:74
prepareGenerator($config)
Give generator necessary configuration if possible.
Definition: Printer.php:28
end($tag)
Returns an end teg.
Definition: Printer.php:55
element($tag, $contents, $attr=array(), $escape=true)
Prints a complete element with content inside.
Definition: Printer.php:68
$config
Instance of HTMLPurifier_Config, for easy access.
Definition: Printer.php:17
+ Here is the call graph for this function:

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