Replace last occurrences of in_array used as a Smarty modifier

- Address https://github.com/friendica/friendica/issues/13158#issuecomment-1826266366
This commit is contained in:
Hypolite Petovan 2023-11-27 12:07:18 -05:00
parent fb19176201
commit 3b3d0231bc
2 changed files with 8 additions and 8 deletions

View file

@ -2,11 +2,11 @@
<div class="field select">
<label for="id_{{$field.0}}">{{$field.1}}</label>
<select name="{{$field.0}}" id="id_{{$field.0}}" aria-describedby="{{$field.0}}_tip" {{$field.5 nofilter}}>
{{foreach $field.4 as $opt=>$val}}
{{if $field.5=='multiple'}}
<option value="{{$opt}}" dir="auto"{{if $opt|in_array:$field.2}} selected="selected"{{/if}}>{{$val}}</option>
{{foreach $field.4 as $opt => $val}}
{{if $field.5 == 'multiple'}}
<option value="{{$opt}}" dir="auto"{{if in_array($opt, $field.2)}} selected="selected"{{/if}}>{{$val}}</option>
{{else}}
<option value="{{$opt}}" dir="auto"{{if $opt==$field.2}} selected="selected"{{/if}}>{{$val}}</option>
<option value="{{$opt}}" dir="auto"{{if $opt == $field.2}} selected="selected"{{/if}}>{{$val}}</option>
{{/if}}
{{/foreach}}
</select>

View file

@ -2,11 +2,11 @@
<div class="form-group field select">
<label for="id_{{$field.0}}">{{$field.1}}</label>
<select name="{{$field.0}}" id="id_{{$field.0}}" class="form-control" aria-describedby="{{$field.0}}_tip" {{$field.5 nofilter}}>
{{foreach $field.4 as $opt=>$val}}
{{if $field.5=='multiple'}}
<option value="{{$opt}}" {{if $opt|in_array:$field.2}}selected="selected"{{/if}}>{{$val}}</option>
{{foreach $field.4 as $opt => $val}}
{{if $field.5 == 'multiple'}}
<option value="{{$opt}}" {{if in_array($opt, $field.2)}}selected="selected"{{/if}}>{{$val}}</option>
{{else}}
<option value="{{$opt}}" {{if $opt==$field.2}}selected="selected"{{/if}}>{{$val}}</option>
<option value="{{$opt}}" {{if $opt == $field.2}}selected="selected"{{/if}}>{{$val}}</option>
{{/if}}
{{/foreach}}
</select>