aboutsummaryrefslogtreecommitdiffstats
path: root/include/smarty/libs/internals/core.display_debug_console.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2008-02-27 02:31:51 +0000
committerrvelices <rv-github@modusoptimus.com>2008-02-27 02:31:51 +0000
commit75bb450a6ece6b2e30ad4c148083b7192d7d7224 (patch)
tree6b3e6c0da5baa7ba7e736e79a4b49a83918f25c9 /include/smarty/libs/internals/core.display_debug_console.php
parent01687607ec04f32ca03370456c112b64f66ca599 (diff)
- first smarty use ... (in admin.php and admin plugins page)
git-svn-id: http://piwigo.org/svn/trunk@2216 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/smarty/libs/internals/core.display_debug_console.php')
-rw-r--r--include/smarty/libs/internals/core.display_debug_console.php61
1 files changed, 61 insertions, 0 deletions
diff --git a/include/smarty/libs/internals/core.display_debug_console.php b/include/smarty/libs/internals/core.display_debug_console.php
new file mode 100644
index 000000000..1a80f3909
--- /dev/null
+++ b/include/smarty/libs/internals/core.display_debug_console.php
@@ -0,0 +1,61 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Smarty debug_console function plugin
+ *
+ * Type: core<br>
+ * Name: display_debug_console<br>
+ * Purpose: display the javascript debug console window
+ * @param array Format: null
+ * @param Smarty
+ */
+function smarty_core_display_debug_console($params, &$smarty)
+{
+ // we must force compile the debug template in case the environment
+ // changed between separate applications.
+
+ if(empty($smarty->debug_tpl)) {
+ // set path to debug template from SMARTY_DIR
+ $smarty->debug_tpl = SMARTY_DIR . 'debug.tpl';
+ if($smarty->security && is_file($smarty->debug_tpl)) {
+ $smarty->secure_dir[] = realpath($smarty->debug_tpl);
+ }
+ $smarty->debug_tpl = 'file:' . SMARTY_DIR . 'debug.tpl';
+ }
+
+ $_ldelim_orig = $smarty->left_delimiter;
+ $_rdelim_orig = $smarty->right_delimiter;
+
+ $smarty->left_delimiter = '{';
+ $smarty->right_delimiter = '}';
+
+ $_compile_id_orig = $smarty->_compile_id;
+ $smarty->_compile_id = null;
+
+ $_compile_path = $smarty->_get_compile_path($smarty->debug_tpl);
+ if ($smarty->_compile_resource($smarty->debug_tpl, $_compile_path))
+ {
+ ob_start();
+ $smarty->_include($_compile_path);
+ $_results = ob_get_contents();
+ ob_end_clean();
+ } else {
+ $_results = '';
+ }
+
+ $smarty->_compile_id = $_compile_id_orig;
+
+ $smarty->left_delimiter = $_ldelim_orig;
+ $smarty->right_delimiter = $_rdelim_orig;
+
+ return $_results;
+}
+
+/* vim: set expandtab: */
+
+?>