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: * @package Nette\Security\Diagnostics
7: */
8:
9:
10:
11: /**
12: * User panel for Debugger Bar.
13: *
14: * @author David Grudl
15: * @package Nette\Security\Diagnostics
16: */
17: class UserPanel extends Object implements IBarPanel
18: {
19: /** @var User */
20: private $user;
21:
22:
23: public function __construct(User $user)
24: {
25: $this->user = $user;
26: }
27:
28:
29: /**
30: * Renders tab.
31: * @return string
32: */
33: public function getTab()
34: {
35: if (headers_sent() && !session_id()) {
36: return;
37: }
38:
39: ob_start();
40: require dirname(__FILE__) . '/templates/UserPanel.tab.phtml';
41: return ob_get_clean();
42: }
43:
44:
45: /**
46: * Renders panel.
47: * @return string
48: */
49: public function getPanel()
50: {
51: ob_start();
52: require dirname(__FILE__) . '/templates/UserPanel.panel.phtml';
53: return ob_get_clean();
54: }
55:
56: }
57: