From 3f6a4c854eeae17feb94ef82d35b34899ec18723 Mon Sep 17 00:00:00 2001 From: biakaveron Date: Tue, 15 Oct 2013 01:04:39 +0400 Subject: [PATCH] Improve custom's sections rendering --- classes/Kohana/Debugtoolbar.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/classes/Kohana/Debugtoolbar.php b/classes/Kohana/Debugtoolbar.php index 3f450f0..7fd0480 100644 --- a/classes/Kohana/Debugtoolbar.php +++ b/classes/Kohana/Debugtoolbar.php @@ -213,9 +213,14 @@ abstract class Kohana_Debugtoolbar { foreach(self::$_custom_sections as $section) { list($title, $data, $logo) = $section; + if ( ! is_string($data) && is_callable($data)) + { + $data = call_user_func($data); + } + $result[] = array( - 'title' => is_callable($title) ? call_user_func($title) : (string)$title, - 'content' => is_callable($data) ? call_user_func($data) : $data, + 'title' => ! is_string($title) && is_callable($title) ? call_user_func($title) : (string)$title, + 'content' => is_string($data) ? $data : Debug::dump($data), 'logo' => $logo ); }