@@ -80,10 +80,10 @@ discard block |
||
| 80 | 80 | if($type=='file' ){ |
| 81 | 81 | $label_after = true; // if type file we need the label after |
| 82 | 82 | $args['class'] .= ' custom-file-input '; |
| 83 | - }elseif($type=='checkbox'){ |
|
| 83 | + } elseif($type=='checkbox'){ |
|
| 84 | 84 | $label_after = true; // if type file we need the label after |
| 85 | 85 | $args['class'] .= ' custom-control-input '; |
| 86 | - }elseif($type=='datepicker' || $type=='timepicker'){ |
|
| 86 | + } elseif($type=='datepicker' || $type=='timepicker'){ |
|
| 87 | 87 | $type = 'text'; |
| 88 | 88 | //$args['class'] .= ' aui-flatpickr bg-initial '; |
| 89 | 89 | $args['class'] .= ' bg-initial '; |
@@ -167,8 +167,7 @@ discard block |
||
| 167 | 167 | |
| 168 | 168 | // label |
| 169 | 169 | if(!empty($args['label'])){ |
| 170 | - if($type == 'file'){$label_args['class'] .= 'custom-file-label';} |
|
| 171 | - elseif($type == 'checkbox'){$label_args['class'] .= 'custom-control-label';} |
|
| 170 | + if($type == 'file'){$label_args['class'] .= 'custom-file-label';} elseif($type == 'checkbox'){$label_args['class'] .= 'custom-control-label';} |
|
| 172 | 171 | $label = self::label( $label_args, $type ); |
| 173 | 172 | } |
| 174 | 173 | |
@@ -189,7 +188,7 @@ discard block |
||
| 189 | 188 | 'content' => $output, |
| 190 | 189 | 'class' => 'form-group custom-file' |
| 191 | 190 | ) ); |
| 192 | - }elseif($type == 'checkbox'){ |
|
| 191 | + } elseif($type == 'checkbox'){ |
|
| 193 | 192 | $wrap_class = $args['switch'] ? 'custom-switch' : 'custom-checkbox'; |
| 194 | 193 | $output = self::wrap( array( |
| 195 | 194 | 'content' => $output, |
@@ -199,7 +198,7 @@ discard block |
||
| 199 | 198 | if($args['label_type']=='horizontal'){ |
| 200 | 199 | $output = '<div class="col-sm-2 col-form-label"></div><div class="col-sm-10">' . $output . '</div>'; |
| 201 | 200 | } |
| 202 | - }elseif($type == 'password' && $args['password_toggle'] && !$args['input_group_right']){ |
|
| 201 | + } elseif($type == 'password' && $args['password_toggle'] && !$args['input_group_right']){ |
|
| 203 | 202 | |
| 204 | 203 | |
| 205 | 204 | // allow password field to toggle view |
@@ -325,7 +324,7 @@ discard block |
||
| 325 | 324 | |
| 326 | 325 | // label |
| 327 | 326 | if(!empty($args['label']) && is_array($args['label'])){ |
| 328 | - }elseif(!empty($args['label']) && !$label_after){ |
|
| 327 | + } elseif(!empty($args['label']) && !$label_after){ |
|
| 329 | 328 | $label_args = array( |
| 330 | 329 | 'title'=> $args['label'], |
| 331 | 330 | 'for'=> $args['id'], |
@@ -360,7 +359,7 @@ discard block |
||
| 360 | 359 | |
| 361 | 360 | wp_editor( $content, $editor_id, $settings ); |
| 362 | 361 | $output .= ob_get_clean(); |
| 363 | - }else{ |
|
| 362 | + } else{ |
|
| 364 | 363 | |
| 365 | 364 | // open |
| 366 | 365 | $output .= '<textarea '; |
@@ -483,7 +482,7 @@ discard block |
||
| 483 | 482 | // maybe hide labels //@todo set a global option for visibility class |
| 484 | 483 | if($type == 'file' || $type == 'checkbox' || $type == 'radio' || !empty($args['label_type']) ){ |
| 485 | 484 | $class = $args['class']; |
| 486 | - }else{ |
|
| 485 | + } else{ |
|
| 487 | 486 | $class = 'sr-only '.$args['class']; |
| 488 | 487 | } |
| 489 | 488 | |
@@ -594,7 +593,7 @@ discard block |
||
| 594 | 593 | $output .= '</'.sanitize_html_class($args['type']).'>'; |
| 595 | 594 | |
| 596 | 595 | |
| 597 | - }else{ |
|
| 596 | + } else{ |
|
| 598 | 597 | $output = $args['content']; |
| 599 | 598 | } |
| 600 | 599 | |
@@ -657,7 +656,7 @@ discard block |
||
| 657 | 656 | if(!empty($args['select2'])){ |
| 658 | 657 | $args['class'] .= ' aui-select2'; |
| 659 | 658 | $is_select2 = true; |
| 660 | - }elseif( strpos($args['class'], 'aui-select2') !== false){ |
|
| 659 | + } elseif( strpos($args['class'], 'aui-select2') !== false){ |
|
| 661 | 660 | $is_select2 = true; |
| 662 | 661 | } |
| 663 | 662 | |
@@ -676,7 +675,7 @@ discard block |
||
| 676 | 675 | |
| 677 | 676 | // label |
| 678 | 677 | if(!empty($args['label']) && is_array($args['label'])){ |
| 679 | - }elseif(!empty($args['label']) && !$label_after){ |
|
| 678 | + } elseif(!empty($args['label']) && !$label_after){ |
|
| 680 | 679 | $label_args = array( |
| 681 | 680 | 'title'=> $args['label'], |
| 682 | 681 | 'for'=> $args['id'], |
@@ -751,7 +750,7 @@ discard block |
||
| 751 | 750 | // placeholder |
| 752 | 751 | if(isset($args['placeholder']) && '' != $args['placeholder'] && !$is_select2){ |
| 753 | 752 | $output .= '<option value="" disabled selected hidden>'.esc_attr($args['placeholder']).'</option>'; |
| 754 | - }elseif($is_select2 && !empty($args['placeholder'])){ |
|
| 753 | + } elseif($is_select2 && !empty($args['placeholder'])){ |
|
| 755 | 754 | $output .= "<option></option>"; // select2 needs an empty select to fill the placeholder |
| 756 | 755 | } |
| 757 | 756 | |
@@ -760,7 +759,7 @@ discard block |
||
| 760 | 759 | |
| 761 | 760 | if(!is_array($args['options'])){ |
| 762 | 761 | $output .= $args['options']; // not the preferred way but an option |
| 763 | - }else{ |
|
| 762 | + } else{ |
|
| 764 | 763 | foreach($args['options'] as $val => $name){ |
| 765 | 764 | $selected = ''; |
| 766 | 765 | if(is_array($name)){ |
@@ -779,7 +778,7 @@ discard block |
||
| 779 | 778 | |
| 780 | 779 | $output .= '<option value="' . esc_attr($option_value) . '" ' . $selected . '>' . $option_label . '</option>'; |
| 781 | 780 | } |
| 782 | - }else{ |
|
| 781 | + } else{ |
|
| 783 | 782 | if(!empty($args['value'])){ |
| 784 | 783 | if(is_array($args['value'])){ |
| 785 | 784 | $selected = in_array($val,$args['value']) ? 'selected="selected"' : ''; |
@@ -1002,7 +1001,7 @@ discard block |
||
| 1002 | 1001 | |
| 1003 | 1002 | // label |
| 1004 | 1003 | if(!empty($args['label']) && is_array($args['label'])){ |
| 1005 | - }elseif(!empty($args['label'])){ |
|
| 1004 | + } elseif(!empty($args['label'])){ |
|
| 1006 | 1005 | $output .= self::label(array('title'=>$args['label'],'for'=>$args['id'].$count,'class'=>'form-check-label'),'radio'); |
| 1007 | 1006 | } |
| 1008 | 1007 | |