Enhance shortcode menu with Thickbox prompt
This commit is contained in:
@@ -74,14 +74,35 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wp-media-buttons .add_sportspress span.wp-media-buttons-icon:before {
|
/* Prefs */
|
||||||
font: normal 20px/1 sportspress, dashicons;
|
.sp-prefs .button {
|
||||||
|
margin: 0 3px 4px 0;
|
||||||
|
padding: 0 7px 1px 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sp-prefs .button input[type=checkbox] {
|
||||||
|
background: transparent;
|
||||||
|
border: none;
|
||||||
|
-webkit-box-shadow: none;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sp-prefs .button input[type=checkbox]:not(:checked):before {
|
||||||
|
float: left;
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
width: 16px;
|
||||||
|
font: 400 21px/1 dashicons;
|
||||||
speak: none;
|
speak: none;
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
content: '\f111';
|
content: '\f335';
|
||||||
|
margin: -3px 0 0 -4px;
|
||||||
|
color: #a00;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* TinyMCE */
|
||||||
|
|
||||||
i.mce-i-sp_shortcodes_button:before, span.mce_sp_shortcodes_button:before {
|
i.mce-i-sp_shortcodes_button:before, span.mce_sp_shortcodes_button:before {
|
||||||
font-family: 'sportspress';
|
font-family: 'sportspress';
|
||||||
speak: none;
|
speak: none;
|
||||||
|
|||||||
@@ -3,15 +3,22 @@
|
|||||||
$strings = 'tinyMCE.addI18n({' . _WP_Editors::$mce_locale . ':{
|
$strings = 'tinyMCE.addI18n({' . _WP_Editors::$mce_locale . ':{
|
||||||
sportspress:{
|
sportspress:{
|
||||||
insert: "' . esc_js( __( 'SportsPress shortcodes', 'sportspress' ) ) . '",
|
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' ) ) . '",
|
countdown: "' . esc_js( __( 'Countdown', 'sportspress' ) ) . '",
|
||||||
event_details: "' . esc_js( __( 'Event Details', 'sportspress' ) ) . '",
|
event: "' . esc_js( __( 'Event', 'sportspress' ) ) . '",
|
||||||
event_results: "' . esc_js( __( 'Event Results', 'sportspress' ) ) . '",
|
details: "' . esc_js( __( 'Details', 'sportspress' ) ) . '",
|
||||||
event_performance: "' . esc_js( __( 'Event Performance', 'sportspress' ) ) . '",
|
results: "' . esc_js( __( 'Results', 'sportspress' ) ) . '",
|
||||||
event_calendar: "' . esc_js( __( 'Event Calendar', 'sportspress' ) ) . '",
|
performance: "' . esc_js( __( 'Performance', 'sportspress' ) ) . '",
|
||||||
event_list: "' . esc_js( __( 'Event List', 'sportspress' ) ) . '",
|
calendar: "' . esc_js( __( 'Calendar', 'sportspress' ) ) . '",
|
||||||
event_blocks: "' . esc_js( __( 'Event Blocks', 'sportspress' ) ) . '",
|
list: "' . esc_js( __( 'List', 'sportspress' ) ) . '",
|
||||||
|
blocks: "' . esc_js( __( 'Blocks', 'sportspress' ) ) . '",
|
||||||
league_table: "' . esc_js( __( 'League Table', 'sportspress' ) ) . '",
|
league_table: "' . esc_js( __( 'League Table', 'sportspress' ) ) . '",
|
||||||
player_list: "' . esc_js( __( 'Player List', 'sportspress' ) ) . '",
|
player: "' . esc_js( __( 'Player', 'sportspress' ) ) . '",
|
||||||
player_gallery: "' . esc_js( __( 'Player Gallery', 'sportspress' ) ) . '"
|
statistics: "' . esc_js( __( 'Statistics', 'sportspress' ) ) . '",
|
||||||
|
list: "' . esc_js( __( 'List', 'sportspress' ) ) . '",
|
||||||
|
gallery: "' . esc_js( __( 'Gallery', 'sportspress' ) ) . '"
|
||||||
}
|
}
|
||||||
}})';
|
}})';
|
||||||
@@ -10,63 +10,202 @@
|
|||||||
menu: [
|
menu: [
|
||||||
{
|
{
|
||||||
text: ed.getLang( 'sportspress.countdown' ),
|
text: ed.getLang( 'sportspress.countdown' ),
|
||||||
|
menu: [
|
||||||
|
{
|
||||||
|
text: ed.getLang( 'sportspress.manual' ),
|
||||||
onclick: function() {
|
onclick: function() {
|
||||||
editor.insertContent( '[countdown id="" live=""]' );
|
editor.insertContent( '[countdown id="" live="1"]' );
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: ed.getLang( 'sportspress.event_details' ),
|
text: ed.getLang( 'sportspress.auto' ),
|
||||||
|
onclick: function() {
|
||||||
|
editor.insertContent( '[countdown]' );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: ed.getLang( 'sportspress.event' ),
|
||||||
|
menu: [
|
||||||
|
{
|
||||||
|
text: ed.getLang( 'sportspress.single' ),
|
||||||
|
menu: [
|
||||||
|
{
|
||||||
|
text: ed.getLang( 'sportspress.details' ),
|
||||||
onclick: function() {
|
onclick: function() {
|
||||||
editor.insertContent( '[event_details id=""]' );
|
editor.insertContent( '[event_details id=""]' );
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: ed.getLang( 'sportspress.event_results' ),
|
text: ed.getLang( 'sportspress.results' ),
|
||||||
onclick: function() {
|
onclick: function() {
|
||||||
editor.insertContent( '[event_results id=""]' );
|
editor.insertContent( '[event_results id=""]' );
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: ed.getLang( 'sportspress.event_performance' ),
|
text: ed.getLang( 'sportspress.performance' ),
|
||||||
onclick: function() {
|
onclick: function() {
|
||||||
editor.insertContent( '[event_performance id=""]' );
|
editor.insertContent( '[event_performance id=""]' );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: ed.getLang( 'sportspress.event_calendar' ),
|
text: ed.getLang( 'sportspress.calendar' ),
|
||||||
onclick: function() {
|
menu: [
|
||||||
editor.insertContent( '[event_calendar id="" status="default" show_all_events_link="0"]' );
|
{
|
||||||
|
text: ed.getLang( 'sportspress.select' ),
|
||||||
|
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( 'My WIndow POPUP Title', '#TB_inline?width=' + W + '&height=' + H + '&inlineId=sp_choose_event_calendar' );
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: ed.getLang( 'sportspress.event_list' ),
|
text: ed.getLang( 'sportspress.manual' ),
|
||||||
|
onclick: function() {
|
||||||
|
editor.insertContent( '[event_calendar id="" status="default" initial="1" show_all_events_link="0"]' );
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: ed.getLang( 'sportspress.auto' ),
|
||||||
|
onclick: function() {
|
||||||
|
editor.insertContent( '[event_calendar]' );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: ed.getLang( 'sportspress.list' ),
|
||||||
|
menu: [
|
||||||
|
{
|
||||||
|
text: ed.getLang( 'sportspress.select' ),
|
||||||
|
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( 'My WIndow POPUP Title', '#TB_inline?width=' + W + '&height=' + H + '&inlineId=sp_choose_event_list' );
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: ed.getLang( 'sportspress.manual' ),
|
||||||
onclick: function() {
|
onclick: function() {
|
||||||
editor.insertContent( '[event_list id="" status="default" show_all_events_link="0"]' );
|
editor.insertContent( '[event_list id="" status="default" show_all_events_link="0"]' );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: ed.getLang( 'sportspress.event_blocks' ),
|
text: ed.getLang( 'sportspress.blocks' ),
|
||||||
|
menu: [
|
||||||
|
{
|
||||||
|
text: ed.getLang( 'sportspress.select' ),
|
||||||
|
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( 'My WIndow POPUP Title', '#TB_inline?width=' + W + '&height=' + H + '&inlineId=sp_choose_event_blocks' );
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: ed.getLang( 'sportspress.manual' ),
|
||||||
onclick: function() {
|
onclick: function() {
|
||||||
editor.insertContent( '[event_blocks id="" status="default" show_all_events_link="0"]' );
|
editor.insertContent( '[event_blocks id="" status="default" show_all_events_link="0"]' );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: ed.getLang( 'sportspress.league_table' ),
|
text: ed.getLang( 'sportspress.league_table' ),
|
||||||
|
menu: [
|
||||||
|
{
|
||||||
|
text: ed.getLang( 'sportspress.select' ),
|
||||||
|
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( 'My WIndow POPUP Title', '#TB_inline?width=' + W + '&height=' + H + '&inlineId=sp_choose_league_table' );
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: ed.getLang( 'sportspress.manual' ),
|
||||||
onclick: function() {
|
onclick: function() {
|
||||||
editor.insertContent( '[league_table id="" number="-1" show_team_logo="1" link_posts="0" show_full_table_link="0"]' );
|
editor.insertContent( '[league_table id="" number="-1" show_team_logo="1" link_posts="0" show_full_table_link="0"]' );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: ed.getLang( 'sportspress.player_list' ),
|
text: ed.getLang( 'sportspress.player' ),
|
||||||
|
menu: [
|
||||||
|
{
|
||||||
|
text: ed.getLang( 'sportspress.single' ),
|
||||||
|
menu: [
|
||||||
|
{
|
||||||
|
text: ed.getLang( 'sportspress.details' ),
|
||||||
|
onclick: function() {
|
||||||
|
editor.insertContent( '[player_details id=""]' );
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: ed.getLang( 'sportspress.statistics' ),
|
||||||
|
onclick: function() {
|
||||||
|
editor.insertContent( '[player_statistics id=""]' );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: ed.getLang( 'sportspress.list' ),
|
||||||
|
menu: [
|
||||||
|
{
|
||||||
|
text: ed.getLang( 'sportspress.select' ),
|
||||||
|
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( 'My WIndow POPUP Title', '#TB_inline?width=' + W + '&height=' + H + '&inlineId=sp_choose_player_list' );
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: ed.getLang( 'sportspress.manual' ),
|
||||||
onclick: function() {
|
onclick: function() {
|
||||||
editor.insertContent( '[player_list id="" number="-1" orderby="default" order="ASC" show_all_players_link="0"]' );
|
editor.insertContent( '[player_list id="" number="-1" orderby="default" order="ASC" show_all_players_link="0"]' );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: ed.getLang( 'sportspress.player_gallery' ),
|
text: ed.getLang( 'sportspress.gallery' ),
|
||||||
onclick: function() {
|
menu: [
|
||||||
editor.insertContent( '[event_blocks id="" number="-1" columns="3" orderby="default" order="ASC" size="thumbnail" show_all_players_link="0"]' );
|
{
|
||||||
|
text: ed.getLang( 'sportspress.select' ),
|
||||||
|
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( 'My WIndow POPUP Title', '#TB_inline?width=' + W + '&height=' + H + '&inlineId=sp_choose_player_gallery' );
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: ed.getLang( 'sportspress.manual' ),
|
||||||
|
onclick: function() {
|
||||||
|
editor.insertContent( '[player_gallery id="" number="-1" columns="3" orderby="default" order="ASC" size="thumbnail" show_all_players_link="0"]' );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
* @author ThemeBoy
|
* @author ThemeBoy
|
||||||
* @category Admin
|
* @category Admin
|
||||||
* @package SportsPress/Admin
|
* @package SportsPress/Admin
|
||||||
* @version 2.0
|
* @version 1.2
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( ! defined( 'ABSPATH' ) ) {
|
if ( ! defined( 'ABSPATH' ) ) {
|
||||||
@@ -17,7 +17,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||||||
/**
|
/**
|
||||||
* SP_Admin_Editor class.
|
* SP_Admin_Editor class.
|
||||||
*
|
*
|
||||||
* @since 2.0
|
* @since 1.2
|
||||||
*/
|
*/
|
||||||
class SP_Admin_Editor {
|
class SP_Admin_Editor {
|
||||||
|
|
||||||
|
|||||||
483
includes/admin/class-sp-admin-thickbox.php
Normal file
483
includes/admin/class-sp-admin-thickbox.php
Normal file
@@ -0,0 +1,483 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Post Types Admin
|
||||||
|
*
|
||||||
|
* @author ThemeBoy
|
||||||
|
* @category Admin
|
||||||
|
* @package SportsPress/Admin
|
||||||
|
* @version 1.2
|
||||||
|
*/
|
||||||
|
|
||||||
|
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
|
|
||||||
|
if ( ! class_exists( 'SP_Admin_Thickbox' ) ) :
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SP_Admin_Thickbox Class
|
||||||
|
*/
|
||||||
|
class SP_Admin_Thickbox {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*/
|
||||||
|
public function __construct() {
|
||||||
|
add_action( 'admin_footer', array( $this, 'admin_footer' ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Admin Footer For Thickbox
|
||||||
|
*
|
||||||
|
* Prints the footer code needed for the TinyMCE modal window.
|
||||||
|
*
|
||||||
|
* @since 1.2
|
||||||
|
* @global $pagenow
|
||||||
|
* @global $typenow
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function admin_footer() {
|
||||||
|
global $pagenow, $typenow;
|
||||||
|
|
||||||
|
// Only run in post/page creation and edit screens
|
||||||
|
if ( in_array( $pagenow, array( 'post.php', 'page.php', 'post-new.php', 'post-edit.php' ) ) ) { ?>
|
||||||
|
<script type="text/javascript">
|
||||||
|
function insertSportsPress( type ) {
|
||||||
|
var $div = jQuery('#sp-thickbox-' + type);
|
||||||
|
|
||||||
|
// All shortcodes have an ID
|
||||||
|
var args = {id: $div.find('[name=id]').val()};
|
||||||
|
|
||||||
|
// Extract args based on type
|
||||||
|
if ( 'event_calendar' == type ) {
|
||||||
|
args['status'] = $div.find('[name=status]').val();
|
||||||
|
args['show_all_events_link'] = $div.find('[name=show_all_events_link]').val() == 'on' ? 1 : 0;
|
||||||
|
} else if ( 'event_list' == type ) {
|
||||||
|
args['status'] = $div.find('[name=status]').val();
|
||||||
|
args['date'] = $div.find('[name=date]').val();
|
||||||
|
args['number'] = $div.find('[name=number]').val();
|
||||||
|
args['order'] = $div.find('[name=order]').val();
|
||||||
|
args['columns'] = $div.find('[name="columns[]"]:checked').map(function() { return this.value; }).get().join(',');
|
||||||
|
args['show_all_events_link'] = $div.find('[name=show_all_events_link]').val() == 'on' ? 1 : 0;
|
||||||
|
} else if ( 'event_blocks' == type ) {
|
||||||
|
args['status'] = $div.find('[name=status]').val();
|
||||||
|
args['date'] = $div.find('[name=date]').val();
|
||||||
|
args['number'] = $div.find('[name=number]').val();
|
||||||
|
args['order'] = $div.find('[name=order]').val();
|
||||||
|
args['show_all_events_link'] = $div.find('[name=show_all_events_link]').val() == 'on' ? 1 : 0;
|
||||||
|
} else if ( 'league_table' == type ) {
|
||||||
|
args['number'] = $div.find('[name=number]').val();
|
||||||
|
args['columns'] = $div.find('[name="columns[]"]:checked').map(function() { return this.value; }).get().join(',');
|
||||||
|
args['show_team_logo'] = $div.find('[name=show_team_logo]').val() == 'on' ? 1 : 0;
|
||||||
|
args['show_full_table_link'] = $div.find('[name=show_full_table_link]').val() == 'on' ? 1 : 0;
|
||||||
|
} else if ( 'player_list' == type ) {
|
||||||
|
args['number'] = $div.find('[name=number]').val();
|
||||||
|
args['columns'] = $div.find('[name="columns[]"]:checked').map(function() { return this.value; }).get().join(',');
|
||||||
|
args['orderby'] = $div.find('[name=orderby]').val();
|
||||||
|
args['order'] = $div.find('[name=order]').val();
|
||||||
|
args['show_all_players_link'] = $div.find('[name=show_all_players_link]').val() == 'on' ? 1 : 0;
|
||||||
|
} else if ( 'player_gallery' == type ) {
|
||||||
|
args['number'] = $div.find('[name=number]').val();
|
||||||
|
args['orderby'] = $div.find('[name=orderby]').val();
|
||||||
|
args['order'] = $div.find('[name=order]').val();
|
||||||
|
args['show_all_players_link'] = $div.find('[name=show_all_players_link]').val() == 'on' ? 1 : 0;
|
||||||
|
args['show_names_on_hover'] = $div.find('[name=show_names_on_hover]').val() == 'on' ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Generate the shortcode
|
||||||
|
var shortcode = '[' + type;
|
||||||
|
for ( var key in args ) {
|
||||||
|
if ( args.hasOwnProperty( key ) ) {
|
||||||
|
shortcode += ' ' + key + '="' + args[key] + '"';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
shortcode += ']';
|
||||||
|
|
||||||
|
// Send the shortcode to the editor
|
||||||
|
window.send_to_editor( shortcode );
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
ob_start();
|
||||||
|
$args = array(
|
||||||
|
'post_type' => 'sp_calendar',
|
||||||
|
'name' => 'id',
|
||||||
|
'values' => 'ID',
|
||||||
|
);
|
||||||
|
sp_dropdown_pages( $args );
|
||||||
|
$calendar_dropdown = ob_get_clean();
|
||||||
|
|
||||||
|
ob_start();
|
||||||
|
$args = array(
|
||||||
|
'post_type' => 'sp_table',
|
||||||
|
'name' => 'id',
|
||||||
|
'values' => 'ID',
|
||||||
|
);
|
||||||
|
sp_dropdown_pages( $args );
|
||||||
|
$league_table_dropdown = ob_get_clean();
|
||||||
|
|
||||||
|
ob_start();
|
||||||
|
$args = array(
|
||||||
|
'post_type' => 'sp_list',
|
||||||
|
'name' => 'id',
|
||||||
|
'values' => 'ID',
|
||||||
|
);
|
||||||
|
sp_dropdown_pages( $args );
|
||||||
|
$player_list_dropdown = ob_get_clean();
|
||||||
|
|
||||||
|
ob_start();
|
||||||
|
$args = array(
|
||||||
|
'prepend_options' => array(
|
||||||
|
'default' => __( 'Default', 'sportspress' ),
|
||||||
|
'number' => __( 'Number', 'sportspress' ),
|
||||||
|
'name' => __( 'Name', 'sportspress' ),
|
||||||
|
'eventsplayed' => __( 'Played', 'sportspress' )
|
||||||
|
),
|
||||||
|
'post_type' => array( 'sp_metric', 'sp_performance', 'sp_statistic' ),
|
||||||
|
'name' => 'orderby',
|
||||||
|
'id' => 'orderby',
|
||||||
|
'values' => 'slug'
|
||||||
|
);
|
||||||
|
sp_dropdown_pages( $args );
|
||||||
|
$player_list_orderby_dropdown = ob_get_clean();
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div id="sp_choose_event_calendar" style="display: none;">
|
||||||
|
<div class="wrap sp-thickbox-content" id="sp-thickbox-event_calendar">
|
||||||
|
<p>
|
||||||
|
<label>
|
||||||
|
<?php printf( __( 'Select %s:', 'sportspress' ), __( 'Calendar', 'sportspress' ) ); ?>
|
||||||
|
<?php echo $calendar_dropdown; ?>
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<label>
|
||||||
|
<?php _e( 'Status:', 'sportspress' ); ?>
|
||||||
|
<?php
|
||||||
|
$args = array(
|
||||||
|
'name' => 'status',
|
||||||
|
'show_option_default' => __( 'Default', 'sportspress' ),
|
||||||
|
);
|
||||||
|
sp_dropdown_statuses( $args );
|
||||||
|
?>
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<label>
|
||||||
|
<?php _e( 'Display link to view all events', 'sportspress' ); ?>
|
||||||
|
<input type="checkbox" name="show_all_events_link" id="show_all_events_link">
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
<p class="submit">
|
||||||
|
<input type="button" id="edd-insert-download" class="button-primary" value="<?php echo sprintf( __( 'Insert %s', 'sportspress' ), __( 'Shortcode', 'sportspress' ) ); ?>" onclick="insertSportsPress('event_calendar');" />
|
||||||
|
<a class="button-secondary" onclick="tb_remove();" title="<?php _e( 'Cancel', 'sportspress' ); ?>"><?php _e( 'Cancel', 'sportspress' ); ?></a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="sp_choose_event_list" style="display: none;">
|
||||||
|
<div class="wrap sp-thickbox-content" id="sp-thickbox-event_list">
|
||||||
|
<p>
|
||||||
|
<label>
|
||||||
|
<?php printf( __( 'Select %s:', 'sportspress' ), __( 'Calendar', 'sportspress' ) ); ?>
|
||||||
|
<?php echo $calendar_dropdown; ?>
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<label>
|
||||||
|
<?php _e( 'Status:', 'sportspress' ); ?>
|
||||||
|
<?php
|
||||||
|
$args = array(
|
||||||
|
'name' => 'status',
|
||||||
|
'show_option_default' => __( 'Default', 'sportspress' ),
|
||||||
|
);
|
||||||
|
sp_dropdown_statuses( $args );
|
||||||
|
?>
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<label>
|
||||||
|
<?php _e( 'Date:', 'sportspress' ); ?>
|
||||||
|
<select id="date" name="date">
|
||||||
|
<option value="default"><?php _e( 'Default', 'sportspress' ); ?></option>
|
||||||
|
<option value=""><?php _e( 'All', 'sportspress' ); ?></option>
|
||||||
|
<option value="w"><?php _e( 'This week', 'sportspress' ); ?></option>
|
||||||
|
<option value="day"><?php _e( 'Today', 'sportspress' ); ?></option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<label>
|
||||||
|
<?php _e( 'Number of events to show:', 'sportspress' ); ?>
|
||||||
|
<input type="text" size="3" name="number" id="number" value="5">
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<label>
|
||||||
|
<?php _e( 'Sort Order:', 'sportspress' ); ?>
|
||||||
|
<select id="order" name="order">
|
||||||
|
<option value="default"><?php _e( 'Default', 'sportspress' ); ?></option>
|
||||||
|
<option value="ASC"><?php _e( 'Ascending', 'sportspress' ); ?></option>
|
||||||
|
<option value="DESC"><?php _e( 'Descending', 'sportspress' ); ?></option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
<p class="sp-prefs">
|
||||||
|
<?php _e( 'Columns:', 'sportspress' ); ?><br>
|
||||||
|
<?php
|
||||||
|
$the_columns = array(
|
||||||
|
'event' => __( 'Event', 'sportspress' ),
|
||||||
|
'teams' => __( 'Teams', 'sportspress' ),
|
||||||
|
'time' => __( 'Time', 'sportspress' ),
|
||||||
|
'venue' => __( 'Venue', 'sportspress' ),
|
||||||
|
'article' => __( 'Article', 'sportspress' ),
|
||||||
|
);
|
||||||
|
$field_name = 'columns[]';
|
||||||
|
$field_id = 'columns';
|
||||||
|
?>
|
||||||
|
<?php foreach ( $the_columns as $key => $label ): ?>
|
||||||
|
<label class="button"><input name="<?php echo $field_name; ?>" type="checkbox" id="<?php echo $field_id . '-' . $key; ?>" value="<?php echo $key; ?>" checked="checked"><?php echo $label; ?></label>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" name="show_all_events_link" id="show_all_events_link">
|
||||||
|
<?php _e( 'Display link to view all events', 'sportspress' ); ?>
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
<p class="submit">
|
||||||
|
<input type="button" id="edd-insert-download" class="button-primary" value="<?php echo sprintf( __( 'Insert %s', 'sportspress' ), __( 'Shortcode', 'sportspress' ) ); ?>" onclick="insertSportsPress('event_list');" />
|
||||||
|
<a class="button-secondary" onclick="tb_remove();" title="<?php _e( 'Cancel', 'sportspress' ); ?>"><?php _e( 'Cancel', 'sportspress' ); ?></a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="sp_choose_event_blocks" style="display: none;">
|
||||||
|
<div class="wrap sp-thickbox-content" id="sp-thickbox-event_blocks">
|
||||||
|
<p>
|
||||||
|
<label>
|
||||||
|
<?php printf( __( 'Select %s:', 'sportspress' ), __( 'Calendar', 'sportspress' ) ); ?>
|
||||||
|
<?php echo $calendar_dropdown; ?>
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<label>
|
||||||
|
<?php _e( 'Status:', 'sportspress' ); ?>
|
||||||
|
<?php
|
||||||
|
$args = array(
|
||||||
|
'name' => 'status',
|
||||||
|
'show_option_default' => __( 'Default', 'sportspress' ),
|
||||||
|
);
|
||||||
|
sp_dropdown_statuses( $args );
|
||||||
|
?>
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<label>
|
||||||
|
<?php _e( 'Date:', 'sportspress' ); ?>
|
||||||
|
<select id="date" name="date">
|
||||||
|
<option value="default"><?php _e( 'Default', 'sportspress' ); ?></option>
|
||||||
|
<option value=""><?php _e( 'All', 'sportspress' ); ?></option>
|
||||||
|
<option value="w"><?php _e( 'This week', 'sportspress' ); ?></option>
|
||||||
|
<option value="day"><?php _e( 'Today', 'sportspress' ); ?></option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<label>
|
||||||
|
<?php _e( 'Number of events to show:', 'sportspress' ); ?>
|
||||||
|
<input type="text" size="3" name="number" id="number" value="5">
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<label>
|
||||||
|
<?php _e( 'Sort Order:', 'sportspress' ); ?>
|
||||||
|
<select id="order" name="order">
|
||||||
|
<option value="default"><?php _e( 'Default', 'sportspress' ); ?></option>
|
||||||
|
<option value="ASC"><?php _e( 'Ascending', 'sportspress' ); ?></option>
|
||||||
|
<option value="DESC"><?php _e( 'Descending', 'sportspress' ); ?></option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" name="show_all_events_link" id="show_all_events_link">
|
||||||
|
<?php _e( 'Display link to view all events', 'sportspress' ); ?>
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
<p class="submit">
|
||||||
|
<input type="button" id="edd-insert-download" class="button-primary" value="<?php echo sprintf( __( 'Insert %s', 'sportspress' ), __( 'Shortcode', 'sportspress' ) ); ?>" onclick="insertSportsPress('event_blocks');" />
|
||||||
|
<a class="button-secondary" onclick="tb_remove();" title="<?php _e( 'Cancel', 'sportspress' ); ?>"><?php _e( 'Cancel', 'sportspress' ); ?></a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="sp_choose_league_table" style="display: none;">
|
||||||
|
<div class="wrap sp-thickbox-content" id="sp-thickbox-league_table">
|
||||||
|
<p>
|
||||||
|
<label>
|
||||||
|
<?php printf( __( 'Select %s:', 'sportspress' ), __( 'League Table', 'sportspress' ) ); ?>
|
||||||
|
<?php echo $league_table_dropdown; ?>
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<label>
|
||||||
|
<?php _e( 'Number of teams to show:', 'sportspress' ); ?>
|
||||||
|
<input type="text" size="3" name="number" id="number" value="5">
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
<p class="sp-prefs">
|
||||||
|
<?php _e( 'Columns:', 'sportspress' ); ?><br>
|
||||||
|
<?php
|
||||||
|
$args = array(
|
||||||
|
'post_type' => 'sp_column',
|
||||||
|
'numberposts' => -1,
|
||||||
|
'posts_per_page' => -1,
|
||||||
|
'orderby' => 'menu_order',
|
||||||
|
'order' => 'ASC'
|
||||||
|
);
|
||||||
|
$the_columns = get_posts( $args );
|
||||||
|
|
||||||
|
$field_name = 'columns[]';
|
||||||
|
$field_id = 'columns';
|
||||||
|
?>
|
||||||
|
<?php foreach ( $the_columns as $column ): ?>
|
||||||
|
<label class="button"><input name="<?php echo $field_name; ?>" type="checkbox" id="<?php echo $field_id . '-' . $column->post_name; ?>" value="<?php echo $column->post_name; ?>" checked="checked"><?php echo $column->post_title; ?></label>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" name="show_team_logo" id="show_team_logo">
|
||||||
|
<?php _e( 'Display logos', 'sportspress' ); ?>
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" name="show_full_table_link" id="show_full_table_link">
|
||||||
|
<?php _e( 'Display link to view full table', 'sportspress' ); ?>
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
<p class="submit">
|
||||||
|
<input type="button" id="edd-insert-download" class="button-primary" value="<?php echo sprintf( __( 'Insert %s', 'sportspress' ), __( 'Shortcode', 'sportspress' ) ); ?>" onclick="insertSportsPress('league_table');" />
|
||||||
|
<a class="button-secondary" onclick="tb_remove();" title="<?php _e( 'Cancel', 'sportspress' ); ?>"><?php _e( 'Cancel', 'sportspress' ); ?></a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="sp_choose_player_list" style="display: none;">
|
||||||
|
<div class="wrap sp-thickbox-content" id="sp-thickbox-player_list">
|
||||||
|
<p>
|
||||||
|
<label>
|
||||||
|
<?php printf( __( 'Select %s:', 'sportspress' ), __( 'Player List', 'sportspress' ) ); ?>
|
||||||
|
<?php echo $player_list_dropdown; ?>
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<label>
|
||||||
|
<?php _e( 'Number of players to show:', 'sportspress' ); ?>
|
||||||
|
<input type="text" size="3" name="number" id="number" value="5">
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
<p class="sp-prefs">
|
||||||
|
<?php _e( 'Columns:', 'sportspress' ); ?><br>
|
||||||
|
<?php
|
||||||
|
$args = array(
|
||||||
|
'post_type' => array( 'sp_metric', 'sp_performance', 'sp_statistic' ),
|
||||||
|
'numberposts' => -1,
|
||||||
|
'posts_per_page' => -1,
|
||||||
|
'orderby' => 'menu_order',
|
||||||
|
'order' => 'ASC'
|
||||||
|
);
|
||||||
|
$the_columns = get_posts( $args );
|
||||||
|
|
||||||
|
$field_name = 'columns[]';
|
||||||
|
$field_id = 'columns';
|
||||||
|
?>
|
||||||
|
<?php foreach ( $the_columns as $column ): ?>
|
||||||
|
<label class="button"><input name="<?php echo $field_name; ?>" type="checkbox" id="<?php echo $field_id . '-' . $column->post_name; ?>" value="<?php echo $column->post_name; ?>" checked="checked"><?php echo $column->post_title; ?></label>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<label>
|
||||||
|
<?php _e( 'Sort by:', 'sportspress' ); ?>
|
||||||
|
<?php echo $player_list_orderby_dropdown; ?>
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<label>
|
||||||
|
<?php _e( 'Sort Order:', 'sportspress' ); ?>
|
||||||
|
<select id="order" name="order">
|
||||||
|
<option value=""><?php _e( 'Default', 'sportspress' ); ?></option>
|
||||||
|
<option value="ASC"><?php _e( 'Ascending', 'sportspress' ); ?></option>
|
||||||
|
<option value="DESC"><?php _e( 'Descending', 'sportspress' ); ?></option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" name="show_all_players_link" id="show_all_players_link">
|
||||||
|
<?php _e( 'Display link to view all players', 'sportspress' ); ?>
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
<p class="submit">
|
||||||
|
<input type="button" id="edd-insert-download" class="button-primary" value="<?php echo sprintf( __( 'Insert %s', 'sportspress' ), __( 'Shortcode', 'sportspress' ) ); ?>" onclick="insertSportsPress('player_list');" />
|
||||||
|
<a class="button-secondary" onclick="tb_remove();" title="<?php _e( 'Cancel', 'sportspress' ); ?>"><?php _e( 'Cancel', 'sportspress' ); ?></a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="sp_choose_player_gallery" style="display: none;">
|
||||||
|
<div class="wrap sp-thickbox-content" id="sp-thickbox-player_gallery">
|
||||||
|
<p>
|
||||||
|
<label>
|
||||||
|
<?php printf( __( 'Select %s:', 'sportspress' ), __( 'Player List', 'sportspress' ) ); ?>
|
||||||
|
<?php echo $player_list_dropdown; ?>
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<label>
|
||||||
|
<?php _e( 'Number of players to show:', 'sportspress' ); ?>
|
||||||
|
<input type="text" size="3" name="number" id="number" value="5">
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<label>
|
||||||
|
<?php _e( 'Sort by:', 'sportspress' ); ?>
|
||||||
|
<?php echo $player_list_orderby_dropdown; ?>
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<label>
|
||||||
|
<?php _e( 'Sort Order:', 'sportspress' ); ?>
|
||||||
|
<select id="order" name="order">
|
||||||
|
<option value=""><?php _e( 'Default', 'sportspress' ); ?></option>
|
||||||
|
<option value="ASC"><?php _e( 'Ascending', 'sportspress' ); ?></option>
|
||||||
|
<option value="DESC"><?php _e( 'Descending', 'sportspress' ); ?></option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" name="show_all_players_link" id="show_all_players_link">
|
||||||
|
<?php _e( 'Display link to view all players', 'sportspress' ); ?>
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" name="show_names_on_hover" id="show_names_on_hover">
|
||||||
|
<?php _e( 'Display player names on hover', 'sportspress' ); ?>
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
<p class="submit">
|
||||||
|
<input type="button" id="edd-insert-download" class="button-primary" value="<?php echo sprintf( __( 'Insert %s', 'sportspress' ), __( 'Shortcode', 'sportspress' ) ); ?>" onclick="insertSportsPress('player_gallery');" />
|
||||||
|
<a class="button-secondary" onclick="tb_remove();" title="<?php _e( 'Cancel', 'sportspress' ); ?>"><?php _e( 'Cancel', 'sportspress' ); ?></a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
endif;
|
||||||
|
|
||||||
|
return new SP_Admin_Thickbox();
|
||||||
@@ -42,7 +42,11 @@ class SP_Admin {
|
|||||||
include( 'class-sp-admin-notices.php' );
|
include( 'class-sp-admin-notices.php' );
|
||||||
include( 'class-sp-admin-assets.php' );
|
include( 'class-sp-admin-assets.php' );
|
||||||
include( 'class-sp-admin-permalink-settings.php' );
|
include( 'class-sp-admin-permalink-settings.php' );
|
||||||
|
|
||||||
|
if ( get_option( 'sportspress_rich_editing', true ) ):
|
||||||
include( 'class-sp-admin-editor.php' );
|
include( 'class-sp-admin-editor.php' );
|
||||||
|
include( 'class-sp-admin-thickbox.php' );
|
||||||
|
endif;
|
||||||
|
|
||||||
// Help
|
// Help
|
||||||
// if ( apply_filters( 'sportspress_enable_admin_help_tab', true ) )
|
// if ( apply_filters( 'sportspress_enable_admin_help_tab', true ) )
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* @author ThemeBoy
|
* @author ThemeBoy
|
||||||
* @category Admin
|
* @category Admin
|
||||||
* @package SportsPress/Admin
|
* @package SportsPress/Admin
|
||||||
* @version 1.1.4
|
* @version 1.2
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
@@ -145,10 +145,19 @@ class SP_Settings_General extends SP_Settings_Page {
|
|||||||
'id' => 'sportspress_enable_live_countdowns',
|
'id' => 'sportspress_enable_live_countdowns',
|
||||||
'default' => 'yes',
|
'default' => 'yes',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'checkboxgroup' => 'end',
|
'checkboxgroup' => '',
|
||||||
'desc_tip' => __( 'This will enable a script allowing the countdowns to be animated.', 'sportspress' ),
|
'desc_tip' => __( 'This will enable a script allowing the countdowns to be animated.', 'sportspress' ),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'desc' => __( 'Shortcode menu', 'sportspress' ),
|
||||||
|
'id' => 'sportspress_rich_editing',
|
||||||
|
'default' => 'yes',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'checkboxgroup' => 'end',
|
||||||
|
'desc_tip' => __( 'This will enable a shortcode menu to be displayed in the visual editor.', 'sportspress' ),
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Header Offset', 'sportspress' ),
|
'title' => __( 'Header Offset', 'sportspress' ),
|
||||||
'id' => 'sportspress_header_offset',
|
'id' => 'sportspress_header_offset',
|
||||||
|
|||||||
@@ -15,11 +15,13 @@ class SP_Event extends SP_Custom_Post{
|
|||||||
public function status() {
|
public function status() {
|
||||||
$post_status = $this->post->post_status;
|
$post_status = $this->post->post_status;
|
||||||
$results = get_post_meta( $this->ID, 'sp_results', true );
|
$results = get_post_meta( $this->ID, 'sp_results', true );
|
||||||
|
if ( is_array( $results ) ) {
|
||||||
foreach( $results as $result ) {
|
foreach( $results as $result ) {
|
||||||
if ( count( array_filter( $result ) ) > 0 ) {
|
if ( count( array_filter( $result ) ) > 0 ) {
|
||||||
return 'results';
|
return 'results';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return $post_status;
|
return $post_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,10 +56,11 @@ class SP_Event extends SP_Custom_Post{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function performance( $admin = false ) {
|
public function performance( $admin = false ) {
|
||||||
$teams = (array)get_post_meta( $this->ID, 'sp_team', false );
|
$teams = get_post_meta( $this->ID, 'sp_team', false );
|
||||||
$performance = (array)get_post_meta( $this->ID, 'sp_players', true );
|
$performance = (array)get_post_meta( $this->ID, 'sp_players', true );
|
||||||
$labels = sp_get_var_labels( 'sp_performance' );
|
$labels = sp_get_var_labels( 'sp_performance' );
|
||||||
$columns = get_post_meta( $this->ID, 'sp_columns', true );
|
$columns = get_post_meta( $this->ID, 'sp_columns', true );
|
||||||
|
if ( is_array( $teams ) ):
|
||||||
foreach( $teams as $i => $team_id ):
|
foreach( $teams as $i => $team_id ):
|
||||||
$players = sp_array_between( (array)get_post_meta( $this->ID, 'sp_player', false ), 0, $i );
|
$players = sp_array_between( (array)get_post_meta( $this->ID, 'sp_player', false ), 0, $i );
|
||||||
$data = sp_array_combine( $players, sp_array_value( $performance, $team_id, array() ) );
|
$data = sp_array_combine( $players, sp_array_value( $performance, $team_id, array() ) );
|
||||||
@@ -88,6 +91,7 @@ class SP_Event extends SP_Custom_Post{
|
|||||||
endif;
|
endif;
|
||||||
endforeach;
|
endforeach;
|
||||||
endforeach;
|
endforeach;
|
||||||
|
endif;
|
||||||
|
|
||||||
if ( $admin ):
|
if ( $admin ):
|
||||||
return array( $labels, $columns, $performance, $teams );
|
return array( $labels, $columns, $performance, $teams );
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
* @author ThemeBoy
|
* @author ThemeBoy
|
||||||
* @category Core
|
* @category Core
|
||||||
* @package SportsPress/Functions
|
* @package SportsPress/Functions
|
||||||
* @version 1.1.4
|
* @version 1.2
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
@@ -273,7 +273,7 @@ if ( !function_exists( 'sp_array_combine' ) ) {
|
|||||||
endforeach;
|
endforeach;
|
||||||
|
|
||||||
foreach ( $keys as $key ):
|
foreach ( $keys as $key ):
|
||||||
if ( ! array_key_exists( $key, $output ) )
|
if ( $key !== false && ! array_key_exists( $key, $output ) )
|
||||||
$output[ $key ] = array();
|
$output[ $key ] = array();
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @author ThemeBoy
|
* @author ThemeBoy
|
||||||
* @package SportsPress/Templates
|
* @package SportsPress/Templates
|
||||||
* @version 1.1
|
* @version 1.2
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
@@ -23,6 +23,7 @@ $defaults = array(
|
|||||||
'paginated' => get_option( 'sportspress_calendar_paginated', 'yes' ) == 'yes' ? true : false,
|
'paginated' => get_option( 'sportspress_calendar_paginated', 'yes' ) == 'yes' ? true : false,
|
||||||
'rows' => get_option( 'sportspress_calendar_rows', 10 ),
|
'rows' => get_option( 'sportspress_calendar_rows', 10 ),
|
||||||
'order' => 'default',
|
'order' => 'default',
|
||||||
|
'columns' => null,
|
||||||
'show_all_events_link' => false,
|
'show_all_events_link' => false,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -39,7 +40,7 @@ $data = $calendar->data();
|
|||||||
$usecolumns = $calendar->columns;
|
$usecolumns = $calendar->columns;
|
||||||
|
|
||||||
if ( isset( $columns ) )
|
if ( isset( $columns ) )
|
||||||
$usecolumns = $columns;
|
$usecolumns = explode( ',', $columns );
|
||||||
?>
|
?>
|
||||||
<div class="sp-table-wrapper sp-scrollable-table-wrapper">
|
<div class="sp-table-wrapper sp-scrollable-table-wrapper">
|
||||||
<table class="sp-event-list sp-data-table<?php if ( $responsive ) { ?> sp-responsive-table<?php } if ( $paginated ) { ?> sp-paginated-table<?php } ?>" data-sp-rows="<?php echo $rows; ?>">
|
<table class="sp-event-list sp-data-table<?php if ( $responsive ) { ?> sp-responsive-table<?php } if ( $paginated ) { ?> sp-paginated-table<?php } ?>" data-sp-rows="<?php echo $rows; ?>">
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @author ThemeBoy
|
* @author ThemeBoy
|
||||||
* @package SportsPress/Templates
|
* @package SportsPress/Templates
|
||||||
* @version 1.1
|
* @version 1.2
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
@@ -23,7 +23,7 @@ unset( $performance[0] );
|
|||||||
|
|
||||||
$performance = array_filter( $performance );
|
$performance = array_filter( $performance );
|
||||||
|
|
||||||
$teams = (array)get_post_meta( $id, 'sp_team', false );
|
$teams = get_post_meta( $id, 'sp_team', false );
|
||||||
$status = $event->status();
|
$status = $event->status();
|
||||||
|
|
||||||
$show_players = get_option( 'sportspress_event_show_players', 'yes' ) == 'yes' ? true : false;
|
$show_players = get_option( 'sportspress_event_show_players', 'yes' ) == 'yes' ? true : false;
|
||||||
@@ -31,7 +31,8 @@ $link_posts = get_option( 'sportspress_event_link_players', 'yes' ) == 'yes' ? t
|
|||||||
$sortable = get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false;
|
$sortable = get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false;
|
||||||
$responsive = get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false;
|
$responsive = get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false;
|
||||||
|
|
||||||
foreach( $teams as $index => $team_id ):
|
if ( is_array( $teams ) ):
|
||||||
|
foreach( $teams as $index => $team_id ):
|
||||||
if ( ! $team_id ) continue;
|
if ( ! $team_id ) continue;
|
||||||
|
|
||||||
// Get results for players in the team
|
// Get results for players in the team
|
||||||
@@ -173,4 +174,5 @@ foreach( $teams as $index => $team_id ):
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
endforeach;
|
endforeach;
|
||||||
|
endif;
|
||||||
|
|||||||
Reference in New Issue
Block a user