1: <?php
2:
3: /**
4: * This file is part of the Nette Framework (http://nette.org)
5: *
6: * Copyright (c) 2004, 2011 David Grudl (http://davidgrudl.com)
7: *
8: * For the full copyright and license information, please view
9: * the file license.txt that was distributed with this source code.
10: */
11:
12: namespace Nette;
13:
14:
15:
16: /**
17: * IDebugPanel implementation helper.
18: *
19: * @author David Grudl
20: */
21: class DebugPanel extends Object implements IDebugPanel
22: {
23: private $id;
24:
25: private $tabCb;
26:
27: private $panelCb;
28:
29: public $data;
30:
31: public function __construct($id, $tabCb, $panelCb)
32: {
33: $this->id = $id;
34: $this->tabCb = $tabCb;
35: $this->panelCb = $panelCb;
36: }
37:
38: public function getId()
39: {
40: return $this->id;
41: }
42:
43: public function getTab()
44: {
45: ob_start();
46: call_user_func($this->tabCb, $this->id, $this->data);
47: return ob_get_clean();
48: }
49:
50: public function getPanel()
51: {
52: ob_start();
53: call_user_func($this->panelCb, $this->id, $this->data);
54: return ob_get_clean();
55: }
56:
57: }
58: