summaryrefslogtreecommitdiffstats
path: root/includes/admin/views
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2021-05-25 21:15:09 +0200
committerHarald Eilertsen <haraldei@anduin.net>2021-05-25 21:15:09 +0200
commit72a0df55f1a5858ac088cfce34183c740c544663 (patch)
tree9a39373efd3a375ea23c966b75f399d57228bb7c /includes/admin/views
parent1d1f5696e79d7d5be03948fdeceb925ae22e8f10 (diff)
downloadgigologadmin-72a0df55f1a5858ac088cfce34183c740c544663.tar.gz
gigologadmin-72a0df55f1a5858ac088cfce34183c740c544663.tar.bz2
gigologadmin-72a0df55f1a5858ac088cfce34183c740c544663.zip
Use select_field in AdminPage::get_user
Diffstat (limited to 'includes/admin/views')
-rw-r--r--includes/admin/views/giglog_admin_page.php19
1 files changed, 4 insertions, 15 deletions
diff --git a/includes/admin/views/giglog_admin_page.php b/includes/admin/views/giglog_admin_page.php
index 4f211fc..bb42aa7 100644
--- a/includes/admin/views/giglog_admin_page.php
+++ b/includes/admin/views/giglog_admin_page.php
@@ -55,21 +55,10 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) {
$current_user = $cid ? GiglogAdmin_Concertlogs::get_assigned_user( $cid, $ctype ) : null;
- $select = '<select name="'.$ctype.'">';
- $select .= '<option value="">Please Select..</option>';
-
- foreach ( $users as $user ) {
- if ( $user == $current_user ) {
- $select .= '<option value="' .$user. '" selected="selected">'.$user;
- }
- else {
- $select .= '<option value="'.$user. '">'. $user;
- }
-
- $select .='</option>';
- }
- $select .= '</select>';
- return($select);
+ return \EternalTerror\ViewHelpers\select_field(
+ $ctype,
+ array_map( fn($user) => [ $user, $user ], $users ),
+ $current_user);
}