summaryrefslogtreecommitdiffstats
path: root/includes/admin/views
diff options
context:
space:
mode:
Diffstat (limited to 'includes/admin/views')
-rw-r--r--includes/admin/views/giglog_admin_page.php36
-rw-r--r--includes/admin/views/giglog_import_gigs.php10
2 files changed, 28 insertions, 18 deletions
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']);