]> git.mxchange.org Git - friendica.git/commitdiff
Replace last occurrences of in_array used as a Smarty modifier
authorHypolite Petovan <hypolite@mrpetovan.com>
Mon, 27 Nov 2023 17:07:18 +0000 (12:07 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Mon, 27 Nov 2023 17:07:18 +0000 (12:07 -0500)
- Address https://github.com/friendica/friendica/issues/13158#issuecomment-1826266366

view/templates/field_select.tpl
view/theme/frio/templates/field_select.tpl

index 187852e03259475fb91e33502f70e86c6b0f7a22..f02110628eaf8262d0bdf10d7ef55fd6179b6d59 100644 (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>
index 87cc27254bd012d81e2d69daa5f090d4c50dfde8..4699ec47dfa5694e3c0d54d7382c78b73719314b 100644 (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>