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: * @package Nette
11: */
12:
13:
14:
15: /**
16: * IDebugPanel implementation helper.
17: *
18: * @author David Grudl
19: */
20: class DebugPanel extends Object implements IDebugPanel
21: {
22: private $id;
23:
24: private $tabCb;
25:
26: private $panelCb;
27:
28: public function __construct($id, $tabCb, $panelCb)
29: {
30: $this->id = $id;
31: $this->tabCb = $tabCb;
32: $this->panelCb = $panelCb;
33: }
34:
35: public function getId()
36: {
37: return $this->id;
38: }
39:
40: public function getTab()
41: {
42: ob_start();
43: call_user_func($this->tabCb, $this->id);
44: return ob_get_clean();
45: }
46:
47: public function getPanel()
48: {
49: ob_start();
50: call_user_func($this->panelCb, $this->id);
51: return ob_get_clean();
52: }
53:
54: }
55: