From 4fe9525a8a863356020079cbd9d158ecc32446e2 Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Thu, 14 Aug 2014 18:54:55 +1000 Subject: [PATCH] Remove mode setting and unused thumbnail sizes --- includes/admin/class-sp-admin-assets.php | 5 - includes/admin/class-sp-admin-settings.php | 7 +- includes/admin/class-sp-admin-welcome.php | 18 -- .../post-types/class-sp-admin-meta-boxes.php | 8 +- .../class-sp-meta-box-event-teams.php | 18 +- .../settings/class-sp-settings-general.php | 20 +- .../settings/class-sp-settings-players.php | 10 +- includes/class-sp-post-types.php | 174 +++++++++--------- includes/sp-core-functions.php | 19 +- includes/sp-template-functions.php | 2 +- sportspress.php | 63 +------ templates/event-details.php | 3 +- templates/event-list.php | 3 +- templates/event-performance.php | 3 +- templates/event-results.php | 3 +- templates/league-table.php | 3 +- templates/player-list.php | 3 +- templates/player-statistics.php | 6 +- templates/team-columns.php | 3 +- 19 files changed, 137 insertions(+), 234 deletions(-) diff --git a/includes/admin/class-sp-admin-assets.php b/includes/admin/class-sp-admin-assets.php index ae5471c2..d6f8b77c 100755 --- a/includes/admin/class-sp-admin-assets.php +++ b/includes/admin/class-sp-admin-assets.php @@ -59,11 +59,6 @@ class SP_Admin_Assets { wp_enqueue_style( 'sportspress-admin-equation-styles', SP()->plugin_url() . '/assets/css/equation.css', array(), SP_VERSION ); } - if ( SP()->mode == 'player' ): - $custom_css = '#adminmenu #menu-posts-sp_team .menu-icon-sp_team div.wp-menu-image:before,.sp-icon-shield:before{content: "\f307"}'; - wp_add_inline_style( 'sportspress-admin-menu-styles', $custom_css ); - endif; - do_action( 'sportspress_admin_css' ); } diff --git a/includes/admin/class-sp-admin-settings.php b/includes/admin/class-sp-admin-settings.php index 70de5878..2525370a 100644 --- a/includes/admin/class-sp-admin-settings.php +++ b/includes/admin/class-sp-admin-settings.php @@ -34,11 +34,8 @@ class SP_Admin_Settings { $settings[] = include( 'settings/class-sp-settings-general.php' ); $settings[] = include( 'settings/class-sp-settings-events.php' ); $settings[] = include( 'settings/class-sp-settings-teams.php' ); - - if ( SP()->mode == 'team' ): - $settings[] = include( 'settings/class-sp-settings-players.php' ); - $settings[] = include( 'settings/class-sp-settings-staff.php' ); - endif; + $settings[] = include( 'settings/class-sp-settings-players.php' ); + $settings[] = include( 'settings/class-sp-settings-staff.php' ); $settings = apply_filters( 'sportspress_get_settings_pages', $settings ); diff --git a/includes/admin/class-sp-admin-welcome.php b/includes/admin/class-sp-admin-welcome.php index dd017c5e..053470a0 100644 --- a/includes/admin/class-sp-admin-welcome.php +++ b/includes/admin/class-sp-admin-welcome.php @@ -181,10 +181,6 @@ class SP_Admin_Welcome { // Save settings if ( isset( $_POST['timezone_string'] ) ): update_option( 'timezone_string', $_POST['timezone_string'] ); - endif; - if ( isset( $_POST['sportspress_mode'] ) && ! empty( $_POST['sportspress_mode'] ) && get_option( 'sportspress_mode', null ) != $_POST['sportspress_mode'] ): - $sport = $_POST['sportspress_mode']; - update_option( 'sportspress_mode', $_POST['sportspress_mode'] ); endif; if ( isset( $_POST['sportspress_sport'] ) && ! empty( $_POST['sportspress_sport'] ) && get_option( 'sportspress_sport', null ) != $_POST['sportspress_sport'] ): $sport = $_POST['sportspress_sport']; @@ -235,20 +231,6 @@ class SP_Admin_Welcome { )); SP_Admin_Settings::output_fields( $settings ); ?> -

- 'sportspress_mode', - 'default' => 'team', - 'type' => 'select', - 'class' => $class, - 'options' => array( - 'team' => _x( 'Team', 'mode select', 'sportspress' ), - 'player' => _x( 'Individual', 'mode select', 'sportspress' ), - ), - )); - SP_Admin_Settings::output_fields( $settings ); - ?>

