diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2021-09-03 11:40:59 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2021-09-03 11:40:59 +0200 |
commit | ce7584bd6362d4eed9160c361498e624aede6a06 (patch) | |
tree | 514420939dd1167547c8c2508314f32817859b09 /includes/admin | |
parent | 74b06505888d69602b32d792ba4a815cd604ae41 (diff) | |
download | gigologadmin-ce7584bd6362d4eed9160c361498e624aede6a06.tar.gz gigologadmin-ce7584bd6362d4eed9160c361498e624aede6a06.tar.bz2 gigologadmin-ce7584bd6362d4eed9160c361498e624aede6a06.zip |
Render adminactions in concert list view.
Clicking the buttons don't work quite yet.
Diffstat (limited to 'includes/admin')
-rw-r--r-- | includes/admin/views/giglog_admin_page.php | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/includes/admin/views/giglog_admin_page.php b/includes/admin/views/giglog_admin_page.php index 5a16b66..3fe3237 100644 --- a/includes/admin/views/giglog_admin_page.php +++ b/includes/admin/views/giglog_admin_page.php @@ -150,7 +150,7 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { return $content; } - private function adminactions( int $concert_id ) : string + private function adminactions( GiglogAdmin_Concert $concert ) : string { global $wpdb; $query = "SELECT id,wpgs_name from wpg_pressstatus" ; @@ -158,11 +158,11 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { return '<form method="POST" action="">' - . '<input type="hidden" name="cid" value="' . $concert_id . '" />' + . '<input type="hidden" name="cid" value="' . $concert->id() . '" />' . \EternalTerror\ViewHelpers\select_field( 'selectstatus', array_map(fn($status) => [ $status->id, $status->wpgs_name ], $statuses), - GiglogAdmin_Concertlogs::get_status($concert_id)) + $concert->status()) . '<input type="submit" value="SetStatus">' . '<input type="submit" name ="edit" value="EDIT">' . '</form>'; @@ -248,12 +248,12 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { $content .= '<td>' . $concert->status() . '</td>'; - // if (current_user_can('administrator')) { - // $content .= - // '<td class="adminbuttons">' - // . $this->adminactions($row->id) - // . '</td>'; - // } + if (current_user_can('administrator')) { + $content .= + '<td class="adminbuttons">' + . $this->adminactions($concert) + . '</td>'; + } $content .= '</tr>'; $lastType = $concert->venue()->city(); } |