/** * Grabs interface help screencasts * * @author Jonathan Davis * @since 1.1 * * @return void **/ public function help() { if (!isset($_GET['id'])) { return; } echo ShoppSupport::callhome(array('ShoppScreencast' => $_GET['id'], 'site' => get_bloginfo('url'))); exit; }
/** * Displays registered screen notices * * @since 1.3 * * @return void **/ public function notices() { if (empty($this->notices) && ShoppSupport::activated()) { return; } $markup = array(); foreach ($this->notices as $notice) { $markup[] = '<div class="' . $notice->style . '">'; $markup[] = '<p>' . $notice->message . '</p>'; $markup[] = '</div>'; } $markup[] = ShoppSupport::reminder(); if (!empty($markup)) { echo join('', $markup); } $this->notices = array(); // Reset output buffer }
public function deactivate_key() { check_admin_referer('wp_ajax_shopp_deactivate_key'); $sitekey = ShoppSupport::key(); $key = $sitekey['k']; echo ShoppSupport::deactivate($key); exit; }
public static function reminder() { $userid = get_current_user_id(); $lasttime = get_user_meta($userid, 'shopp_nonag', true); $dismissed = current_time('timestamp') - $lasttime < rand(2, 5) * 86400; if (!current_user_can('shopp_settings') || ShoppSupport::activated() || $dismissed) { return ''; } $url = add_query_arg('action', 'shopp_nonag', wp_nonce_url(admin_url('admin-ajax.php'), 'wp_ajax_shopp_nonag')); $_ = array(); $_[] = '<div id="shopp-activation-nag" class="update-nag">'; $_[] = '<p class="dismiss shoppui-remove-sign alignright"></p>'; $_[] = '<p class="nag">' . self::buykey() . '</p>'; $_[] = '</div>'; $_[] = '<script type="text/javascript">'; $_[] = 'jQuery(document).ready(function($){var id="#shopp-activation-nag",el=$(id).click(function(){window.open($(this).find("a").attr("href"),"_blank");}).find(".dismiss").click(function(){$(id).remove();$.ajax(\'' . $url . '\');});});'; $_[] = '</script>'; return join('', $_); }
/** * Adds update availability notices for new Shopp releases and installed add-ons * * @since 1.3 * * @return void **/ public function updates() { add_filter('plugin_row_meta', array('ShoppSupport', 'addons'), 10, 2); // Show installed addons if (ShoppSupport::activated()) { return; } add_action('in_plugin_update_message-' . SHOPP_PLUGINFILE, array('ShoppSupport', 'wpupdate'), 10, 2); add_action('after_plugin_row_' . SHOPP_PLUGINFILE, array('ShoppSupport', 'pluginsnag'), 10, 2); }
public static function help($id) { if (!ShoppSupport::activated()) { return ''; } $helpurl = add_query_arg(array('src' => 'help', 'id' => $id), admin_url('admin.php')); return apply_filters('shopp_admin_boxhelp', '<a href="' . esc_url($helpurl) . '" class="help shoppui-question"></a>'); }