Modularize!

This commit is contained in:
Brian Miyaji
2015-01-28 14:02:35 +11:00
parent aa0eeae6cd
commit 87baaf7288
35 changed files with 1491 additions and 928 deletions

View File

@@ -193,139 +193,6 @@ class SP_Settings_Events extends SP_Settings_Page {
);
if ( 'yes' == get_option( 'sportspress_load_calendars_module', 'yes' ) ) {
$settings = array_merge( $settings,
array(
array( 'title' => __( 'Event List', 'sportspress' ), 'type' => 'title', 'id' => 'event_list_options' ),
),
apply_filters( 'sportspress_event_list_options', array(
array(
'title' => __( 'Teams', 'sportspress' ),
'desc' => __( 'Display logos', 'sportspress' ),
'id' => 'sportspress_event_list_show_logos',
'default' => 'no',
'type' => 'checkbox',
),
array(
'title' => __( 'Title Format', 'sportspress' ),
'id' => 'sportspress_event_list_title_format',
'default' => 'title',
'type' => 'select',
'options' => array(
'title' => __( 'Title', 'sportspress' ),
'teams' => __( 'Teams', 'sportspress' ),
'homeaway' => sprintf( '%s | %s', __( 'Home', 'sportspress' ), __( 'Away', 'sportspress' ) ),
),
),
array(
'title' => __( 'Time/Results Format', 'sportspress' ),
'id' => 'sportspress_event_list_time_format',
'default' => 'combined',
'type' => 'select',
'options' => array(
'combined' => __( 'Combined', 'sportspress' ),
'separate' => __( 'Separate', 'sportspress' ),
'time' => __( 'Time Only', 'sportspress' ),
'results' => __( 'Results Only', 'sportspress' ),
),
),
array(
'title' => __( 'Pagination', 'sportspress' ),
'desc' => __( 'Paginate', 'sportspress' ),
'id' => 'sportspress_event_list_paginated',
'default' => 'yes',
'type' => 'checkbox',
),
array(
'title' => __( 'Limit', 'sportspress' ),
'id' => 'sportspress_event_list_rows',
'class' => 'small-text',
'default' => '10',
'desc' => __( 'events', 'sportspress' ),
'type' => 'number',
'custom_attributes' => array(
'min' => 1,
'step' => 1
),
),
)),
array(
array( 'type' => 'sectionend', 'id' => 'event_list_options' ),
array( 'title' => __( 'Event Blocks', 'sportspress' ), 'type' => 'title', 'id' => 'event_blocks_options' ),
),
apply_filters( 'sportspress_event_blocks_options', array(
array(
'title' => __( 'Title', 'sportspress' ),
'desc' => __( 'Display calendar title', 'sportspress' ),
'id' => 'sportspress_event_blocks_show_title',
'default' => 'no',
'type' => 'checkbox',
),
array(
'title' => __( 'Details', 'sportspress' ),
'desc' => __( 'Display competition', 'sportspress' ),
'id' => 'sportspress_event_blocks_show_league',
'default' => 'no',
'type' => 'checkbox',
'checkboxgroup' => 'start',
),
array(
'desc' => __( 'Display season', 'sportspress' ),
'id' => 'sportspress_event_blocks_show_season',
'default' => 'no',
'type' => 'checkbox',
'checkboxgroup' => '',
),
array(
'desc' => __( 'Display venue', 'sportspress' ),
'id' => 'sportspress_event_blocks_show_venue',
'default' => 'no',
'type' => 'checkbox',
'checkboxgroup' => 'end',
),
array(
'title' => __( 'Pagination', 'sportspress' ),
'desc' => __( 'Paginate', 'sportspress' ),
'id' => 'sportspress_event_blocks_paginated',
'default' => 'yes',
'type' => 'checkbox',
),
array(
'title' => __( 'Limit', 'sportspress' ),
'id' => 'sportspress_event_blocks_rows',
'class' => 'small-text',
'default' => '10',
'desc' => __( 'events', 'sportspress' ),
'type' => 'number',
'custom_attributes' => array(
'min' => 1,
'step' => 1
),
),
)),
array(
array( 'type' => 'sectionend', 'id' => 'event_list_options' ),
)
);
} // End event settings
return apply_filters( 'sportspress_event_settings', $settings );
}