Fix activation warnings

This commit is contained in:
Brian Miyaji
2014-03-29 04:11:59 +11:00
parent 8a9e211f5b
commit 222cd0d2f8
8 changed files with 2322 additions and 2299 deletions

View File

@@ -40,6 +40,12 @@ class SP_Settings_Config extends SP_Settings_Page {
* @return array
*/
public function get_settings() {
$sports = sp_get_sport_options();
$sport_options = array();
foreach ( $sports as $slug => $data ):
$sport_options[ $slug ] = $data['name'];
endforeach;
return apply_filters('sportspress_event_settings', array(
array( 'title' => __( 'Configure SportsPress', 'sportspress' ), 'type' => 'title','desc' => '', 'id' => 'config_options' ),
@@ -49,7 +55,7 @@ class SP_Settings_Config extends SP_Settings_Page {
'id' => 'sportspress_sport',
'default' => 'soccer',
'type' => 'select',
'options' => SP()->sports->options,
'options' => $sport_options,
),
array( 'type' => 'results' ),
@@ -73,12 +79,6 @@ class SP_Settings_Config extends SP_Settings_Page {
* Save settings
*/
public function save() {
$settings = $this->get_settings();
SP_Admin_Settings::save_fields( $settings );
if ( isset( $_POST['sportspress_primary_result'] ) )
update_option( 'sportspress_primary_result', $_POST['sportspress_primary_result'] );
if ( isset( $_POST['sportspress_sport'] ) && ! empty( $_POST['sportspress_sport'] ) && get_option( 'sportspress_sport', null ) != $_POST['sportspress_sport'] ):
$sport = SP()->sports->$_POST['sportspress_sport'];
@@ -162,7 +162,13 @@ class SP_Settings_Config extends SP_Settings_Page {
endif;
endforeach;
endforeach;
update_option( 'sportspress_primary_result', 0 );
elseif ( isset( $_POST['sportspress_primary_result'] ) ):
update_option( 'sportspress_primary_result', $_POST['sportspress_primary_result'] );
endif;
$settings = $this->get_settings();
SP_Admin_Settings::save_fields( $settings );
}
/**

View File

@@ -86,7 +86,9 @@ class SP_Settings_Events extends SP_Settings_Page {
);
foreach ( SP()->text->event as $key => $value ):
$strings = sp_get_text_options();
foreach ( sp_array_value( $strings, 'event', array() ) as $key => $value ):
$settings[] = array(
'title' => $value,
'id' => 'sportspress_event_' . $key . '_text',

View File

@@ -91,7 +91,9 @@ class SP_Settings_General extends SP_Settings_Page {
);
foreach ( SP()->text->general as $key => $value ):
$strings = sp_get_text_options();
foreach ( sp_array_value( $strings, 'general', array() ) as $key => $value ):
$settings[] = array(
'title' => $value,
'id' => 'sportspress_' . $key . '_text',

View File

@@ -62,7 +62,9 @@ class SP_Settings_Players extends SP_Settings_Page {
);
foreach ( SP()->text->player as $key => $value ):
$strings = sp_get_text_options();
foreach ( sp_array_value( $strings, 'player', array() ) as $key => $value ):
$settings[] = array(
'title' => $value,
'id' => 'sportspress_player_' . $key . '_text',

View File

@@ -63,7 +63,9 @@ class SP_Settings_Teams extends SP_Settings_Page {
);
foreach ( SP()->text->team as $key => $value ):
$strings = sp_get_text_options();
foreach ( sp_array_value( $strings, 'team', array() ) as $key => $value ):
$settings[] = array(
'title' => $value,
'id' => 'sportspress_team_' . $key . '_text',

File diff suppressed because it is too large Load Diff

View File

@@ -22,48 +22,7 @@ class SP_Text {
* @return void
*/
public function __construct() {
$this->data = apply_filters( 'sportspress_text', array(
'general' => array(
'league' => __( 'League', 'sportspress' ),
'season' => __( 'Season', 'sportspress' ),
),
'event' => array(
'event' => __( 'Event', 'sportspress' ),
'date' => __( 'Date', 'sportspress' ),
'time' => __( 'Time', 'sportspress' ),
'results' => __( 'Results', 'sportspress' ),
'team' => __( 'Team', 'sportspress' ),
'teams' => __( 'Teams', 'sportspress' ),
'details' => __( 'Details', 'sportspress' ),
'venue' => __( 'Venue', 'sportspress' ),
'player' => __( 'Player', 'sportspress' ),
'substitutes' => __( 'Substitutes', 'sportspress' ),
'total' => __( 'Total', 'sportspress' ),
'article' => __( 'Article', 'sportspress' ),
'preview' => __( 'Preview', 'sportspress' ),
'recap' => __( 'Recap', 'sportspress' ),
'view_all_events' => __( 'View all events', 'sportspress' ),
),
'team' => array(
'team' => __( 'Team', 'sportspress' ),
'teams' => __( 'Teams', 'sportspress' ),
'pos' => __( 'Pos', 'sportspress' ),
'view_full_table' => __( 'View full table', 'sportspress' ),
),
'player' => array(
'player' => __( 'Player', 'sportspress' ),
'position' => __( 'Position', 'sportspress' ),
'nationality' => __( 'Nationality', 'sportspress' ),
'current_team' => __( 'Current Team', 'sportspress' ),
'past_teams' => __( 'Past Teams', 'sportspress' ),
'rank' => __( 'Rank', 'sportspress' ),
'played' => __( 'Played', 'sportspress' ),
'view_all_players' => __( 'View all players', 'sportspress' ),
),
'staff' => array(
'staff' => __( 'Staff', 'sportspress' ),
),
));
$this->data = sp_get_text_options();
}
public function __get( $key ) {

File diff suppressed because it is too large Load Diff