From 5f0a93a8af1bbf521e78ff086611148fc079f65d Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Sun, 24 Aug 2014 16:45:03 +1000 Subject: [PATCH] Make event list and blocks pagination independent --- .../settings/class-sp-settings-events.php | 33 ++++++++++++++++--- templates/event-blocks.php | 4 +-- templates/event-list.php | 4 +-- 3 files changed, 33 insertions(+), 8 deletions(-) diff --git a/includes/admin/settings/class-sp-settings-events.php b/includes/admin/settings/class-sp-settings-events.php index a869510d..ac54d333 100644 --- a/includes/admin/settings/class-sp-settings-events.php +++ b/includes/admin/settings/class-sp-settings-events.php @@ -130,19 +130,19 @@ class SP_Settings_Events extends SP_Settings_Page { array( 'type' => 'sectionend', 'id' => 'event_options' ), - array( 'title' => __( 'Calendars', 'sportspress' ), 'type' => 'title', 'id' => 'calendar_options' ), + array( 'title' => __( 'Event List', 'sportspress' ), 'type' => 'title', 'id' => 'event_list_options' ), array( 'title' => __( 'Pagination', 'sportspress' ), 'desc' => __( 'Paginate', 'sportspress' ), - 'id' => 'sportspress_calendar_paginated', + 'id' => 'sportspress_event_list_paginated', 'default' => 'yes', 'type' => 'checkbox', ), array( 'title' => __( 'Limit', 'sportspress' ), - 'id' => 'sportspress_calendar_rows', + 'id' => 'sportspress_event_list_rows', 'class' => 'small-text', 'default' => '10', 'desc' => __( 'events', 'sportspress' ), @@ -153,7 +153,32 @@ class SP_Settings_Events extends SP_Settings_Page { ), ), - array( 'type' => 'sectionend', 'id' => 'calendar_options' ), + array( 'type' => 'sectionend', 'id' => 'event_list_options' ), + + array( 'title' => __( 'Event Blocks', 'sportspress' ), 'type' => 'title', 'id' => 'event_blocks_options' ), + + 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( 'type' => 'sectionend', 'id' => 'event_list_options' ), )); // End event settings } diff --git a/templates/event-blocks.php b/templates/event-blocks.php index 6f96f64b..c2b7d957 100644 --- a/templates/event-blocks.php +++ b/templates/event-blocks.php @@ -16,8 +16,8 @@ $defaults = array( 'date' => 'default', 'number' => -1, 'link_teams' => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false, - 'paginated' => get_option( 'sportspress_calendar_paginated', 'yes' ) == 'yes' ? true : false, - 'rows' => get_option( 'sportspress_calendar_rows', 10 ), + 'paginated' => get_option( 'sportspress_event_blocks_paginated', 'yes' ) == 'yes' ? true : false, + 'rows' => get_option( 'sportspress_event_blocks_rows', 10 ), 'order' => 'default', 'show_all_events_link' => false, ); diff --git a/templates/event-list.php b/templates/event-list.php index 8a8c0ad7..feadcf17 100644 --- a/templates/event-list.php +++ b/templates/event-list.php @@ -21,8 +21,8 @@ $defaults = array( '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 ), + 'paginated' => get_option( 'sportspress_event_list_paginated', 'yes' ) == 'yes' ? true : false, + 'rows' => get_option( 'sportspress_event_list_rows', 10 ), 'order' => 'default', 'columns' => null, 'show_all_events_link' => false,