function DisplayCompare($changes, $sections, $index, $index_compare) { foreach ($changes as $name => $data) { $sections[] = $name; if (isset($data[$index]) || isset($data[$index_compare])) { echo "<tr><td>" . implode("/", $sections) . "</td>"; echo "<td>" . printval($data, $index, 0, '-') . "</td>\n"; echo "<td>" . printval($data, $index_compare, 0, '-') . "</td>\n"; echo "</tr>\n"; } else { DisplayCompare($data, $sections, $index, $index_compare); } array_pop($sections); } }
function DisplayTheaterCompare() { global $theater, $mod, $theaterfile, $theaterpath, $version, $mod_compare, $theaterfile_compare, $theaterpath_compare, $version_compare; $theater_compare = ParseTheaterFile("{$theaterfile_compare}.theater", $mod_compare, $version_compare, $theaterpath_compare); $index = "{$version}/{$theaterfile}"; $index_compare = "{$version_compare}/{$theaterfile_compare}"; $changes = multi_diff($index, $theater, $index_compare, $theater_compare); DisplayStatsHeader(); echo "<table border='1' cellpadding='2' cellspacing='0'><tr><th>Setting</th><th>{$index}</th><th>{$index_compare}</th></tr>\n"; $sections = array(); foreach ($changes as $name => $data) { $sections[] = $name; if (isset($data[$index]) || isset($data[$index_compare])) { echo "<tr><td>" . implode("/", $sections) . "</td>"; echo "<td>" . printval($data, $index, 0, '-') . "</td>\n"; echo "<td>" . printval($data, $index_compare, 0, '-') . "</td>\n"; echo "</tr>\n"; } else { DisplayCompare($data, $sections, $index, $index_compare); } array_pop($sections); } closePage(1); }