diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2021-04-07 10:36:19 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2021-04-07 10:36:19 +0200 |
commit | 4f34c1ae93330e142c75f181d4d0c8c2fa8e4bdc (patch) | |
tree | cfd55338b858df931f5b0fbbb01202b998751007 | |
parent | 5a877f9e768f727e931fe8c2b66e62e363a032b2 (diff) | |
download | gigologadmin-4f34c1ae93330e142c75f181d4d0c8c2fa8e4bdc.tar.gz gigologadmin-4f34c1ae93330e142c75f181d4d0c8c2fa8e4bdc.tar.bz2 gigologadmin-4f34c1ae93330e142c75f181d4d0c8c2fa8e4bdc.zip |
Fix AdminPage::adminactions()
The reason it did not work was that it was not the same as the inline
version.
-rw-r--r-- | includes/admin/views/giglog_admin_page.php | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/includes/admin/views/giglog_admin_page.php b/includes/admin/views/giglog_admin_page.php index babe988..4f24892 100644 --- a/includes/admin/views/giglog_admin_page.php +++ b/includes/admin/views/giglog_admin_page.php @@ -84,22 +84,26 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { return $select; } - static function adminactions() //didn't get this one to work, the point was to create the drop down menu with a function, but it works fine to create it directly in the query + static function adminactions($concert_id) { global $wpdb; $query = "SELECT id,wpgs_name from wpg_pressstatus" ; $statuses = $wpdb->get_results($query); - $select = '<form method="POST" action=""><select name="selectstatus">'; + $select = + '<form method="POST" action="">' + . '<input type="hidden" name="cid" value="' . $concert_id . '" />' + . '<select name="selectstatus">'; foreach ( $statuses AS $sts ) { - - $select .= '<option value="' . $sts . '">'; - $select .= $sts -> wpgs_name . '</option>'; + $select .= '<option value="' . $sts->id . '">' . $sts->wpgs_name . '</option>'; } - $select .= '</select>'; - $select .= '<input type="submit" value="Adminstatus"></form>'; + $select .= + '</select>' + . '<input type="submit" value="Set status">' + . '</form>'; + return $select; } @@ -169,18 +173,12 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { $content .= '<td>'.GiglogAdmin_AdminPage::returnuser('rev1', $row->id ).'</td>'; $content .= '<td>'.GiglogAdmin_AdminPage::returnuser('rev2', $row->id ).'</td>'; $content .= '<td>'.$row -> wpgs_name.'</td>'; - if (current_user_can('administrator')) //($hf_username == 'etadmin') - { $content .= '<td class="adminbuttons">'; - $stquery = "SELECT id,wpgs_name from wpg_pressstatus" ; - $statuses = $wpdb->get_results($stquery); - $content .= '<form method="POST" action=""><input type="hidden" name="cid" value="' . $row->id. '" /><select name="selectstatus">'; - foreach ( $statuses AS $sts ) - { - $content .= '<option value="'.$sts->id. '">'.$sts -> wpgs_name .'</option>'; - } - $content .= '</select>'; - $content .= '<input type="submit" value="Set status"></form>'; - $content .= '</td>'; + + if (current_user_can('administrator')) { + $content .= + '<td class="adminbuttons">' + . GiglogAdmin_AdminPage::adminactions($row->id) + . '</td>'; } $content .= '</tr>'; $lastType = $row->wpgvenue_city; @@ -192,7 +190,9 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { } static function update() - { global $wpdb; + { + global $wpdb; + if ('POST' !== $_SERVER['REQUEST_METHOD']) return; |