1: <?php
2:
3: /**
4: * This file is part of the Tracy (https://tracy.nette.org)
5: * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
6: */
7:
8: namespace Tracy;
9:
10:
11: /**
12: * IBarPanel implementation helper.
13: * @internal
14: */
15: class DefaultBarPanel implements IBarPanel
16: {
17: public $data;
18:
19: private $id;
20:
21:
22: public function __construct($id)
23: {
24: $this->id = $id;
25: }
26:
27:
28: /**
29: * Renders HTML code for custom tab.
30: * @return string
31: */
32: public function getTab()
33: {
34: ob_start(function () {});
35: $data = $this->data;
36: require __DIR__ . "/assets/Bar/{$this->id}.tab.phtml";
37: return ob_get_clean();
38: }
39:
40:
41: /**
42: * Renders HTML code for custom panel.
43: * @return string
44: */
45: public function getPanel()
46: {
47: ob_start(function () {});
48: if (is_file(__DIR__ . "/assets/Bar/{$this->id}.panel.phtml")) {
49: $data = $this->data;
50: require __DIR__ . "/assets/Bar/{$this->id}.panel.phtml";
51: }
52: return ob_get_clean();
53: }
54: }
55: