Enable individual sport mode

This commit is contained in:
Brian Miyaji
2014-06-19 15:37:16 +10:00
parent cdf74285d5
commit 33069f395d
12 changed files with 217 additions and 124 deletions

View File

@@ -5,7 +5,7 @@
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin
* @version 0.8
* @version 1.1
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -42,25 +42,29 @@ class SP_Settings_Config extends SP_Settings_Page {
*/
public function get_settings() {
return apply_filters('sportspress_config_settings', array(
$settings = array(
array( 'title' => __( 'Configure SportsPress', 'sportspress' ), 'type' => 'title','desc' => '', 'id' => 'config_options' ),
array( 'type' => 'outcomes' ),
array( 'type' => 'results' ),
);
array( 'type' => 'performance' ),
if ( SP()->mode == 'team' ) $settings[] = array( 'type' => 'performance' );
array( 'type' => 'columns' ),
$settings[] = array( 'type' => 'columns' );
array( 'type' => 'metrics' ),
if ( SP()->mode == 'team' ):
$settings = array_merge( $settings, array(
array( 'type' => 'metrics' ),
array( 'type' => 'statistics' ),
array( 'type' => 'statistics' ),
));
endif;
array( 'type' => 'sectionend', 'id' => 'config_options' ),
$settings[] = array( 'type' => 'sectionend', 'id' => 'config_options' ); // End event settings
)); // End event settings
return apply_filters( 'sportspress_config_settings', $settings );
}
/**

View File

@@ -5,7 +5,7 @@
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin
* @version 1.0
* @version 1.1
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

View File

@@ -53,6 +53,16 @@ class SP_Settings_General extends SP_Settings_Page {
'type' => 'select',
'options' => $presets,
),
array(
'title' => __( 'Mode', 'sportspress' ),
'id' => 'sportspress_mode',
'default' => 'team',
'type' => 'select',
'options' => array(
'team' => __( 'Team', 'sportspress' ),
'player' => __( 'Individual', 'sportspress' ),
),
),
array(
'title' => __( 'Google Maps', 'sportspress' ),

View File

@@ -5,7 +5,7 @@
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin
* @version 1.0
* @version 1.1
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -35,9 +35,7 @@ class SP_Settings_Players extends SP_Settings_Page {
* @return array
*/
public function get_settings() {
return apply_filters( 'sportspress_player_settings', array(
$settings = array(
array( 'title' => __( 'Player Options', 'sportspress' ), 'type' => 'title','desc' => '', 'id' => 'player_options' ),
array(
@@ -59,15 +57,19 @@ class SP_Settings_Players extends SP_Settings_Page {
'default' => 'yes',
'type' => 'checkbox',
),
);
array(
if ( SP()->mode == 'team' ):
$settings[] = 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' ),
@@ -90,8 +92,9 @@ class SP_Settings_Players extends SP_Settings_Page {
),
array( 'type' => 'sectionend', 'id' => 'list_options' ),
)); // End player settings
return apply_filters( 'sportspress_player_settings', $settings );
}
}