Clean up spaces, tabs, indentation, and bracket formatting
This commit is contained in:
@@ -2,55 +2,60 @@
|
||||
/**
|
||||
* SportsPress Module Settings
|
||||
*
|
||||
* @author ThemeBoy
|
||||
* @category Admin
|
||||
* @package SportsPress/Admin
|
||||
* @version 2.7.9
|
||||
* @author ThemeBoy
|
||||
* @category Admin
|
||||
* @package SportsPress/Admin
|
||||
* @version 2.7.9
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'SP_Settings_Modules' ) ) :
|
||||
|
||||
/**
|
||||
* SP_Settings_Modules
|
||||
*/
|
||||
class SP_Settings_Modules extends SP_Settings_Page {
|
||||
|
||||
/**
|
||||
* @var array
|
||||
* SP_Settings_Modules
|
||||
*/
|
||||
public $sections = array();
|
||||
class SP_Settings_Modules extends SP_Settings_Page {
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->id = 'modules';
|
||||
$this->label = __( 'Modules', 'sportspress' );
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
public $sections = array();
|
||||
|
||||
$this->sections = apply_filters( 'sportspress_module_sections', array(
|
||||
'general' => __( 'General', 'sportspress' ),
|
||||
'event' => __( 'Events', 'sportspress' ),
|
||||
'team' => __( 'Teams', 'sportspress' ),
|
||||
'player_staff' => __( 'Players', 'sportspress' ) . ' & ' . __( 'Staff', 'sportspress' ),
|
||||
'admin' => __( 'Dashboard', 'sportspress' ),
|
||||
'other' => __( 'Other', 'sportspress' ),
|
||||
));
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->id = 'modules';
|
||||
$this->label = __( 'Modules', 'sportspress' );
|
||||
|
||||
add_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 );
|
||||
add_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) );
|
||||
add_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) );
|
||||
}
|
||||
$this->sections = apply_filters(
|
||||
'sportspress_module_sections',
|
||||
array(
|
||||
'general' => __( 'General', 'sportspress' ),
|
||||
'event' => __( 'Events', 'sportspress' ),
|
||||
'team' => __( 'Teams', 'sportspress' ),
|
||||
'player_staff' => __( 'Players', 'sportspress' ) . ' & ' . __( 'Staff', 'sportspress' ),
|
||||
'admin' => __( 'Dashboard', 'sportspress' ),
|
||||
'other' => __( 'Other', 'sportspress' ),
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* Output modules
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function output() {
|
||||
?>
|
||||
add_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 );
|
||||
add_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) );
|
||||
add_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Output modules
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function output() {
|
||||
?>
|
||||
<div class="sp-modules-wrapper">
|
||||
<div class="sp-modules-sidebar">
|
||||
<?php do_action( 'sportspress_modules_sidebar' ); ?>
|
||||
@@ -64,7 +69,7 @@ class SP_Settings_Modules extends SP_Settings_Page {
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td>
|
||||
<p><?php _e( 'Get SportsPress Pro to get access to all modules. You can upgrade any time without losing any of your data.','sportspress' ); ?></p>
|
||||
<p><?php _e( 'Get SportsPress Pro to get access to all modules. You can upgrade any time without losing any of your data.', 'sportspress' ); ?></p>
|
||||
<p class="sp-module-actions">
|
||||
<span><?php _e( 'Premium', 'sportspress' ); ?></span>
|
||||
<a class="button button-primary" href="<?php echo apply_filters( 'sportspress_pro_url', 'http://tboy.co/pro' ); ?>" target="_blank"><?php _e( 'Upgrade Now', 'sportspress' ); ?></a>
|
||||
@@ -137,51 +142,51 @@ class SP_Settings_Modules extends SP_Settings_Page {
|
||||
<?php
|
||||
$categories = array(
|
||||
'documentation' => array(
|
||||
'icon' => 'sp-icon-book',
|
||||
'icon' => 'sp-icon-book',
|
||||
'label' => __( 'Documentation', 'sportspress' ),
|
||||
'links' => array(
|
||||
'http://tboy.co/installation' => __( 'Getting Started', 'sportspress' ),
|
||||
'http://tboy.co/manuals' => __( 'Manuals', 'sportspress' ),
|
||||
'http://tboy.co/videos' => __( 'Videos', 'sportspress' ),
|
||||
'http://tboy.co/manuals' => __( 'Manuals', 'sportspress' ),
|
||||
'http://tboy.co/videos' => __( 'Videos', 'sportspress' ),
|
||||
),
|
||||
),
|
||||
'help' => array(
|
||||
'icon' => 'dashicons dashicons-heart',
|
||||
'help' => array(
|
||||
'icon' => 'dashicons dashicons-heart',
|
||||
'label' => __( 'Help', 'sportspress' ),
|
||||
'links' => array(
|
||||
'http://tboy.co/forums' => __( 'Support Forums', 'sportspress' ),
|
||||
'http://tboy.co/ideas' => __( 'Feature Requests', 'sportspress' ),
|
||||
'http://tboy.co/ideas' => __( 'Feature Requests', 'sportspress' ),
|
||||
),
|
||||
),
|
||||
'social' => array(
|
||||
'icon' => 'dashicons dashicons-share',
|
||||
'social' => array(
|
||||
'icon' => 'dashicons dashicons-share',
|
||||
'label' => __( 'Connect', 'sportspress' ),
|
||||
'links' => array(
|
||||
'http://tboy.co/twitter' => __( 'Twitter', 'sportspress' ),
|
||||
'http://tboy.co/twitter' => __( 'Twitter', 'sportspress' ),
|
||||
'http://tboy.co/facebook' => __( 'Facebook', 'sportspress' ),
|
||||
'http://tboy.co/youtube' => __( 'YouTube', 'sportspress' ),
|
||||
'http://tboy.co/gplus' => __( 'Google+', 'sportspress' ),
|
||||
'http://tboy.co/youtube' => __( 'YouTube', 'sportspress' ),
|
||||
'http://tboy.co/gplus' => __( 'Google+', 'sportspress' ),
|
||||
),
|
||||
),
|
||||
'developers' => array(
|
||||
'icon' => 'dashicons dashicons-editor-code',
|
||||
'developers' => array(
|
||||
'icon' => 'dashicons dashicons-editor-code',
|
||||
'label' => __( 'Developers', 'sportspress' ),
|
||||
'links' => array(
|
||||
'http://tboy.co/developers' => __( 'Reference', 'sportspress' ),
|
||||
'http://tboy.co/slack' => __( 'Slack', 'sportspress' ),
|
||||
'http://tboy.co/github' => __( 'GitHub', 'sportspress' ),
|
||||
'http://tboy.co/slack' => __( 'Slack', 'sportspress' ),
|
||||
'http://tboy.co/github' => __( 'GitHub', 'sportspress' ),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
if ( class_exists( 'SportsPress_Pro' ) ) {
|
||||
$categories['help']['links']['http://support.themeboy.com/'] = __( 'Premium Support', 'sportspress' );
|
||||
} else {
|
||||
$categories['help']['links'][ apply_filters( 'sportspress_pro_url', 'http://tboy.co/pro' ) ] = '<span class="sp-desc-tip" title="' . __( 'Upgrade to Pro', 'sportspress' ) . '">' . __( 'Premium Support', 'sportspress' ) . '</span>';
|
||||
}
|
||||
|
||||
|
||||
$categories = apply_filters( 'sportspress_modules_welcome_links', $categories );
|
||||
|
||||
|
||||
if ( sizeof( $categories ) ) {
|
||||
?>
|
||||
<table class="widefat" cellspacing="0">
|
||||
@@ -192,7 +197,7 @@ class SP_Settings_Modules extends SP_Settings_Page {
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td>
|
||||
<?php foreach ( $categories as $slug => $category ) { ?>
|
||||
<?php foreach ( $categories as $slug => $category ) { ?>
|
||||
<p><strong><i class="<?php echo esc_attr( $category['icon'] ); ?>"></i> <?php echo esc_html( $category['label'] ); ?></strong></p>
|
||||
<ul class="sp-<?php echo esc_attr( $slug ); ?>-links">
|
||||
<?php foreach ( $category['links'] as $url => $text ) { ?>
|
||||
@@ -205,11 +210,11 @@ class SP_Settings_Modules extends SP_Settings_Page {
|
||||
</table>
|
||||
<?php } ?>
|
||||
|
||||
<?php do_action( 'sportspress_modules_after_sidebar' ); ?>
|
||||
<?php do_action( 'sportspress_modules_after_sidebar' ); ?>
|
||||
</div>
|
||||
|
||||
<div class="sp-modules-main">
|
||||
<?php foreach ( SP()->modules->data as $section => $modules ) { ?>
|
||||
<?php foreach ( SP()->modules->data as $section => $modules ) { ?>
|
||||
<table class="sp-modules-table widefat" cellspacing="0">
|
||||
<thead>
|
||||
<tr><th>
|
||||
@@ -252,38 +257,38 @@ class SP_Settings_Modules extends SP_Settings_Page {
|
||||
<?php } ?>
|
||||
|
||||
<p class="submit">
|
||||
<input name="save" class="button button-primary" type="submit" value="<?php _e( 'Save Changes', 'sportspress' ); ?>" />
|
||||
<?php $GLOBALS['hide_save_button'] = true; ?>
|
||||
</p>
|
||||
<input name="save" class="button button-primary" type="submit" value="<?php _e( 'Save Changes', 'sportspress' ); ?>" />
|
||||
<?php $GLOBALS['hide_save_button'] = true; ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="sportspress_update_modules" value="1">
|
||||
|
||||
<?php if ( isset( $_POST[ 'sportspress_update_modules' ] ) ) { ?>
|
||||
<?php if ( isset( $_POST['sportspress_update_modules'] ) ) { ?>
|
||||
<script type="text/javascript">
|
||||
window.onload = function() {
|
||||
window.location = window.location.href;
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
flush_rewrite_rules();
|
||||
}
|
||||
|
||||
/**
|
||||
* Save settings
|
||||
*/
|
||||
public function save() {
|
||||
foreach ( SP()->modules->data as $sections => $modules ) {
|
||||
foreach ( $modules as $id => $module ) {
|
||||
$name = 'sportspress_load_' . $id . '_module';
|
||||
update_option( $name, isset( $_POST[ $name ] ) ? 'yes' : 'no' );
|
||||
<?php
|
||||
}
|
||||
flush_rewrite_rules();
|
||||
}
|
||||
|
||||
/**
|
||||
* Save settings
|
||||
*/
|
||||
public function save() {
|
||||
foreach ( SP()->modules->data as $sections => $modules ) {
|
||||
foreach ( $modules as $id => $module ) {
|
||||
$name = 'sportspress_load_' . $id . '_module';
|
||||
update_option( $name, isset( $_POST[ $name ] ) ? 'yes' : 'no' );
|
||||
}
|
||||
}
|
||||
flush_rewrite_rules();
|
||||
}
|
||||
flush_rewrite_rules();
|
||||
}
|
||||
}
|
||||
|
||||
endif;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user