toolbar.php 1.51 KB
Newer Older
Qiang Xue committed
1
<?php
2 3 4 5
/* @var $this \yii\web\View */
/* @var $panels \yii\debug\Panel[] */
/* @var $tag string */
/* @var $position string */
6

7
use yii\helpers\Url;
8 9 10 11 12

$minJs = <<<EOD
document.getElementById('yii-debug-toolbar').style.display = 'none';
document.getElementById('yii-debug-toolbar-min').style.display = 'block';
if (window.localStorage) {
13
    localStorage.setItem('yii-debug-toolbar', 'minimized');
14 15 16 17 18 19 20
}
EOD;

$maxJs = <<<EOD
document.getElementById('yii-debug-toolbar-min').style.display = 'none';
document.getElementById('yii-debug-toolbar').style.display = 'block';
if (window.localStorage) {
21
    localStorage.setItem('yii-debug-toolbar', 'maximized');
22 23 24
}
EOD;

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

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