@@ -29,12 +29,14 @@ discard block |
||
| 29 | 29 | if (\is_string($end)) { |
| 30 | 30 | $label=$end; |
| 31 | 31 | \array_pop($fields); |
| 32 | - } else |
|
| 33 | - $label=NULL; |
|
| 32 | + } else { |
|
| 33 | + $label=NULL; |
|
| 34 | + } |
|
| 34 | 35 | } |
| 35 | 36 | } |
| 36 | - if (isset($label)) |
|
| 37 | - $this->setLabel($label); |
|
| 37 | + if (isset($label)) { |
|
| 38 | + $this->setLabel($label); |
|
| 39 | + } |
|
| 38 | 40 | foreach ( $fields as $field ) { |
| 39 | 41 | $this->addItem($field); |
| 40 | 42 | } |
@@ -57,8 +59,9 @@ discard block |
||
| 57 | 59 | |
| 58 | 60 | public function addItem($item) { |
| 59 | 61 | $item=parent::addItem($item); |
| 60 | - if($item instanceof HtmlFormField) |
|
| 61 | - $item->setContainer($this); |
|
| 62 | + if($item instanceof HtmlFormField) { |
|
| 63 | + $item->setContainer($this); |
|
| 64 | + } |
|
| 62 | 65 | return $item; |
| 63 | 66 | } |
| 64 | 67 | |
@@ -73,8 +76,9 @@ discard block |
||
| 73 | 76 | if ($this->_equalWidth) { |
| 74 | 77 | $count=$this->count(); |
| 75 | 78 | $this->addToProperty("class", Wide::getConstants()["W".$count]." fields"); |
| 76 | - } else |
|
| 77 | - $this->addToProperty("class", "fields"); |
|
| 79 | + } else { |
|
| 80 | + $this->addToProperty("class", "fields"); |
|
| 81 | + } |
|
| 78 | 82 | return parent::compile($js, $view); |
| 79 | 83 | } |
| 80 | 84 | |
@@ -136,8 +140,9 @@ discard block |
||
| 136 | 140 | $fields[]=$itemO; |
| 137 | 141 | } |
| 138 | 142 | $radios=new HtmlFormFields($identifier, $fields); |
| 139 | - if (isset($label)) |
|
| 140 | - $radios->setLabel($label)->setProperty("for", $name); |
|
| 143 | + if (isset($label)) { |
|
| 144 | + $radios->setLabel($label)->setProperty("for", $name); |
|
| 145 | + } |
|
| 141 | 146 | return $radios; |
| 142 | 147 | } |
| 143 | 148 | |
@@ -57,20 +57,23 @@ |
||
| 57 | 57 | public function asLink($href=NULL,$target=NULL) { |
| 58 | 58 | if (isset($href)) { |
| 59 | 59 | $_target=""; |
| 60 | - if(isset($target)) |
|
| 61 | - $_target="target='{$target}'"; |
|
| 60 | + if(isset($target)) { |
|
| 61 | + $_target="target='{$target}'"; |
|
| 62 | + } |
|
| 62 | 63 | $this->wrap("<a href='" . $href . "' {$_target}>", "</a>"); |
| 63 | 64 | } |
| 64 | 65 | return $this->addToProperty("class", "link"); |
| 65 | 66 | } |
| 66 | 67 | |
| 67 | 68 | public function addLabel($label, $before=false, $emoji=null) { |
| 68 | - if($before) |
|
| 69 | - $this->wrap($label); |
|
| 70 | - else |
|
| 71 | - $this->wrap("", $label); |
|
| 72 | - if($emoji!=null) |
|
| 73 | - $this->setEmoji($emoji); |
|
| 69 | + if($before) { |
|
| 70 | + $this->wrap($label); |
|
| 71 | + } else { |
|
| 72 | + $this->wrap("", $label); |
|
| 73 | + } |
|
| 74 | + if($emoji!=null) { |
|
| 75 | + $this->setEmoji($emoji); |
|
| 76 | + } |
|
| 74 | 77 | return $this; |
| 75 | 78 | } |
| 76 | 79 | |
@@ -47,8 +47,9 @@ |
||
| 47 | 47 | |
| 48 | 48 | public function addList($items = array(), $ordered = false) { |
| 49 | 49 | $list = new HtmlList("", $items); |
| 50 | - if ($ordered) |
|
| 51 | - $list->setOrdered(); |
|
| 50 | + if ($ordered) { |
|
| 51 | + $list->setOrdered(); |
|
| 52 | + } |
|
| 52 | 53 | $list->setClass("list"); |
| 53 | 54 | $this->content["list"] = $list; |
| 54 | 55 | return $list; |
@@ -18,8 +18,9 @@ discard block |
||
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | public function setValue($value) { |
| 21 | - if (isset($value)) |
|
| 22 | - $this->setProperty("value", $value); |
|
| 21 | + if (isset($value)) { |
|
| 22 | + $this->setProperty("value", $value); |
|
| 23 | + } |
|
| 23 | 24 | return $this; |
| 24 | 25 | } |
| 25 | 26 | |
@@ -34,16 +35,18 @@ discard block |
||
| 34 | 35 | } |
| 35 | 36 | |
| 36 | 37 | public function setPlaceholder($value) { |
| 37 | - if (JString::isNotNull($value)) |
|
| 38 | - $this->_placeholder = $value; |
|
| 38 | + if (JString::isNotNull($value)) { |
|
| 39 | + $this->_placeholder = $value; |
|
| 40 | + } |
|
| 39 | 41 | return $this; |
| 40 | 42 | } |
| 41 | 43 | |
| 42 | 44 | public function compile(JsUtils $js = NULL, &$view = NULL) { |
| 43 | 45 | $value = $this->_placeholder; |
| 44 | 46 | if (JString::isNull($value)) { |
| 45 | - if (JString::isNotNull($this->getProperty("name"))) |
|
| 46 | - $value = \ucfirst($this->getProperty("name")); |
|
| 47 | + if (JString::isNotNull($this->getProperty("name"))) { |
|
| 48 | + $value = \ucfirst($this->getProperty("name")); |
|
| 49 | + } |
|
| 47 | 50 | } |
| 48 | 51 | $this->setProperty("placeholder", $value); |
| 49 | 52 | return parent::compile($js, $view); |
@@ -67,8 +67,9 @@ |
||
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | public static function doubleBackSlashes($value) { |
| 70 | - if (\is_string($value)) |
|
| 71 | - return \str_replace("\\", "\\\\", $value); |
|
| 70 | + if (\is_string($value)) { |
|
| 71 | + return \str_replace("\\", "\\\\", $value); |
|
| 72 | + } |
|
| 72 | 73 | return $value; |
| 73 | 74 | } |
| 74 | 75 | |
@@ -24,10 +24,11 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | public function setBasic($very = false) { |
| 26 | 26 | $table = $this->_self; |
| 27 | - if ($very) |
|
| 28 | - $table->addToPropertyCtrl("class", "very", array( |
|
| 27 | + if ($very) { |
|
| 28 | + $table->addToPropertyCtrl("class", "very", array( |
|
| 29 | 29 | "very" |
| 30 | 30 | )); |
| 31 | + } |
|
| 31 | 32 | return $table->addToPropertyCtrl("class", "basic", array( |
| 32 | 33 | "basic" |
| 33 | 34 | )); |
@@ -35,10 +36,11 @@ discard block |
||
| 35 | 36 | |
| 36 | 37 | public function setCompact($very = false) { |
| 37 | 38 | $table = $this->_self; |
| 38 | - if ($very) |
|
| 39 | - $table->addToPropertyCtrl("class", "very", array( |
|
| 39 | + if ($very) { |
|
| 40 | + $table->addToPropertyCtrl("class", "very", array( |
|
| 40 | 41 | "very" |
| 41 | 42 | )); |
| 43 | + } |
|
| 42 | 44 | return $table->addToPropertyCtrl("class", "compact", array( |
| 43 | 45 | "compact" |
| 44 | 46 | )); |
@@ -72,8 +72,9 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | protected function getItemToAdd($item) { |
| 74 | 74 | $itemO = parent::getItemToAdd($item); |
| 75 | - if ($itemO instanceof AbstractCheckbox) |
|
| 76 | - $itemO->addClass("item"); |
|
| 75 | + if ($itemO instanceof AbstractCheckbox) { |
|
| 76 | + $itemO->addClass("item"); |
|
| 77 | + } |
|
| 77 | 78 | return $itemO; |
| 78 | 79 | } |
| 79 | 80 | |
@@ -179,8 +180,9 @@ discard block |
||
| 179 | 180 | if (isset($masterItem)) { |
| 180 | 181 | if (\is_array($masterItem)) { |
| 181 | 182 | $masterO = new HtmlFormCheckbox("master-" . $identifier, @$masterItem[0], @$masterItem[1]); |
| 182 | - if (isset($name)) |
|
| 183 | - $masterO->setName($name); |
|
| 183 | + if (isset($name)) { |
|
| 184 | + $masterO->setName($name); |
|
| 185 | + } |
|
| 184 | 186 | if (isset($masterItem[1])) { |
| 185 | 187 | if (\array_search($masterItem[1], $values) !== false) { |
| 186 | 188 | $masterO->getDataField()->setProperty("checked", ""); |
@@ -204,8 +206,9 @@ discard block |
||
| 204 | 206 | if (\array_search($val, $values) !== false) { |
| 205 | 207 | $itemO->getDataField()->setProperty("checked", ""); |
| 206 | 208 | } |
| 207 | - if (isset($name)) |
|
| 208 | - $itemO->setName($name); |
|
| 209 | + if (isset($name)) { |
|
| 210 | + $itemO->setName($name); |
|
| 211 | + } |
|
| 209 | 212 | $itemO->setClass("item"); |
| 210 | 213 | $fields[] = $itemO; |
| 211 | 214 | } |
@@ -151,25 +151,29 @@ discard block |
||
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | public function getColPosition($colIndex) { |
| 154 | - if ($this->_container->_isMerged() !== true) |
|
| 155 | - return $colIndex; |
|
| 154 | + if ($this->_container->_isMerged() !== true) { |
|
| 155 | + return $colIndex; |
|
| 156 | + } |
|
| 156 | 157 | $pos = 0; |
| 157 | 158 | $rows = $this->_container->getContent(); |
| 158 | 159 | for ($i = 0; $i < $this->_row; $i ++) { |
| 159 | 160 | $max = \min($colIndex, $rows[$i]->count()); |
| 160 | 161 | for ($j = 0; $j < $max; $j ++) { |
| 161 | 162 | $rowspan = $rows[$i]->getItem($j)->getRowspan(); |
| 162 | - if ($rowspan + $i > $this->_row) |
|
| 163 | - $pos ++; |
|
| 163 | + if ($rowspan + $i > $this->_row) { |
|
| 164 | + $pos ++; |
|
| 165 | + } |
|
| 164 | 166 | } |
| 165 | 167 | } |
| 166 | - if ($pos > $colIndex) |
|
| 167 | - return NULL; |
|
| 168 | + if ($pos > $colIndex) { |
|
| 169 | + return NULL; |
|
| 170 | + } |
|
| 168 | 171 | $count = $this->count(); |
| 169 | 172 | for ($i = 0; $i < $count; $i ++) { |
| 170 | 173 | $pos += $this->content[$i]->getColspan(); |
| 171 | - if ($pos >= $colIndex + 1) |
|
| 172 | - return $i; |
|
| 174 | + if ($pos >= $colIndex + 1) { |
|
| 175 | + return $i; |
|
| 176 | + } |
|
| 173 | 177 | } |
| 174 | 178 | return null; |
| 175 | 179 | } |
@@ -192,8 +196,9 @@ discard block |
||
| 192 | 196 | public function containsStr($needle) { |
| 193 | 197 | $cells = $this->content; |
| 194 | 198 | foreach ($cells as $cell) { |
| 195 | - if (\strpos($cell->getContent(), $needle) !== false) |
|
| 196 | - return true; |
|
| 199 | + if (\strpos($cell->getContent(), $needle) !== false) { |
|
| 200 | + return true; |
|
| 201 | + } |
|
| 197 | 202 | } |
| 198 | 203 | return false; |
| 199 | 204 | } |
@@ -108,15 +108,17 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | public function getColspan() { |
| 110 | 110 | $colspan = 1; |
| 111 | - if (\array_key_exists("colspan", $this->properties)) |
|
| 112 | - $colspan = $this->getProperty("colspan"); |
|
| 111 | + if (\array_key_exists("colspan", $this->properties)) { |
|
| 112 | + $colspan = $this->getProperty("colspan"); |
|
| 113 | + } |
|
| 113 | 114 | return $colspan; |
| 114 | 115 | } |
| 115 | 116 | |
| 116 | 117 | public function getRowspan() { |
| 117 | 118 | $rowspan = 1; |
| 118 | - if (\array_key_exists("rowspan", $this->properties)) |
|
| 119 | - $rowspan = $this->getProperty("rowspan"); |
|
| 119 | + if (\array_key_exists("rowspan", $this->properties)) { |
|
| 120 | + $rowspan = $this->getProperty("rowspan"); |
|
| 121 | + } |
|
| 120 | 122 | return $rowspan; |
| 121 | 123 | } |
| 122 | 124 | |
@@ -155,7 +157,8 @@ discard block |
||
| 155 | 157 | } |
| 156 | 158 | |
| 157 | 159 | public function compile(JsUtils $js = NULL, &$view = NULL) { |
| 158 | - if (! $this->_deleted) |
|
| 159 | - return parent::compile($js, $view); |
|
| 160 | + if (! $this->_deleted) { |
|
| 161 | + return parent::compile($js, $view); |
|
| 162 | + } |
|
| 160 | 163 | } |
| 161 | 164 | } |