diff options
Diffstat (limited to 'includes/admin/views/giglog_admin_page.php')
-rw-r--r-- | includes/admin/views/giglog_admin_page.php | 19 |
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); } |