Combine event performance table more elegantly
This commit is contained in:
@@ -28,43 +28,42 @@ class SP_Meta_Box_Event_Performance {
|
|||||||
else
|
else
|
||||||
$split_positions = false;
|
$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' ) )
|
if ( 'manual' == get_option( 'sportspress_event_performance_columns', 'auto' ) )
|
||||||
$manual = true;
|
$manual = true;
|
||||||
else
|
else
|
||||||
$manual = false;
|
$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 ):
|
// Get positions
|
||||||
if ( -1 == $team_id ) continue;
|
$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
|
// Get status option
|
||||||
$players = sp_array_between( (array)get_post_meta( $post->ID, 'sp_player', false ), 0, $key );
|
if ( 'yes' == get_option( 'sportspress_event_show_status', 'yes' ) )
|
||||||
$players[] = -1;
|
$status = true;
|
||||||
$data = sp_array_combine( $players, sp_array_value( $stats, $team_id, array() ) );
|
else
|
||||||
|
$status = false;
|
||||||
|
|
||||||
// Determine if we need checkboxes
|
self::tables( $post->ID, $stats, $labels, $columns, $teams, $has_checkboxes, $split_positions, $split_teams, $positions, $status );
|
||||||
if ( $manual && $i == 0 )
|
|
||||||
$has_checkboxes = true;
|
|
||||||
else
|
|
||||||
$has_checkboxes = false;
|
|
||||||
|
|
||||||
?>
|
|
||||||
<?php if ( get_option( 'sportspress_event_split_players_by_team' ) ) { ?>
|
|
||||||
<div>
|
|
||||||
<?php if ( $team_id ): ?>
|
|
||||||
<p><strong><?php echo get_the_title( $team_id ); ?></strong></p>
|
|
||||||
<?php elseif ( $i ): ?>
|
|
||||||
<br>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php self::table( $labels, $columns, $data, $team_id, $has_checkboxes, $split_positions ); ?>
|
|
||||||
</div>
|
|
||||||
<?php } else { ?>
|
|
||||||
<?php self::table( $labels, $columns, $data, $team_id, $has_checkboxes, $split_positions ); ?>
|
|
||||||
<?php } ?>
|
|
||||||
<?php
|
|
||||||
$i ++;
|
|
||||||
endforeach;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -75,77 +74,73 @@ class SP_Meta_Box_Event_Performance {
|
|||||||
update_post_meta( $post_id, 'sp_columns', sp_array_value( $_POST, 'sp_columns', array() ) );
|
update_post_meta( $post_id, 'sp_columns', sp_array_value( $_POST, 'sp_columns', array() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Admin edit tables
|
||||||
|
*/
|
||||||
|
public static function tables( $post_id, $stats = array(), $labels = array(), $columns = array(), $teams = array(), $has_checkboxes = false, $split_positions = false, $split_teams = true, $positions = array(), $status = true ) {
|
||||||
|
$i = 0;
|
||||||
|
|
||||||
|
if ( $split_teams ) {
|
||||||
|
foreach ( $teams as $key => $team_id ):
|
||||||
|
if ( -1 == $team_id ) continue;
|
||||||
|
|
||||||
|
// 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() ) );
|
||||||
|
?>
|
||||||
|
<div>
|
||||||
|
<?php if ( $team_id ): ?>
|
||||||
|
<p><strong><?php echo get_the_title( $team_id ); ?></strong></p>
|
||||||
|
<?php elseif ( $i ): ?>
|
||||||
|
<br>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php self::table( $labels, $columns, $data, $team_id, $has_checkboxes, $split_positions, $positions, $status ); ?>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
$i ++;
|
||||||
|
endforeach;
|
||||||
|
} else {
|
||||||
|
?>
|
||||||
|
<div class="sp-data-table-container">
|
||||||
|
<table class="widefat sp-data-table sp-performance-table sp-sortable-table">
|
||||||
|
<?php self::header( $columns, $labels, $positions, $labels, $has_checkboxes, $status, false, false ); ?>
|
||||||
|
<?php self::footer( sp_array_value( $stats, -1 ), $labels, 0, $positions, $labels, $split_positions, $status, false, false ); ?>
|
||||||
|
<tbody>
|
||||||
|
<?php
|
||||||
|
foreach ( $teams as $key => $team_id ):
|
||||||
|
if ( -1 == $team_id ) continue;
|
||||||
|
|
||||||
|
// 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() ) );
|
||||||
|
|
||||||
|
foreach ( $data as $player_id => $player_performance ):
|
||||||
|
self::row( $labels, $player_id, $player_performance, $team_id, $data, ! empty( $positions ), $status, false, false );
|
||||||
|
endforeach;
|
||||||
|
endforeach;
|
||||||
|
?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Admin edit table
|
* Admin edit table
|
||||||
*/
|
*/
|
||||||
public static function table( $labels = array(), $columns = array(), $data = array(), $team_id, $has_checkboxes = false, $split_positions = false ) {
|
public static function table( $labels = array(), $columns = array(), $data = array(), $team_id, $has_checkboxes = false, $split_positions = false, $positions = array(), $status = true ) {
|
||||||
if ( taxonomy_exists( 'sp_position' ) ) {
|
|
||||||
$args = array(
|
|
||||||
'hide_empty' => false,
|
|
||||||
'parent' => 0,
|
|
||||||
'include_children' => true,
|
|
||||||
);
|
|
||||||
$positions = get_terms( 'sp_position', $args );
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
<div class="sp-data-table-container">
|
<div class="sp-data-table-container">
|
||||||
<table class="widefat sp-data-table sp-performance-table sp-sortable-table">
|
<table class="widefat sp-data-table sp-performance-table sp-sortable-table">
|
||||||
<thead>
|
<?php self::header( $columns, $labels, $positions, $labels, $has_checkboxes, $status ); ?>
|
||||||
<tr>
|
<?php self::footer( $data, $labels, $team_id, $positions, $labels, $split_positions, $status ); ?>
|
||||||
<th class="icon"> </th>
|
|
||||||
<th>#</th>
|
|
||||||
<th><?php _e( 'Player', 'sportspress' ); ?></th>
|
|
||||||
<?php if ( ! empty( $positions ) ) { ?>
|
|
||||||
<th class="column-position">
|
|
||||||
<?php _e( 'Position', 'sportspress' ); ?>
|
|
||||||
</th>
|
|
||||||
<?php } ?>
|
|
||||||
<?php foreach ( $labels as $key => $label ): ?>
|
|
||||||
<th>
|
|
||||||
<?php if ( $has_checkboxes ): ?>
|
|
||||||
<label for="sp_columns_<?php echo $key; ?>">
|
|
||||||
<input type="checkbox" name="sp_columns[]" value="<?php echo $key; ?>" id="sp_columns_<?php echo $key; ?>" <?php checked( ! is_array( $columns ) || in_array( $key, $columns ) ); ?>>
|
|
||||||
<?php echo $label; ?>
|
|
||||||
</label>
|
|
||||||
<?php else: ?>
|
|
||||||
<?php echo $label; ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
</th>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
<?php if ( $team_id ): ?>
|
|
||||||
<th>
|
|
||||||
<?php _e( 'Status', 'sportspress' ); ?>
|
|
||||||
</th>
|
|
||||||
<?php else: ?>
|
|
||||||
<th>
|
|
||||||
<?php _e( 'Outcome', 'sportspress' ); ?>
|
|
||||||
</th>
|
|
||||||
<?php endif; ?>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tfoot>
|
|
||||||
<?php do_action( 'sportspress_event_performance_meta_box_table_footer', $data, $labels, $team_id ); ?>
|
|
||||||
<tr class="sp-row sp-total">
|
|
||||||
<td> </td>
|
|
||||||
<td> </td>
|
|
||||||
<td><strong><?php _e( 'Total', 'sportspress' ); ?></strong></td>
|
|
||||||
<?php if ( ! empty( $positions ) ) { ?>
|
|
||||||
<td> </td>
|
|
||||||
<?php } ?>
|
|
||||||
<?php foreach( $labels as $column => $label ):
|
|
||||||
$player_id = 0;
|
|
||||||
$player_performance = sp_array_value( $data, $player_id, array() );
|
|
||||||
$value = sp_array_value( $player_performance, $column, '' );
|
|
||||||
?>
|
|
||||||
<td><input type="text" name="sp_players[<?php echo $team_id; ?>][<?php echo $player_id; ?>][<?php echo $column; ?>]" placeholder="0" <?php if ( $split_positions ) { ?>readonly="readonly"<?php } else { ?>value="<?php echo $value; ?>"<?php } ?> /></td>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
<td> </td>
|
|
||||||
</tr>
|
|
||||||
</tfoot>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
foreach ( $data as $player_id => $player_performance ):
|
foreach ( $data as $player_id => $player_performance ):
|
||||||
self::row( $labels, $player_id, $player_performance, $team_id, $data, ! empty( $positions ) );
|
self::row( $labels, $player_id, $player_performance, $team_id, $data, ! empty( $positions ), $status );
|
||||||
endforeach;
|
endforeach;
|
||||||
?>
|
?>
|
||||||
</tbody>
|
</tbody>
|
||||||
@@ -154,20 +149,100 @@ class SP_Meta_Box_Event_Performance {
|
|||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Admin edit table header
|
||||||
|
*/
|
||||||
|
public static function header( $columns = array(), $labels = array(), $positions = array(), $labels = array(), $has_checkboxes = false, $status = true, $sortable = true, $numbers = true ) {
|
||||||
|
?>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<?php if ( $sortable ) { ?>
|
||||||
|
<th class="icon"> </th>
|
||||||
|
<?php } ?>
|
||||||
|
<?php if ( $numbers ) { ?>
|
||||||
|
<th>#</th>
|
||||||
|
<?php } ?>
|
||||||
|
<th><?php _e( 'Player', 'sportspress' ); ?></th>
|
||||||
|
<?php if ( ! empty( $positions ) ) { ?>
|
||||||
|
<th class="column-position">
|
||||||
|
<?php _e( 'Position', 'sportspress' ); ?>
|
||||||
|
</th>
|
||||||
|
<?php } ?>
|
||||||
|
<?php foreach ( $labels as $key => $label ): ?>
|
||||||
|
<th>
|
||||||
|
<?php if ( $has_checkboxes ): ?>
|
||||||
|
<label for="sp_columns_<?php echo $key; ?>">
|
||||||
|
<input type="checkbox" name="sp_columns[]" value="<?php echo $key; ?>" id="sp_columns_<?php echo $key; ?>" <?php checked( ! is_array( $columns ) || in_array( $key, $columns ) ); ?>>
|
||||||
|
<?php echo $label; ?>
|
||||||
|
</label>
|
||||||
|
<?php else: ?>
|
||||||
|
<?php echo $label; ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
</th>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<?php if ( $status ) { ?>
|
||||||
|
<th>
|
||||||
|
<?php _e( 'Status', 'sportspress' ); ?>
|
||||||
|
</th>
|
||||||
|
<?php } ?>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Admin edit table footer
|
||||||
|
*/
|
||||||
|
public static function footer( $data = array(), $labels = array(), $team_id = 0, $positions = array(), $labels = array(), $split_positions = false, $status = true, $sortable = true, $numbers = true ) {
|
||||||
|
?>
|
||||||
|
<tfoot>
|
||||||
|
<?php do_action( 'sportspress_event_performance_meta_box_table_footer', $data, $labels, $team_id, $positions, $status, $sortable, $numbers ); ?>
|
||||||
|
<?php if ( $team_id ) { ?>
|
||||||
|
<tr class="sp-row sp-total">
|
||||||
|
<?php if ( $sortable ) { ?>
|
||||||
|
<td> </td>
|
||||||
|
<?php } ?>
|
||||||
|
<?php if ( $numbers ) { ?>
|
||||||
|
<td> </td>
|
||||||
|
<?php } ?>
|
||||||
|
<td><strong><?php _e( 'Total', 'sportspress' ); ?></strong></td>
|
||||||
|
<?php if ( ! empty( $positions ) ) { ?>
|
||||||
|
<td> </td>
|
||||||
|
<?php } ?>
|
||||||
|
<?php foreach( $labels as $column => $label ):
|
||||||
|
$player_id = 0;
|
||||||
|
$player_performance = sp_array_value( $data, $player_id, array() );
|
||||||
|
$value = sp_array_value( $player_performance, $column, '' );
|
||||||
|
?>
|
||||||
|
<td><input type="text" name="sp_players[<?php echo $team_id; ?>][<?php echo $player_id; ?>][<?php echo $column; ?>]" placeholder="0" <?php if ( $split_positions ) { ?>readonly="readonly"<?php } else { ?>value="<?php echo $value; ?>"<?php } ?> /></td>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<?php if ( $status ) { ?>
|
||||||
|
<td> </td>
|
||||||
|
<?php } ?>
|
||||||
|
</tr>
|
||||||
|
<?php } ?>
|
||||||
|
</tfoot>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Admin edit table row
|
* Admin edit table row
|
||||||
*/
|
*/
|
||||||
public static function row( $labels = array(), $player_id = 0, $player_performance = array(), $team_id = 0, $data = array(), $positions = true ) {
|
public static function row( $labels = array(), $player_id = 0, $player_performance = array(), $team_id = 0, $data = array(), $positions = true, $status = true, $sortable = true, $numbers = true ) {
|
||||||
if ( $player_id <= 0 ) return;
|
if ( $player_id <= 0 ) return;
|
||||||
|
|
||||||
$number = get_post_meta( $player_id, 'sp_number', true );
|
$number = get_post_meta( $player_id, 'sp_number', true );
|
||||||
$value = sp_array_value( $player_performance, 'number', '' );
|
$value = sp_array_value( $player_performance, 'number', '' );
|
||||||
?>
|
?>
|
||||||
<tr class="sp-row sp-post" data-player="<?php echo $player_id; ?>">
|
<tr class="sp-row sp-post" data-player="<?php echo $player_id; ?>">
|
||||||
<td class="icon"><span class="dashicons dashicons-menu post-state-format"></span></td>
|
<?php if ( $sortable ) { ?>
|
||||||
<td>
|
<td class="icon"><span class="dashicons dashicons-menu post-state-format"></span></td>
|
||||||
<input class="small-text sp-player-number-input" type="text" name="sp_players[<?php echo $team_id; ?>][<?php echo $player_id; ?>][number]" value="<?php echo $value; ?>" />
|
<?php } ?>
|
||||||
</td>
|
<?php if ( $numbers ) { ?>
|
||||||
|
<td>
|
||||||
|
<input class="small-text sp-player-number-input" type="text" name="sp_players[<?php echo $team_id; ?>][<?php echo $player_id; ?>][number]" value="<?php echo $value; ?>" />
|
||||||
|
</td>
|
||||||
|
<?php } ?>
|
||||||
<td><?php echo get_the_title( $player_id ); ?></td>
|
<td><?php echo get_the_title( $player_id ); ?></td>
|
||||||
<?php if ( $positions ) { ?>
|
<?php if ( $positions ) { ?>
|
||||||
<td>
|
<td>
|
||||||
@@ -198,34 +273,12 @@ class SP_Meta_Box_Event_Performance {
|
|||||||
<input class="sp-player-<?php echo $column; ?>-input" type="text" name="sp_players[<?php echo $team_id; ?>][<?php echo $player_id; ?>][<?php echo $column; ?>]" value="<?php echo $value; ?>" placeholder="0" />
|
<input class="sp-player-<?php echo $column; ?>-input" type="text" name="sp_players[<?php echo $team_id; ?>][<?php echo $player_id; ?>][<?php echo $column; ?>]" value="<?php echo $value; ?>" placeholder="0" />
|
||||||
</td>
|
</td>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<?php if ( $team_id ): ?>
|
<?php if ( $status ) { ?>
|
||||||
<td class="sp-status-selector">
|
<td class="sp-status-selector">
|
||||||
<?php echo self::status_select( $team_id, $player_id, sp_array_value( $player_performance, 'status', null ) ); ?>
|
<?php echo self::status_select( $team_id, $player_id, sp_array_value( $player_performance, 'status', null ) ); ?>
|
||||||
<?php echo self::sub_select( $team_id, $player_id, sp_array_value( $player_performance, 'sub', null ), $data ); ?>
|
<?php echo self::sub_select( $team_id, $player_id, sp_array_value( $player_performance, 'sub', null ), $data ); ?>
|
||||||
</td>
|
</td>
|
||||||
<?php else: ?>
|
<?php } ?>
|
||||||
<td>
|
|
||||||
<?php
|
|
||||||
$values = sp_array_value( $player_performance, 'outcome', '' );
|
|
||||||
if ( ! is_array( $values ) )
|
|
||||||
$values = array( $values );
|
|
||||||
|
|
||||||
$args = array(
|
|
||||||
'post_type' => '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 );
|
|
||||||
?>
|
|
||||||
</td>
|
|
||||||
<?php endif; ?>
|
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,8 +11,12 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
|||||||
|
|
||||||
// Initialize totals
|
// Initialize totals
|
||||||
$totals = array();
|
$totals = array();
|
||||||
|
|
||||||
|
// Set null
|
||||||
|
if ( ! isset( $position ) ) $position = null;
|
||||||
|
if ( ! isset( $class ) ) $class = null;
|
||||||
?>
|
?>
|
||||||
<div class="sp-template sp-template-event-performance sp-template-event-performance-combined sp-template-event-performance-<?php echo $mode; ?>">
|
<div class="sp-template sp-template-event-performance sp-template-event-performance-combined sp-template-event-performance-<?php echo $mode; ?><?php if ( isset( $class ) ) { echo ' ' . $class; } ?>">
|
||||||
<?php if ( $caption ): ?>
|
<?php if ( $caption ): ?>
|
||||||
<h4 class="sp-table-caption"><?php echo $caption; ?></h4>
|
<h4 class="sp-table-caption"><?php echo $caption; ?></h4>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
@@ -113,9 +117,10 @@ $totals = array();
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</tbody>
|
</tbody>
|
||||||
<?php if ( $show_total ): ?>
|
<?php if ( apply_filters( 'sportspress_event_performance_show_footer', $show_total ) ): ?>
|
||||||
<?php if ( ! $primary || sizeof( array_intersect_key( $totals, array_flip( (array) $primary ) ) ) ): ?>
|
<tfoot>
|
||||||
<tfoot>
|
<?php do_action( 'sportspress_event_performance_table_footer', $data, $labels, $position, $performance_ids ); ?>
|
||||||
|
<?php if ( $show_total && ( ! $primary || sizeof( array_intersect_key( $totals, array_flip( (array) $primary ) ) ) ) ): ?>
|
||||||
<tr class="' . ( $i % 2 == 0 ? 'odd' : 'even' ) . '">
|
<tr class="' . ( $i % 2 == 0 ? 'odd' : 'even' ) . '">
|
||||||
<?php
|
<?php
|
||||||
if ( isset( $labels['number'] ) ):
|
if ( isset( $labels['number'] ) ):
|
||||||
@@ -123,7 +128,7 @@ $totals = array();
|
|||||||
endif;
|
endif;
|
||||||
echo '<td class="data-name">' . __( 'Total', 'sportspress' ) . '</td>';
|
echo '<td class="data-name">' . __( 'Total', 'sportspress' ) . '</td>';
|
||||||
|
|
||||||
$row = sp_array_value( $data, 0, array() );
|
$row = sp_array_value( $data, 1, array() );
|
||||||
|
|
||||||
if ( $mode == 'icons' ) echo '<td class="sp-performance-icons">';
|
if ( $mode == 'icons' ) echo '<td class="sp-performance-icons">';
|
||||||
|
|
||||||
@@ -155,8 +160,8 @@ $totals = array();
|
|||||||
if ( $mode == 'icons' ) echo '</td>';
|
if ( $mode == 'icons' ) echo '</td>';
|
||||||
?>
|
?>
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
<?php endif; ?>
|
||||||
<?php endif; ?>
|
</tfoot>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -155,11 +155,11 @@ if ( ! isset( $class ) ) $class = null;
|
|||||||
?>
|
?>
|
||||||
</tbody>
|
</tbody>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if ( $show_total ): ?>
|
<?php if ( apply_filters( 'sportspress_event_performance_show_footer', $show_total ) ): ?>
|
||||||
<<?php echo ( $show_players ? 'tfoot' : 'tbody' ); ?>>
|
<<?php echo ( $show_players ? 'tfoot' : 'tbody' ); ?>>
|
||||||
<?php
|
<?php
|
||||||
do_action( 'sportspress_event_performance_table_footer', $data, $labels, $position, $performance_ids );
|
do_action( 'sportspress_event_performance_table_footer', $data, $labels, $position, $performance_ids );
|
||||||
if ( ! $primary || sizeof( array_intersect_key( $totals, array_flip( (array) $primary ) ) ) ) {
|
if ( $show_total && ( ! $primary || sizeof( array_intersect_key( $totals, array_flip( (array) $primary ) ) ) ) ) {
|
||||||
?>
|
?>
|
||||||
<tr class="sp-total-row <?php echo ( $i % 2 == 0 ? 'odd' : 'even' ); ?>">
|
<tr class="sp-total-row <?php echo ( $i % 2 == 0 ? 'odd' : 'even' ); ?>">
|
||||||
<?php
|
<?php
|
||||||
|
|||||||
Reference in New Issue
Block a user