1: <?php
2:
3: namespace Zippy\Html;
4:
5: /**
6: * Компонент выполняющий роль контейнера для других компонентов.
7: * Используется для управления группой компонентов, например скрытия методом SetVisible
8: *
9: */
10: class Panel extends HtmlContainer implements \Zippy\Interfaces\ClickListener, \Zippy\Interfaces\Requestable
11: {
12: protected $event = null;
13:
14: public function RenderImpl() {
15: parent::RenderImpl();
16:
17: if ($this->event == null) {
18: return;
19: }
20:
21: if ($this->event->isajax == false) {
22: $url = $this->owner->getURLNode() . "::" . $this->id;
23: $this->setAttribute("onclick", "window.location='{$url}';event.returnValue=false; return false;");
24: } else {
25: $url = $this->owner->getURLNode() . "::" . $this->id . "&ajax=true";
26: $this->setAttribute("onclick", "getUpdate('{$url}');event.returnValue=false; return false;");
27: }
28: }
29:
30: /*
31: public function setVisible($visible)
32: {
33: $this->visible = $visible;
34: }
35:
36: public function isVisible()
37: {
38: return $this->visible;
39: }
40:
41: */
42:
43: /**
44: * @see Requestable
45: */
46: public function RequestHandle() {
47: parent::RequestHandle();
48: $this->OnEvent();
49: // WebApplication::getApplication()->setReloadPage();
50: }
51:
52: /**
53: * @see ClickListener
54: */
55: public function onClick(\Zippy\Interfaces\EventReceiver $receiver, $handler, $ajax = false) {
56:
57: $this->event = new \Zippy\Event($receiver, $handler);
58:
59: $this->event->isajax = $ajax;
60: }
61:
62: /**
63: * @see ClickListener
64: */
65: public function OnEvent() {
66: if ($this->event != null) {
67: $this->event->onEvent($this);
68: }
69: }
70:
71:
72: }
73: