Use primary performance in totals row when teams combined
This commit is contained in:
@@ -112,43 +112,47 @@ $totals = array();
|
|||||||
?>
|
?>
|
||||||
</tbody>
|
</tbody>
|
||||||
<?php if ( $show_total ): ?>
|
<?php if ( $show_total ): ?>
|
||||||
<tfoot>
|
<?php if ( ! $primary || sizeof( array_intersect_key( $totals, array_flip( (array) $primary ) ) ) ): ?>
|
||||||
<tr class="' . ( $i % 2 == 0 ? 'odd' : 'even' ) . '">
|
<tfoot>
|
||||||
<?php
|
<tr class="' . ( $i % 2 == 0 ? 'odd' : 'even' ) . '">
|
||||||
if ( isset( $labels['number'] ) ):
|
<?php
|
||||||
echo '<td class="data-number"> </td>';
|
if ( isset( $labels['number'] ) ):
|
||||||
endif;
|
echo '<td class="data-number"> </td>';
|
||||||
echo '<td class="data-name">' . __( 'Total', 'sportspress' ) . '</td>';
|
|
||||||
|
|
||||||
$row = sp_array_value( $data, 0, array() );
|
|
||||||
|
|
||||||
if ( $mode == 'icons' ) echo '<td class="sp-performance-icons">';
|
|
||||||
|
|
||||||
foreach ( $labels as $key => $label ):
|
|
||||||
if ( in_array( $key, array( 'number', 'name' ) ) )
|
|
||||||
continue;
|
|
||||||
if ( $key == 'position' ):
|
|
||||||
$value = '—';
|
|
||||||
elseif ( array_key_exists( $key, $row ) && $row[ $key ] != '' ):
|
|
||||||
$value = $row[ $key ];
|
|
||||||
else:
|
|
||||||
$value = sp_array_value( $totals, $key, 0 );
|
|
||||||
endif;
|
endif;
|
||||||
|
echo '<td class="data-name">' . __( 'Total', 'sportspress' ) . '</td>';
|
||||||
|
|
||||||
if ( $mode == 'values' ):
|
$row = sp_array_value( $data, 0, array() );
|
||||||
echo '<td class="data-' . $key . '">' . $value . '</td>';
|
|
||||||
elseif ( intval( $value ) && $mode == 'icons' ):
|
if ( $mode == 'icons' ) echo '<td class="sp-performance-icons">';
|
||||||
$performance_id = sp_array_value( $performance_ids, $key, null );
|
|
||||||
if ( $performance_id && has_post_thumbnail( $performance_id ) ):
|
foreach ( $labels as $key => $label ):
|
||||||
echo str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini' ) . ' ', $value );
|
if ( in_array( $key, array( 'number', 'name' ) ) )
|
||||||
|
continue;
|
||||||
|
if ( $key == 'position' ):
|
||||||
|
$value = '—';
|
||||||
|
elseif ( $primary && $key !== $primary ):
|
||||||
|
$value = ' ';
|
||||||
|
elseif ( array_key_exists( $key, $row ) && $row[ $key ] != '' ):
|
||||||
|
$value = $row[ $key ];
|
||||||
|
else:
|
||||||
|
$value = sp_array_value( $totals, $key, 0 );
|
||||||
endif;
|
endif;
|
||||||
endif;
|
|
||||||
endforeach;
|
|
||||||
|
|
||||||
if ( $mode == 'icons' ) echo '</td>';
|
if ( $mode == 'values' ):
|
||||||
?>
|
echo '<td class="data-' . $key . '">' . $value . '</td>';
|
||||||
</tr>
|
elseif ( intval( $value ) && $mode == 'icons' ):
|
||||||
</tfoot>
|
$performance_id = sp_array_value( $performance_ids, $key, null );
|
||||||
|
if ( $performance_id && has_post_thumbnail( $performance_id ) ):
|
||||||
|
echo str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini' ) . ' ', $value );
|
||||||
|
endif;
|
||||||
|
endif;
|
||||||
|
endforeach;
|
||||||
|
|
||||||
|
if ( $mode == 'icons' ) echo '</td>';
|
||||||
|
?>
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
<?php endif; ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user