Verified Commit bdcf4c2a authored by Côme Chilliet's avatar Côme Chilliet
Browse files

feat(developers) Improve debug help object type list

Show icons and type names, and sort by type name.
Also values are now passed to var_export so that we can easily see if
 it’s NULL, FALSE, TRUE, '' or 0 for empty values.
Also added missing fields

issue #6041
parent 62bb987e
......@@ -82,17 +82,13 @@ class debugHelp extends simplePlugin
}
$node = [
'img' => $img,
'name' => $infos['name'],
'name' => $infos['name'].' ('.$type.')',
'attrs' => [],
'subnodes' => []
];
foreach (['aclCategory', 'mainAttr', 'ou', 'filter', 'tabClass', 'tabGroup', 'mainTab', 'management'] as $key) {
foreach (['description','aclCategory','ou','mainAttr','nameAttr','filter','filterRDN','tabClass','tabGroup','mainTab','management','templateActive','snapshotActive'] as $key) {
if (isset($infos[$key])) {
if ($infos[$key] != '') {
$node['attrs'][$key] = [$infos[$key]];
} else {
$node['attrs'][$key] = ' ';
}
$node['attrs'][$key] = var_export($infos[$key], TRUE);
}
}
try {
......@@ -100,8 +96,9 @@ class debugHelp extends simplePlugin
} catch (FusionDirectoryException $e) {
$node['attrs']['count'] = $e->getMessage();
}
$dump[] = $node;
$dump[$type] = $node;
}
ksort($dump);
$this->dump = $dump;
}
......
......@@ -9,19 +9,17 @@
{foreach from=$nodes key=key item=node}
<li>
<a href="#" onclick="Effect.toggle('toggle_{$key}', 'blind', {literal}{ duration: 0.3 }{/literal}); return false;">
{$node.name}
<img style="vertical-align:middle;" src="{$node.img|escape}" alt=""/>&nbsp;{$node.name|escape}
</a>
<div id="toggle_{$key}" style="overflow: visible; display: none;">
<table class="listingTable">
<tbody>
{foreach from=$node.attrs key=label item=values}
{foreach from=$values item=value}
{foreach from=$node.attrs key=label item=value}
<tr>
<th>{$label}</th>
<td>{$value}</td>
<th>{$label|escape}</th>
<td>{$value|escape}</td>
</tr>
{/foreach}
{/foreach}
</tbody>
</table>
</div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment