@@ -31,8 +31,9 @@ discard block |
||
| 31 | 31 | if (isset($extra)) { |
| 32 | 32 | $result->addExtraContent($extra); |
| 33 | 33 | } |
| 34 | - } else |
|
| 35 | - $result->addItemContent($value); |
|
| 34 | + } else { |
|
| 35 | + $result->addItemContent($value); |
|
| 36 | + } |
|
| 36 | 37 | return $result; |
| 37 | 38 | } |
| 38 | 39 | |
@@ -58,8 +59,9 @@ discard block |
||
| 58 | 59 | $item=$this->getItem($itemIndex); |
| 59 | 60 | if (isset($item)) { |
| 60 | 61 | $content=$item->getContent(); |
| 61 | - if(isset($content[$contentIndex])) |
|
| 62 | - return $content[$contentIndex]; |
|
| 62 | + if(isset($content[$contentIndex])) { |
|
| 63 | + return $content[$contentIndex]; |
|
| 64 | + } |
|
| 63 | 65 | } |
| 64 | 66 | } |
| 65 | 67 | |
@@ -28,8 +28,9 @@ discard block |
||
| 28 | 28 | $this->addImage($image); |
| 29 | 29 | } |
| 30 | 30 | $this->addHeaderContent($header, $metas, $description,$extra); |
| 31 | - } else |
|
| 32 | - $this->addContent($value); |
|
| 31 | + } else { |
|
| 32 | + $this->addContent($value); |
|
| 33 | + } |
|
| 33 | 34 | } |
| 34 | 35 | |
| 35 | 36 | public function addElement($content, $baseClass="") { |
@@ -62,8 +63,9 @@ discard block |
||
| 62 | 63 | |
| 63 | 64 | public function addImage($src="", $alt="", $size=NULL) { |
| 64 | 65 | $image=new HtmlImg("img-", $src, $alt); |
| 65 | - if (isset($size)) |
|
| 66 | - $image->setSize($size); |
|
| 66 | + if (isset($size)) { |
|
| 67 | + $image->setSize($size); |
|
| 68 | + } |
|
| 67 | 69 | $this->content['image']=$image; |
| 68 | 70 | return $image; |
| 69 | 71 | } |
@@ -86,8 +88,9 @@ discard block |
||
| 86 | 88 | foreach ( $metas as $meta ) { |
| 87 | 89 | $this->addMeta($meta); |
| 88 | 90 | } |
| 89 | - } else |
|
| 90 | - $this->addMeta($metas); |
|
| 91 | + } else { |
|
| 92 | + $this->addMeta($metas); |
|
| 93 | + } |
|
| 91 | 94 | return $this; |
| 92 | 95 | } |
| 93 | 96 | |
@@ -114,8 +117,9 @@ discard block |
||
| 114 | 117 | $result=new HtmlSemDoubleElement("", "span", "", $caption); |
| 115 | 118 | $this->addContent($result); |
| 116 | 119 | $result->setFloated($direction); |
| 117 | - } else |
|
| 118 | - $result=$this->addContent($caption); |
|
| 120 | + } else { |
|
| 121 | + $result=$this->addContent($caption); |
|
| 122 | + } |
|
| 119 | 123 | return $result; |
| 120 | 124 | } |
| 121 | 125 | |
@@ -127,8 +131,9 @@ discard block |
||
| 127 | 131 | } |
| 128 | 132 | |
| 129 | 133 | public function addHeaderContent($header, $metas=array(), $description=NULL,$extra=NULL) { |
| 130 | - if(isset($header)) |
|
| 131 | - $this->addElement($header, "header"); |
|
| 134 | + if(isset($header)) { |
|
| 135 | + $this->addElement($header, "header"); |
|
| 136 | + } |
|
| 132 | 137 | $this->addMetas($metas); |
| 133 | 138 | if (isset($description)) { |
| 134 | 139 | $this->addElement($description, "description"); |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | foreach ($ajaxSubmit as $ajaxSubmitItem){ |
| 50 | 50 | $compilation.=$ajaxSubmitItem->compile($js); |
| 51 | 51 | } |
| 52 | - }elseif($ajaxSubmit instanceof AjaxCall){ |
|
| 52 | + } elseif($ajaxSubmit instanceof AjaxCall){ |
|
| 53 | 53 | $compilation=$ajaxSubmit->compile($js); |
| 54 | 54 | } |
| 55 | 55 | $compilation=str_ireplace("\"","%quote%", $compilation); |
@@ -67,8 +67,9 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | public function setAttached($value=true){ |
| 69 | 69 | $form=$this->getForm(); |
| 70 | - if($value) |
|
| 71 | - $form->addToPropertyCtrl("class", "attached", array ("attached" )); |
|
| 70 | + if($value) { |
|
| 71 | + $form->addToPropertyCtrl("class", "attached", array ("attached" )); |
|
| 72 | + } |
|
| 72 | 73 | return $form; |
| 73 | 74 | } |
| 74 | 75 | |
@@ -90,10 +91,11 @@ discard block |
||
| 90 | 91 | */ |
| 91 | 92 | public function submitOn($event,$identifierOrElement,$url,$responseElement,$parameters=NULL){ |
| 92 | 93 | $form=$this->getForm(); |
| 93 | - if($identifierOrElement instanceof BaseHtml) |
|
| 94 | - $elem=$identifierOrElement; |
|
| 95 | - else |
|
| 96 | - $elem=$form->getElementById($identifierOrElement, $form->getContent()); |
|
| 94 | + if($identifierOrElement instanceof BaseHtml) { |
|
| 95 | + $elem=$identifierOrElement; |
|
| 96 | + } else { |
|
| 97 | + $elem=$form->getElementById($identifierOrElement, $form->getContent()); |
|
| 98 | + } |
|
| 97 | 99 | if(isset($elem)){ |
| 98 | 100 | $this->_buttonAsSubmit($elem, $event,$url,$responseElement,$parameters); |
| 99 | 101 | } |
@@ -123,8 +123,9 @@ |
||
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | public function run(JsUtils $js){ |
| 126 | - if(JString::isNotNull($this->_identifier)) |
|
| 127 | - $js->execOn("click", "#".$this->_identifier." .ui.toggle", 'var active=$(this).hasClass("active");$(this).children("i").toggleClass("up",active).toggleClass("down",!active);var nextTd=$(this).closest("td").next("td");nextTd.children(":not(.toggle-caption)").toggle(active);nextTd.children(".toggle-caption").toggle(!active);$(this).trigger({type:"toggled",active: active,caption: nextTd.children(".toggle-caption")});'); |
|
| 126 | + if(JString::isNotNull($this->_identifier)) { |
|
| 127 | + $js->execOn("click", "#".$this->_identifier." .ui.toggle", 'var active=$(this).hasClass("active");$(this).children("i").toggleClass("up",active).toggleClass("down",!active);var nextTd=$(this).closest("td").next("td");nextTd.children(":not(.toggle-caption)").toggle(active);nextTd.children(".toggle-caption").toggle(!active);$(this).trigger({type:"toggled",active: active,caption: nextTd.children(".toggle-caption")});'); |
|
| 128 | + } |
|
| 128 | 129 | parent::run($js); |
| 129 | 130 | } |
| 130 | 131 | } |
@@ -41,8 +41,9 @@ discard block |
||
| 41 | 41 | * @param string $popupEvent |
| 42 | 42 | */ |
| 43 | 43 | public function setPopupAttributes($variation=NULL, $popupEvent=NULL) { |
| 44 | - if (isset($this->_popup)) |
|
| 45 | - $this->_popup->setAttributes($variation, $popupEvent); |
|
| 44 | + if (isset($this->_popup)) { |
|
| 45 | + $this->_popup->setAttributes($variation, $popupEvent); |
|
| 46 | + } |
|
| 46 | 47 | } |
| 47 | 48 | |
| 48 | 49 | /** |
@@ -97,8 +98,9 @@ discard block |
||
| 97 | 98 | $labelO=$label; |
| 98 | 99 | if (\is_object($label) === false) { |
| 99 | 100 | $labelO=new HtmlLabel("label-" . $this->identifier, $label); |
| 100 | - if (isset($icon)) |
|
| 101 | - $labelO->addIcon($icon); |
|
| 101 | + if (isset($icon)) { |
|
| 102 | + $labelO->addIcon($icon); |
|
| 103 | + } |
|
| 102 | 104 | } else { |
| 103 | 105 | $labelO->addToPropertyCtrl("class", "label", array ("label" )); |
| 104 | 106 | } |
@@ -125,10 +127,12 @@ discard block |
||
| 125 | 127 | * @return HtmlSemDoubleElement |
| 126 | 128 | */ |
| 127 | 129 | public function asLink($href=NULL,$target=NULL) { |
| 128 | - if (isset($href)) |
|
| 129 | - $this->setProperty("href", $href); |
|
| 130 | - if(isset($target)) |
|
| 131 | - $this->setProperty("target", $target); |
|
| 130 | + if (isset($href)) { |
|
| 131 | + $this->setProperty("href", $href); |
|
| 132 | + } |
|
| 133 | + if(isset($target)) { |
|
| 134 | + $this->setProperty("target", $target); |
|
| 135 | + } |
|
| 132 | 136 | return $this->setTagName("a"); |
| 133 | 137 | } |
| 134 | 138 | |
@@ -139,8 +143,9 @@ discard block |
||
| 139 | 143 | */ |
| 140 | 144 | public function jsShowDimmer($show=true) { |
| 141 | 145 | $status="hide"; |
| 142 | - if ($show === true) |
|
| 143 | - $status="show"; |
|
| 146 | + if ($show === true) { |
|
| 147 | + $status="show"; |
|
| 148 | + } |
|
| 144 | 149 | return '$("#.' . $this->identifier . ').dimmer("' . $status . '");'; |
| 145 | 150 | } |
| 146 | 151 | |
@@ -16,8 +16,9 @@ discard block |
||
| 16 | 16 | * @param mixed $view |
| 17 | 17 | */ |
| 18 | 18 | protected function _compileLibrary(BaseGui $library, &$view=NULL){ |
| 19 | - if(isset($view)) |
|
| 20 | - $library->compileHtml($this, $view); |
|
| 19 | + if(isset($view)) { |
|
| 20 | + $library->compileHtml($this, $view); |
|
| 21 | + } |
|
| 21 | 22 | if ($library->isAutoCompile()) { |
| 22 | 23 | $library->compile(true); |
| 23 | 24 | } |
@@ -36,7 +37,9 @@ discard block |
||
| 36 | 37 | } |
| 37 | 38 | |
| 38 | 39 | protected function minify($input) { |
| 39 | - if(trim($input) === "") return $input; |
|
| 40 | + if(trim($input) === "") { |
|
| 41 | + return $input; |
|
| 42 | + } |
|
| 40 | 43 | $input= preg_replace( |
| 41 | 44 | array( |
| 42 | 45 | // Remove comment(s) |
@@ -109,15 +109,18 @@ discard block |
||
| 109 | 109 | $flag=false; |
| 110 | 110 | $index=0; |
| 111 | 111 | while ( !$flag && $index < sizeof($elements) ) { |
| 112 | - if ($elements[$index] instanceof BaseHtml) |
|
| 113 | - $flag=($callback($elements[$index])); |
|
| 112 | + if ($elements[$index] instanceof BaseHtml) { |
|
| 113 | + $flag=($callback($elements[$index])); |
|
| 114 | + } |
|
| 114 | 115 | $index++; |
| 115 | 116 | } |
| 116 | - if ($flag === true) |
|
| 117 | - return $elements[$index - 1]; |
|
| 117 | + if ($flag === true) { |
|
| 118 | + return $elements[$index - 1]; |
|
| 119 | + } |
|
| 118 | 120 | } elseif ($elements instanceof BaseHtml) { |
| 119 | - if ($callback($elements)) |
|
| 120 | - return $elements; |
|
| 121 | + if ($callback($elements)) { |
|
| 122 | + return $elements; |
|
| 123 | + } |
|
| 121 | 124 | } |
| 122 | 125 | return null; |
| 123 | 126 | } |
@@ -143,8 +146,9 @@ discard block |
||
| 143 | 146 | |
| 144 | 147 | public function fromArray($array) { |
| 145 | 148 | foreach ( $this as $key => $value ) { |
| 146 | - if(array_key_exists($key, $array)===true) |
|
| 147 | - $this->_callSetter("set" . ucfirst($key), $key, $array[$key], $array); |
|
| 149 | + if(array_key_exists($key, $array)===true) { |
|
| 150 | + $this->_callSetter("set" . ucfirst($key), $key, $array[$key], $array); |
|
| 151 | + } |
|
| 148 | 152 | } |
| 149 | 153 | foreach ( $array as $key => $value ) { |
| 150 | 154 | if($this->_callSetter($key, $key, $value, $array)===false){ |
@@ -213,11 +217,11 @@ discard block |
||
| 213 | 217 | if(\strstr($result, "%{$key}%")!==false){ |
| 214 | 218 | if (\is_array($value)) { |
| 215 | 219 | $v=PropertyWrapper::wrap($value, $js,$view); |
| 216 | - }elseif($value instanceof \stdClass){ |
|
| 220 | + } elseif($value instanceof \stdClass){ |
|
| 217 | 221 | $v=\print_r($value,true); |
| 218 | - }elseif ($value instanceof BaseHtml){ |
|
| 222 | + } elseif ($value instanceof BaseHtml){ |
|
| 219 | 223 | $v=$value->compile($js,$view); |
| 220 | - }else{ |
|
| 224 | + } else{ |
|
| 221 | 225 | $v=$value; |
| 222 | 226 | } |
| 223 | 227 | $result=str_replace("%{$key}%", $v, $result); |
@@ -345,8 +345,9 @@ discard block |
||
| 345 | 345 | $result= $this->getBody()->_addRow($result); |
| 346 | 346 | } |
| 347 | 347 | if(isset($this->_afterCompileEvents["onNewRow"])){ |
| 348 | - if(\is_callable($this->_afterCompileEvents["onNewRow"])) |
|
| 349 | - $this->_afterCompileEvents["onNewRow"]($result,$object); |
|
| 348 | + if(\is_callable($this->_afterCompileEvents["onNewRow"])) { |
|
| 349 | + $this->_afterCompileEvents["onNewRow"]($result,$object); |
|
| 350 | + } |
|
| 350 | 351 | } |
| 351 | 352 | return $result; |
| 352 | 353 | } |
@@ -375,8 +376,9 @@ discard block |
||
| 375 | 376 | } |
| 376 | 377 | } |
| 377 | 378 | $result= parent::run($js); |
| 378 | - if(isset($this->_footer)) |
|
| 379 | - $this->_footer->run($js); |
|
| 379 | + if(isset($this->_footer)) { |
|
| 380 | + $this->_footer->run($js); |
|
| 381 | + } |
|
| 380 | 382 | $this->_runned=true; |
| 381 | 383 | return $result; |
| 382 | 384 | } |
@@ -417,8 +419,9 @@ discard block |
||
| 417 | 419 | |
| 418 | 420 | public function setColWidth($colIndex,$width){ |
| 419 | 421 | $part=$this->_getFirstPart(); |
| 420 | - if($part!==null && $part->count()>0) |
|
| 421 | - $part->getCell(0, $colIndex)->setWidth($width); |
|
| 422 | + if($part!==null && $part->count()>0) { |
|
| 423 | + $part->getCell(0, $colIndex)->setWidth($width); |
|
| 424 | + } |
|
| 422 | 425 | return $this; |
| 423 | 426 | } |
| 424 | 427 | |
@@ -84,15 +84,17 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | public function getColspan() { |
| 86 | 86 | $colspan=1; |
| 87 | - if (\array_key_exists("colspan", $this->properties)) |
|
| 88 | - $colspan=$this->getProperty("colspan"); |
|
| 87 | + if (\array_key_exists("colspan", $this->properties)) { |
|
| 88 | + $colspan=$this->getProperty("colspan"); |
|
| 89 | + } |
|
| 89 | 90 | return $colspan; |
| 90 | 91 | } |
| 91 | 92 | |
| 92 | 93 | public function getRowspan() { |
| 93 | 94 | $rowspan=1; |
| 94 | - if (\array_key_exists("rowspan", $this->properties)) |
|
| 95 | - $rowspan=$this->getProperty("rowspan"); |
|
| 95 | + if (\array_key_exists("rowspan", $this->properties)) { |
|
| 96 | + $rowspan=$this->getProperty("rowspan"); |
|
| 97 | + } |
|
| 96 | 98 | return $rowspan; |
| 97 | 99 | } |
| 98 | 100 | |
@@ -129,7 +131,8 @@ discard block |
||
| 129 | 131 | } |
| 130 | 132 | |
| 131 | 133 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
| 132 | - if(!$this->_deleted) |
|
| 133 | - return parent::compile($js,$view); |
|
| 134 | + if(!$this->_deleted) { |
|
| 135 | + return parent::compile($js,$view); |
|
| 136 | + } |
|
| 134 | 137 | } |
| 135 | 138 | } |