| @@ -4,11 +4,8 @@ | ||
| 4 | 4 | } |
| 5 | 5 | |
| 6 | 6 | class FrmFieldGridHelper { |
| 7 | 7 | |
| 8 | - /** | |
| 9 | - * @var bool|string | |
| 10 | - */ | |
| 11 | 8 | private $parent_li; |
| 12 | 9 | |
| 13 | 10 | /** |
| 14 | 11 | * @var int |
| @@ -54,16 +51,10 @@ | ||
| 54 | 51 | * @var int |
| 55 | 52 | */ |
| 56 | 53 | private $section_size; |
| 57 | 54 | |
| 58 | - /** | |
| 59 | - * @var bool | |
| 60 | - */ | |
| 61 | 55 | private $section_is_open = false; |
| 62 | 56 | |
| 63 | - /** | |
| 64 | - * @param bool $nested | |
| 65 | - */ | |
| 66 | 57 | public function __construct( $nested = false ) { |
| 67 | 58 | $this->parent_li = false; |
| 68 | 59 | $this->current_list_size = 0; |
| 69 | 60 | $this->current_field_count = 0; |
| @@ -157,9 +148,8 @@ | ||
| 157 | 148 | private function should_first_close_the_active_field_wrapper() { |
| 158 | 149 | if ( false === $this->parent_li || ! empty( $this->section_helper ) ) { |
| 159 | 150 | return false; |
| 160 | 151 | } |
| 161 | - | |
| 162 | 152 | if ( 'end_divider' === $this->field->type ) { |
| 163 | 153 | return false; |
| 164 | 154 | } |
| 165 | 155 | return ! $this->can_support_current_layout() || $this->is_frm_first; |
| @@ -176,9 +166,8 @@ | ||
| 176 | 166 | } |
| 177 | 167 | |
| 178 | 168 | /** |
| 179 | 169 | * @param string $class |
| 180 | - * | |
| 181 | 170 | * @return int |
| 182 | 171 | */ |
| 183 | 172 | private static function get_size_of_class( $class ) { |
| 184 | 173 | switch ( $class ) { |
| @@ -197,9 +186,8 @@ | ||
| 197 | 186 | } |
| 198 | 187 | |
| 199 | 188 | if ( 0 === strpos( $class, 'frm' ) ) { |
| 200 | 189 | $substr = substr( $class, 3 ); |
| 201 | - | |
| 202 | 190 | if ( is_numeric( $substr ) ) { |
| 203 | 191 | return (int) $substr; |
| 204 | 192 | } |
| 205 | 193 | } |
| @@ -221,9 +209,8 @@ | ||
| 221 | 209 | } |
| 222 | 210 | |
| 223 | 211 | if ( ! empty( $this->section_helper ) ) { |
| 224 | 212 | $this->section_helper->sync_list_size(); |
| 225 | - | |
| 226 | 213 | if ( 'end_divider' === $this->field->type ) { |
| 227 | 214 | $this->maybe_close_section_helper(); |
| 228 | 215 | } |
| 229 | 216 | return; |
| @@ -231,9 +218,8 @@ | ||
| 231 | 218 | |
| 232 | 219 | if ( false !== $this->parent_li ) { |
| 233 | 220 | ++$this->current_field_count; |
| 234 | 221 | $this->current_list_size += $this->active_field_size; |
| 235 | - | |
| 236 | 222 | if ( 12 === $this->current_list_size ) { |
| 237 | 223 | $this->close_field_wrapper(); |
| 238 | 224 | } |
| 239 | 225 | } |
| @@ -273,9 +259,8 @@ | ||
| 273 | 259 | } |
| 274 | 260 | |
| 275 | 261 | /** |
| 276 | 262 | * @param string $class |
| 277 | - * | |
| 278 | 263 | * @return bool |
| 279 | 264 | */ |
| 280 | 265 | private function can_support_an_additional_layout( $class ) { |
| 281 | 266 | $size = self::get_size_of_class( $class ); |