From 5d199643219a373b0be28c7660ccc1e178722988 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Wed, 18 Sep 2013 08:06:22 +0200 Subject: [PATCH] adding DEBUG console --- public/include/smarty_globals.inc.php | 3 ++ public/templates/test/master.tpl | 4 ++ public/templates/test/system/debugger.tpl | 51 +++++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 public/templates/test/system/debugger.tpl diff --git a/public/include/smarty_globals.inc.php b/public/include/smarty_globals.inc.php index acde330c..e4b3787f 100644 --- a/public/include/smarty_globals.inc.php +++ b/public/include/smarty_globals.inc.php @@ -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); diff --git a/public/templates/test/master.tpl b/public/templates/test/master.tpl index f825201e..dbd14374 100644 --- a/public/templates/test/master.tpl +++ b/public/templates/test/master.tpl @@ -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}
+ {if $DEBUG > 0}
+ {nocache}{include file="system/debugger.tpl"}{/nocache} +
+ {/if} diff --git a/public/templates/test/system/debugger.tpl b/public/templates/test/system/debugger.tpl new file mode 100644 index 00000000..d36d8219 --- /dev/null +++ b/public/templates/test/system/debugger.tpl @@ -0,0 +1,51 @@ + +{if $DebuggerInfo} + + Debugger Console +
+
+ + + + + + + + + + + {section name=debug loop=$DebuggerInfo} + + + + + + + {/section} + +
LevelTimeMessageBacktrace
{$DebuggerInfo[debug].level}{$DebuggerInfo[debug].time}{$DebuggerInfo[debug].message} + + {foreach from=$DebuggerInfo[debug].backtrace item=backtrace} + + + + + + {/foreach} +
{$backtrace.line}{$backtrace.file}{$backtrace.function}
+
+ +
+
+ + +{/if}