Skip to content
This repository has been archived by the owner on Aug 14, 2023. It is now read-only.

Commit

Permalink
Merge pull request #284 from semperfiwebdesign/development
Browse files Browse the repository at this point in the history
Development to master for 2.6
  • Loading branch information
michaeltorbert authored Feb 8, 2019
2 parents a6d5fc3 + 247901e commit 787814f
Show file tree
Hide file tree
Showing 25 changed files with 713 additions and 4,992 deletions.
35 changes: 32 additions & 3 deletions classes/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,35 @@ class SM_Admin {
public function __construct() {
add_action( 'admin_head', array( &$this, 'load_admin_scripts' ) );
add_action( 'admin_menu', array( &$this, 'add_addl_menus' ), 20 );
add_action( 'admin_notices', array( $this, 'admin_notices' ) );
}

/**
* Adds admin notices.
*
* @since 2.5.1
*/
function admin_notices() {

global $simple_map;
$options = $simple_map->get_options();

if ( empty( $options['api_key'] ) ) {
?>
<div class="error">
<p>
<?php echo __( 'You must enter an API key for your domain.',
'simplemap' ) .
' <a href="' .
admin_url( 'edit.php?post_type=sm-location&page=simplemap' ) .
'">'
. __( 'Enter a key on the General Options page.',
'simplemap' )
. '</a>'; ?></p>
</div>
<?php
}

}

/**
Expand Down Expand Up @@ -48,15 +77,15 @@ public function add_addl_menus(){
) );
}

/**
* TODO: Currently this loads on toplevel_page_simplemap... but that could change once we redo the menus.
*/
public function load_admin_scripts() {
// Print admin scripts.
global $current_screen;

// General options page.
if ( 'toplevel_page_simplemap' === $current_screen->id ) :
/**
* TODO: Currently this loads on toplevel_page_simplemap... but that could change once we redo the menus.
*/
?>
<script type="text/javascript">
jQuery(document).ready(function ($) {
Expand Down
96 changes: 48 additions & 48 deletions classes/help.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,26 @@ function print_page() {
$simple_map->show_toolbar( $sm_page_title );
?>

<div><p><?php _e( 'Jump to a section:', 'simplemap' ); // XSS ok. ?> <a
href="#displaying_your_map"><?php _e( 'Displaying Your Map', 'simplemap' ); // XSS ok. ?></a> | <a
href="#general_options"><?php _e( 'General Options', 'simplemap' ); // XSS ok. ?></a> | <a
href="#adding_a_location"><?php _e( 'Adding a Location', 'simplemap' ); // XSS ok. ?></a></p></div>
<div><p><?php _e( 'Jump to a section:', 'simplemap' ); // XSS ok. ?> <a href="#displaying_your_map"><?php _e( 'Displaying Your Map', 'simplemap' ); // XSS ok. ?></a> | <a href="#general_options"><?php _e( 'General Options', 'simplemap' ); // XSS ok. ?></a> | <a href="#adding_a_location"><?php _e( 'Adding a Location', 'simplemap' ); // XSS ok. ?></a></p></div>

<div id="dashboard-widgets-wrap" class="clear">

<div id='dashboard-widgets' class='metabox-holder'>

<div class='postbox-container' style='width:49%;'>
<div class='postbox-container'>

<div id='normal-sortables' class='meta-box-sortables ui-sortable'>

<a name="premium_features"></a>

<div class="postbox">

<h3><?php _e( 'Premium Features', 'simplemap' ); // XSS ok. ?></h3>

<div class="inside" style="padding: 0 10px 10px 10px;">
<div class="inside">

<div class="table">

<table class="form-table">

<tr>
Expand All @@ -56,70 +55,68 @@ function print_page() {
</tr>

</table>

</div>

<div class="clear"></div>

</div> <!-- inside -->

</div> <!-- postbox -->

<!-- =========================================
==============================================
========================================== -->

<a name="displaying_your_map"></a>

<div class="postbox">

<h3><?php _e( 'Displaying Your Map', 'simplemap' ); // XSS ok. ?></h3>

<div class="inside" style="padding: 0 10px 10px 10px;">
<div class="inside">

<div class="table">

<table class="form-table">

<tr>
<td><?php _e( 'To show your map on any post or page, insert the shortcode in the body:', 'simplemap' ); // XSS ok. ?>
<code
style="font-size: 1.2em; background: #ffffe0;">[simplemap]</code>
<code>[simplemap]</code>
</td>
</tr>

<tr>
<td><?php _e( 'If you want only certain categories or tags to show on a map, insert shortcode like this, where the numbers are replaced with the ID numbers of your desired categories and tags:', 'simplemap' ); // XSS ok. ?>
<code style="font-size: 1.2em; background: #ffffe0;">[simplemap
categories=2,5,14 tags=3,6,15]</code></td>
<code>[simplemap categories=2,5,14 tags=3,6,15]</code>
</td>
</tr>

<tr>
<td><?php _e( 'If you want to hide the category or tag filters on the search form, insert shortcode like this:', 'simplemap' ); // XSS ok. ?>
<code style="font-size: 1.2em; background: #ffffe0;">[simplemap
show_categories_filter=false show_tags_filter=false]</code>
<code>[simplemap show_categories_filter=false show_tags_filter=false]</code>
</td>
</tr>

<tr>
<td><?php _e( 'If you want to hide the map, insert shortcode like this:', 'simplemap' ); // XSS ok. ?>
<code style="font-size: 1.2em; background: #ffffe0;">[simplemap
hide_map=true]</code></td>
<code>[simplemap hide_map=true]</code></td>
</tr>

<tr>
<td><?php _e( 'If you want to hide the list of results, insert shortcode like this:', 'simplemap' ); // XSS ok. ?>
<code style="font-size: 1.2em; background: #ffffe0;">[simplemap
hide_list=true]</code></td>
<code>[simplemap hide_list=true]</code></td>
</tr>

<tr>
<td><?php _e( 'If you want to override the default lat / lng for a specific map, insert shortcode like this:', 'simplemap' ); // XSS ok. ?>
<code style="font-size: 1.2em; background: #ffffe0;">[simplemap
default_lat='34.1346702' default_lng='-118.4389877']</code>
<code>[simplemap default_lat='34.1346702' default_lng='-118.4389877']</code>
</td>
</tr>

<tr>
<td><?php _e( 'You can combine tag attributes as needed:', 'simplemap' ); // XSS ok. ?>
<code style="font-size: 1.2em; background: #ffffe0;">[simplemap
categories=2,5,14 show_tags_filter=false]</code></td>
<code>[simplemap categories=2,5,14 show_tags_filter=false]</code></td>
</tr>

<tr>
Expand All @@ -131,25 +128,29 @@ function print_page() {
</tr>

</table>

</div>

<div class="clear"></div>

</div> <!-- inside -->

</div> <!-- postbox -->

<!-- =========================================
==============================================
========================================== -->

<a name="general_options"></a>

<div class="postbox">

<h3><?php _e( 'General Options', 'simplemap' ); // XSS ok. ?></h3>

<div class="inside" style="padding: 0 10px 10px 10px;">
<div class="inside">

<div class="table">

<table class="form-table">

<tr valign="top">
Expand Down Expand Up @@ -183,35 +184,39 @@ function print_page() {
</tr>

</table>

</div>

<div class="clear"></div>

</div> <!-- inside -->

</div> <!-- postbox -->

<!-- =========================================
==============================================
========================================== -->

<a name="adding_a_location"></a>

<div class="postbox">

<h3><?php _e( 'Adding a Location', 'simplemap' ); // XSS ok. ?></h3>

<div class="inside" style="padding: 0 10px 10px 10px;">
<div class="inside">

<div class="table">

<table class="form-table">

<tr>
<td>
<?php _e( 'To properly add a new location, you must enter one or both of the following:', 'simplemap' ); // XSS ok. ?>
<br/>
<span
style="padding-left: 20px;"><?php _e( '1. A full address', 'simplemap' ); // XSS ok. ?></span><br/>
<span
style="padding-left: 20px;"><?php _e( '2. A latitude and longitude', 'simplemap' ); // XSS ok. ?></span><br/>
<ol>
<li><?php _e( 'A full address', 'simplemap' ); // XSS ok. ?></li>
<li><?php _e( 'A latitude and longitude', 'simplemap' ); // XSS ok. ?></li>
</ol>
<?php _e( 'If you enter a latitude and longitude, then the address will not be geocoded, and your custom values will be left in place. Entering an address without latitude or longitude will result in the address being geocoded before it is submitted to the database.', 'simplemap' ); // XSS ok. ?>
</td>
</tr>
Expand Down Expand Up @@ -239,7 +244,7 @@ function print_page() {

</div> <!-- postbox-container -->

<div class='postbox-container' style='width:49%;'>
<div class='postbox-container'>

<div id='side-sortables' class='meta-box-sortables ui-sortable'>

Expand All @@ -249,9 +254,9 @@ function print_page() {

<div class="postbox">

<h3 style='color:#fff;text-shadow:0 1px 0 #000;background: #fff url( <?php echo SIMPLEMAP_URL; ?>/inc/images/blue-grad.png ) top left repeat-x;'><?php _e( 'Premium Support and Features', 'simplemap' ); // XSS ok. ?></h3>
<h3 class='blue-bg'><?php _e( 'Premium Support and Features', 'simplemap' ); // XSS ok. ?></h3>

<div class="inside" style='padding: 0 10px 10px;'>
<div class="inside">

<?php
// Check for premium support status
Expand All @@ -267,28 +272,20 @@ function print_page() {
<?php _e( 'By signing up for SimpleMap premium support, you help to ensure future enhancements to this excellent project as well as the following benefits:', 'simplemap' ); // XSS ok. ?>
</p>

<ul style='margin-left:25px;list-style-type:disc'>
<ul>
<li><?php _e( 'Around the clock access to our extensive knowledge base and support forum from within your WordPress dashboard', 'simplemap' ); // XSS ok. ?></li>
<li><?php _e( 'Professional and timely response times to all your questions from the SimpleMap team', 'simplemap' ); // XSS ok. ?></li>
<li><?php _e( 'A 10% discount for any custom functionality you request from the SimpleMap developers', 'simplemap' ); // XSS ok. ?></li>
<li><?php _e( 'A 6-12 month advance access to new features integrated into the auto upgrade functionality of WordPress', 'simplemap' ); // XSS ok. ?></li>
</ul>

<ul style='margin-left:25px;list-style-type:none'>
<li>
<a target='_blank' href='<?php echo get_ftps_paypal_button( $simplemap_ps ); ?>'><?php _e( 'Signup Now', 'simplemap' ); // XSS ok. ?></a>
</li>
<li><a target='_blank'
href='<?php echo get_ftps_learn_more_link( $simplemap_ps ); ?>'><?php _e( 'Learn More', 'simplemap' ); // XSS ok. ?></a>
</li>
</ul>
<p><a target='_blank' href='<?php echo get_ftps_paypal_button( $simplemap_ps ); ?>'><?php _e( 'Signup Now', 'simplemap' ); // XSS ok. ?></a> or <a target='_blank' href='<?php echo get_ftps_learn_more_link( $simplemap_ps ); ?>'><?php _e( 'Learn More', 'simplemap' ); // XSS ok. ?></a></p>
<?php else : ?>

<p class='howto'><?php printf( 'Your premium support for <code>%s</code> was purchased on <code>%s</code> by <code>%s</code> (%s). It will remain valid for this URL until <code>%s</code>.', get_ftps_site( $simplemap_ps ), date( 'F d, Y', get_ftps_purchase_date( $simplemap_ps ) ), get_ftps_name( $simplemap_ps ), get_ftps_email( $simplemap_ps ), date( 'F d, Y', get_ftps_exp_date( $simplemap_ps ) ) ); ?></p>
<p><a href='#'
id='premium_help'><?php _e( 'Launch Premium Support widget', 'simplemap' ); // XSS ok. ?></a>
| <a target="blank"
href="http://support.simplemap-plugin.com?sso=<?php echo get_ftps_sso_key( $simplemap_ps ); ?>"><?php _e( 'Visit Premium Support web site', 'simplemap' ); // XSS ok. ?></a>
<p>
<a href='#' id='premium_help'><?php _e( 'Launch Premium Support widget', 'simplemap' ); // XSS ok. ?></a>
| <a target="blank" href="http://support.simplemap-plugin.com?sso=<?php echo get_ftps_sso_key( $simplemap_ps ); ?>"><?php _e( 'Visit Premium Support web site', 'simplemap' ); // XSS ok. ?></a>
</p>
<script type="text/javascript" charset="utf-8">
Tender = {
Expand All @@ -297,27 +294,30 @@ function print_page() {
widgetToggles: [document.getElementById('premium_help')]
}
</script>
<script src="https://simplemap.tenderapp.com/tender_widget.js"
type="text/javascript"></script>
<script src="https://simplemap.tenderapp.com/tender_widget.js" type="text/javascript"></script>

<?php endif; ?>

</div> <!-- inside -->

</div> <!-- postbox -->

<?php do_action( 'sm-help-side-sortables-bottom' ); ?>

</div> <!-- meta-box-sortables -->

</div> <!-- postbox-container -->

</div> <!-- dashboard-widgets -->

<div class="clear">
</div>
<div class="clear"></div>

</div><!-- dashboard-widgets-wrap -->

</div> <!-- wrap -->

<?php
}
}
}
?>
?>
Loading

0 comments on commit 787814f

Please sign in to comment.