Files
yii2/extensions/yii/debug/views/default/toolbar.php
Carsten Brandt 421ebeee1e refactored debug toolbar assets
also fixed problems with display on small screens.

fixes #1747
2014-01-04 13:41:59 +01:00

40 lines
1.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* @var \yii\web\View $this
* @var \yii\debug\Panel[] $panels
* @var string $tag
* @var string $position
*/
use yii\debug\panels\ConfigPanel;
$minJs = <<<EOD
document.getElementById('yii-debug-toolbar').style.display = 'none';
document.getElementById('yii-debug-toolbar-min').style.display = 'block';
if (window.localStorage) {
localStorage.setItem('yii-debug-toolbar', 'minimized');
}
EOD;
$maxJs = <<<EOD
document.getElementById('yii-debug-toolbar-min').style.display = 'none';
document.getElementById('yii-debug-toolbar').style.display = 'block';
if (window.localStorage) {
localStorage.setItem('yii-debug-toolbar', 'maximized');
}
EOD;
$url = $panels['request']->getUrl();
?>
<div id="yii-debug-toolbar" class="yii-debug-toolbar-<?= $position ?>">
<?php foreach ($panels as $panel): ?>
<?= $panel->getSummary() ?>
<?php endforeach; ?>
<span class="yii-debug-toolbar-toggler" onclick="<?= $minJs ?>"></span>
</div>
<div id="yii-debug-toolbar-min">
<a href="<?= $url ?>" title="Open Yii Debugger" id="yii-debug-toolbar-logo">
<img width="29" height="30" alt="" src="<?= ConfigPanel::getYiiLogo() ?>">
</a>
<span class="yii-debug-toolbar-toggler" onclick="<?= $maxJs ?>"></span>
</div>