Fix HTML for staff in event performance table

This commit is contained in:
Nabil Kadimi
2019-04-27 00:17:36 +01:00
parent 81b4f0143b
commit 8a23c7c792
2 changed files with 11 additions and 8 deletions

View File

@@ -68,8 +68,8 @@ $i = 0;
foreach ( $subs as $sub_id => $sub ): foreach ( $subs as $sub_id => $sub ):
if ( ! $sub_id ) if ( ! $sub_id )
continue; continue;
$index = sp_array_value( $sub, 'sub', 0 ); $i = sp_array_value( $sub, 'sub', 0 );
$lineup_sub_relation[ $index ] = $sub_id; $lineup_sub_relation[ $i ] = $sub_id;
endforeach; endforeach;
$data = apply_filters( 'sportspress_event_performance_players', $data, $lineups, $subs, $mode ); $data = apply_filters( 'sportspress_event_performance_players', $data, $lineups, $subs, $mode );
@@ -274,7 +274,11 @@ $i = 0;
</<?php echo ( $show_players ? 'tfoot' : 'tbody' ); ?>> </<?php echo ( $show_players ? 'tfoot' : 'tbody' ); ?>>
<?php endif; ?> <?php endif; ?>
</table> </table>
<?php
if ( $show_staff ) {
echo sp_get_template( 'event-staff.php', array( 'id' => $id, 'index' => $index ) );
}
?>
</div> </div>
<?php do_action( 'sportspress_after_event_performance_table', $data, $lineups, $subs, $class ); ?> <?php do_action( 'sportspress_after_event_performance_table', $data, $lineups, $subs, $class ); ?>
</div> </div>

View File

@@ -236,6 +236,7 @@ if ( is_array( $teams ) ):
'performance_ids' => isset( $performance_ids ) ? $performance_ids : null, 'performance_ids' => isset( $performance_ids ) ? $performance_ids : null,
'primary' => 'primary' == $total ? $primary : null, 'primary' => 'primary' == $total ? $primary : null,
'class' => 'sp-template-event-performance-team-' . $index . ' sp-template-event-performance-section sp-template-event-performance-section-' . $section_id . ' sp-template-event-performance-team-' . $index . '-section-' . $section_id, 'class' => 'sp-template-event-performance-team-' . $index . ' sp-template-event-performance-section sp-template-event-performance-section-' . $section_id . ' sp-template-event-performance-team-' . $index . '-section-' . $section_id,
'show_staff' => $show_staff,
) ); ) );
} }
@@ -256,9 +257,12 @@ if ( is_array( $teams ) ):
} }
sp_get_template( 'event-performance-table.php', array( sp_get_template( 'event-performance-table.php', array(
'id' => $id,
'index' => $index,
'scrollable' => $scrollable, 'scrollable' => $scrollable,
'sortable' => $sortable, 'sortable' => $sortable,
'show_players' => $show_team_players, 'show_players' => $show_team_players,
'show_staff' => $show_staff,
'show_numbers' => $show_numbers, 'show_numbers' => $show_numbers,
'show_minutes' => $show_minutes, 'show_minutes' => $show_minutes,
'show_total' => $show_total, 'show_total' => $show_total,
@@ -272,14 +276,9 @@ if ( is_array( $teams ) ):
'link_posts' => $link_posts, 'link_posts' => $link_posts,
'performance_ids' => isset( $performance_ids ) ? $performance_ids : null, 'performance_ids' => isset( $performance_ids ) ? $performance_ids : null,
'primary' => 'primary' == $total ? $primary : null, 'primary' => 'primary' == $total ? $primary : null,
) ); ) );
} }
} }
if ( $show_staff ):
sp_get_template( 'event-staff.php', array( 'id' => $id, 'index' => $index ) );
endif;
} }
?> ?>
<?php <?php