adding DEBUG console

This commit is contained in:
Sebastian Grewe 2013-09-18 08:06:22 +02:00
parent 7aace8be26
commit 5d19964321
3 changed files with 58 additions and 0 deletions

View File

@ -154,6 +154,9 @@ if ($setting->getValue('maintenance'))
if ($motd = $setting->getValue('system_motd'))
$_SESSION['POPUP'][] = array('CONTENT' => $motd, 'TYPE' => 'info');
// So we can display additional info
$smarty->assign('DEBUG', DEBUG);
// Make it available in Smarty
$smarty->assign('PATH', 'site_assets/' . THEME);
$smarty->assign('GLOBAL', $aGlobal);

View File

@ -50,5 +50,9 @@
{if $CONTENT != "empty" or $CONTENT != ""}{if file_exists($smarty.current_dir|cat:"/$PAGE/$ACTION/$CONTENT")}{include file="$PAGE/$ACTION/$CONTENT"}{else}Missing template for this page{/if}{/if}
<div class="spacer"></div>
</section>
{if $DEBUG > 0}<div id="debug">
{nocache}{include file="system/debugger.tpl"}{/nocache}
</div>
{/if}
</body>
</html>

View File

@ -0,0 +1,51 @@
{if $DebuggerInfo}
<!-- This will be loaded if we have debug information available -->
<a href="#" id="toggle" class="toggle">Debugger Console</a>
<div id="panel">
<div id="DebuggerConsole">
<table width="100%">
<thead>
<tr>
<th width="15"><b>Level</b></th>
<th width="25"><b>Time</b></th>
<th width="*"><b>Message</b></th>
<th width="*"><b>Backtrace</b></th>
</tr>
</thead>
<tbody>
{section name=debug loop=$DebuggerInfo}
<tr class="{cycle values="even,odd"}">
<td align="center">{$DebuggerInfo[debug].level}</td>
<td align="right">{$DebuggerInfo[debug].time}</td>
<td align="left">{$DebuggerInfo[debug].message}</td>
<td align="left">
<table border="0">
{foreach from=$DebuggerInfo[debug].backtrace item=backtrace}
<tr>
<td style="display:inline-block; width:25px;">{$backtrace.line}</td>
<td style="display:inline-block; width:200px">{$backtrace.file}</td>
<td style="display:inline-block;">{$backtrace.function}</td>
</tr>
{/foreach}
</table>
</td>
</tr>
{/section}
</tbody>
</table>
</div>
</div>
<script>{literal}
$(document).ready(function(){
$("div#panel").hide();
$("#toggle").click(function(){
$("#panel").slideToggle("slow");
$(this).toggleClass("active");
return false;
});
});
{/literal}</script>
{/if}