function vis_structure($io, $prev_value, &$allSame) { $id = $io['id']; $value = $io['value']; $ios = get_child_ios($id); $result = ''; if (count($ios) == 0) { $result = vis_value($value, $prev_value, $allSame); } else { $childrenSame = true; $result2 = ''; $result2 .= '<table class="table table-condensed">'; $dttoMode = false; $dttoNames = ''; foreach ($ios as $cio) { $childSame = true; $object = get_object($cio['object_id']); $result3 = '<tr><td>'; $result3 .= get_object_link($object, $cio['name'], $cio['operation_id']); $result3 .= '</td><td>'; $result3 .= render_value($cio, $object, $childSame); $result3 .= '</td></tr>'; $childrenSame = $childrenSame && $childSame; if (!$childSame) { if ($dttoMode) { $result2 .= "<tr><td title=\"These members are unchanged: {$dttoNames}\">⋮</td><td></td></tr>"; $dttoMode = false; $dttoNames = ''; } $result2 .= $result3; } else { $dttoMode = true; $dttoNames .= " " . htmlentities($cio['name']); } } $result2 .= '</table>'; if ($childrenSame) { $result = dtto(); } else { $allSame = false; $result = $result2; } } return $result; }
function render_io($r, &$allSame, $reference = 'object', $variable_name = '') { $result = ''; # Arrow for read/write/view switch ($r['readwrite']) { case 1: $result .= '<td><i title="read" class="icon-arrow-left"></i></td> '; break; case 2: $result .= '<td><i title="write" class="icon-arrow-right"></i></td> '; break; case 3: $result .= '<td><i title="value" class="icon-eye-open"></i></td> '; break; } // If we want to link to object, use the note for the operation to link to it $object = get_object($r['object_id']); $result .= '<td>'; if ($reference == 'object') { $result .= get_object_link($object, $r['note'], $r['operation_id'], $r['name']); $result .= '</td><td>'; } else { $result .= $r['note']; $result .= '</td><td>'; $result .= get_operation_link(get_operation($r['operation_id']), $r['object_id']); } $result .= '</td><td>'; $allSame = true; $result .= render_value($r, $object, $allSame); $result .= '</td><td>'; $result .= render_code_link($r['code_id'], $r['name']); $result .= '</td>'; return $result; }