From 44ad0a77496b120eede51e60698e1caff093352c Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Tue, 25 May 2021 16:43:05 +0200 Subject: Use select_field in adminactions form. Also add a `get_status` method to the Concertlogs class, returning the press status for a given concert_id. --- includes/admin/views/giglog_admin_page.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'includes/admin/views/giglog_admin_page.php') diff --git a/includes/admin/views/giglog_admin_page.php b/includes/admin/views/giglog_admin_page.php index 8ae30c3..f84b497 100644 --- a/includes/admin/views/giglog_admin_page.php +++ b/includes/admin/views/giglog_admin_page.php @@ -152,22 +152,16 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { $query = "SELECT id,wpgs_name from wpg_pressstatus" ; $statuses = $wpdb->get_results($query); - $select = + return '
' . '' - . '' + . \EternalTerror\ViewHelpers\select_field( + 'selectstatus', + array_map(fn($status) => [ $status->id, $status->wpgs_name ], $statuses), + GiglogAdmin_Concertlogs::get_status($concert_id)) . '' . '' . '
'; - - return $select; } //function to calculate if the concert has been added in the past 10 days or before that and show a green NEW for the newest rows -- cgit v1.2.3