diff --git a/assets/css/slickmap.css b/assets/css/slickmap.css new file mode 100644 index 00000000..fc6bf87b --- /dev/null +++ b/assets/css/slickmap.css @@ -0,0 +1,225 @@ +.sp-sitemap { + margin: 40px 0; + float: left; + width: 100%; + position: relative; +} + +/* ------------------------------------------------------------ + Reset Styles (adapted from meyerweb.com) +------------------------------------------------------------ */ + +.sp-sitemap div, .sp-sitemap span, .sp-sitemap applet, .sp-sitemap object, .sp-sitemap iframe, .sp-sitemap +h1, .sp-sitemap h2, .sp-sitemap h3, .sp-sitemap h4, .sp-sitemap h5, .sp-sitemap h6, .sp-sitemap p, .sp-sitemap blockquote, .sp-sitemap pre, .sp-sitemap +a, .sp-sitemap abbr, .sp-sitemap acronym, .sp-sitemap address, .sp-sitemap big, .sp-sitemap cite, .sp-sitemap code, .sp-sitemap +del, .sp-sitemap dfn, .sp-sitemap em, .sp-sitemap font, .sp-sitemap img, .sp-sitemap ins, .sp-sitemap kbd, .sp-sitemap q, .sp-sitemap s, .sp-sitemap samp, .sp-sitemap +small, .sp-sitemap strike, .sp-sitemap strong, .sp-sitemap sub, .sp-sitemap sup, .sp-sitemap tt, .sp-sitemap var, .sp-sitemap +dl, .sp-sitemap dt, .sp-sitemap dd, .sp-sitemap ol, .sp-sitemap ul, .sp-sitemap li, .sp-sitemap +fieldset, .sp-sitemap form, .sp-sitemap label, .sp-sitemap legend, .sp-sitemap +table, .sp-sitemap caption, .sp-sitemap tbody, .sp-sitemap tfoot, .sp-sitemap thead, .sp-sitemap tr, .sp-sitemap th, .sp-sitemap td { + margin: 0; + padding: 0; + border: 0; + outline: 0; + vertical-align: baseline; +} + +/* ------------------------------------------------------------ + NUMBER OF COLUMNS: Adjust .sp-sitemap li to set the number + of columns required in your site map. The default is + 4 columns (25%). 5 columns would be 20%, 6 columns would + be 16.6%, etc. +------------------------------------------------------------ */ + +.sp-sitemap li { + width: 10%; +} + +.sp-sitemap li ul li { + width:100% !important; +} + +.sp-sitemap .col0 { max-width: 300px; } +.sp-sitemap .col1 { max-width: 300px; } +.sp-sitemap .col2 { max-width: 600px; } +.sp-sitemap .col3 { max-width: 900px; } +.sp-sitemap .col4 { max-width: 1200px; } +.sp-sitemap .col5 { max-width: 1500px; } +.sp-sitemap .col6 { max-width: 1800px; } +.sp-sitemap .col7 { max-width: 2100px; } +.sp-sitemap .col8 { max-width: 2400px; } +.sp-sitemap .col9 { max-width: 2700px; } +.sp-sitemap .col10 { max-width: 3000px; } +.sp-sitemap .col11 { max-width: 3300px; } +.sp-sitemap .col12 { max-width: 3600px; } + +.sp-sitemap .col1 li { width:99.9%; } +.sp-sitemap .col2 li { width:50%; } +.sp-sitemap .col3 li { width:33.3%; } +.sp-sitemap .col4 li { width:25%; } +.sp-sitemap .col5 li { width:20%; } +.sp-sitemap .col6 li { width:16.6%; } +.sp-sitemap .col7 li { width:14.2%; } +.sp-sitemap .col8 li { width:12.5%; } +.sp-sitemap .col9 li { width:11.1%; } +.sp-sitemap .col10 li { width:10%; } +.sp-sitemap .col11 li { width:9%; } +.sp-sitemap .col12 li { width:8.3%; } + +/* ------------------------------------------------------------ + General Styles +------------------------------------------------------------ */ + +.sp-sitemap h1 { + font-weight: bold; + text-transform: uppercase; + font-size: 20px; + margin: 0 0 5px 0; +} +.sp-sitemap h2 { + font-size: 10px; + color: #777777; + margin: 0 0 20px 0; +} +.sp-sitemap a { + text-decoration: none; +} +.sp-sitemap ol, .sp-sitemap ul { + list-style: none; +} +.sp-sitemap li { + margin: 0; +} +.sp-sitemap li a.button { + white-space: normal; +} + + +/* ------------------------------------------------------------ + Site Map Styles +------------------------------------------------------------ */ + +/* -------- Top Level --------- */ + +.sp-sitemap #sp-primary .sp-home { + display: block; + float: none; + background: #f1f1f1 url('../images/slickmap/L1-left.png') center bottom no-repeat; + position: relative; + z-index: 2; + padding: 0 0 30px 0; +} +.sp-sitemap #sp-primary .sp-breadcrumb { + display: block; + float: none; + background: #f1f1f1 url('../images/slickmap/vertical-line.png') center bottom repeat-y; + position: relative; + z-index: 2; + padding: 0 0 30px 0; + margin-bottom: 30px; +} +.sp-sitemap #sp-primary li { + min-width: 150px; + float: left; + background: url('../images/slickmap/L1-center.png') center top no-repeat; + padding: 30px 0; + margin-top: -30px; +} +.sp-sitemap #sp-primary li a.button { + margin: 0 20px 0 0; + padding: 10px 0; + display: block; + font-size: 13px; + font-weight: bold; + text-align: center; + height: auto; + line-height: normal; +} +.sp-sitemap #sp-primary li:last-child { + background: url('../images/slickmap/L1-right.png') center top no-repeat; +} + +/* -------- Second Level --------- */ + +.sp-sitemap #sp-primary li li { + width: 100%; + clear: left; + margin-top: 0; + padding: 10px 0 0 0; + background: url('../images/slickmap/vertical-line.png') center bottom repeat-y; +} +.sp-sitemap #sp-primary li li:first-child { + padding-top: 30px; +} +.sp-sitemap #sp-primary li li:last-child { + background: url('../images/slickmap/vertical-line.png') center bottom repeat-y; +} + +/* -------- Third Level --------- */ + +.sp-sitemap #sp-primary li li ul { + margin: 10px 0 0 0; + width: 100%; + float: right; + padding: 9px 0 10px 0; + background: #f1f1f1 url('../images/slickmap/L3-ul-top.png') center top no-repeat; +} +.sp-sitemap #sp-primary li li li { + background: url('../images/slickmap/L3-center.png') left center no-repeat; + padding: 5px 0; +} +.sp-sitemap #sp-primary li li li a { + padding: 5px 0; + width: 80%; + float: right; +} +.sp-sitemap #sp-primary li li li:first-child { + padding: 15px 0 5px 0; + background: url('../images/slickmap/L3-li-top.png') left center no-repeat; +} +.sp-sitemap #sp-primary li li li:last-child { + background: url('../images/slickmap/L3-bottom.png') left center no-repeat; +} + + +/* ------------------------------------------------------------ + Utility Navigation +------------------------------------------------------------ */ + +.sp-sitemap #sp-utility { + float: right; + max-width: 80%; + margin-top: -30px; + margin-right: 10px; +} +.sp-sitemap #sp-utility li { + float: left; + margin-bottom: 10px; + width: auto; +} +.sp-sitemap #sp-utility li a.button { + margin: 0 10px 0 0; + padding: 10px 16px; + display: block; + font-size: 13px; + font-weight: bold; + text-align: center; + height: auto; + line-height: normal; + position: relative; + z-index: 10; +} +.sp-sitemap #sp-utility li a:link:before, +.sp-sitemap #sp-utility li a:visited:before { + margin-bottom: 3px; +} + +@media screen and ( max-width: 782px ) { + .sp-sitemap #sp-primary { + clear: both; + padding-top: 50px; + } + .sp-sitemap #sp-utility { + max-width: none; + } +} \ No newline at end of file diff --git a/assets/images/slickmap/L1-center.png b/assets/images/slickmap/L1-center.png new file mode 100644 index 00000000..8023abc5 Binary files /dev/null and b/assets/images/slickmap/L1-center.png differ diff --git a/assets/images/slickmap/L1-left.png b/assets/images/slickmap/L1-left.png new file mode 100644 index 00000000..320fd43d Binary files /dev/null and b/assets/images/slickmap/L1-left.png differ diff --git a/assets/images/slickmap/L1-right.png b/assets/images/slickmap/L1-right.png new file mode 100644 index 00000000..154441a3 Binary files /dev/null and b/assets/images/slickmap/L1-right.png differ diff --git a/assets/images/slickmap/L3-bottom.png b/assets/images/slickmap/L3-bottom.png new file mode 100644 index 00000000..572b282e Binary files /dev/null and b/assets/images/slickmap/L3-bottom.png differ diff --git a/assets/images/slickmap/L3-center.png b/assets/images/slickmap/L3-center.png new file mode 100644 index 00000000..bf04ec17 Binary files /dev/null and b/assets/images/slickmap/L3-center.png differ diff --git a/assets/images/slickmap/L3-li-top.png b/assets/images/slickmap/L3-li-top.png new file mode 100644 index 00000000..7799e40e Binary files /dev/null and b/assets/images/slickmap/L3-li-top.png differ diff --git a/assets/images/slickmap/L3-ul-top.png b/assets/images/slickmap/L3-ul-top.png new file mode 100644 index 00000000..80c3fb36 Binary files /dev/null and b/assets/images/slickmap/L3-ul-top.png differ diff --git a/assets/images/slickmap/vertical-line.png b/assets/images/slickmap/vertical-line.png new file mode 100644 index 00000000..af2d0372 Binary files /dev/null and b/assets/images/slickmap/vertical-line.png differ diff --git a/includes/admin/class-sp-admin-assets.php b/includes/admin/class-sp-admin-assets.php old mode 100644 new mode 100755 index 5584fe83..c6ad0725 --- a/includes/admin/class-sp-admin-assets.php +++ b/includes/admin/class-sp-admin-assets.php @@ -44,6 +44,10 @@ class SP_Admin_Assets { wp_enqueue_style( 'sportspress-admin', SP()->plugin_url() . '/assets/css/admin.css', array(), SP_VERSION ); } + if ( in_array( $screen->id, array( 'sportspress_page_sp-overview' ) ) ) { + wp_enqueue_style( 'sportspress-admin-slickmap', SP()->plugin_url() . '/assets/css/slickmap.css', array(), '1.1.0' ); + } + if ( in_array( $screen->id, array( 'dashboard' ) ) ) { wp_enqueue_style( 'sportspress-admin-dashboard-styles', SP()->plugin_url() . '/assets/css/dashboard.css', array(), SP_VERSION ); } diff --git a/includes/admin/class-sp-admin-menus.php b/includes/admin/class-sp-admin-menus.php old mode 100644 new mode 100755 index bc397170..077215fd --- a/includes/admin/class-sp-admin-menus.php +++ b/includes/admin/class-sp-admin-menus.php @@ -23,8 +23,9 @@ class SP_Admin_Menus { public function __construct() { add_filter( 'admin_menu', array( $this, 'menu_clean' ), 5 ); add_action( 'admin_menu', array( $this, 'admin_menu' ), 6 ); - add_action( 'admin_menu', array( $this, 'leagues_menu' ), 7 ); - add_action( 'admin_menu', array( $this, 'seasons_menu' ), 8 ); + add_action( 'admin_menu', array( $this, 'overview_menu' ), 7 ); + add_action( 'admin_menu', array( $this, 'leagues_menu' ), 8 ); + add_action( 'admin_menu', array( $this, 'seasons_menu' ), 9 ); if ( current_user_can( 'manage_options' ) ) add_action( 'admin_menu', array( $this, 'status_menu' ), 20 ); @@ -47,7 +48,14 @@ class SP_Admin_Menus { if ( current_user_can( 'manage_sportspress' ) ) $menu[] = array( '', 'read', 'separator-sportspress', '', 'wp-menu-separator sportspress' ); - $main_page = add_menu_page( __( 'SportsPress Settings', 'sportspress' ), __( 'SportsPress', 'sportspress' ), 'manage_sportspress', 'sportspress', array( $this, 'settings_page' ), apply_filters( 'sportspress_menu_icon', null ), '51.5' ); + $main_page = add_menu_page( __( 'SportsPress', 'sportspress' ), __( 'SportsPress', 'sportspress' ), 'manage_sportspress', 'sportspress', array( $this, 'settings_page' ), apply_filters( 'sportspress_menu_icon', null ), '51.5' ); + } + + /** + * Add menu item + */ + public function overview_menu() { + add_submenu_page( 'sportspress', __( 'Overview', 'sportspress' ), __( 'Overview', 'sportspress' ), 'manage_sportspress', 'sp-overview', array( $this, 'overview_page' ) ); } /** @@ -230,6 +238,14 @@ class SP_Admin_Menus { endif; } + /** + * Init the overview page + */ + public function overview_page() { + include_once( 'class-sp-admin-overview.php' ); + SP_Admin_Overview::output(); + } + /** * Init the settings page */ diff --git a/includes/admin/class-sp-admin-overview.php b/includes/admin/class-sp-admin-overview.php new file mode 100644 index 00000000..4d05b8ad --- /dev/null +++ b/includes/admin/class-sp-admin-overview.php @@ -0,0 +1,578 @@ +mode == 'team' ): + $settings[] = include( 'settings/class-sp-settings-players.php' ); + $settings[] = include( 'settings/class-sp-settings-staff.php' ); + endif; + + $settings = apply_filters( 'sportspress_get_settings_pages', $settings ); + + $settings[] = include( 'settings/class-sp-settings-text.php' ); + $settings[] = include( 'settings/class-sp-settings-config.php' ); + + self::$settings = apply_filters( 'sportspress_get_settings_config_pages', $settings ); + } + return self::$settings; + } + + /** + * Save the settings + */ + public static function save() { + global $current_section, $current_tab; + + if ( empty( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'sportspress-settings' ) ) + die( __( 'Action failed. Please refresh the page and retry.', 'sportspress' ) ); + + // Trigger actions + do_action( 'sportspress_settings_save_' . $current_tab ); + do_action( 'sportspress_update_options_' . $current_tab ); + do_action( 'sportspress_update_options' ); + + self::add_message( __( 'Your settings have been saved.', 'sportspress' ) ); + + do_action( 'sportspress_settings_saved' ); + } + + /** + * Add a message + * @param string $text + */ + public static function add_message( $text ) { + self::$messages[] = $text; + } + + /** + * Add an error + * @param string $text + */ + public static function add_error( $text ) { + self::$errors[] = $text; + } + + /** + * Output messages + errors + */ + public static function show_messages() { + if ( sizeof( self::$errors ) > 0 ) { + foreach ( self::$errors as $error ) + echo '
' . esc_html( $error ) . '
' . esc_html( $message ) . '
' . wp_kses_post( $description ) . '
'; + } elseif ( $description && in_array( $value['type'], array( 'checkbox' ) ) ) { + $description = wp_kses_post( $description ); + } elseif ( $description ) { + $description = '' . wp_kses_post( $description ) . ''; + } + + if ( $tip && in_array( $value['type'], array( 'checkbox' ) ) ) { + + $tip = '' . $tip . '
'; + + } elseif ( $tip ) { + + $tip = '+ + + +
+