1: <?php
2:
3: /**
4: * This file is part of the Nette Framework.
5: *
6: * Copyright (c) 2004, 2010 David Grudl (http://davidgrudl.com)
7: *
8: * This source file is subject to the "Nette license", and/or
9: * GPL license. For more information please see http://nette.org
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 function __construct($id, $tabCb, $panelCb)
30: {
31: $this->id = $id;
32: $this->tabCb = $tabCb;
33: $this->panelCb = $panelCb;
34: }
35:
36: public function getId()
37: {
38: return $this->id;
39: }
40:
41: public function getTab()
42: {
43: ob_start();
44: call_user_func($this->tabCb, $this->id);
45: return ob_get_clean();
46: }
47:
48: public function getPanel()
49: {
50: ob_start();
51: call_user_func($this->panelCb, $this->id);
52: return ob_get_clean();
53: }
54:
55: }
56: