toolbar.php 1.17 KB
Newer Older
Qiang Xue committed
1 2 3 4
<?php
/**
 * @var \yii\base\View $this
 * @var \yii\debug\Panel[] $panels
Qiang Xue committed
5
 * @var string $tag
Qiang Xue committed
6
 */
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
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();
Qiang Xue committed
26 27 28 29 30
?>
<div id="yii-debug-toolbar">
	<?php foreach ($panels as $panel): ?>
	<?php echo $panel->getSummary(); ?>
	<?php endforeach; ?>
Qiang Xue committed
31
	<span class="yii-debug-toolbar-toggler" onclick="<?php echo $minJs; ?>"></span>
32 33 34 35 36
</div>
<div id="yii-debug-toolbar-min">
	<a href="<?php echo $url; ?>" title="Open Yii Debugger" id="yii-debug-toolbar-logo">
		<img width="29" height="30" alt="" src="<?php echo ConfigPanel::getYiiLogo(); ?>">
	</a>
Qiang Xue committed
37
	<span class="yii-debug-toolbar-toggler" onclick="<?php echo $maxJs; ?>"></span>
Qiang Xue committed
38
</div>