3 homepage: http://arc.semsol.org/
4 license: http://arc.semsol.org/license
6 class: ARC2 Legacy XML Serializer
7 author: Benjamin Nowack
13 class ARC2_LegacyHTMLSerializer extends ARC2_Class {
15 function __construct($a = '', &$caller) {
16 parent::__construct($a, $caller);
19 function ARC2_LegacyHTMLSerializer($a = '', &$caller) {/* ns */
20 $this->__construct($a, $caller);
25 $this->content_header = 'text/html';
30 function getSerializedArray($struct, $root = 1, $ind = ' ') {
33 $is_flat = $this->isAssociativeArray($struct) ? 0 : 1;
34 foreach ($struct as $k => $v) {
35 if (!$is_flat) $r .= $n . $ind . $ind . '<dt>' . $k . '</dt>';
36 $r .= $n . $ind . $ind . '<dd>' . (is_array($v) ? $this->getSerializedArray($v, 0, $ind . $ind . $ind) . $n . $ind . $ind : htmlspecialchars($v)) . '</dd>';
38 return $n . $ind . '<dl>' . $r . $n . $ind . '</dl>';
43 function isAssociativeArray($v) {
44 foreach (array_keys($v) as $k => $val) {
45 if ($k !== $val) return 1;