From aa72a30d4a6ffdfbdc49ab061b3ed9f76d86d7ae Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Mon, 6 Sep 2021 09:46:26 +0200 Subject: Fix indentation and whitespace, add braces where missing. --- includes/admin/views/_concerts_table.php | 87 +++++++++++++++++--------------- 1 file changed, 46 insertions(+), 41 deletions(-) diff --git a/includes/admin/views/_concerts_table.php b/includes/admin/views/_concerts_table.php index 75f50c6..e75ca38 100644 --- a/includes/admin/views/_concerts_table.php +++ b/includes/admin/views/_concerts_table.php @@ -26,7 +26,7 @@ if (!class_exists("GiglogAdmin_ConcertsTable")) public function render(): string { return $this->render_filters() - . $this->render_concerts_table(); + . $this->render_concerts_table(); } private function render_concerts_table() : string @@ -35,15 +35,15 @@ if (!class_exists("GiglogAdmin_ConcertsTable")) // $content .= 'CITYIDBANDVENUEDATE'; $content .= 'CITYNAMEVENUEDATE'; - if(!is_admin()) { + + if (!is_admin()) { $content .= 'EVENTTICKETS'; } - - else - { + else { $content .= ' PHOTO1PHOTO2TEXT1TEXT2STATUS'; - if (current_user_can('administrator')) - $content .= 'AdminOptions'; + if (current_user_can('administrator')) { + $content .= 'AdminOptions'; + } } $content .= ''; @@ -51,13 +51,18 @@ if (!class_exists("GiglogAdmin_ConcertsTable")) // Use the submitted "city" if any. Otherwise, use the default/static value. $cty = filter_input( INPUT_POST, 'selectcity', FILTER_SANITIZE_SPECIAL_CHARS ); - if ($cty) $filter['city'] = $cty; + if ($cty) { + $filter['city'] = $cty; + } $venue = filter_input( INPUT_POST, 'selectvenue', FILTER_SANITIZE_SPECIAL_CHARS ); - if ($venue) $filter['venue_id'] = $venue; + if ($venue) { + $filter['venue_id'] = $venue; + } - if(isset($_POST['ownconcerts']) && $_POST['ownconcerts'] == '1') - $filter['currentuser'] = wp_get_current_user()->user_login; + if(isset($_POST['ownconcerts']) && $_POST['ownconcerts'] == '1') { + $filter['currentuser'] = wp_get_current_user()->user_login; + } $concerts = GiglogAdmin_Concert::find_concerts($filter); @@ -73,10 +78,11 @@ if (!class_exists("GiglogAdmin_ConcertsTable")) if ($lastType == '' ) { $content .= '' . $concert->venue()->city() . ''; } - // Modify these to match the database structure - // $content .= '' . $row->id. ''; - // $content .= '' . $row->id. ''; - if ($lastType != '' && $lastType == $concert->venue()->city()) $content .= ''; + + if ($lastType != '' && $lastType == $concert->venue()->city()) { + $content .= ''; + } + $content .= ''. $concert->cname() . ''; $content .= '' . $concert->venue()->name() . ''; $fdate = strtotime($concert->cdate()); @@ -100,10 +106,9 @@ if (!class_exists("GiglogAdmin_ConcertsTable")) $content .= '' . self::STATUS_LABELS[$concert->status()] . ''; if (current_user_can('administrator')) { - $content .= - '' - . $this->adminactions($concert) - . ''; + $content .= '' + . $this->adminactions($concert) + . ''; } } $content .= ''; @@ -119,12 +124,12 @@ if (!class_exists("GiglogAdmin_ConcertsTable")) { $cty = filter_input(INPUT_POST, 'selectcity', FILTER_SANITIZE_SPECIAL_CHARS); - $select = '
FILTER DATA:'; - $select .= \EternalTerror\ViewHelpers\select_field( - "selectcity", - array_map(fn($city) => [$city, $city], GiglogAdmin_Venue::all_cities()), - $cty, - "Select city..."); + $select = 'FILTER DATA:' + . \EternalTerror\ViewHelpers\select_field( + "selectcity", + array_map(fn($city) => [$city, $city], GiglogAdmin_Venue::all_cities()), + $cty, + "Select city..."); if ( !empty($cty) ) { @@ -141,8 +146,8 @@ if (!class_exists("GiglogAdmin_ConcertsTable")) if(is_admin()) { //option to select own concerts only $select .= ''; + . checked(isset($_POST['ownconcerts']) ? $_POST['ownconcerts'] : false) + . '>'; } $select .= '
'; @@ -152,12 +157,12 @@ if (!class_exists("GiglogAdmin_ConcertsTable")) private function adminactions( GiglogAdmin_Concert $concert ) : string { return - '
' - . '' - . \EternalTerror\ViewHelpers\select_field( - 'selectstatus', - array_map(fn($i) => [ $i, self::STATUS_LABELS[$i] ], range(1, count(self::STATUS_LABELS) - 1)), - $concert->status()) + '' + . '' + . \EternalTerror\ViewHelpers\select_field( + 'selectstatus', + array_map(fn($i) => [ $i, self::STATUS_LABELS[$i] ], range(1, count(self::STATUS_LABELS) - 1)), + $concert->status()) . '' . '' . '
'; @@ -189,10 +194,10 @@ if (!class_exists("GiglogAdmin_ConcertsTable")) //first check if current slot is taken by current user if ( $assigned_user == $this->username ) { $f = '
' - . ' ' - . ' ' - . ' ' - . '
'; + . ' ' + . ' ' + . ' ' + . ''; } elseif ( $assigned_user ) { //check if slot is taken by another user $f = 'Taken' @@ -204,10 +209,10 @@ if (!class_exists("GiglogAdmin_ConcertsTable")) } else { //not taken by anyone $f = '
' - . ' ' - . ' ' - . ' ' - . '
'; + . ' ' + . ' ' + . ' ' + . ''; } return $f; -- cgit v1.2.3