diff --git a/includes/admin/post-types/class-sp-admin-cpt-performance.php b/includes/admin/post-types/class-sp-admin-cpt-performance.php
index e17bd12f..72a836e5 100644
--- a/includes/admin/post-types/class-sp-admin-cpt-performance.php
+++ b/includes/admin/post-types/class-sp-admin-cpt-performance.php
@@ -43,6 +43,8 @@ class SP_Admin_CPT_Performance extends SP_Admin_CPT {
'sp_icon' => __( 'Icon', 'sportspress' ),
'title' => __( 'Label', 'sportspress' ),
'sp_key' => __( 'Variable', 'sportspress' ),
+ 'sp_section' => __( 'Category', 'sportspress' ),
+ 'sp_config_format' => __( 'Format', 'sportspress' ),
'sp_description' => __( 'Description', 'sportspress' ),
);
return apply_filters( 'sportspress_performance_admin_columns', $columns );
@@ -61,6 +63,14 @@ class SP_Admin_CPT_Performance extends SP_Admin_CPT {
global $post;
echo $post->post_name;
break;
+ case 'sp_section':
+ global $post;
+ echo sp_get_post_section( $post->ID );
+ break;
+ case 'sp_config_format':
+ global $post;
+ echo sp_get_post_format( $post->ID );
+ break;
case 'sp_description':
global $post;
echo '' . $post->post_excerpt . '';
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 bdda9245..f307fcc2 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
@@ -20,19 +20,7 @@ class SP_Meta_Box_Event_Performance {
*/
public static function output( $post ) {
$event = new SP_Event( $post );
- list( $labels, $columns, $stats, $teams ) = $event->performance( true );
-
- // Determine if we are splitting positions
- if ( 'yes' == get_option( 'sportspress_event_split_players_by_position', 'no' ) )
- $split_positions = true;
- 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;
+ list( $labels, $columns, $stats, $teams, $formats ) = $event->performance( true );
// Determine if columns are auto or manual
if ( 'manual' == get_option( 'sportspress_event_performance_columns', 'auto' ) )
@@ -48,7 +36,7 @@ class SP_Meta_Box_Event_Performance {
// Get positions
$positions = array();
- if ( taxonomy_exists( 'sp_position' ) ):
+ if ( 'yes' == get_option( 'sportspress_event_show_position', 'yes' ) && taxonomy_exists( 'sp_position' ) ):
$args = array(
'hide_empty' => false,
'parent' => 0,
@@ -66,7 +54,7 @@ class SP_Meta_Box_Event_Performance {
// Apply filters to labels
$labels = apply_filters( 'sportspress_event_performance_labels_admin', $labels );
- self::tables( $post->ID, $stats, $labels, $columns, $teams, $has_checkboxes, $split_positions, $split_teams, $positions, $status );
+ self::tables( $post->ID, $stats, $labels, $columns, $teams, $has_checkboxes, $positions, $status, $formats );
}
/**
@@ -80,95 +68,96 @@ class SP_Meta_Box_Event_Performance {
/**
* 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 ) {
+ public static function tables( $post_id, $stats = array(), $labels = array(), $columns = array(), $teams = array(), $has_checkboxes = false, $positions = array(), $status = true, $formats = array() ) {
+ $sections = get_option( 'sportspress_event_performance_sections', -1 );
+
$i = 0;
- if ( $split_teams ) {
- foreach ( $teams as $key => $team_id ):
- if ( -1 == $team_id ) continue;
-
+ foreach ( $teams as $key => $team_id ):
+ if ( -1 == $team_id ) continue;
+
+ if ( -1 == $sections ) {
// 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() ) );
-
- $tabs = array();
-
- if ( $team_id ):
- $tabs['values'] = get_the_title( $team_id );
- elseif ( $i ):
- echo '
';
- endif;
-
- $tabs = apply_filters( 'sportspress_event_performance_tabs_admin', $tabs );
?>
- - - +
+
—
+ + +—
+ + +| readonly="readonly"value="" /> | +@@ -256,7 +245,7 @@ class SP_Meta_Box_Event_Performance { /** * Admin edit table row */ - 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 ) { + 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, $section = -1, $formats = array() ) { if ( $player_id <= 0 ) return; $number = get_post_meta( $player_id, 'sp_number', true ); @@ -296,9 +285,10 @@ class SP_Meta_Box_Event_Performance { $label ): $value = sp_array_value( $player_performance, $column, '' ); + $placeholder = sp_get_format_placeholder( sp_array_value( $formats, $column, 'number' ) ); ?> | - + | diff --git a/includes/admin/views/html-admin-config.php b/includes/admin/views/html-admin-config.php index 0f418e6c..fc84324a 100644 --- a/includes/admin/views/html-admin-config.php +++ b/includes/admin/views/html-admin-config.php @@ -162,7 +162,8 @@- | + | + | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| > | - | |||||||||||||
| + | ||||||||||||||