diff options
Diffstat (limited to 'includes/admin')
-rw-r--r-- | includes/admin/helpfiles/instr_photog.php | 2 | ||||
-rw-r--r-- | includes/admin/helpfiles/instr_reviewers.php | 2 | ||||
-rw-r--r-- | includes/admin/helpfiles/instrunctions.php | 2 | ||||
-rw-r--r-- | includes/admin/register_db_tables.php | 5 | ||||
-rw-r--r-- | includes/admin/views/giglog_admin_page.php | 36 | ||||
-rw-r--r-- | includes/admin/views/giglog_import_gigs.php | 10 |
6 files changed, 35 insertions, 22 deletions
diff --git a/includes/admin/helpfiles/instr_photog.php b/includes/admin/helpfiles/instr_photog.php index 0750557..f661c5f 100644 --- a/includes/admin/helpfiles/instr_photog.php +++ b/includes/admin/helpfiles/instr_photog.php @@ -13,7 +13,7 @@ if ( !class_exists( 'Instructions_Photogs' ) ) { - static function render_instr_photo_html() { + static function render_instr_photo_html(): void { diff --git a/includes/admin/helpfiles/instr_reviewers.php b/includes/admin/helpfiles/instr_reviewers.php index e00a432..3632980 100644 --- a/includes/admin/helpfiles/instr_reviewers.php +++ b/includes/admin/helpfiles/instr_reviewers.php @@ -9,7 +9,7 @@ if ( !class_exists( 'Instructions_Reviewers' ) ) { class Instructions_Reviewers { - static function render_instr_rev_html() { + static function render_instr_rev_html(): void { ?> diff --git a/includes/admin/helpfiles/instrunctions.php b/includes/admin/helpfiles/instrunctions.php index 49b77fe..b9c4d89 100644 --- a/includes/admin/helpfiles/instrunctions.php +++ b/includes/admin/helpfiles/instrunctions.php @@ -9,7 +9,7 @@ if ( !class_exists( 'Instructions_Page' ) ) { class Instructions_Page { - static function render_instr_html() { + static function render_instr_html(): void { ?> diff --git a/includes/admin/register_db_tables.php b/includes/admin/register_db_tables.php index 947be22..11223b3 100644 --- a/includes/admin/register_db_tables.php +++ b/includes/admin/register_db_tables.php @@ -5,7 +5,7 @@ // SPDX-License-Identifier: AGPL-3.0-or-later if (!function_exists('giglogadmin_populate_countries')) { - function giglogadmin_populate_countries() + function giglogadmin_populate_countries(): void { global $wpdb; $wpdb->query( @@ -254,6 +254,9 @@ if (!function_exists('giglogadmin_populate_countries')) { if ( !function_exists( "giglog_register_db_tables") ) { + /** + * @return void + */ function giglog_register_db_tables() { $db_version = get_option('giglogadmin_db_version'); diff --git a/includes/admin/views/giglog_admin_page.php b/includes/admin/views/giglog_admin_page.php index 3482ae2..b78b4db 100644 --- a/includes/admin/views/giglog_admin_page.php +++ b/includes/admin/views/giglog_admin_page.php @@ -9,7 +9,7 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { require_once __DIR__ . '/../../venue.php'; class GiglogAdmin_AdminPage { - static function render_html() { + static function render_html(): void { ?> <div class="wrap"> <h1>Giglog Admin</h1> @@ -36,7 +36,7 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { echo(GiglogAdmin_AdminPage::editforms()); //not sure why it doesn't show without the echo? } - static function get_allvenues($invenue) + static function get_allvenues( ?int $invenue ): string { $select = '<select name="selectvenueadmin">'; $select .= '<option value="">Please Select..</option>'; @@ -50,7 +50,7 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { } - static function get_user($cid, $ctype) + static function get_user( ?int $cid, string $ctype): string { $hf_user = wp_get_current_user(); $hf_username = $hf_user->user_login; @@ -75,7 +75,7 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { } - static function get_filters() + static function get_filters(): string { $cities = array_merge(["ALL"], GiglogAdmin_Venue::all_cities()); $cty = filter_input( INPUT_POST, 'selectcity', FILTER_SANITIZE_SPECIAL_CHARS ); @@ -107,9 +107,9 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { || $venue_list[0]; $select .= '<select name="selectvenue">'; - foreach ( $venue_list AS $venue ) { - //below line returns an erorr which I haven't really figured out yet But filtering works. It doesn't keep the venue selected in the dropdown - $select .= '<option value="' . $venue[0] . '"' . selected($venue[0], $selected_venue) . '>'; + + foreach ( $venue_list as $venue ) { + $select .= '<option value="' . $venue[0] . '"' . selected($venue, $selected_venue) . '>'; $select .= $venue[1] . '</option>'; } $select .= '</select>'; @@ -125,7 +125,7 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { return $select; } - static function editforms() + static function editforms(): string { $cid = filter_input(INPUT_POST, "cid"); $editing = filter_input(INPUT_POST, "edit") == "EDIT"; @@ -168,7 +168,7 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { return $content; } - static function adminactions($concert_id) + static function adminactions( int $concert_id ) : string { global $wpdb; $query = "SELECT id,wpgs_name from wpg_pressstatus" ; @@ -193,7 +193,10 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { } //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 - static function getpublishstatus($concert_id) + /** + * @return null|string + */ + static function getpublishstatus(int $concert_id) { global $wpdb; $date1 = new DateTime("now"); @@ -210,11 +213,11 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { } - static function get_concerts() + static function get_concerts(): string { $hf_user = wp_get_current_user(); $hf_username = $hf_user->user_login; - $roles = ( array ) $hf_user->roles; + $roles = $hf_user->roles; global $wpdb; $content = '<table class="assignit">'; @@ -293,6 +296,9 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { } + /** + * @return void + */ static function update() { global $wpdb; @@ -372,7 +378,7 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { } } - static function assignconcert($p1, $c) + static function assignconcert($p1, $c): void { global $wpdb; @@ -393,7 +399,7 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { wp_mail( $to, $subject, $body, $headers ); } - static function unassignconcert($p1, $c) + static function unassignconcert($p1, $c): void { global $wpdb; @@ -414,7 +420,7 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { wp_mail( $to, $subject, $body, $headers ); } - static function returnuser($p1, $c) + static function returnuser(string $p1, ?int $c): string { global $wpdb; $hf_user = wp_get_current_user(); diff --git a/includes/admin/views/giglog_import_gigs.php b/includes/admin/views/giglog_import_gigs.php index 053f505..0e7406f 100644 --- a/includes/admin/views/giglog_import_gigs.php +++ b/includes/admin/views/giglog_import_gigs.php @@ -12,7 +12,7 @@ if ( !class_exists( 'GiglogAdmin_ImportGigsPage' ) ) { require_once __DIR__ . '/../../venue.php'; class GiglogAdmin_ImportGigsPage { - static function render_html() { + static function render_html(): void { ?> <div class="wrap"> <h1>Import gigs</h1> @@ -27,7 +27,7 @@ if ( !class_exists( 'GiglogAdmin_ImportGigsPage' ) ) { <?php } - static function submit_form() { + static function submit_form(): void { if ('POST' === $_SERVER['REQUEST_METHOD'] && current_user_can('upload_files') && !empty($_FILES['giglog_import_file']['tmp_name'])) { $nonce = $_POST['giglog_import_nonce']; $valid_nonce = isset($nonce) && wp_verify_nonce($nonce); @@ -48,8 +48,12 @@ if ( !class_exists( 'GiglogAdmin_ImportGigsPage' ) ) { * 5. Event info link * * Empty lines are ignored. + * + * @return void + * + * @param ArrayAccess|array $file */ - static function process_upload($file) { + static function process_upload(array $file): void { $newconcert= []; $fo = new SplFileObject($file['tmp_name']); |