1 | <?php |
||
13 | trait BaseHtmlEventsTrait{ |
||
14 | |||
15 | protected $_events=array (); |
||
16 | |||
17 | public function addEvent($event, $jsCode, $stopPropagation=false, $preventDefault=false) { |
||
26 | |||
27 | public function _addEvent($event, $jsCode) { |
||
39 | |||
40 | public function on($event, $jsCode, $stopPropagation=false, $preventDefault=false) { |
||
43 | |||
44 | public function onClick($jsCode, $stopPropagation=false, $preventDefault=true) { |
||
47 | |||
48 | public function setClick($jsCode) { |
||
51 | |||
52 | public function onCreate($jsCode){ |
||
60 | |||
61 | public function addEventsOnRun(JsUtils $js=NULL) { |
||
83 | |||
84 | protected function _eventsOnCreate(JsUtils $js=NULL){ |
||
85 | if(isset($this->_events["_create"])){ |
||
86 | $create=$this->_events["_create"]; |
||
87 | if(\is_array($create)){ |
||
88 | $create=\implode("", $create); |
||
89 | } |
||
90 | if(isset($js) && $create!=="") |
||
91 | $js->exec($create,true); |
||
92 | unset($this->_events["_create"]); |
||
93 | } |
||
94 | } |
||
95 | |||
96 | public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) { |
||
102 | |||
103 | public function getOn($event, $url, $responseElement="", $parameters=array()) { |
||
106 | |||
107 | public function getOnClick($url, $responseElement="", $parameters=array()) { |
||
110 | |||
111 | public function postOn($event, $url, $params="{}", $responseElement="", $parameters=array()) { |
||
115 | |||
116 | public function postOnClick($url, $params="{}", $responseElement="", $parameters=array()) { |
||
119 | |||
120 | public function postFormOn($event, $url, $form, $responseElement="", $parameters=array()) { |
||
124 | |||
125 | public function postFormOnClick($url, $form, $responseElement="", $parameters=array()) { |
||
128 | |||
129 | public function jsDoJquery($jqueryCall, $param="") { |
||
132 | |||
133 | public function executeOnRun($jsCode) { |
||
136 | |||
137 | public function jsHtml($content="") { |
||
140 | |||
141 | public function jsShow() { |
||
144 | |||
145 | public function jsHide() { |
||
148 | } |
||
149 |