Add tutorials module
This commit is contained in:
@@ -776,6 +776,41 @@ table.sp-status-table td mark.yes {
|
|||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Tutorials */
|
||||||
|
.sp-tutorials-list {
|
||||||
|
margin: -6px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.sp-tutorials-list li {
|
||||||
|
display: inline-block;
|
||||||
|
width: 342px;
|
||||||
|
max-width: 100%;
|
||||||
|
margin: 6px;
|
||||||
|
}
|
||||||
|
.sp-tutorials-list li strong {
|
||||||
|
background: #aaa;
|
||||||
|
display: inline-block;
|
||||||
|
color: #ffffff;
|
||||||
|
padding: 0 6px;
|
||||||
|
border-radius: 3px;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 12px;
|
||||||
|
margin-right: 3px;
|
||||||
|
}
|
||||||
|
.sp-tutorials-list li:hover strong {
|
||||||
|
background: #00a69c;
|
||||||
|
}
|
||||||
|
.sp-tutorials-list li .sp-popup {
|
||||||
|
float: right;
|
||||||
|
color: #aaa;
|
||||||
|
}
|
||||||
|
.sp-tutorials-list li:hover .sp-popup {
|
||||||
|
color: #00a69c;
|
||||||
|
}
|
||||||
|
.sp-tutorials-list li iframe {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
/* Media Queries */
|
/* Media Queries */
|
||||||
@media only screen and (max-width: 850px) {
|
@media only screen and (max-width: 850px) {
|
||||||
.sp-modules-wrapper {
|
.sp-modules-wrapper {
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ class SP_Modules {
|
|||||||
'tournaments' => array(
|
'tournaments' => array(
|
||||||
'label' => __( 'Tournaments', 'sportspress' ),
|
'label' => __( 'Tournaments', 'sportspress' ),
|
||||||
'class' => 'SportsPress_Tournaments',
|
'class' => 'SportsPress_Tournaments',
|
||||||
'tip' => __( 'Upgrade to Pro', 'sportspress' ),
|
|
||||||
'icon' => 'sp-icon-tournament',
|
'icon' => 'sp-icon-tournament',
|
||||||
'link' => 'http://tboy.co/tournaments',
|
'link' => 'http://tboy.co/tournaments',
|
||||||
),
|
),
|
||||||
@@ -52,7 +51,6 @@ class SP_Modules {
|
|||||||
'team_colors' => array(
|
'team_colors' => array(
|
||||||
'label' => __( 'Team Colors', 'sportspress' ),
|
'label' => __( 'Team Colors', 'sportspress' ),
|
||||||
'class' => 'SportsPress_Team_Colors',
|
'class' => 'SportsPress_Team_Colors',
|
||||||
'tip' => __( 'Upgrade to Pro', 'sportspress' ),
|
|
||||||
'icon' => 'sp-icon-color',
|
'icon' => 'sp-icon-color',
|
||||||
'link' => 'http://tboy.co/colors',
|
'link' => 'http://tboy.co/colors',
|
||||||
),
|
),
|
||||||
@@ -79,12 +77,15 @@ class SP_Modules {
|
|||||||
'staff_directories' => array(
|
'staff_directories' => array(
|
||||||
'label' => __( 'Directories', 'sportspress' ),
|
'label' => __( 'Directories', 'sportspress' ),
|
||||||
'class' => 'SportsPress_Staff_Directories',
|
'class' => 'SportsPress_Staff_Directories',
|
||||||
'tip' => __( 'Upgrade to Pro', 'sportspress' ),
|
|
||||||
'icon' => 'sp-icon-archive',
|
'icon' => 'sp-icon-archive',
|
||||||
'link' => 'http://tboy.co/directories',
|
'link' => 'http://tboy.co/directories',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
'other' => array(
|
'other' => array(
|
||||||
|
'tutorials' => array(
|
||||||
|
'label' => __( 'Tutorials', 'sportspress' ),
|
||||||
|
'icon' => 'dashicons dashicons-video-alt3',
|
||||||
|
),
|
||||||
'twitter' => array(
|
'twitter' => array(
|
||||||
'label' => __( 'Twitter', 'sportspress' ),
|
'label' => __( 'Twitter', 'sportspress' ),
|
||||||
'class' => 'SportsPress_Twitter',
|
'class' => 'SportsPress_Twitter',
|
||||||
@@ -96,28 +97,24 @@ class SP_Modules {
|
|||||||
'branding' => array(
|
'branding' => array(
|
||||||
'label' => __( 'Branding', 'sportspress' ),
|
'label' => __( 'Branding', 'sportspress' ),
|
||||||
'class' => 'SportsPress_Branding',
|
'class' => 'SportsPress_Branding',
|
||||||
'tip' => __( 'Upgrade to Pro', 'sportspress' ),
|
|
||||||
'icon' => 'sp-icon-sportspress',
|
'icon' => 'sp-icon-sportspress',
|
||||||
'link' => 'http://tboy.co/branding',
|
'link' => 'http://tboy.co/branding',
|
||||||
),
|
),
|
||||||
'league_menu' => array(
|
'league_menu' => array(
|
||||||
'label' => __( 'League Menu', 'sportspress' ),
|
'label' => __( 'League Menu', 'sportspress' ),
|
||||||
'class' => 'SportsPress_League_Menu',
|
'class' => 'SportsPress_League_Menu',
|
||||||
'tip' => __( 'Upgrade to Pro', 'sportspress' ),
|
|
||||||
'icon' => 'sp-icon-menu',
|
'icon' => 'sp-icon-menu',
|
||||||
'link' => 'http://tboy.co/menu',
|
'link' => 'http://tboy.co/menu',
|
||||||
),
|
),
|
||||||
'sponsors' => array(
|
'sponsors' => array(
|
||||||
'label' => __( 'Sponsors', 'sportspress' ),
|
'label' => __( 'Sponsors', 'sportspress' ),
|
||||||
'class' => 'SportsPress_Sponsors',
|
'class' => 'SportsPress_Sponsors',
|
||||||
'tip' => __( 'Upgrade to Pro', 'sportspress' ),
|
|
||||||
'icon' => 'sp-icon-megaphone',
|
'icon' => 'sp-icon-megaphone',
|
||||||
'link' => 'http://tboy.co/sponsors',
|
'link' => 'http://tboy.co/sponsors',
|
||||||
),
|
),
|
||||||
'multisite' => array(
|
'multisite' => array(
|
||||||
'label' => __( 'Multisite', 'sportspress' ),
|
'label' => __( 'Multisite', 'sportspress' ),
|
||||||
'class' => 'SportsPress_Multisite',
|
'class' => 'SportsPress_Multisite',
|
||||||
'tip' => __( 'Upgrade to Pro', 'sportspress' ),
|
|
||||||
'icon' => 'sp-icon-globe',
|
'icon' => 'sp-icon-globe',
|
||||||
'link' => 'http://tboy.co/multisite',
|
'link' => 'http://tboy.co/multisite',
|
||||||
),
|
),
|
||||||
|
|||||||
163
modules/sportspress-tutorials.php
Normal file
163
modules/sportspress-tutorials.php
Normal file
@@ -0,0 +1,163 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
Plugin Name: SportsPress Tutorials
|
||||||
|
Plugin URI: http://themeboy.com/
|
||||||
|
Description: Display SportsPress video tutorials.
|
||||||
|
Author: ThemeBoy
|
||||||
|
Author URI: http://themeboy.com/
|
||||||
|
Version: 1.7
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Exit if accessed directly
|
||||||
|
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||||
|
|
||||||
|
if ( ! class_exists( 'SportsPress_Tutorials' ) ) :
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Main SportsPress Tutorials Class
|
||||||
|
*
|
||||||
|
* @class SportsPress_Tutorials
|
||||||
|
* @version 1.7
|
||||||
|
*/
|
||||||
|
class SportsPress_Tutorials {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
public $ids = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*/
|
||||||
|
public function __construct() {
|
||||||
|
// Define constants
|
||||||
|
$this->define_constants();
|
||||||
|
|
||||||
|
add_action( 'init', array( $this, 'get_video_ids' ) );
|
||||||
|
add_action( 'admin_menu', array( $this, 'admin_menu' ), 8 );
|
||||||
|
add_action( 'sportspress_screen_ids', array( $this, 'screen_ids' ) );
|
||||||
|
add_filter( 'sportspress_next_steps', array( $this, 'next_steps' ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define constants.
|
||||||
|
*/
|
||||||
|
private function define_constants() {
|
||||||
|
if ( !defined( 'SP_TUTORIALS_VERSION' ) )
|
||||||
|
define( 'SP_TUTORIALS_VERSION', '1.7' );
|
||||||
|
|
||||||
|
if ( !defined( 'SP_TUTORIALS_URL' ) )
|
||||||
|
define( 'SP_TUTORIALS_URL', plugin_dir_url( __FILE__ ) );
|
||||||
|
|
||||||
|
if ( !defined( 'SP_TUTORIALS_DIR' ) )
|
||||||
|
define( 'SP_TUTORIALS_DIR', plugin_dir_path( __FILE__ ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get video IDs.
|
||||||
|
*/
|
||||||
|
public function get_video_ids() {
|
||||||
|
$this->ids = apply_filters( 'sportspress_tutorial_videos', array(
|
||||||
|
__( 'Get Started', 'sportspress' ) => apply_filters( 'sportspress_get_started_tutorial_videos', array(
|
||||||
|
__( 'Installation', 'sportspress' ) => '121430679',
|
||||||
|
__( 'Competitions', 'sportspress' ) . ' & ' . __( 'Seasons', 'sportspress' ) => '121438196',
|
||||||
|
__( 'Venues', 'sportspress' ) => '121438615',
|
||||||
|
__( 'Positions', 'sportspress' ) . ' & ' . __( 'Jobs', 'sportspress' ) => '121438826',
|
||||||
|
) ),
|
||||||
|
__( 'Teams', 'sportspress' ) => apply_filters( 'sportspress_team_tutorial_videos', array(
|
||||||
|
__( 'Add New Team', 'sportspress' ) => '121439873',
|
||||||
|
__( 'League Tables', 'sportspress' ) => '121592514',
|
||||||
|
) ),
|
||||||
|
__( 'Players', 'sportspress' ) . ' & ' . __( 'Staff', 'sportspress' ) => array_merge(
|
||||||
|
apply_filters( 'sportspress_player_tutorial_videos', array(
|
||||||
|
__( 'Add New Player', 'sportspress' ) => '121440032',
|
||||||
|
) ),
|
||||||
|
apply_filters( 'sportspress_staff_tutorial_videos', array(
|
||||||
|
__( 'Add New Staff', 'sportspress' ) => '121440185',
|
||||||
|
) )
|
||||||
|
),
|
||||||
|
__( 'Events', 'sportspress' ) => apply_filters( 'sportspress_event_tutorial_videos', array(
|
||||||
|
__( 'Add New Event', 'sportspress' ) => '121524233',
|
||||||
|
__( 'Edit Event', 'sportspress' ) => '121590015',
|
||||||
|
__( 'Calendars', 'sportspress' ) => '121591259',
|
||||||
|
) ),
|
||||||
|
) );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add menu item
|
||||||
|
*/
|
||||||
|
public function admin_menu() {
|
||||||
|
add_submenu_page( 'sportspress', __( 'Tutorials', 'sportspress' ), __( 'Tutorials', 'sportspress' ), 'manage_sportspress', 'sportspress-tutorials', array( $this, 'tutorials_page' ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Init the tutorials page
|
||||||
|
*/
|
||||||
|
public function tutorials_page() {
|
||||||
|
$i = 0;
|
||||||
|
?>
|
||||||
|
<div class="wrap sportspress sportspress-tutorials-wrap">
|
||||||
|
<h2>
|
||||||
|
<?php _e( 'Tutorials', 'sportspress' ); ?>
|
||||||
|
</h2>
|
||||||
|
<div class="sp-tutorials-main">
|
||||||
|
<?php foreach ( $this->ids as $section => $ids ) { ?>
|
||||||
|
<h3><?php echo $section; ?></h3>
|
||||||
|
<ul class="sp-tutorials-list">
|
||||||
|
<?php foreach ( $ids as $label => $id ) { $i++; ?>
|
||||||
|
<li>
|
||||||
|
<table class="widefat" cellspacing="0">
|
||||||
|
<thead>
|
||||||
|
<tr><th>
|
||||||
|
<strong><?php echo $i; ?></strong>
|
||||||
|
<?php echo $label; ?>
|
||||||
|
<a href="#" class="sp-popup sp-icon-popup" title="<?php _e( 'Pop-out', 'sportspress' ); ?>" onclick="window.open('//player.vimeo.com/video/<?php echo $id; ?>?color=00a69c&portrait=0&title=0&byline=0&autoplay=1', '_blank', 'width=640, height=360');return false;"></a>
|
||||||
|
</th></tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<div class="sp-fitvids">
|
||||||
|
<iframe src="//player.vimeo.com/video/<?php echo $id; ?>?color=00a69c&portrait=0&title=0&byline=0" width="320" height="180" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</li>
|
||||||
|
<?php } ?>
|
||||||
|
</ul>
|
||||||
|
<?php } ?>
|
||||||
|
<?php do_action( 'sportspress_tutorials_page' ); ?>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add screen ids
|
||||||
|
*/
|
||||||
|
public function screen_ids( $ids = array() ) {
|
||||||
|
$ids[] = 'sportspress_page_sportspress-tutorials';
|
||||||
|
return $ids;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add link to next steps
|
||||||
|
*/
|
||||||
|
public function next_steps( $steps = array() ) {
|
||||||
|
$steps = array(
|
||||||
|
'tutorials' => array(
|
||||||
|
'link' => admin_url( add_query_arg( array( 'page' => 'sportspress-tutorials' ), 'admin.php' ) ),
|
||||||
|
'icon' => 'dashicons dashicons-video-alt3',
|
||||||
|
'label' => __( 'Tutorials', 'sportspress' ),
|
||||||
|
) ) + $steps;
|
||||||
|
return $steps;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
endif;
|
||||||
|
|
||||||
|
if ( get_option( 'sportspress_load_tutorials_module', 'yes' ) == 'yes' ) {
|
||||||
|
new SportsPress_Tutorials();
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user