Add team table columns shortcode close #32
This commit is contained in:
@@ -5,20 +5,21 @@ $strings = 'tinyMCE.addI18n({' . _WP_Editors::$mce_locale . ':{
|
||||
insert: "' . esc_js( __( 'SportsPress Shortcodes', 'sportspress' ) ) . '",
|
||||
auto: "' . esc_js( __( 'Auto', 'sportspress' ) ) . '",
|
||||
manual: "' . esc_js( __( 'Manual', 'sportspress' ) ) . '",
|
||||
single: "' . esc_js( __( 'Single', 'sportspress' ) ) . '",
|
||||
select: "' . esc_js( __( 'Select...', 'sportspress' ) ) . '",
|
||||
countdown: "' . esc_js( __( 'Countdown', 'sportspress' ) ) . '",
|
||||
event: "' . esc_js( __( 'Event', 'sportspress' ) ) . '",
|
||||
details: "' . esc_js( __( 'Details', 'sportspress' ) ) . '",
|
||||
results: "' . esc_js( __( 'Results', 'sportspress' ) ) . '",
|
||||
countdown: "' . esc_js( __( 'Countdown', 'sportspress' ) ) . '",
|
||||
performance: "' . esc_js( __( 'Performance', 'sportspress' ) ) . '",
|
||||
calendar: "' . esc_js( __( 'Calendar', 'sportspress' ) ) . '",
|
||||
team: "' . esc_js( __( 'Team', 'sportspress' ) ) . '",
|
||||
statistics: "' . esc_js( __( 'Statistics', 'sportspress' ) ) . '",
|
||||
table_columns: "' . esc_js( __( 'Table Columns', 'sportspress' ) ) . '",
|
||||
league_table: "' . esc_js( __( 'League Table', 'sportspress' ) ) . '",
|
||||
player_list: "' . esc_js( __( 'Player List', 'sportspress' ) ) . '",
|
||||
list: "' . esc_js( __( 'List', 'sportspress' ) ) . '",
|
||||
blocks: "' . esc_js( __( 'Blocks', 'sportspress' ) ) . '",
|
||||
league_table: "' . esc_js( __( 'League Table', 'sportspress' ) ) . '",
|
||||
player: "' . esc_js( __( 'Player', 'sportspress' ) ) . '",
|
||||
statistics: "' . esc_js( __( 'Statistics', 'sportspress' ) ) . '",
|
||||
list: "' . esc_js( __( 'List', 'sportspress' ) ) . '",
|
||||
gallery: "' . esc_js( __( 'Gallery', 'sportspress' ) ) . '"
|
||||
}
|
||||
}})';
|
||||
|
||||
@@ -12,39 +12,34 @@
|
||||
text: ed.getLang( 'sportspress.event' ),
|
||||
menu: [
|
||||
{
|
||||
text: ed.getLang( 'sportspress.single' ),
|
||||
menu: [
|
||||
{
|
||||
text: ed.getLang( 'sportspress.details' ),
|
||||
onclick: function() {
|
||||
// triggers the thickbox
|
||||
var width = jQuery(window).width(), H = jQuery(window).height(), W = ( 720 < width ) ? 720 : width;
|
||||
W = W - 80;
|
||||
H = H - 84;
|
||||
tb_show( ed.getLang( 'sportspress.event' ) + ' - ' + ed.getLang( 'sportspress.details' ), 'admin-ajax.php?action=sportspress_event_details_shortcode&width=' + W + '&height=' + H );
|
||||
}
|
||||
},
|
||||
{
|
||||
text: ed.getLang( 'sportspress.results' ),
|
||||
onclick: function() {
|
||||
// triggers the thickbox
|
||||
var width = jQuery(window).width(), H = jQuery(window).height(), W = ( 720 < width ) ? 720 : width;
|
||||
W = W - 80;
|
||||
H = H - 84;
|
||||
tb_show( ed.getLang( 'sportspress.event' ) + ' - ' + ed.getLang( 'sportspress.results' ), 'admin-ajax.php?action=sportspress_event_results_shortcode&width=' + W + '&height=' + H );
|
||||
}
|
||||
},
|
||||
{
|
||||
text: ed.getLang( 'sportspress.performance' ),
|
||||
onclick: function() {
|
||||
// triggers the thickbox
|
||||
var width = jQuery(window).width(), H = jQuery(window).height(), W = ( 720 < width ) ? 720 : width;
|
||||
W = W - 80;
|
||||
H = H - 84;
|
||||
tb_show( ed.getLang( 'sportspress.event' ) + ' - ' + ed.getLang( 'sportspress.performance' ), 'admin-ajax.php?action=sportspress_event_performance_shortcode&width=' + W + '&height=' + H );
|
||||
}
|
||||
}
|
||||
]
|
||||
text: ed.getLang( 'sportspress.details' ),
|
||||
onclick: function() {
|
||||
// triggers the thickbox
|
||||
var width = jQuery(window).width(), H = jQuery(window).height(), W = ( 720 < width ) ? 720 : width;
|
||||
W = W - 80;
|
||||
H = H - 84;
|
||||
tb_show( ed.getLang( 'sportspress.event' ) + ' - ' + ed.getLang( 'sportspress.details' ), 'admin-ajax.php?action=sportspress_event_details_shortcode&width=' + W + '&height=' + H );
|
||||
}
|
||||
},
|
||||
{
|
||||
text: ed.getLang( 'sportspress.results' ),
|
||||
onclick: function() {
|
||||
// triggers the thickbox
|
||||
var width = jQuery(window).width(), H = jQuery(window).height(), W = ( 720 < width ) ? 720 : width;
|
||||
W = W - 80;
|
||||
H = H - 84;
|
||||
tb_show( ed.getLang( 'sportspress.event' ) + ' - ' + ed.getLang( 'sportspress.results' ), 'admin-ajax.php?action=sportspress_event_results_shortcode&width=' + W + '&height=' + H );
|
||||
}
|
||||
},
|
||||
{
|
||||
text: ed.getLang( 'sportspress.performance' ),
|
||||
onclick: function() {
|
||||
// triggers the thickbox
|
||||
var width = jQuery(window).width(), H = jQuery(window).height(), W = ( 720 < width ) ? 720 : width;
|
||||
W = W - 80;
|
||||
H = H - 84;
|
||||
tb_show( ed.getLang( 'sportspress.event' ) + ' - ' + ed.getLang( 'sportspress.performance' ), 'admin-ajax.php?action=sportspress_event_performance_shortcode&width=' + W + '&height=' + H );
|
||||
}
|
||||
},
|
||||
{
|
||||
text: ed.getLang( 'sportspress.countdown' ),
|
||||
@@ -55,7 +50,12 @@
|
||||
H = H - 84;
|
||||
tb_show( ed.getLang( 'sportspress.event' ) + ' - ' + ed.getLang( 'sportspress.countdown' ), 'admin-ajax.php?action=sportspress_countdown_shortcode&width=' + W + '&height=' + H );
|
||||
}
|
||||
},
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
text: ed.getLang( 'sportspress.calendar' ),
|
||||
menu: [
|
||||
{
|
||||
text: ed.getLang( 'sportspress.calendar' ),
|
||||
onclick : function() {
|
||||
@@ -63,7 +63,7 @@
|
||||
var width = jQuery(window).width(), H = jQuery(window).height(), W = ( 720 < width ) ? 720 : width;
|
||||
W = W - 80;
|
||||
H = H - 84;
|
||||
tb_show( ed.getLang( 'sportspress.event' ) + ' - ' + ed.getLang( 'sportspress.calendar' ), 'admin-ajax.php?action=sportspress_event_calendar_shortcode&width=' + W + '&height=' + H );
|
||||
tb_show( ed.getLang( 'sportspress.calendar' ) + ' - ' + ed.getLang( 'sportspress.calendar' ), 'admin-ajax.php?action=sportspress_event_calendar_shortcode&width=' + W + '&height=' + H );
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -73,7 +73,7 @@
|
||||
var width = jQuery(window).width(), H = jQuery(window).height(), W = ( 720 < width ) ? 720 : width;
|
||||
W = W - 80;
|
||||
H = H - 84;
|
||||
tb_show( ed.getLang( 'sportspress.event' ) + ' - ' + ed.getLang( 'sportspress.list' ), 'admin-ajax.php?action=sportspress_event_list_shortcode&width=' + W + '&height=' + H );
|
||||
tb_show( ed.getLang( 'sportspress.calendar' ) + ' - ' + ed.getLang( 'sportspress.list' ), 'admin-ajax.php?action=sportspress_event_list_shortcode&width=' + W + '&height=' + H );
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -83,58 +83,23 @@
|
||||
var width = jQuery(window).width(), H = jQuery(window).height(), W = ( 720 < width ) ? 720 : width;
|
||||
W = W - 80;
|
||||
H = H - 84;
|
||||
tb_show( ed.getLang( 'sportspress.event' ) + ' - ' + ed.getLang( 'sportspress.blocks' ), 'admin-ajax.php?action=sportspress_event_blocks_shortcode&width=' + W + '&height=' + H );
|
||||
tb_show( ed.getLang( 'sportspress.calendar' ) + ' - ' + ed.getLang( 'sportspress.blocks' ), 'admin-ajax.php?action=sportspress_event_blocks_shortcode&width=' + W + '&height=' + H );
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
text: ed.getLang( 'sportspress.player' ),
|
||||
text: ed.getLang( 'sportspress.team' ),
|
||||
menu: [
|
||||
{
|
||||
text: ed.getLang( 'sportspress.single' ),
|
||||
menu: [
|
||||
{
|
||||
text: ed.getLang( 'sportspress.details' ),
|
||||
onclick: function() {
|
||||
// triggers the thickbox
|
||||
var width = jQuery(window).width(), H = jQuery(window).height(), W = ( 720 < width ) ? 720 : width;
|
||||
W = W - 80;
|
||||
H = H - 84;
|
||||
tb_show( ed.getLang( 'sportspress.player' ) + ' - ' + ed.getLang( 'sportspress.details' ), 'admin-ajax.php?action=sportspress_player_details_shortcode&width=' + W + '&height=' + H );
|
||||
}
|
||||
},
|
||||
{
|
||||
text: ed.getLang( 'sportspress.statistics' ),
|
||||
onclick: function() {
|
||||
// triggers the thickbox
|
||||
var width = jQuery(window).width(), H = jQuery(window).height(), W = ( 720 < width ) ? 720 : width;
|
||||
W = W - 80;
|
||||
H = H - 84;
|
||||
tb_show( ed.getLang( 'sportspress.player' ) + ' - ' + ed.getLang( 'sportspress.statistics' ), 'admin-ajax.php?action=sportspress_player_statistics_shortcode&width=' + W + '&height=' + H );
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
text: ed.getLang( 'sportspress.list' ),
|
||||
onclick : function() {
|
||||
// triggers the thickbox
|
||||
var width = jQuery(window).width(), H = jQuery(window).height(), W = ( 720 < width ) ? 720 : width;
|
||||
W = W - 80;
|
||||
H = H - 84;
|
||||
tb_show( ed.getLang( 'sportspress.player' ) + ' - ' + ed.getLang( 'sportspress.list' ), 'admin-ajax.php?action=sportspress_player_list_shortcode&width=' + W + '&height=' + H );
|
||||
}
|
||||
},
|
||||
{
|
||||
text: ed.getLang( 'sportspress.gallery' ),
|
||||
onclick : function() {
|
||||
// triggers the thickbox
|
||||
var width = jQuery(window).width(), H = jQuery(window).height(), W = ( 720 < width ) ? 720 : width;
|
||||
W = W - 80;
|
||||
H = H - 84;
|
||||
tb_show( ed.getLang( 'sportspress.player' ) + ' - ' + ed.getLang( 'sportspress.gallery' ), 'admin-ajax.php?action=sportspress_player_gallery_shortcode&width=' + W + '&height=' + H );
|
||||
}
|
||||
text: ed.getLang( 'sportspress.table_columns' ),
|
||||
onclick: function() {
|
||||
// triggers the thickbox
|
||||
var width = jQuery(window).width(), H = jQuery(window).height(), W = ( 720 < width ) ? 720 : width;
|
||||
W = W - 80;
|
||||
H = H - 84;
|
||||
tb_show( ed.getLang( 'sportspress.team' ) + ' - ' + ed.getLang( 'sportspress.table_columns' ), 'admin-ajax.php?action=sportspress_team_columns_shortcode&width=' + W + '&height=' + H );
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -147,6 +112,56 @@
|
||||
H = H - 84;
|
||||
tb_show( ed.getLang( 'sportspress.league_table' ), 'admin-ajax.php?action=sportspress_league_table_shortcode&width=' + W + '&height=' + H );
|
||||
}
|
||||
},
|
||||
{
|
||||
text: ed.getLang( 'sportspress.player' ),
|
||||
menu: [
|
||||
{
|
||||
text: ed.getLang( 'sportspress.details' ),
|
||||
onclick: function() {
|
||||
// triggers the thickbox
|
||||
var width = jQuery(window).width(), H = jQuery(window).height(), W = ( 720 < width ) ? 720 : width;
|
||||
W = W - 80;
|
||||
H = H - 84;
|
||||
tb_show( ed.getLang( 'sportspress.player' ) + ' - ' + ed.getLang( 'sportspress.details' ), 'admin-ajax.php?action=sportspress_player_details_shortcode&width=' + W + '&height=' + H );
|
||||
}
|
||||
},
|
||||
{
|
||||
text: ed.getLang( 'sportspress.statistics' ),
|
||||
onclick: function() {
|
||||
// triggers the thickbox
|
||||
var width = jQuery(window).width(), H = jQuery(window).height(), W = ( 720 < width ) ? 720 : width;
|
||||
W = W - 80;
|
||||
H = H - 84;
|
||||
tb_show( ed.getLang( 'sportspress.player' ) + ' - ' + ed.getLang( 'sportspress.statistics' ), 'admin-ajax.php?action=sportspress_player_statistics_shortcode&width=' + W + '&height=' + H );
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
text: ed.getLang( 'sportspress.player_list' ),
|
||||
menu: [
|
||||
{
|
||||
text: ed.getLang( 'sportspress.list' ),
|
||||
onclick : function() {
|
||||
// triggers the thickbox
|
||||
var width = jQuery(window).width(), H = jQuery(window).height(), W = ( 720 < width ) ? 720 : width;
|
||||
W = W - 80;
|
||||
H = H - 84;
|
||||
tb_show( ed.getLang( 'sportspress.player_list' ) + ' - ' + ed.getLang( 'sportspress.list' ), 'admin-ajax.php?action=sportspress_player_list_shortcode&width=' + W + '&height=' + H );
|
||||
}
|
||||
},
|
||||
{
|
||||
text: ed.getLang( 'sportspress.gallery' ),
|
||||
onclick : function() {
|
||||
// triggers the thickbox
|
||||
var width = jQuery(window).width(), H = jQuery(window).height(), W = ( 720 < width ) ? 720 : width;
|
||||
W = W - 80;
|
||||
H = H - 84;
|
||||
tb_show( ed.getLang( 'sportspress.player_list' ) + ' - ' + ed.getLang( 'sportspress.gallery' ), 'admin-ajax.php?action=sportspress_player_gallery_shortcode&width=' + W + '&height=' + H );
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
@@ -136,6 +136,7 @@ class SP_Admin_Meta_Boxes {
|
||||
add_meta_box( 'sp_editordiv', __( 'Description', 'sportspress' ), 'SP_Meta_Box_Calendar_Editor::output', 'sp_calendar', 'normal', 'low' );
|
||||
|
||||
// Teams
|
||||
add_meta_box( 'sp_shortcodediv', __( 'Shortcodes', 'sportspress' ), 'SP_Meta_Box_Team_Shortcode::output', 'sp_team', 'side', 'default' );
|
||||
add_meta_box( 'sp_detailsdiv', __( 'Details', 'sportspress' ), 'SP_Meta_Box_Team_Details::output', 'sp_team', 'side', 'default' );
|
||||
if ( isset( $post ) && isset( $post->ID ) ):
|
||||
if ( get_the_terms( $post->ID, 'sp_league' ) && get_the_terms( $post->ID, 'sp_season' ) ) add_meta_box( 'sp_columnssdiv', __( 'Table Columns', 'sportspress' ), 'SP_Meta_Box_Team_Columns::output', 'sp_team', 'normal', 'high' );
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* Team Shortcode
|
||||
*
|
||||
* @author ThemeBoy
|
||||
* @category Admin
|
||||
* @package SportsPress/Admin/Meta_Boxes
|
||||
* @version 1.3
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
/**
|
||||
* SP_Meta_Box_Team_Shortcode
|
||||
*/
|
||||
class SP_Meta_Box_Team_Shortcode {
|
||||
|
||||
/**
|
||||
* Output the metabox
|
||||
*/
|
||||
public static function output( $post ) {
|
||||
?>
|
||||
<p class="howto">
|
||||
<?php _e( 'Copy this code and paste it into your post, page or text widget content.', 'sportspress' ); ?>
|
||||
</p>
|
||||
<p>
|
||||
<strong><?php _e( 'Table Columns', 'sportspress' ); ?></strong>
|
||||
</p>
|
||||
<p><input type="text" value="[team_columns <?php echo $post->ID; ?>]" readonly="readonly" class="wp-ui-text-highlight code"></p>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,7 @@ class SP_Shortcodes {
|
||||
'event_calendar' => __CLASS__ . '::event_calendar',
|
||||
'event_list' => __CLASS__ . '::event_list',
|
||||
'event_blocks' => __CLASS__ . '::event_blocks',
|
||||
'team_columns' => __CLASS__ . '::team_columns',
|
||||
'league_table' => __CLASS__ . '::league_table',
|
||||
'player_details' => __CLASS__ . '::player_details',
|
||||
'player_statistics' => __CLASS__ . '::player_statistics',
|
||||
|
||||
24
includes/shortcodes/class-sp-shortcode-team-columns.php
Normal file
24
includes/shortcodes/class-sp-shortcode-team-columns.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* Team Columns Shortcode
|
||||
*
|
||||
* @author ThemeBoy
|
||||
* @category Shortcodes
|
||||
* @package SportsPress/Shortcodes/Team_Columns
|
||||
* @version 1.3
|
||||
*/
|
||||
class SP_Shortcode_Team_Columns {
|
||||
|
||||
/**
|
||||
* Output the team columns shortcode.
|
||||
*
|
||||
* @param array $atts
|
||||
*/
|
||||
public static function output( $atts ) {
|
||||
|
||||
if ( ! isset( $atts['id'] ) && isset( $atts[0] ) && is_numeric( $atts[0] ) )
|
||||
$atts['id'] = $atts[0];
|
||||
|
||||
sp_get_template( 'team-columns.php', $atts );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user