1
0
Fork 0
mirror of https://github.com/Oreolek/debug-toolbar.git synced 2024-05-14 23:18:14 +03:00

fix for new 3.1 features

This commit is contained in:
biakaveron 2011-02-19 00:28:18 +03:00
parent fc24a6154b
commit 43a81fee02
2 changed files with 13 additions and 13 deletions

View file

@ -87,7 +87,7 @@ class DebugToolbar
$template->set('benchmarks', self::get_benchmarks()); $template->set('benchmarks', self::get_benchmarks());
} }
if ($output = Request::instance()->response and self::is_enabled()) if ($output = Request::initial()->response()->body() and self::is_enabled())
{ {
// Try to add css just before the </head> tag // Try to add css just before the </head> tag
if (stripos($output, '</head>') !== FALSE) if (stripos($output, '</head>') !== FALSE)
@ -111,7 +111,7 @@ class DebugToolbar
$output .= $template->render(); $output .= $template->render();
} }
Request::instance()->response = $output; Request::initial()->response()->body($output);
} }
else else
{ {
@ -146,7 +146,7 @@ class DebugToolbar
{ {
if (is_array($data) OR is_object($data)) if (is_array($data) OR is_object($data))
{ {
$data = Kohana::dump($data); $data = Debug::dump($data);
} }
$result[$tab] = $data; $result[$tab] = $data;
@ -385,7 +385,7 @@ class DebugToolbar
public static function is_enabled() public static function is_enabled()
{ {
// Don't auto render toolbar for ajax requests // Don't auto render toolbar for ajax requests
if (Request::$is_ajax) if (Request::initial()->is_ajax())
return FALSE; return FALSE;
// Don't auto render toolbar if $_GET['debug'] = 'false' // Don't auto render toolbar if $_GET['debug'] = 'false'
@ -401,9 +401,9 @@ class DebugToolbar
if ($secret_key !== FALSE and isset($_GET[$secret_key])) if ($secret_key !== FALSE and isset($_GET[$secret_key]))
return TRUE; return TRUE;
// Don't auto render when IN_PRODUCTION (this can obviously be // Don't auto render when in PRODUCTION (this can obviously be
// overridden by the above secret key) // overridden by the above secret key)
if (IN_PRODUCTION) if (Kohana::$environment == Kohana::PRODUCTION)
return FALSE; return FALSE;
return TRUE; return TRUE;

View file

@ -216,22 +216,22 @@
<li onclick="debugToolbar.showvar(this, 'vars-session'); return false;">SESSION</li> <li onclick="debugToolbar.showvar(this, 'vars-session'); return false;">SESSION</li>
</ul> </ul>
<div style="display: none;" id="vars-post"> <div style="display: none;" id="vars-post">
<?php echo isset($_POST) ? Kohana::debug($_POST) : Kohana::debug(array()) ?> <?php echo isset($_POST) ? Debug::vars($_POST) : Debug::vars(array()) ?>
</div> </div>
<div style="display: none;" id="vars-get"> <div style="display: none;" id="vars-get">
<?php echo isset($_GET) ? Kohana::debug($_GET) : Kohana::debug(array()) ?> <?php echo isset($_GET) ? Debug::vars($_GET) : Debug::vars(array()) ?>
</div> </div>
<div style="display: none;" id="vars-files"> <div style="display: none;" id="vars-files">
<?php echo isset($_FILES) ? Kohana::debug($_FILES) : Kohana::debug(array()) ?> <?php echo isset($_FILES) ? Debug::vars($_FILES) : Debug::vars(array()) ?>
</div> </div>
<div style="display: none;" id="vars-server"> <div style="display: none;" id="vars-server">
<?php echo isset($_SERVER) ? Kohana::debug($_SERVER) : Kohana::debug(array()) ?> <?php echo isset($_SERVER) ? Debug::vars($_SERVER) : Debug::vars(array()) ?>
</div> </div>
<div style="display: none;" id="vars-cookie"> <div style="display: none;" id="vars-cookie">
<?php echo isset($_COOKIE) ? Kohana::debug($_COOKIE) : Kohana::debug(array()) ?> <?php echo isset($_COOKIE) ? Debug::vars($_COOKIE) : Debug::vars(array()) ?>
</div> </div>
<div style="display: none;" id="vars-session"> <div style="display: none;" id="vars-session">
<?php echo isset($_SESSION) ? Kohana::debug($_SESSION) : Kohana::debug(array()) ?> <?php echo isset($_SESSION) ? Debug::vars($_SESSION) : Debug::vars(array()) ?>
</div> </div>
</div> </div>
<?php endif ?> <?php endif ?>
@ -323,7 +323,7 @@
<th>name</th> <th>name</th>
</tr> </tr>
<?php foreach($routes as $name => $route): <?php foreach($routes as $name => $route):
$class = ($route == Request::instance()->route ? ' current' : ''); ?> $class = ($route == Request::initial()->route() ? ' current' : ''); ?>
<tr class="<?php echo text::alternate('odd','even').$class?>"> <tr class="<?php echo text::alternate('odd','even').$class?>">
<td><?php echo ++$r_counter ?></td> <td><?php echo ++$r_counter ?></td>
<td><?php echo $name ?></td> <td><?php echo $name ?></td>