diff options
| author | wn_ <invalid@email.com> | 2024-11-23 18:23:49 +0000 |
|---|---|---|
| committer | wn_ <invalid@email.com> | 2024-11-24 13:59:29 +0000 |
| commit | 667528d5b927f0f284a067b0e24c9ca7f26c28a4 (patch) | |
| tree | f28c7ece3584a7852b6562020246b1de6167774e /include/controls.php | |
| parent | 53fee911e6a39a5c8504d03d1f114a131d00784c (diff) | |
Use PHP 8 'str_' functions.
A few more characters in some places, but helps with readability.
Diffstat (limited to 'include/controls.php')
| -rwxr-xr-x | include/controls.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/controls.php b/include/controls.php index 4443bbc55..5c6174e3d 100755 --- a/include/controls.php +++ b/include/controls.php @@ -46,7 +46,7 @@ */ function input_tag(string $name, string $value, string $type = "text", array $attributes = [], string $id = ""): string { $attributes_str = attributes_to_string($attributes); - $dojo_type = strpos($attributes_str, "dojoType") === false ? "dojoType='dijit.form.TextBox'" : ""; + $dojo_type = str_contains($attributes_str, "dojoType") ? "" : "dojoType='dijit.form.TextBox'"; return "<input name=\"".htmlspecialchars($name)."\" $dojo_type ".attributes_to_string($attributes)." id=\"".htmlspecialchars($id)."\" type=\"$type\" value=\"".htmlspecialchars($value)."\">"; @@ -86,7 +86,7 @@ */ function select_tag(string $name, mixed $value, array $values, array $attributes = [], string $id = ""): string { $attributes_str = attributes_to_string($attributes); - $dojo_type = strpos($attributes_str, "dojoType") === false ? "dojoType='fox.form.Select'" : ""; + $dojo_type = str_contains($attributes_str, "dojoType") ? "" : "dojoType='fox.form.Select'"; $rv = "<select $dojo_type name=\"".htmlspecialchars($name)."\" id=\"".htmlspecialchars($id)."\" name=\"".htmlspecialchars($name)."\" $attributes_str>"; @@ -115,7 +115,7 @@ */ function select_hash(string $name, $value, array $values, array $attributes = [], string $id = ""): string { $attributes_str = attributes_to_string($attributes); - $dojo_type = strpos($attributes_str, "dojoType") === false ? "dojoType='fox.form.Select'" : ""; + $dojo_type = str_contains($attributes_str, "dojoType") ? "" : "dojoType='fox.form.Select'"; $rv = "<select $dojo_type name=\"".htmlspecialchars($name)."\" id=\"".htmlspecialchars($id)."\" name=\"".htmlspecialchars($name)."\" $attributes_str>"; |