Add table options to event statistics and simplify localization

This commit is contained in:
Brian Miyaji
2014-03-22 17:09:23 +11:00
parent b9b7d54c0d
commit d433a58eb0
4 changed files with 53 additions and 42 deletions

View File

@@ -15,7 +15,7 @@ class SportsPressEventSettingsPage {
add_settings_section(
'event',
__( 'Event Options', 'sportspress' ),
__( 'Events', 'sportspress' ),
'',
'sportspress_events'
);
@@ -28,6 +28,14 @@ class SportsPressEventSettingsPage {
'event'
);
add_settings_field(
'statistics',
__( 'Statistics', 'sportspress' ),
array( $this, 'statistics_callback' ),
'sportspress_events',
'event'
);
add_settings_field(
'results',
__( 'Results', 'sportspress' ),
@@ -60,6 +68,35 @@ class SportsPressEventSettingsPage {
<?php
}
function statistics_callback() {
$responsive = sportspress_array_value( $this->options, 'event_statistics_responsive', true );
$sortable = sportspress_array_value( $this->options, 'event_statistics_sortable', true );
$link_posts = sportspress_array_value( $this->options, 'event_statistics_link_posts', true );
?>
<fieldset>
<label for="sportspress_event_statistics_responsive">
<input id="sportspress_event_statistics_responsive_default" name="sportspress[event_statistics_responsive]" type="hidden" value="0">
<input id="sportspress_event_statistics_responsive" name="sportspress[event_statistics_responsive]" type="checkbox" value="1" <?php checked( $responsive ); ?>>
<?php _e( 'Responsive', 'sportspress' ); ?>
</label>
</fieldset>
<fieldset>
<label for="sportspress_event_statistics_sortable">
<input id="sportspress_event_statistics_sortable_default" name="sportspress[event_statistics_sortable]" type="hidden" value="0">
<input id="sportspress_event_statistics_sortable" name="sportspress[event_statistics_sortable]" type="checkbox" value="1" <?php checked( $sortable ); ?>>
<?php _e( 'Sortable', 'sportspress' ); ?>
</label>
</fieldset>
<fieldset>
<label for="sportspress_event_statistics_link_posts">
<input id="sportspress_event_statistics_link_posts_default" name="sportspress[event_statistics_link_posts]" type="hidden" value="0">
<input id="sportspress_event_statistics_link_posts" name="sportspress[event_statistics_link_posts]" type="checkbox" value="1" <?php checked( $link_posts ); ?>>
<?php _e( 'Link players', 'sportspress' ); ?>
</label>
</fieldset>
<?php
}
function results_callback() {
$main_result = sportspress_array_value( $this->options, 'main_result', 0 );