protected function renderSingleLevel(array $configuration, $relativePath = null)
{
$this->output .= '<ul>';
foreach ($configuration as $key => $value) {
$path = $relativePath ? $relativePath . '.' . $key : $key;
$pathEscaped = htmlspecialchars($path);
$keyEscaped = htmlspecialchars($key);
$typeEscaped = htmlspecialchars(gettype($value));
if ($typeEscaped === 'array') {
$this->output .= sprintf('<li class="folder" title="%s">', $pathEscaped);
$this->output .= sprintf('%s (%s)', $keyEscaped, count($value));
$this->renderSingleLevel($value, $path);
$this->output .= '</li>';
} else {
$this->output .= '<li>';
$this->output .= sprintf('<div class="key" title="%s">%s:</div> ', $pathEscaped, $keyEscaped);
$this->output .= sprintf('<div class="value" title="%s">', $typeEscaped);
switch ($typeEscaped) {
case 'boolean':
$this->output .= $value ? 'TRUE' : 'FALSE';
break;
case 'NULL':
$this->output .= 'NULL';
break;
default:
$this->output .= htmlspecialchars($value);
}
$this->output .= '</div>';
$this->output .= '</li>';
}
}
$this->output .= '</ul>';
}