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: * @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 $data;
29:
30: public function __construct($id, $tabCb, $panelCb)
31: {
32: $this->id = $id;
33: $this->tabCb = $tabCb;
34: $this->panelCb = $panelCb;
35: }
36:
37: public function getId()
38: {
39: return $this->id;
40: }
41:
42: public function getTab()
43: {
44: ob_start();
45: call_user_func($this->tabCb, $this->id, $this->data);
46: return ob_get_clean();
47: }
48:
49: public function getPanel()
50: {
51: ob_start();
52: call_user_func($this->panelCb, $this->id, $this->data);
53: return ob_get_clean();
54: }
55:
56: }
57: