Add Rookie theme shortcut to modules page

This commit is contained in:
Brian Miyaji
2015-03-31 22:48:23 +11:00
parent 0b9cd325a1
commit 9f0b283168
2 changed files with 41 additions and 23 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

View File

@@ -88,7 +88,7 @@ class SP_Settings_Modules extends SP_Settings_Page {
<p><?php _e( 'Offer premium news & highlights from leading global sports. SportsPress TV will keep your visitors entertained for hours.','sportspress' ); ?></p>
<p class="sp-module-actions">
<span><?php _e( 'Free', 'sportspress' ); ?></span>
<a class="button" href="<?php echo add_query_arg( array( 'tab' => 'search', 's' => 'sportspress+tv' ), network_admin_url( 'plugin-install.php' ) ); ?>"><?php _e( 'Install Now', 'sportspress' ); ?></a>
<a class="button" href="<?php echo add_query_arg( array( 'tab' => 'search', 's' => 'SportsPress+TV' ), network_admin_url( 'plugin-install.php' ) ); ?>"><?php _e( 'Install Now', 'sportspress' ); ?></a>
</p>
</td></tr>
</tbody>
@@ -157,6 +157,46 @@ class SP_Settings_Modules extends SP_Settings_Page {
<?php } ?>
<?php } ?>
<?php if ( current_user_can( 'manage_network_themes' ) ) { ?>
<?php $theme = wp_get_theme(); ?>
<?php if ( 'rookie' == $theme->stylesheet ) { ?>
<table class="widefat" cellspacing="0">
<thead>
<tr><th>
<strong><?php _e( 'Current Theme', 'sportspress' ); ?></strong>
</th></tr>
</thead>
<tbody>
<tr><td>
<img src="<?php echo $theme->get_screenshot(); ?>" class="sp-theme-screenshot">
<p><?php _e( 'Rookie is a free starter theme for SportsPress.', 'sportspress' ); ?></p>
<p class="sp-module-actions">
<a class="button" href="http://tboy.co/themes" target="_blank"><?php _e( 'Need a Better Theme?', 'sportspress' ); ?></a>
</p>
</td></tr>
</tbody>
</table>
<?php } elseif ( ! current_theme_supports( 'sportspress' ) ) { ?>
<table class="widefat" cellspacing="0">
<thead>
<tr><th>
<strong><?php _e( 'Free SportsPress Theme', 'sportspress' ); ?></strong>
</th></tr>
</thead>
<tbody>
<tr><td>
<img src="<?php echo plugin_dir_url( SP_PLUGIN_FILE ); ?>/assets/images/modules/rookie.png" class="sp-theme-screenshot">
<p><?php _e( 'Rookie is a free starter theme for SportsPress.', 'sportspress' ); ?></p>
<p class="sp-module-actions">
<span><?php _e( 'Free', 'sportspress' ); ?></span>
<a class="button" href="<?php echo add_query_arg( array( 'theme' => 'rookie' ), network_admin_url( 'theme-install.php' ) ); ?>"><?php _e( 'Install Now', 'sportspress' ); ?></a>
</p>
</td></tr>
</tbody>
</table>
<?php } ?>
<?php } ?>
<table class="widefat" cellspacing="0">
<thead>
<tr><th>
@@ -190,28 +230,6 @@ class SP_Settings_Modules extends SP_Settings_Page {
</td></tr>
</tbody>
</table>
<?php if ( current_user_can( 'manage_network_themes' ) ) { ?>
<?php $theme = wp_get_theme(); ?>
<?php if ( ! current_theme_supports( 'sportspress' ) ) { ?>
<table class="widefat" cellspacing="0">
<thead>
<tr><th>
<strong><?php _e( 'Current Theme', 'sportspress' ); ?></strong>
</th></tr>
</thead>
<tbody>
<tr><td>
<img src="<?php echo $theme->get_screenshot(); ?>" class="sp-theme-screenshot">
<p><?php _e( '<strong>Your theme does not declare SportsPress support</strong> &#8211; if you encounter layout issues please read our integration guide or choose a SportsPress theme :)', 'sportspress' ); ?></p>
<p class="sp-module-actions">
<a class="button" href="http://tboy.co/themes" target="_blank"><?php _e( 'Need a Better Theme?', 'sportspress' ); ?></a>
</p>
</td></tr>
</tbody>
</table>
<?php } ?>
<?php } ?>
</div>
<div class="sp-modules-main">