toolbar.php 1.44 KB
Newer Older
Qiang Xue committed
1 2
<?php
/**
Alexander Makarov committed
3
 * @var \yii\web\View $this
Qiang Xue committed
4
 * @var \yii\debug\Panel[] $panels
Qiang Xue committed
5
 * @var string $tag
6
 * @var string $position
Qiang Xue committed
7
 */
8
use yii\helpers\Url;
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

$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;

26 27
$firstPanel = reset($panels);
$url = $firstPanel->getUrl();
Qiang Xue committed
28
?>
29
<div id="yii-debug-toolbar" class="yii-debug-toolbar-<?= $position ?>">
30
    <div class="yii-debug-toolbar-block title">
31
        <a href="<?= Url::to(['index']) ?>">
32 33 34 35 36
            <img width="29" height="30" alt="" src="<?= \yii\debug\Module::getYiiLogo() ?>">
            Yii Debugger
        </a>
    </div>

Qiang Xue committed
37
	<?php foreach ($panels as $panel): ?>
38
	    <?= $panel->getSummary() ?>
Qiang Xue committed
39
	<?php endforeach; ?>
Alexander Makarov committed
40
	<span class="yii-debug-toolbar-toggler" onclick="<?= $minJs ?>"></span>
41 42
</div>
<div id="yii-debug-toolbar-min">
Alexander Makarov committed
43
	<a href="<?= $url ?>" title="Open Yii Debugger" id="yii-debug-toolbar-logo">
44
		<img width="29" height="30" alt="" src="<?= \yii\debug\Module::getYiiLogo() ?>">
45
	</a>
Alexander Makarov committed
46
	<span class="yii-debug-toolbar-toggler" onclick="<?= $maxJs ?>"></span>
Qiang Xue committed
47
</div>