@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | */ |
| 11 | 11 | trait JsUtilsEventsTrait { |
| 12 | 12 | |
| 13 | - protected $jquery_events = array( |
|
| 13 | + protected $jquery_events=array( |
|
| 14 | 14 | "bind", |
| 15 | 15 | "blur", |
| 16 | 16 | "change", |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | "unload" |
| 52 | 52 | ); |
| 53 | 53 | |
| 54 | - abstract public function _add_event($element, $js, $event, $preventDefault = false, $stopPropagation = false, $immediatly = true); |
|
| 54 | + abstract public function _add_event($element, $js, $event, $preventDefault=false, $stopPropagation=false, $immediatly=true); |
|
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | 57 | * Outputs a javascript library blur event |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | * code to execute |
| 63 | 63 | * @return string |
| 64 | 64 | */ |
| 65 | - public function blur($element = 'this', $js = '') { |
|
| 65 | + public function blur($element='this', $js='') { |
|
| 66 | 66 | return $this->_add_event($element, $js, 'blur'); |
| 67 | 67 | } |
| 68 | 68 | |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | * @param boolean $stopPropagation |
| 78 | 78 | * @return string |
| 79 | 79 | */ |
| 80 | - public function change($element = 'this', $js = '', $preventDefault = false, $stopPropagation = false) { |
|
| 80 | + public function change($element='this', $js='', $preventDefault=false, $stopPropagation=false) { |
|
| 81 | 81 | return $this->_add_event($element, $js, 'change', $preventDefault, $stopPropagation); |
| 82 | 82 | } |
| 83 | 83 | |
@@ -94,15 +94,15 @@ discard block |
||
| 94 | 94 | * @param boolean $stopPropagation |
| 95 | 95 | * @return string |
| 96 | 96 | */ |
| 97 | - public function click($element = 'this', $js = '', $ret_false = TRUE, $preventDefault = false, $stopPropagation = false) { |
|
| 98 | - if (! is_array($js)) { |
|
| 99 | - $js = array( |
|
| 97 | + public function click($element='this', $js='', $ret_false=TRUE, $preventDefault=false, $stopPropagation=false) { |
|
| 98 | + if (!is_array($js)) { |
|
| 99 | + $js=array( |
|
| 100 | 100 | $js |
| 101 | 101 | ); |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | if ($ret_false) { |
| 105 | - $js[] = "return false;"; |
|
| 105 | + $js[]="return false;"; |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | return $this->_add_event($element, $js, 'click', $preventDefault, $stopPropagation); |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | * code to execute |
| 118 | 118 | * @return string |
| 119 | 119 | */ |
| 120 | - public function contextmenu($element = 'this', $js = '') { |
|
| 120 | + public function contextmenu($element='this', $js='') { |
|
| 121 | 121 | return $this->_add_event($element, $js, 'contextmenu'); |
| 122 | 122 | } |
| 123 | 123 | |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | * code to execute |
| 131 | 131 | * @return string |
| 132 | 132 | */ |
| 133 | - public function dblclick($element = 'this', $js = '') { |
|
| 133 | + public function dblclick($element='this', $js='') { |
|
| 134 | 134 | return $this->_add_event($element, $js, 'dblclick'); |
| 135 | 135 | } |
| 136 | 136 | |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | * code to execute |
| 144 | 144 | * @return string |
| 145 | 145 | */ |
| 146 | - public function error($element = 'this', $js = '') { |
|
| 146 | + public function error($element='this', $js='') { |
|
| 147 | 147 | return $this->_add_event($element, $js, 'error'); |
| 148 | 148 | } |
| 149 | 149 | |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | * code to execute |
| 157 | 157 | * @return string |
| 158 | 158 | */ |
| 159 | - public function focus($element = 'this', $js = '') { |
|
| 159 | + public function focus($element='this', $js='') { |
|
| 160 | 160 | return $this->_add_event($element, $js, 'focus'); |
| 161 | 161 | } |
| 162 | 162 | |
@@ -170,9 +170,9 @@ discard block |
||
| 170 | 170 | * code for mouse out |
| 171 | 171 | * @return string |
| 172 | 172 | */ |
| 173 | - public function hover($element = 'this', $over, $out) { |
|
| 174 | - $event = "\n\t$(" . Javascript::prep_element($element) . ").hover(\n\t\tfunction()\n\t\t{\n\t\t\t{$over}\n\t\t}, \n\t\tfunction()\n\t\t{\n\t\t\t{$out}\n\t\t});\n"; |
|
| 175 | - $this->jquery_code_for_compile[] = $event; |
|
| 173 | + public function hover($element='this', $over, $out) { |
|
| 174 | + $event="\n\t$(".Javascript::prep_element($element).").hover(\n\t\tfunction()\n\t\t{\n\t\t\t{$over}\n\t\t}, \n\t\tfunction()\n\t\t{\n\t\t\t{$out}\n\t\t});\n"; |
|
| 175 | + $this->jquery_code_for_compile[]=$event; |
|
| 176 | 176 | return $event; |
| 177 | 177 | } |
| 178 | 178 | |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | * code to execute |
| 186 | 186 | * @return string |
| 187 | 187 | */ |
| 188 | - public function keydown($element = 'this', $js = '') { |
|
| 188 | + public function keydown($element='this', $js='') { |
|
| 189 | 189 | return $this->_add_event($element, $js, 'keydown'); |
| 190 | 190 | } |
| 191 | 191 | |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | * code to execute |
| 199 | 199 | * @return string |
| 200 | 200 | */ |
| 201 | - public function keypress($element = 'this', $js = '') { |
|
| 201 | + public function keypress($element='this', $js='') { |
|
| 202 | 202 | return $this->_add_event($element, $js, 'keypress'); |
| 203 | 203 | } |
| 204 | 204 | |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | * code to execute |
| 212 | 212 | * @return string |
| 213 | 213 | */ |
| 214 | - public function keyup($element = 'this', $js = '') { |
|
| 214 | + public function keyup($element='this', $js='') { |
|
| 215 | 215 | return $this->_add_event($element, $js, 'keyup'); |
| 216 | 216 | } |
| 217 | 217 | |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | * code to execute |
| 225 | 225 | * @return string |
| 226 | 226 | */ |
| 227 | - public function load($element = 'this', $js = '') { |
|
| 227 | + public function load($element='this', $js='') { |
|
| 228 | 228 | return $this->_add_event($element, $js, 'load'); |
| 229 | 229 | } |
| 230 | 230 | |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | * code to execute |
| 238 | 238 | * @return string |
| 239 | 239 | */ |
| 240 | - public function mousedown($element = 'this', $js = '') { |
|
| 240 | + public function mousedown($element='this', $js='') { |
|
| 241 | 241 | return $this->_add_event($element, $js, 'mousedown'); |
| 242 | 242 | } |
| 243 | 243 | |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | * code to execute |
| 251 | 251 | * @return string |
| 252 | 252 | */ |
| 253 | - public function mouseout($element = 'this', $js = '', $preventDefault = false, $stopPropagation = false) { |
|
| 253 | + public function mouseout($element='this', $js='', $preventDefault=false, $stopPropagation=false) { |
|
| 254 | 254 | return $this->_add_event($element, $js, 'mouseout', $preventDefault, $stopPropagation); |
| 255 | 255 | } |
| 256 | 256 | |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | * code to execute |
| 264 | 264 | * @return string |
| 265 | 265 | */ |
| 266 | - public function mouseleave($element = 'this', $js = '', $preventDefault = false, $stopPropagation = false) { |
|
| 266 | + public function mouseleave($element='this', $js='', $preventDefault=false, $stopPropagation=false) { |
|
| 267 | 267 | return $this->_add_event($element, $js, 'mouseleave', $preventDefault, $stopPropagation); |
| 268 | 268 | } |
| 269 | 269 | |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | * code to execute |
| 277 | 277 | * @return string |
| 278 | 278 | */ |
| 279 | - public function mouseenter($element = 'this', $js = '', $preventDefault = false, $stopPropagation = false) { |
|
| 279 | + public function mouseenter($element='this', $js='', $preventDefault=false, $stopPropagation=false) { |
|
| 280 | 280 | return $this->_add_event($element, $js, 'mouseenter', $preventDefault, $stopPropagation); |
| 281 | 281 | } |
| 282 | 282 | |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | * code to execute |
| 290 | 290 | * @return string |
| 291 | 291 | */ |
| 292 | - public function mouseover($element = 'this', $js = '') { |
|
| 292 | + public function mouseover($element='this', $js='') { |
|
| 293 | 293 | return $this->_add_event($element, $js, 'mouseover'); |
| 294 | 294 | } |
| 295 | 295 | |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | * code to execute |
| 303 | 303 | * @return string |
| 304 | 304 | */ |
| 305 | - public function mouseup($element = 'this', $js = '') { |
|
| 305 | + public function mouseup($element='this', $js='') { |
|
| 306 | 306 | return $this->_add_event($element, $js, 'mouseup'); |
| 307 | 307 | } |
| 308 | 308 | |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | * code to execute |
| 316 | 316 | * @return string |
| 317 | 317 | */ |
| 318 | - public function unload($element = 'this', $js = '') { |
|
| 318 | + public function unload($element='this', $js='') { |
|
| 319 | 319 | return $this->_add_event($element, $js, 'unload'); |
| 320 | 320 | } |
| 321 | 321 | |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | * code to execute |
| 330 | 330 | * @return string |
| 331 | 331 | */ |
| 332 | - public function resize($element = 'this', $js = '') { |
|
| 332 | + public function resize($element='this', $js='') { |
|
| 333 | 333 | return $this->_add_event($element, $js, 'resize'); |
| 334 | 334 | } |
| 335 | 335 | |
@@ -343,7 +343,7 @@ discard block |
||
| 343 | 343 | * code to execute |
| 344 | 344 | * @return string |
| 345 | 345 | */ |
| 346 | - public function scroll($element = 'this', $js = '') { |
|
| 346 | + public function scroll($element='this', $js='') { |
|
| 347 | 347 | return $this->_add_event($element, $js, 'scroll'); |
| 348 | 348 | } |
| 349 | 349 | } |
@@ -7,18 +7,18 @@ |
||
| 7 | 7 | |
| 8 | 8 | public function __construct(JsUtils $js) { |
| 9 | 9 | parent::__construct($js); |
| 10 | - $this->uiName = "dimmer"; |
|
| 10 | + $this->uiName="dimmer"; |
|
| 11 | 11 | } |
| 12 | 12 | |
| 13 | - public function setOn($value = false) { |
|
| 14 | - $this->params["on"] = $value; |
|
| 13 | + public function setOn($value=false) { |
|
| 14 | + $this->params["on"]=$value; |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | public function setOpacity($value) { |
| 18 | - $this->params["opacity"] = $value; |
|
| 18 | + $this->params["opacity"]=$value; |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | public function setClosable($value) { |
| 22 | - $this->params["closable"] = $value; |
|
| 22 | + $this->params["closable"]=$value; |
|
| 23 | 23 | } |
| 24 | 24 | } |
@@ -12,21 +12,21 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | private $_inverted; |
| 14 | 14 | |
| 15 | - public function __construct($identifier, $content = NULL) { |
|
| 15 | + public function __construct($identifier, $content=NULL) { |
|
| 16 | 16 | parent::__construct($identifier, "div", "ui dimmer"); |
| 17 | 17 | $this->setContent($content); |
| 18 | - $this->_inverted = false; |
|
| 18 | + $this->_inverted=false; |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | public function setContent($content) { |
| 22 | - $this->content = new HtmlSemDoubleElement("content-" . $this->identifier, "div", "content", new HtmlSemDoubleElement("", "div", "center", $content)); |
|
| 22 | + $this->content=new HtmlSemDoubleElement("content-".$this->identifier, "div", "content", new HtmlSemDoubleElement("", "div", "center", $content)); |
|
| 23 | 23 | return $this; |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - public function asIcon($icon, $title, $subHeader = NULL) { |
|
| 27 | - $header = new HtmlHeader("header-" . $this->identifier); |
|
| 26 | + public function asIcon($icon, $title, $subHeader=NULL) { |
|
| 27 | + $header=new HtmlHeader("header-".$this->identifier); |
|
| 28 | 28 | $header->asIcon($icon, $title, $subHeader); |
| 29 | - if ($this->_inverted === false) |
|
| 29 | + if ($this->_inverted===false) |
|
| 30 | 30 | $header->setInverted(); |
| 31 | 31 | return $this->setContent($header); |
| 32 | 32 | } |
@@ -35,24 +35,24 @@ discard block |
||
| 35 | 35 | return $this->addToProperty("class", "page"); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - public function setInverted($recursive = true) { |
|
| 38 | + public function setInverted($recursive=true) { |
|
| 39 | 39 | parent::setInverted($recursive); |
| 40 | - $this->_inverted = true; |
|
| 40 | + $this->_inverted=true; |
|
| 41 | 41 | return $this; |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | public function run(JsUtils $js) { |
| 45 | 45 | if ($this->_container instanceof HtmlSingleElement) { |
| 46 | - $this->_bsComponent = $js->semantic()->dimmer("#" . $this->_container->getIdentifier(), $this->_params); |
|
| 46 | + $this->_bsComponent=$js->semantic()->dimmer("#".$this->_container->getIdentifier(), $this->_params); |
|
| 47 | 47 | } else { |
| 48 | - $this->_bsComponent = $js->semantic()->dimmer("#" . $this->identifier, $this->_params); |
|
| 48 | + $this->_bsComponent=$js->semantic()->dimmer("#".$this->identifier, $this->_params); |
|
| 49 | 49 | } |
| 50 | 50 | return parent::run($js); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | public function jsShow() { |
| 54 | 54 | if (isset($this->_container)) |
| 55 | - return '$("#.' . $this->_container->getIdentifier() . ').dimmer("show");'; |
|
| 55 | + return '$("#.'.$this->_container->getIdentifier().').dimmer("show");'; |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | public function setBlurring() { |
@@ -60,17 +60,17 @@ discard block |
||
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | public function setParams($_params) { |
| 63 | - $this->_params = $_params; |
|
| 63 | + $this->_params=$_params; |
|
| 64 | 64 | return $this; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | public function setContainer($_container) { |
| 68 | - $this->_container = $_container; |
|
| 68 | + $this->_container=$_container; |
|
| 69 | 69 | return $this; |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | public function setClosable($closable) { |
| 73 | - $this->_params['closable'] = $closable; |
|
| 73 | + $this->_params['closable']=$closable; |
|
| 74 | 74 | return $this; |
| 75 | 75 | } |
| 76 | 76 | } |
@@ -26,8 +26,9 @@ discard block |
||
| 26 | 26 | public function asIcon($icon, $title, $subHeader = NULL) { |
| 27 | 27 | $header = new HtmlHeader("header-" . $this->identifier); |
| 28 | 28 | $header->asIcon($icon, $title, $subHeader); |
| 29 | - if ($this->_inverted === false) |
|
| 30 | - $header->setInverted(); |
|
| 29 | + if ($this->_inverted === false) { |
|
| 30 | + $header->setInverted(); |
|
| 31 | + } |
|
| 31 | 32 | return $this->setContent($header); |
| 32 | 33 | } |
| 33 | 34 | |
@@ -51,8 +52,9 @@ discard block |
||
| 51 | 52 | } |
| 52 | 53 | |
| 53 | 54 | public function jsShow() { |
| 54 | - if (isset($this->_container)) |
|
| 55 | - return '$("#.' . $this->_container->getIdentifier() . ').dimmer("show");'; |
|
| 55 | + if (isset($this->_container)) { |
|
| 56 | + return '$("#.' . $this->_container->getIdentifier() . ').dimmer("show");'; |
|
| 57 | + } |
|
| 56 | 58 | } |
| 57 | 59 | |
| 58 | 60 | public function setBlurring() { |
@@ -29,10 +29,10 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | protected $js; |
| 31 | 31 | |
| 32 | - public function __construct($autoCompile = true) { |
|
| 33 | - $this->autoCompile = $autoCompile; |
|
| 34 | - $this->components = array(); |
|
| 35 | - $this->htmlComponents = array(); |
|
| 32 | + public function __construct($autoCompile=true) { |
|
| 33 | + $this->autoCompile=$autoCompile; |
|
| 34 | + $this->components=array(); |
|
| 35 | + $this->htmlComponents=array(); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | public function isAutoCompile() { |
@@ -40,12 +40,12 @@ discard block |
||
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | public function setAutoCompile($autoCompile) { |
| 43 | - $this->autoCompile = $autoCompile; |
|
| 43 | + $this->autoCompile=$autoCompile; |
|
| 44 | 44 | return $this; |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - public function compile($internal = false) { |
|
| 48 | - if ($internal === false && $this->autoCompile === true) |
|
| 47 | + public function compile($internal=false) { |
|
| 48 | + if ($internal===false && $this->autoCompile===true) |
|
| 49 | 49 | throw new \Exception("Impossible to compile if autoCompile is set to 'true'"); |
| 50 | 50 | foreach ($this->components as $component) { |
| 51 | 51 | $component->compile(); |
@@ -53,20 +53,20 @@ discard block |
||
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | public function setJs(JsUtils $js) { |
| 56 | - $this->js = $js; |
|
| 56 | + $this->js=$js; |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | public function addComponent(SimpleComponent $component, $attachTo, $params) { |
| 60 | 60 | if ($this->autoCompile) { |
| 61 | - if ($attachTo != null) { |
|
| 62 | - if (! isset($this->components[$attachTo])) { |
|
| 63 | - $this->components[$attachTo] = $component; |
|
| 61 | + if ($attachTo!=null) { |
|
| 62 | + if (!isset($this->components[$attachTo])) { |
|
| 63 | + $this->components[$attachTo]=$component; |
|
| 64 | 64 | } else { |
| 65 | - $this->components[] = $component; |
|
| 65 | + $this->components[]=$component; |
|
| 66 | 66 | } |
| 67 | 67 | $component->attach($attachTo); |
| 68 | 68 | } else { |
| 69 | - $this->components[] = $component; |
|
| 69 | + $this->components[]=$component; |
|
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 | if (isset($params)) |
@@ -76,11 +76,11 @@ discard block |
||
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | public function addHtmlComponent(BaseHtml $htmlComponent) { |
| 79 | - $this->htmlComponents[$htmlComponent->getIdentifier()] = $htmlComponent; |
|
| 79 | + $this->htmlComponents[$htmlComponent->getIdentifier()]=$htmlComponent; |
|
| 80 | 80 | return $htmlComponent; |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | - public function compileHtml(JsUtils $js = NULL, &$view = NULL) { |
|
| 83 | + public function compileHtml(JsUtils $js=NULL, &$view=NULL) { |
|
| 84 | 84 | foreach ($this->htmlComponents as $htmlComponent) { |
| 85 | 85 | $htmlComponent->compile($js, $view); |
| 86 | 86 | } |
@@ -45,8 +45,9 @@ discard block |
||
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | public function compile($internal = false) { |
| 48 | - if ($internal === false && $this->autoCompile === true) |
|
| 49 | - throw new \Exception("Impossible to compile if autoCompile is set to 'true'"); |
|
| 48 | + if ($internal === false && $this->autoCompile === true) { |
|
| 49 | + throw new \Exception("Impossible to compile if autoCompile is set to 'true'"); |
|
| 50 | + } |
|
| 50 | 51 | foreach ($this->components as $component) { |
| 51 | 52 | $component->compile(); |
| 52 | 53 | } |
@@ -69,9 +70,10 @@ discard block |
||
| 69 | 70 | $this->components[] = $component; |
| 70 | 71 | } |
| 71 | 72 | } |
| 72 | - if (isset($params)) |
|
| 73 | - if (\is_array($params)) |
|
| 73 | + if (isset($params)) { |
|
| 74 | + if (\is_array($params)) |
|
| 74 | 75 | $component->setParams($params); |
| 76 | + } |
|
| 75 | 77 | return $component; |
| 76 | 78 | } |
| 77 | 79 | |
@@ -16,15 +16,15 @@ discard block |
||
| 16 | 16 | * @version 1.001 |
| 17 | 17 | */ |
| 18 | 18 | class HtmlMessage extends HtmlSemDoubleElement { |
| 19 | - use AttachedTrait,HasTimeoutTrait; |
|
| 19 | + use AttachedTrait, HasTimeoutTrait; |
|
| 20 | 20 | |
| 21 | 21 | protected $icon; |
| 22 | 22 | |
| 23 | 23 | protected $close; |
| 24 | 24 | |
| 25 | - public function __construct($identifier, $content = "") { |
|
| 25 | + public function __construct($identifier, $content="") { |
|
| 26 | 26 | parent::__construct($identifier, "div"); |
| 27 | - $this->_template = '<%tagName% id="%identifier%" %properties%>%close%%icon%%wrapContentBefore%%content%%wrapContentAfter%</%tagName%>'; |
|
| 27 | + $this->_template='<%tagName% id="%identifier%" %properties%>%close%%icon%%wrapContentBefore%%content%%wrapContentAfter%</%tagName%>'; |
|
| 28 | 28 | $this->setClass("ui message"); |
| 29 | 29 | $this->setContent($content); |
| 30 | 30 | } |
@@ -36,9 +36,9 @@ discard block |
||
| 36 | 36 | * @return \Ajax\semantic\html\collections\HtmlMessage |
| 37 | 37 | */ |
| 38 | 38 | public function addHeader($header) { |
| 39 | - $headerO = $header; |
|
| 39 | + $headerO=$header; |
|
| 40 | 40 | if (\is_string($header)) { |
| 41 | - $headerO = new HtmlSemDoubleElement("header-" . $this->identifier, "div"); |
|
| 41 | + $headerO=new HtmlSemDoubleElement("header-".$this->identifier, "div"); |
|
| 42 | 42 | $headerO->setClass("header"); |
| 43 | 43 | $headerO->setContent($header); |
| 44 | 44 | } |
@@ -53,9 +53,9 @@ discard block |
||
| 53 | 53 | $this->addToProperty("class", "icon"); |
| 54 | 54 | $this->wrapContent("<div class='content'>", "</div>"); |
| 55 | 55 | if (\is_string($icon)) { |
| 56 | - $this->icon = new HtmlIcon("icon-" . $this->identifier, $icon); |
|
| 56 | + $this->icon=new HtmlIcon("icon-".$this->identifier, $icon); |
|
| 57 | 57 | } else { |
| 58 | - $this->icon = $icon; |
|
| 58 | + $this->icon=$icon; |
|
| 59 | 59 | } |
| 60 | 60 | return $this; |
| 61 | 61 | } |
@@ -72,23 +72,23 @@ discard block |
||
| 72 | 72 | * default : array("preventDefault"=>true,"stopPropagation"=>true,"params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>null,"headers"=>null,"historize"=>false) |
| 73 | 73 | * @return $this |
| 74 | 74 | */ |
| 75 | - public function getOnClose($url, $responseElement = "", $parameters = array()) { |
|
| 75 | + public function getOnClose($url, $responseElement="", $parameters=array()) { |
|
| 76 | 76 | if (isset($this->close)) { |
| 77 | 77 | $this->close->getOnClick($url, $responseElement, $parameters); |
| 78 | 78 | } |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | - public function addLoader($loaderIcon = "notched circle") { |
|
| 81 | + public function addLoader($loaderIcon="notched circle") { |
|
| 82 | 82 | $this->setIcon($loaderIcon); |
| 83 | 83 | $this->icon->addToIcon("loading"); |
| 84 | 84 | return $this; |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - public function setDismissable($dismiss = true) { |
|
| 88 | - if ($dismiss === true) |
|
| 89 | - $this->close = new HtmlIcon("close-" . $this->identifier, "close"); |
|
| 87 | + public function setDismissable($dismiss=true) { |
|
| 88 | + if ($dismiss===true) |
|
| 89 | + $this->close=new HtmlIcon("close-".$this->identifier, "close"); |
|
| 90 | 90 | else |
| 91 | - $this->close = NULL; |
|
| 91 | + $this->close=NULL; |
|
| 92 | 92 | return $this; |
| 93 | 93 | } |
| 94 | 94 | |
@@ -98,9 +98,9 @@ discard block |
||
| 98 | 98 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run() |
| 99 | 99 | */ |
| 100 | 100 | public function run(JsUtils $js) { |
| 101 | - if (! isset($this->_bsComponent)) { |
|
| 101 | + if (!isset($this->_bsComponent)) { |
|
| 102 | 102 | if (isset($this->close)) { |
| 103 | - $js->execOn("click", "#" . $this->identifier . " .close", "$(this).closest('.message').transition({$this->_closeTransition})"); |
|
| 103 | + $js->execOn("click", "#".$this->identifier." .close", "$(this).closest('.message').transition({$this->_closeTransition})"); |
|
| 104 | 104 | } |
| 105 | 105 | if (isset($this->_timeout)) { |
| 106 | 106 | $js->exec("setTimeout(function() { $('#{$this->identifier}').transition({$this->_closeTransition}); }, {$this->_timeout});", true); |
@@ -109,15 +109,15 @@ discard block |
||
| 109 | 109 | return parent::run($js); |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | - public function setState($visible = true) { |
|
| 113 | - $visible = ($visible === true) ? "visible" : "hidden"; |
|
| 112 | + public function setState($visible=true) { |
|
| 113 | + $visible=($visible===true) ? "visible" : "hidden"; |
|
| 114 | 114 | return $this->addToPropertyCtrl("class", $visible, array( |
| 115 | 115 | "visible", |
| 116 | 116 | "hidden" |
| 117 | 117 | )); |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | - public function setVariation($value = "floating") { |
|
| 120 | + public function setVariation($value="floating") { |
|
| 121 | 121 | return $this->addToPropertyCtrl("class", $value, array( |
| 122 | 122 | "floating", |
| 123 | 123 | "compact" |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | |
| 139 | 139 | public function setMessage($message) { |
| 140 | 140 | if (\is_array($this->content)) { |
| 141 | - $this->content[\sizeof($this->content) - 1] = $message; |
|
| 141 | + $this->content[\sizeof($this->content)-1]=$message; |
|
| 142 | 142 | } else |
| 143 | 143 | $this->setContent($message); |
| 144 | 144 | } |
@@ -85,10 +85,11 @@ discard block |
||
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | public function setDismissable($dismiss = true) { |
| 88 | - if ($dismiss === true) |
|
| 89 | - $this->close = new HtmlIcon("close-" . $this->identifier, "close"); |
|
| 90 | - else |
|
| 91 | - $this->close = NULL; |
|
| 88 | + if ($dismiss === true) { |
|
| 89 | + $this->close = new HtmlIcon("close-" . $this->identifier, "close"); |
|
| 90 | + } else { |
|
| 91 | + $this->close = NULL; |
|
| 92 | + } |
|
| 92 | 93 | return $this; |
| 93 | 94 | } |
| 94 | 95 | |
@@ -139,7 +140,8 @@ discard block |
||
| 139 | 140 | public function setMessage($message) { |
| 140 | 141 | if (\is_array($this->content)) { |
| 141 | 142 | $this->content[\sizeof($this->content) - 1] = $message; |
| 142 | - } else |
|
| 143 | - $this->setContent($message); |
|
| 143 | + } else { |
|
| 144 | + $this->setContent($message); |
|
| 145 | + } |
|
| 144 | 146 | } |
| 145 | 147 | } |