From: Hendrik B. <nh...@us...> - 2010-08-20 20:36:17
|
Update of /cvsroot/arianne/stendhal_website/content/admin In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv17122/content/admin Modified Files: inspect.php Log Message: render item slots (as key/value table for now) Index: inspect.php =================================================================== RCS file: /cvsroot/arianne/stendhal_website/content/admin/inspect.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** inspect.php 20 Aug 2010 20:18:19 -0000 1.4 --- inspect.php 20 Aug 2010 20:36:09 -0000 1.5 *************** *** 173,180 **** --- 173,213 ---- } + /** + * renders the result of a deep inspect + * + * @param $inspectData + */ private function renderInspectResult($inspectData) { + $this->renderItemSlots($inspectData); $this->renderKeyedSlots($inspectData); } + /** + * renders a slot with items + * + * @param $inspectData data of an deep inspect + */ + private function renderItemSlots($inspectData) { + foreach ($inspectData as $slotName => $slot) { + if (in_array($slotName, InspectPage::$KEYED_SLOTS)) { + continue; + } + + echo '<h2>'.htmlspecialchars($slotName).'</h2>'; + foreach ($slot as $item) { + echo '<table class="prettytable"><tr><th>key</th><th>value</th></tr>'; + foreach ($item as $key => $value) { + echo '<tr><td>'.htmlspecialchars($key).'</td><td>'.htmlspecialchars($value).'</td></tr>'; + } + echo '</table>'; + } + } + } + + /** + * renders a slot with an object that is a map + * + * @param $inspectData data of an deep inspect + */ private function renderKeyedSlots($inspectData) { foreach (InspectPage::$KEYED_SLOTS as $keyedSlot) { |