1: <?php
2:
3: /**
4: * This file is part of the Nette Framework (https://nette.org)
5: * Copyright (c) 2004 David Grudl (http://davidgrudl.com)
6: */
7:
8: namespace Nette\Security\Diagnostics;
9:
10: use Nette,
11: Nette\Diagnostics\Helpers;
12:
13:
14: /**
15: * User panel for Debugger Bar.
16: *
17: * @author David Grudl
18: */
19: class UserPanel extends Nette\Object implements Nette\Diagnostics\IBarPanel
20: {
21: /** @var Nette\Security\User */
22: private $user;
23:
24:
25: public function __construct(Nette\Security\User $user)
26: {
27: $this->user = $user;
28: }
29:
30:
31: /**
32: * Renders tab.
33: * @return string
34: */
35: public function getTab()
36: {
37: if (headers_sent() && !session_id()) {
38: return;
39: }
40:
41: ob_start();
42: require __DIR__ . '/templates/UserPanel.tab.phtml';
43: return ob_get_clean();
44: }
45:
46:
47: /**
48: * Renders panel.
49: * @return string
50: */
51: public function getPanel()
52: {
53: ob_start();
54: require __DIR__ . '/templates/UserPanel.panel.phtml';
55: return ob_get_clean();
56: }
57:
58: }
59: