| 1: | <?php |
| 2: | |
| 3: | namespace Zippy\Html; |
| 4: | |
| 5: | |
| 6: | |
| 7: | |
| 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: | |
| 32: | |
| 33: | |
| 34: | |
| 35: | |
| 36: | |
| 37: | |
| 38: | |
| 39: | |
| 40: | |
| 41: | |
| 42: | |
| 43: | |
| 44: | |
| 45: | |
| 46: | public function RequestHandle() { |
| 47: | parent::RequestHandle(); |
| 48: | $this->OnEvent(); |
| 49: | |
| 50: | } |
| 51: | |
| 52: | |
| 53: | |
| 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: | |
| 64: | |
| 65: | public function OnEvent() { |
| 66: | if ($this->event != null) { |
| 67: | $this->event->onEvent($this); |
| 68: | } |
| 69: | } |
| 70: | |
| 71: | |
| 72: | } |
| 73: | |