diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php index b483c2c6..fd72a78e 100644 --- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php @@ -28,43 +28,42 @@ class SP_Meta_Box_Event_Performance { else $split_positions = false; + // Determine if we are splitting teams + if ( 'yes' == get_option( 'sportspress_event_split_players_by_team', 'yes' ) ) + $split_teams = true; + else + $split_teams = false; + + // Determine if columns are auto or manual if ( 'manual' == get_option( 'sportspress_event_performance_columns', 'auto' ) ) $manual = true; else $manual = false; - $i = 0; + // Determine if we need checkboxes + if ( $manual && $i == 0 ) + $has_checkboxes = true; + else + $has_checkboxes = false; - foreach ( $teams as $key => $team_id ): - if ( -1 == $team_id ) continue; + // Get positions + $positions = array(); + if ( taxonomy_exists( 'sp_position' ) ): + $args = array( + 'hide_empty' => false, + 'parent' => 0, + 'include_children' => true, + ); + $positions = get_terms( 'sp_position', $args ); + endif; - // Get results for players in the team - $players = sp_array_between( (array)get_post_meta( $post->ID, 'sp_player', false ), 0, $key ); - $players[] = -1; - $data = sp_array_combine( $players, sp_array_value( $stats, $team_id, array() ) ); + // Get status option + if ( 'yes' == get_option( 'sportspress_event_show_status', 'yes' ) ) + $status = true; + else + $status = false; - // Determine if we need checkboxes - if ( $manual && $i == 0 ) - $has_checkboxes = true; - else - $has_checkboxes = false; - - ?> - -
- -
+ +
| - | # | -- - | - - | - - $label ): ?> -- - - - - - | - - -- - | - -- - | - -|
|---|---|---|---|---|---|---|---|
| - | - | - - | - - $label ): - $player_id = 0; - $player_performance = sp_array_value( $data, $player_id, array() ); - $value = sp_array_value( $player_performance, $column, '' ); - ?> - | readonly="readonly"value="" /> | - -- | ||
| + + + | # | + ++ + | + + | + + $label ): ?> ++ + + + + + | + + ++ + | + +||
| + + + | + + | + + | + + $label ): + $player_id = 0; + $player_performance = sp_array_value( $data, $player_id, array() ); + $value = sp_array_value( $player_performance, $column, '' ); + ?> + | readonly="readonly"value="" /> | + + ++ + | ||
| - | - - | + ++ + + | + + | +@@ -198,34 +273,12 @@ class SP_Meta_Box_Event_Performance { | - +- - | - 'sp_outcome', - 'name' => 'sp_players[' . $team_id . '][' . $player_id . '][outcome][]', - 'option_none_value' => '', - 'sort_order' => 'ASC', - 'sort_column' => 'menu_order', - 'selected' => $values, - 'class' => 'sp-outcome', - 'property' => 'multiple', - 'chosen' => true, - 'placeholder' => __( 'None', 'sportspress' ), - ); - sp_dropdown_pages( $args ); - ?> - | - +|
| '; @@ -155,8 +160,8 @@ $totals = array(); if ( $mode == 'icons' ) echo ' | '; ?>