Esempio n. 1
0
/**
 * Display an ordered list of steps
 */
function wpem_template_list_steps()
{
    $steps = wp_easy_mode()->admin->get_steps();
    $count = count($steps);
    echo '<ol class="wpem-steps-list">';
    foreach ($steps as $i => $step) {
        $classes = array('wpem-steps-list-item', sprintf('wpem-steps-list-item-%d', $step->position), sprintf('wpem-steps-list-item-%s', $step->name));
        if (0 === $i) {
            $classes[] = 'first-step';
        }
        if ($count === $i + 1) {
            $classes[] = 'last-step';
        }
        if ($step->name === wpem_get_current_step()->name) {
            $classes[] = 'active-step';
        }
        if (wpem_get_current_step()->position > $i + 1) {
            $classes[] = 'done-step';
        }
        $classes = array_map('trim', $classes);
        printf('<li class="%s">%s</li>', implode(' ', array_map('esc_attr', $classes)), esc_html($step->title));
    }
    echo '</ol>';
}
Esempio n. 2
0
    }
    /**
     * Deactivate the plugin silently
     */
    public function deactivate()
    {
        if (!$this->is_standalone_plugin()) {
            return;
        }
        /**
         * Filter to deactivate when done
         *
         * @var bool
         */
        if (!(bool) apply_filters('wpem_deactivate', true)) {
            return;
        }
        deactivate_plugins(WPEM_PLUGIN, true);
    }
}
/**
 * Returns the plugin instance
 *
 * @return WPEM_Plugin
 */
function wp_easy_mode()
{
    return WPEM_Plugin::instance();
}
wp_easy_mode();
Esempio n. 3
0
?>
">

	<title><?php 
wpem_template_title();
?>
</title>

	<?php 
wp_print_styles('wpem-fullscreen');
?>

	<style type="text/css">
	.wpem-steps-list li {
		width: <?php 
echo wpem_round(100 / count(wp_easy_mode()->admin->get_steps()), 2);
?>
%;
	}
	</style>

	<?php 
wp_print_scripts('jquery');
?>

	<!--[if lte IE 9]>
		<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
		<script src="//cdnjs.cloudflare.com/ajax/libs/webshim/1.15.10/dev/polyfiller.js"></script>
		<script type="text/javascript">
			jQuery.webshim.setOptions( 'extendNative', true );
			jQuery.webshim.polyfill( 'forms' );
Esempio n. 4
0
/**
 * Mark the wizard as done
 */
function wpem_mark_as_done()
{
    delete_option('wpem_last_viewed');
    update_option('wpem_done', 1);
    wp_easy_mode()->self_destruct();
    wp_easy_mode()->deactivate();
}