You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

toolbar.php 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /* @var $this \yii\web\View */
  3. /* @var $panels \yii\debug\Panel[] */
  4. /* @var $tag string */
  5. /* @var $position string */
  6. use yii\helpers\Url;
  7. $minJs = <<<EOD
  8. document.getElementById('yii-debug-toolbar').style.display = 'none';
  9. document.getElementById('yii-debug-toolbar-min').style.display = 'block';
  10. if (window.localStorage) {
  11. localStorage.setItem('yii-debug-toolbar', 'minimized');
  12. }
  13. EOD;
  14. $maxJs = <<<EOD
  15. document.getElementById('yii-debug-toolbar-min').style.display = 'none';
  16. document.getElementById('yii-debug-toolbar').style.display = 'block';
  17. if (window.localStorage) {
  18. localStorage.setItem('yii-debug-toolbar', 'maximized');
  19. }
  20. EOD;
  21. $firstPanel = reset($panels);
  22. $url = $firstPanel->getUrl();
  23. ?>
  24. <div id="yii-debug-toolbar" class="yii-debug-toolbar-<?= $position ?> hidden-print">
  25. <div class="yii-debug-toolbar-block title">
  26. <a href="<?= Url::to(['index']) ?>">
  27. <img width="29" height="30" alt="" src="<?= \yii\debug\Module::getYiiLogo() ?>">
  28. Yii Debugger
  29. </a>
  30. </div>
  31. <?php foreach ($panels as $panel): ?>
  32. <?= $panel->getSummary() ?>
  33. <?php endforeach; ?>
  34. <span class="yii-debug-toolbar-toggler" onclick="<?= $minJs ?>">›</span>
  35. </div>
  36. <div id="yii-debug-toolbar-min" class="hidden-print">
  37. <a href="<?= $url ?>" title="Open Yii Debugger" id="yii-debug-toolbar-logo">
  38. <img width="29" height="30" alt="" src="<?= \yii\debug\Module::getYiiLogo() ?>">
  39. </a>
  40. <span class="yii-debug-toolbar-toggler" onclick="<?= $maxJs ?>">‹</span>
  41. </div>