@@ -33,42 +33,42 @@ discard block |
||
33 | 33 | * @param string|HtmlSemDoubleElement $header |
34 | 34 | * @return \Ajax\semantic\html\collections\HtmlMessage |
35 | 35 | */ |
36 | - public function addHeader($header){ |
|
36 | + public function addHeader($header) { |
|
37 | 37 | $headerO=$header; |
38 | - if(\is_string($header)){ |
|
39 | - $headerO=new HtmlSemDoubleElement("header-".$this->identifier,"div"); |
|
38 | + if (\is_string($header)) { |
|
39 | + $headerO=new HtmlSemDoubleElement("header-".$this->identifier, "div"); |
|
40 | 40 | $headerO->setClass("header"); |
41 | 41 | $headerO->setContent($header); |
42 | 42 | } |
43 | - return $this->addContent($headerO,true); |
|
43 | + return $this->addContent($headerO, true); |
|
44 | 44 | } |
45 | 45 | |
46 | - public function setHeader($header){ |
|
46 | + public function setHeader($header) { |
|
47 | 47 | return $this->addHeader($header); |
48 | 48 | } |
49 | 49 | |
50 | - public function addList($elements,$ordered=false){ |
|
51 | - $list=new HtmlList("list-".$this->identifier,$elements); |
|
50 | + public function addList($elements, $ordered=false) { |
|
51 | + $list=new HtmlList("list-".$this->identifier, $elements); |
|
52 | 52 | $list->setOrdered($ordered); |
53 | 53 | $list->setClass("ui list"); |
54 | 54 | $this->addContent($list); |
55 | 55 | } |
56 | 56 | |
57 | - public function setIcon($icon){ |
|
57 | + public function setIcon($icon) { |
|
58 | 58 | $this->addToProperty("class", "icon"); |
59 | - $this->wrapContent("<div class='content'>","</div>"); |
|
59 | + $this->wrapContent("<div class='content'>", "</div>"); |
|
60 | 60 | $this->icon=new HtmlIcon("icon-".$this->identifier, $icon); |
61 | 61 | return $this; |
62 | 62 | } |
63 | 63 | |
64 | - public function addLoader($loaderIcon="notched circle"){ |
|
64 | + public function addLoader($loaderIcon="notched circle") { |
|
65 | 65 | $this->setIcon($loaderIcon); |
66 | 66 | $this->icon->addToIcon("loading"); |
67 | 67 | return $this; |
68 | 68 | } |
69 | 69 | |
70 | - public function setDismissable($dismiss=true){ |
|
71 | - if($dismiss===true) |
|
70 | + public function setDismissable($dismiss=true) { |
|
71 | + if ($dismiss===true) |
|
72 | 72 | $this->close=new HtmlIcon("close-".$this->identifier, "close"); |
73 | 73 | else |
74 | 74 | $this->close=NULL; |
@@ -79,41 +79,41 @@ discard block |
||
79 | 79 | * {@inheritDoc} |
80 | 80 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run() |
81 | 81 | */ |
82 | - public function run(JsUtils $js){ |
|
82 | + public function run(JsUtils $js) { |
|
83 | 83 | parent::run($js); |
84 | - if(isset($this->close)){ |
|
84 | + if (isset($this->close)) { |
|
85 | 85 | $js->execOn("click", "#".$this->identifier." .close", "$(this).closest('.message').transition({$this->_closeTransition})"); |
86 | 86 | } |
87 | - if(isset($this->_timeout)){ |
|
88 | - $js->exec("setTimeout(function() { $('#{$this->identifier}').transition({$this->_closeTransition}); }, {$this->_timeout});",true); |
|
87 | + if (isset($this->_timeout)) { |
|
88 | + $js->exec("setTimeout(function() { $('#{$this->identifier}').transition({$this->_closeTransition}); }, {$this->_timeout});", true); |
|
89 | 89 | } |
90 | 90 | } |
91 | 91 | |
92 | - public function setState($visible=true){ |
|
93 | - $visible=($visible===true)?"visible":"hidden"; |
|
94 | - return $this->addToPropertyCtrl("class", $visible, array("visible","hidden")); |
|
92 | + public function setState($visible=true) { |
|
93 | + $visible=($visible===true) ? "visible" : "hidden"; |
|
94 | + return $this->addToPropertyCtrl("class", $visible, array("visible", "hidden")); |
|
95 | 95 | } |
96 | 96 | |
97 | - public function setVariation($value="floating"){ |
|
98 | - return $this->addToPropertyCtrl("class", $value, array("floating","compact")); |
|
97 | + public function setVariation($value="floating") { |
|
98 | + return $this->addToPropertyCtrl("class", $value, array("floating", "compact")); |
|
99 | 99 | } |
100 | 100 | |
101 | - public function setStyle($style){ |
|
101 | + public function setStyle($style) { |
|
102 | 102 | return $this->addToPropertyCtrl("class", $style, Style::getConstants()); |
103 | 103 | } |
104 | 104 | |
105 | - public function setError(){ |
|
105 | + public function setError() { |
|
106 | 106 | return $this->setStyle("error"); |
107 | 107 | } |
108 | 108 | |
109 | - public function setWarning(){ |
|
109 | + public function setWarning() { |
|
110 | 110 | return $this->setStyle("warning"); |
111 | 111 | } |
112 | 112 | |
113 | - public function setMessage($message){ |
|
114 | - if(\is_array($this->content)){ |
|
113 | + public function setMessage($message) { |
|
114 | + if (\is_array($this->content)) { |
|
115 | 115 | $this->content[\sizeof($this->content)-1]=$message; |
116 | - }else |
|
116 | + } else |
|
117 | 117 | $this->setContent($message); |
118 | 118 | } |
119 | 119 |
@@ -68,10 +68,11 @@ discard block |
||
68 | 68 | } |
69 | 69 | |
70 | 70 | public function setDismissable($dismiss=true){ |
71 | - if($dismiss===true) |
|
72 | - $this->close=new HtmlIcon("close-".$this->identifier, "close"); |
|
73 | - else |
|
74 | - $this->close=NULL; |
|
71 | + if($dismiss===true) { |
|
72 | + $this->close=new HtmlIcon("close-".$this->identifier, "close"); |
|
73 | + } else { |
|
74 | + $this->close=NULL; |
|
75 | + } |
|
75 | 76 | return $this; |
76 | 77 | } |
77 | 78 | |
@@ -113,8 +114,9 @@ discard block |
||
113 | 114 | public function setMessage($message){ |
114 | 115 | if(\is_array($this->content)){ |
115 | 116 | $this->content[\sizeof($this->content)-1]=$message; |
116 | - }else |
|
117 | - $this->setContent($message); |
|
117 | + } else { |
|
118 | + $this->setContent($message); |
|
119 | + } |
|
118 | 120 | } |
119 | 121 | |
120 | 122 | public function setTimeout($_timeout) { |
@@ -28,27 +28,27 @@ |
||
28 | 28 | $method="get"; |
29 | 29 | extract($this->parameters); |
30 | 30 | $result=$this->_eventPreparing($preventDefault, $stopPropagation); |
31 | - switch($this->method) { |
|
31 | + switch ($this->method) { |
|
32 | 32 | case "get": |
33 | - $result.=$js->getDeferred($url, $responseElement, $params, $jsCallback, $attr,$jqueryDone,$ajaxTransition); |
|
33 | + $result.=$js->getDeferred($url, $responseElement, $params, $jsCallback, $attr, $jqueryDone, $ajaxTransition); |
|
34 | 34 | break; |
35 | 35 | case "post": |
36 | - $result.=$js->postDeferred($url, $responseElement, $params, $jsCallback, $attr,$hasLoader,$jqueryDone,$ajaxTransition); |
|
36 | + $result.=$js->postDeferred($url, $responseElement, $params, $jsCallback, $attr, $hasLoader, $jqueryDone, $ajaxTransition); |
|
37 | 37 | break; |
38 | 38 | case "postForm": |
39 | - $result.=$js->postFormDeferred($url, $form, $responseElement, $validation, $jsCallback, $attr,$hasLoader,$jqueryDone,$ajaxTransition); |
|
39 | + $result.=$js->postFormDeferred($url, $form, $responseElement, $validation, $jsCallback, $attr, $hasLoader, $jqueryDone, $ajaxTransition); |
|
40 | 40 | break; |
41 | 41 | case "json": |
42 | - $result.=$js->jsonDeferred($url,$method,$params,$jsCallback); |
|
42 | + $result.=$js->jsonDeferred($url, $method, $params, $jsCallback); |
|
43 | 43 | break; |
44 | 44 | case "jsonArray": |
45 | - $result.=$js->jsonArrayDeferred($modelSelector, $url,$method,$params,$jsCallback); |
|
45 | + $result.=$js->jsonArrayDeferred($modelSelector, $url, $method, $params, $jsCallback); |
|
46 | 46 | break; |
47 | 47 | } |
48 | 48 | return $result; |
49 | 49 | } |
50 | 50 | |
51 | - protected function _eventPreparing($preventDefault,$stopPropagation){ |
|
51 | + protected function _eventPreparing($preventDefault, $stopPropagation) { |
|
52 | 52 | $result=""; |
53 | 53 | if ($preventDefault===true) { |
54 | 54 | $result.=Javascript::$preventDefault; |