diff --git a/includes/admin/post-types/class-sp-admin-meta-boxes.php b/includes/admin/post-types/class-sp-admin-meta-boxes.php index 022cb8e7..31498857 100644 --- a/includes/admin/post-types/class-sp-admin-meta-boxes.php +++ b/includes/admin/post-types/class-sp-admin-meta-boxes.php @@ -52,7 +52,7 @@ class SP_Admin_Meta_Boxes { add_action( 'sportspress_process_sp_event_meta', 'SP_Meta_Box_Event_Teams::save', 30, 2 ); add_action( 'sportspress_process_sp_event_meta', 'SP_Meta_Box_Event_Video::save', 40, 2 ); add_action( 'sportspress_process_sp_event_meta', 'SP_Meta_Box_Event_Results::save', 50, 2 ); - if ( SP()->mode == 'team' ) add_action( 'sportspress_process_sp_event_meta', 'SP_Meta_Box_Event_Performance::save', 60, 2 ); + add_action( 'sportspress_process_sp_event_meta', 'SP_Meta_Box_Event_Performance::save', 60, 2 ); // Save Calendar Meta Boxes add_action( 'sportspress_process_sp_calendar_meta', 'SP_Meta_Box_Calendar_Format::save', 10, 2 ); @@ -62,7 +62,7 @@ class SP_Admin_Meta_Boxes { // Save Team Meta Boxes add_action( 'sportspress_process_sp_team_meta', 'SP_Meta_Box_Team_Details::save', 10, 2 ); add_action( 'sportspress_process_sp_team_meta', 'SP_Meta_Box_Team_Columns::save', 20, 2 ); - if ( SP()->mode == 'team' ) add_action( 'sportspress_process_sp_team_meta', 'SP_Meta_Box_Team_Lists::save', 30, 2 ); + add_action( 'sportspress_process_sp_team_meta', 'SP_Meta_Box_Team_Lists::save', 30, 2 ); // Save Table Meta Boxes add_action( 'sportspress_process_sp_table_meta', 'SP_Meta_Box_Table_Details::save', 10, 2 ); @@ -124,7 +124,7 @@ class SP_Admin_Meta_Boxes { add_meta_box( 'sp_videodiv', __( 'Video', 'sportspress' ), 'SP_Meta_Box_Event_Video::output', 'sp_event', 'side', 'low' ); if ( sizeof( array_filter( sp_array_value( $post_meta, 'sp_team', array() ) ) ) ): add_meta_box( 'sp_resultsdiv', __( 'Team Results', 'sportspress' ), 'SP_Meta_Box_Event_Results::output', 'sp_event', 'normal', 'high' ); - if ( SP()->mode == 'team' ) add_meta_box( 'sp_performancediv', __( 'Player Performance', 'sportspress' ), 'SP_Meta_Box_Event_Performance::output', 'sp_event', 'normal', 'high' ); + add_meta_box( 'sp_performancediv', __( 'Player Performance', 'sportspress' ), 'SP_Meta_Box_Event_Performance::output', 'sp_event', 'normal', 'high' ); endif; add_meta_box( 'sp_editordiv', __( 'Article', 'sportspress' ), 'SP_Meta_Box_Event_Editor::output', 'sp_event', 'normal', 'low' ); @@ -139,7 +139,7 @@ class SP_Admin_Meta_Boxes { add_meta_box( 'sp_detailsdiv', __( 'Details', 'sportspress' ), 'SP_Meta_Box_Team_Details::output', 'sp_team', 'side', 'default' ); if ( isset( $post ) && isset( $post->ID ) ): if ( get_the_terms( $post->ID, 'sp_league' ) && get_the_terms( $post->ID, 'sp_season' ) ) add_meta_box( 'sp_columnssdiv', __( 'Table Columns', 'sportspress' ), 'SP_Meta_Box_Team_Columns::output', 'sp_team', 'normal', 'high' ); - if ( SP()->mode == 'team' ) add_meta_box( 'sp_listsdiv', __( 'Player Lists', 'sportspress' ), 'SP_Meta_Box_Team_Lists::output', 'sp_team', 'normal', 'high' ); + add_meta_box( 'sp_listsdiv', __( 'Player Lists', 'sportspress' ), 'SP_Meta_Box_Team_Lists::output', 'sp_team', 'normal', 'high' ); endif; add_meta_box( 'sp_editordiv', __( 'Profile', 'sportspress' ), 'SP_Meta_Box_Team_Editor::output', 'sp_team', 'normal', 'low' ); diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php index df53f3f8..5b3d4523 100644 --- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php @@ -37,17 +37,13 @@ class SP_Meta_Box_Event_Teams { wp_dropdown_pages( $args ); ?>

- mode == 'team' ): - ?> - - ID, 'sp_player', 'block', 'sp_current_team', $i ); - sp_post_checklist( $post->ID, 'sp_staff', 'none', 'sp_current_team', $i ); - endif; + + ID, 'sp_player', 'block', 'sp_current_team', $i ); + sp_post_checklist( $post->ID, 'sp_staff', 'none', 'sp_current_team', $i ); ?> $presets, ), - array( - 'title' => __( 'Mode', 'sportspress' ), - 'id' => 'sportspress_mode', - 'default' => 'team', - 'type' => 'select', - 'options' => array( - 'team' => _x( 'Team', 'mode select', 'sportspress' ), - 'player' => _x( 'Individual', 'mode select', 'sportspress' ), - ), - ), - array( 'title' => __( 'Google Maps', 'sportspress' ), 'id' => 'sportspress_map_type', @@ -141,6 +130,15 @@ class SP_Settings_General extends SP_Settings_Page { 'desc_tip' => __( 'This will enable a script allowing the tables to be sortable.', 'sportspress' ), ), + array( + 'desc' => __( 'Scrollable tables', 'sportspress' ), + 'id' => 'sportspress_enable_scrollable_tables', + 'default' => 'yes', + 'type' => 'checkbox', + 'checkboxgroup' => '', + 'desc_tip' => __( 'This will enable a script allowing the tables to be scrollable.', 'sportspress' ), + ), + array( 'desc' => __( 'Live countdowns', 'sportspress' ), 'id' => 'sportspress_enable_live_countdowns', diff --git a/includes/admin/settings/class-sp-settings-players.php b/includes/admin/settings/class-sp-settings-players.php index b4f1e4a3..67c1e3f6 100644 --- a/includes/admin/settings/class-sp-settings-players.php +++ b/includes/admin/settings/class-sp-settings-players.php @@ -57,19 +57,15 @@ class SP_Settings_Players extends SP_Settings_Page { 'default' => 'yes', 'type' => 'checkbox', ), - ); - if ( SP()->mode == 'team' ): - $settings[] = array( + array( 'title' => __( 'Teams', 'sportspress' ), 'desc' => __( 'Link teams', 'sportspress' ), 'id' => 'sportspress_list_link_teams', 'default' => 'no', 'type' => 'checkbox', - ); - endif; + ), - $settings = array_merge( $settings, array( array( 'title' => __( 'Pagination', 'sportspress' ), 'desc' => __( 'Paginate', 'sportspress' ), @@ -92,7 +88,7 @@ class SP_Settings_Players extends SP_Settings_Page { ), array( 'type' => 'sectionend', 'id' => 'list_options' ), - )); // End player settings + ); // End player settings return apply_filters( 'sportspress_player_settings', $settings ); } diff --git a/includes/class-sp-post-types.php b/includes/class-sp-post-types.php index a81a2a01..72986419 100644 --- a/includes/class-sp-post-types.php +++ b/includes/class-sp-post-types.php @@ -456,99 +456,97 @@ class SP_Post_types { ) ); - if ( SP()->mode == 'team' ): - register_post_type( 'sp_player', - apply_filters( 'sportspress_register_post_type_player', - array( - 'labels' => array( - 'name' => __( 'Players', 'sportspress' ), - 'singular_name' => __( 'Player', 'sportspress' ), - 'add_new_item' => __( 'Add New Player', 'sportspress' ), - 'edit_item' => __( 'Edit Player', 'sportspress' ), - 'new_item' => __( 'New', 'sportspress' ), - 'view_item' => __( 'View Player', 'sportspress' ), - 'search_items' => __( 'Search', 'sportspress' ), - 'not_found' => __( 'No results found.', 'sportspress' ), - 'not_found_in_trash' => __( 'No results found.', 'sportspress' ), - ), - 'public' => true, - 'show_ui' => true, - 'capability_type' => 'sp_player', - 'map_meta_cap' => true, - 'publicly_queryable' => true, - 'exclude_from_search' => false, - 'hierarchical' => false, - 'rewrite' => array( 'slug' => get_option( 'sportspress_player_slug', 'player' ) ), - 'supports' => array( 'title', 'author', 'thumbnail', 'excerpt', 'page-attributes' ), - 'has_archive' => false, - 'show_in_nav_menus' => true, - 'menu_icon' => 'dashicons-groups', - ) + register_post_type( 'sp_player', + apply_filters( 'sportspress_register_post_type_player', + array( + 'labels' => array( + 'name' => __( 'Players', 'sportspress' ), + 'singular_name' => __( 'Player', 'sportspress' ), + 'add_new_item' => __( 'Add New Player', 'sportspress' ), + 'edit_item' => __( 'Edit Player', 'sportspress' ), + 'new_item' => __( 'New', 'sportspress' ), + 'view_item' => __( 'View Player', 'sportspress' ), + 'search_items' => __( 'Search', 'sportspress' ), + 'not_found' => __( 'No results found.', 'sportspress' ), + 'not_found_in_trash' => __( 'No results found.', 'sportspress' ), + ), + 'public' => true, + 'show_ui' => true, + 'capability_type' => 'sp_player', + 'map_meta_cap' => true, + 'publicly_queryable' => true, + 'exclude_from_search' => false, + 'hierarchical' => false, + 'rewrite' => array( 'slug' => get_option( 'sportspress_player_slug', 'player' ) ), + 'supports' => array( 'title', 'author', 'thumbnail', 'excerpt', 'page-attributes' ), + 'has_archive' => false, + 'show_in_nav_menus' => true, + 'menu_icon' => 'dashicons-groups', ) - ); + ) + ); - register_post_type( 'sp_list', - apply_filters( 'sportspress_register_post_type_list', - array( - 'labels' => array( - 'name' => __( 'Player Lists', 'sportspress' ), - 'singular_name' => __( 'Player List', 'sportspress' ), - 'add_new_item' => __( 'Add New Player List', 'sportspress' ), - 'edit_item' => __( 'Edit Player List', 'sportspress' ), - 'new_item' => __( 'New', 'sportspress' ), - 'view_item' => __( 'View Player List', 'sportspress' ), - 'search_items' => __( 'Search', 'sportspress' ), - 'not_found' => __( 'No results found.', 'sportspress' ), - 'not_found_in_trash' => __( 'No results found.', 'sportspress' ), - ), - 'public' => true, - 'show_ui' => true, - 'capability_type' => 'sp_list', - 'map_meta_cap' => true, - 'publicly_queryable' => true, - 'exclude_from_search' => false, - 'hierarchical' => false, - 'rewrite' => array( 'slug' => get_option( 'sportspress_list_slug', 'list' ) ), - 'supports' => array( 'title', 'page-attributes', 'author', 'thumbnail' ), - 'has_archive' => false, - 'show_in_nav_menus' => true, - 'show_in_menu' => 'edit.php?post_type=sp_player', - 'show_in_admin_bar' => true, - ) + register_post_type( 'sp_list', + apply_filters( 'sportspress_register_post_type_list', + array( + 'labels' => array( + 'name' => __( 'Player Lists', 'sportspress' ), + 'singular_name' => __( 'Player List', 'sportspress' ), + 'add_new_item' => __( 'Add New Player List', 'sportspress' ), + 'edit_item' => __( 'Edit Player List', 'sportspress' ), + 'new_item' => __( 'New', 'sportspress' ), + 'view_item' => __( 'View Player List', 'sportspress' ), + 'search_items' => __( 'Search', 'sportspress' ), + 'not_found' => __( 'No results found.', 'sportspress' ), + 'not_found_in_trash' => __( 'No results found.', 'sportspress' ), + ), + 'public' => true, + 'show_ui' => true, + 'capability_type' => 'sp_list', + 'map_meta_cap' => true, + 'publicly_queryable' => true, + 'exclude_from_search' => false, + 'hierarchical' => false, + 'rewrite' => array( 'slug' => get_option( 'sportspress_list_slug', 'list' ) ), + 'supports' => array( 'title', 'page-attributes', 'author', 'thumbnail' ), + 'has_archive' => false, + 'show_in_nav_menus' => true, + 'show_in_menu' => 'edit.php?post_type=sp_player', + 'show_in_admin_bar' => true, ) - ); + ) + ); - register_post_type( 'sp_staff', - apply_filters( 'sportspress_register_post_type_staff', - array( - 'labels' => array( - 'name' => __( 'Staff', 'sportspress' ), - 'singular_name' => __( 'Staff', 'sportspress' ), - 'add_new_item' => __( 'Add New Staff', 'sportspress' ), - 'edit_item' => __( 'Edit Staff', 'sportspress' ), - 'new_item' => __( 'New', 'sportspress' ), - 'view_item' => __( 'View Staff', 'sportspress' ), - 'search_items' => __( 'Search', 'sportspress' ), - 'not_found' => __( 'No results found.', 'sportspress' ), - 'not_found_in_trash' => __( 'No results found.', 'sportspress' ), - ), - 'public' => true, - 'show_ui' => true, - 'capability_type' => 'sp_staff', - 'map_meta_cap' => true, - 'publicly_queryable' => true, - 'exclude_from_search' => false, - 'hierarchical' => false, - 'rewrite' => array( 'slug' => get_option( 'sportspress_staff_slug', 'staff' ) ), - 'supports' => array( 'title', 'author', 'thumbnail', 'excerpt' ), - 'has_archive' => false, - 'show_in_nav_menus' => true, - 'show_in_menu' => 'edit.php?post_type=sp_player', - 'show_in_admin_bar' => true, - ) + register_post_type( 'sp_staff', + apply_filters( 'sportspress_register_post_type_staff', + array( + 'labels' => array( + 'name' => __( 'Staff', 'sportspress' ), + 'singular_name' => __( 'Staff', 'sportspress' ), + 'add_new_item' => __( 'Add New Staff', 'sportspress' ), + 'edit_item' => __( 'Edit Staff', 'sportspress' ), + 'new_item' => __( 'New', 'sportspress' ), + 'view_item' => __( 'View Staff', 'sportspress' ), + 'search_items' => __( 'Search', 'sportspress' ), + 'not_found' => __( 'No results found.', 'sportspress' ), + 'not_found_in_trash' => __( 'No results found.', 'sportspress' ), + ), + 'public' => true, + 'show_ui' => true, + 'capability_type' => 'sp_staff', + 'map_meta_cap' => true, + 'publicly_queryable' => true, + 'exclude_from_search' => false, + 'hierarchical' => false, + 'rewrite' => array( 'slug' => get_option( 'sportspress_staff_slug', 'staff' ) ), + 'supports' => array( 'title', 'author', 'thumbnail', 'excerpt' ), + 'has_archive' => false, + 'show_in_nav_menus' => true, + 'show_in_menu' => 'edit.php?post_type=sp_player', + 'show_in_admin_bar' => true, ) - ); - endif; + ) + ); } public function display_scheduled_events( $posts ) { diff --git a/includes/sp-core-functions.php b/includes/sp-core-functions.php index 8d35f5fc..9596fb47 100644 --- a/includes/sp-core-functions.php +++ b/includes/sp-core-functions.php @@ -1066,19 +1066,25 @@ if ( !function_exists( 'sp_get_next_event' ) ) { function sp_get_text_options() { $strings = apply_filters( 'sportspress_text', array( __( 'Article', 'sportspress' ), + __( 'Current Team', 'sportspress' ), __( 'Date', 'sportspress' ), __( 'Details', 'sportspress' ), __( 'Event', 'sportspress' ), __( 'League', 'sportspress' ), __( 'Nationality', 'sportspress' ), __( 'Outcome', 'sportspress' ), + __( 'Past Teams', 'sportspress' ), __( 'Played', 'sportspress' ), + __( 'Player', 'sportspress' ), __( 'Pos', 'sportspress' ), + __( 'Position', 'sportspress' ), __( 'Preview', 'sportspress' ), __( 'Rank', 'sportspress' ), __( 'Recap', 'sportspress' ), __( 'Team Results', 'sportspress' ), __( 'Season', 'sportspress' ), + __( 'Staff', 'sportspress' ), + __( 'Substitutes', 'sportspress' ), __( 'Team', 'sportspress' ), __( 'Teams', 'sportspress' ), __( 'Time', 'sportspress' ), @@ -1086,20 +1092,9 @@ function sp_get_text_options() { __( 'Total', 'sportspress' ), __( 'Venue', 'sportspress' ), __( 'View all events', 'sportspress' ), + __( 'View all players', 'sportspress' ), __( 'View full table', 'sportspress' ), )); - - if ( SP()->mode == 'team' ): - $strings = array_merge( $strings, array( - __( 'Current Team', 'sportspress' ), - __( 'Past Teams', 'sportspress' ), - __( 'Player', 'sportspress' ), - __( 'Position', 'sportspress' ), - __( 'Staff', 'sportspress' ), - __( 'Substitutes', 'sportspress' ), - __( 'View all players', 'sportspress' ), - )); - endif; asort( $strings ); return $strings; diff --git a/includes/sp-template-functions.php b/includes/sp-template-functions.php index cb8247ba..df7767bb 100644 --- a/includes/sp-template-functions.php +++ b/includes/sp-template-functions.php @@ -133,7 +133,7 @@ if ( ! function_exists( 'sportspress_output_event_performance' ) ) { * @return void */ function sportspress_output_event_performance() { - if ( SP()->mode == 'team' ) sp_get_template( 'event-performance.php' ); + sp_get_template( 'event-performance.php' ); } } diff --git a/sportspress.php b/sportspress.php index c57dab5c..4570bb75 100644 --- a/sportspress.php +++ b/sportspress.php @@ -56,11 +56,6 @@ final class SportsPress { */ public $text = array(); - /** - * @var string - */ - public $mode = 'team'; - /** * Main SportsPress Instance * @@ -121,7 +116,6 @@ final class SportsPress { add_action( 'init', array( $this, 'init' ), 0 ); add_action( 'init', array( 'SP_Shortcodes', 'init' ) ); add_action( 'after_setup_theme', array( $this, 'setup_environment' ) ); - add_filter( 'gettext', array( $this, 'gettext' ), 20, 3 ); // Loaded action do_action( 'sportspress_loaded' ); @@ -279,9 +273,6 @@ final class SportsPress { // Load string options $this->text = get_option( 'sportspress_text', array() ); - // Get mode option - $this->mode = sp_get_option( 'sportspress_mode', 'team' ); - // Init action do_action( 'sportspress_init' ); } @@ -304,65 +295,13 @@ final class SportsPress { */ public function setup_environment() { add_theme_support( 'post-thumbnails' ); - - // Standard (3:2) - add_image_size( 'sportspress-standard', 640, 480, true ); - add_image_size( 'sportspress-standard-thumbnail', 320, 240, true ); - // Wide (16:9) - add_image_size( 'sportspress-wide-header', 1920, 1080, true ); - add_image_size( 'sportspress-wide', 640, 360, true ); - add_image_size( 'sportspress-wide-thumbnail', 320, 180, true ); - - // Square (1:1) - add_image_size( 'sportspress-square', 640, 640, true ); - add_image_size( 'sportspress-square-thumbnail', 320, 320, true ); - - // Fit (Proportional) - add_image_size( 'sportspress-fit', 640, 640, false ); + // Add image sizes add_image_size( 'sportspress-fit-thumbnail', 320, 320, false ); add_image_size( 'sportspress-fit-icon', 128, 128, false ); add_image_size( 'sportspress-fit-mini', 32, 32, false ); } - /** - * Replace team strings with player if individual mode. - */ - public function gettext( $translated_text, $untranslated_text, $domain = 'default' ) { - if ( SP()->mode == 'player' && $domain == 'sportspress' ): - switch ( $untranslated_text ): - case 'Teams': - return __( 'Players', 'sportspress' ); - case 'Team': - return __( 'Player', 'sportspress' ); - case 'teams': - return __( 'players', 'sportspress' ); - case 'Add New Team': - return __( 'Add New Player', 'sportspress' ); - case 'Edit Team': - return __( 'Edit Player', 'sportspress' ); - case 'Team Options': - return __( 'Player Options', 'sportspress' ); - case 'Team Results': - return __( 'Player Performance', 'sportspress' ); - case 'Logo': - return __( 'Photo', 'sportspress' ); - case 'Add logo': - return __( 'Add photo', 'sportspress' ); - case 'Remove logo': - return __( 'Remove photo', 'sportspress' ); - case 'Select Logo': - return __( 'Select Photo', 'sportspress' ); - case 'Display logos': - return __( 'Display photos', 'sportspress' ); - case 'Link teams': - return __( 'Link players', 'sportspress' ); - endswitch; - endif; - - return $translated_text; - } - /** Helper functions ******************************************************/ /** diff --git a/templates/event-details.php b/templates/event-details.php index 4feaa714..8fd97fdd 100644 --- a/templates/event-details.php +++ b/templates/event-details.php @@ -12,6 +12,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly if ( ! isset( $id ) ) $id = get_the_ID(); +$scrollable = get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false; $date = get_the_time( get_option('date_format'), $id ); $time = get_the_time( get_option('time_format'), $id ); $leagues = get_the_terms( $id, 'sp_league' ); @@ -30,7 +31,7 @@ if ( $seasons ): endif; ?>

-
+
diff --git a/templates/event-list.php b/templates/event-list.php index 353fee21..c3c3d385 100644 --- a/templates/event-list.php +++ b/templates/event-list.php @@ -19,6 +19,7 @@ $defaults = array( 'link_teams' => get_option( 'sportspress_calendar_link_teams', 'no' ) == 'yes' ? true : false, 'link_venues' => get_option( 'sportspress_calendar_link_venues', 'yes' ) == 'yes' ? true : false, 'sortable' => get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false, + 'scrollable' => get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false, 'responsive' => get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false, 'paginated' => get_option( 'sportspress_calendar_paginated', 'yes' ) == 'yes' ? true : false, 'rows' => get_option( 'sportspress_calendar_rows', 10 ), @@ -46,7 +47,7 @@ if ( isset( $columns ) ): $usecolumns = explode( ',', $columns ); endif; ?> -
+
diff --git a/templates/event-performance.php b/templates/event-performance.php index e94e350a..6e008dae 100644 --- a/templates/event-performance.php +++ b/templates/event-performance.php @@ -29,6 +29,7 @@ $status = $event->status(); $show_players = get_option( 'sportspress_event_show_players', 'yes' ) == 'yes' ? true : false; $link_posts = get_option( 'sportspress_event_link_players', 'yes' ) == 'yes' ? true : false; $sortable = get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false; +$scrollable = get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false; $responsive = get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false; if ( is_array( $teams ) ): @@ -55,7 +56,7 @@ if ( is_array( $teams ) ): sp_get_template( 'event-staff.php', array( 'id' => $id, 'index' => $index ) ); endif; ?> -
+
diff --git a/templates/event-results.php b/templates/event-results.php index 34a8fef9..b0322224 100644 --- a/templates/event-results.php +++ b/templates/event-results.php @@ -31,6 +31,7 @@ $data = array_filter( $data ); if ( empty( $data ) ) return false; +$scrollable = get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false; $show_outcomes = array_key_exists( 'outcome', $labels ); // Initialize @@ -88,7 +89,7 @@ else: $output .= '

' . __( 'Team Results', 'sportspress' ) . '

'; - $output .= '
' . + $output .= '
' . '
' . ''; foreach( $labels as $key => $label ): diff --git a/templates/league-table.php b/templates/league-table.php index d73b4826..e1d79ab6 100644 --- a/templates/league-table.php +++ b/templates/league-table.php @@ -17,6 +17,7 @@ $defaults = array( 'show_team_logo' => get_option( 'sportspress_table_show_logos', 'yes' ) == 'yes' ? true : false, 'link_posts' => get_option( 'sportspress_table_link_teams', 'no' ) == 'yes' ? true : false, 'sortable' => get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false, + 'scrollable' => get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false, 'responsive' => get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false, 'paginated' => get_option( 'sportspress_table_paginated', 'yes' ) == 'yes' ? true : false, 'rows' => get_option( 'sportspress_table_rows', 10 ), @@ -26,7 +27,7 @@ extract( $defaults, EXTR_SKIP ); $output = '

' . get_the_title( $id ) . '

'; -$output .= '
'; +$output .= '
'; $output .= '
' . __( 'Team', 'sportspress' ) . '
' . '' . ''; diff --git a/templates/player-list.php b/templates/player-list.php index 850af1a8..4fad2158 100644 --- a/templates/player-list.php +++ b/templates/player-list.php @@ -21,6 +21,7 @@ $defaults = array( 'link_posts' => get_option( 'sportspress_list_link_players', 'yes' ) == 'yes' ? true : false, 'link_teams' => get_option( 'sportspress_list_link_teams', 'no' ) == 'yes' ? true : false, 'sortable' => get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false, + 'scrollable' => get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false, 'responsive' => get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false, 'paginated' => get_option( 'sportspress_list_paginated', 'yes' ) == 'yes' ? true : false, 'rows' => get_option( 'sportspress_list_rows', 10 ), @@ -79,7 +80,7 @@ foreach ( $groups as $group ): $output .= '<' . $grouptag . ' class="sp-table-caption player-group-name player-list-group-name">' . $group->name . ''; endif; - $output .= '
' . + $output .= '
' . '
' . '' . ''; if ( in_array( $orderby, array( 'number', 'name' ) ) ): diff --git a/templates/player-statistics.php b/templates/player-statistics.php index 8daefeb1..c426f741 100644 --- a/templates/player-statistics.php +++ b/templates/player-statistics.php @@ -14,13 +14,13 @@ if ( ! isset( $id ) ) $player = new SP_Player( $id ); +$scrollable = get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false; +$responsive = get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false; $leagues = get_the_terms( $id, 'sp_league' ); // Loop through statistics for each league if ( is_array( $leagues ) ): foreach ( $leagues as $league ): - $responsive = get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false; - $data = $player->data( $league->term_id ); // The first row should be column labels @@ -34,7 +34,7 @@ if ( is_array( $leagues ) ): return false; $output = '

' . $league->name . '

' . - '
' . + '
' . '
' . '' . ''; foreach( $labels as $key => $label ): diff --git a/templates/team-columns.php b/templates/team-columns.php index 9026e9bb..e93250d6 100644 --- a/templates/team-columns.php +++ b/templates/team-columns.php @@ -12,6 +12,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly if ( ! isset( $id ) ) $id = get_the_ID(); +$scrollable = get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false; $leagues = get_the_terms( $id, 'sp_league' ); if ( ! $leagues ) @@ -36,7 +37,7 @@ foreach ( $leagues as $league ): unset( $data[0] ); $output .= '

' . $league->name . '

' . - '
' . + '
' . '
' . '' . ''; foreach( $labels as $key => $label ):