/** * Imports old settings from the old Easing Slider plugin (v1.x). * We don't do this automatically in the ESL_Upgrade class. Instead, we give the user the choice through the 'Edit Slideshow' panel. * This is because users were having issues with the plugin deactivating after upgrade, failing to fire the automatic process. * Although this solution isn't ideal, it is the best failsafe. * * @since 2.1.1 */ public static final function legacy_import() { /** Reset the plugin */ EasingSliderLite::get_instance()->uninstall(); EasingSliderLite::get_instance()->activate(); /** Get default slideshow settings */ $slideshow = EasingSliderLite::get_instance()->slideshow_defaults(); /** Transfer the settings */ $slideshow->dimensions->width = get_option('width'); $slideshow->dimensions->height = get_option('height'); $slideshow->dimensions->responsive = false; $slideshow->transitions->effect = get_option('transition') == 'fade' ? 'fade' : 'slide'; $slideshow->transitions->duration = get_option('transpeed'); $slideshow->navigation->arrows = get_option('buttons') == '' ? 'false' : 'true'; $slideshow->navigation->pagination = get_option('sPagination') == '' ? 'false' : 'true'; $slideshow->playback->pause = get_option('interval'); /** Add the slides */ $slideshow->slides = array(); for ($i = 1; $i <= 10; $i++) { /** Check if the slide has an image. Bail if not. */ $image = get_option("sImg{$i}"); if (empty($image)) { continue; } /** Resize the image and get its thumbnail */ $sizes = (object) array('thumbnail' => (object) array('url' => $image)); /** Add the slide image & link */ $slideshow->slides[] = (object) array('id' => $i, 'url' => $image, 'alt' => null, 'title' => null, 'link' => get_option("sImgLink{$i}"), 'linkTarget' => '_blank', 'sizes' => $sizes); } /** Update the slideshow settings */ update_option('easingsliderlite_slideshow', $slideshow); /** Flag upgrade */ update_option('easingsliderlite_major_upgrade', 1); }
/** * Displays a slideshow * * @since 2.0 */ public function display_slideshow() { /** Display the slideshow */ ob_start(); require dirname(EasingSliderLite::get_file()) . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . 'slideshow.php'; return ob_get_clean(); }
/** * Customization page actions * * @since 2.1 */ public function do_customizer_actions($page) { /** Save customizations */ if (isset($_POST['save'])) { /** Security check */ if (!$this->security_check('save', $page)) { wp_die(__('Security check has failed. Save has been prevented. Please try again.', 'easingsliderlite')); exit; } /** Save the customizations */ update_option('easingsliderlite_customizations', json_encode(EasingSliderLite::get_instance()->validate((object) array('arrows' => (object) $_POST['arrows'], 'pagination' => (object) $_POST['pagination'], 'border' => (object) $_POST['border'], 'shadow' => (object) $_POST['shadow'])))); } }
do_action('easingsliderlite_pagination', $s, $c); } ?> <?php /** Edit slideshow link, don't remove this! Won't show if user isn't logged in or doesn't have permission to edit slideshows */ ?> <?php if (current_user_can('easingsliderlite_edit_slideshow') && apply_filters('easingsliderlite_edit_slideshow_icon', __return_true())) { ?> <a href="<?php echo admin_url("admin.php?page=easingsliderlite_edit_slideshow"); ?> " style="position: absolute; top: -15px; left: -15px; z-index: 50;"> <img src="<?php echo plugins_url(dirname(plugin_basename(EasingSliderLite::get_file()))) . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'edit_icon.png'; ?> " style="box-shadow: none; border-radius: none;" /> </a> <?php } ?> </div> <?php /** Display the slideshow shadow */ if (!apply_filters('easingsliderlite_disable_shadow', __return_false())) { /** Get the inline styling */ $styles = $c->shadow->enable ? 'display: block; ' : 'display: none; '; $styles .= $s->dimensions->responsive ? "max-width: {$s->dimensions->width}px; " : "width: {$s->dimensions->width}px; "; $styles .= $c->border->width !== 0 ? "margin-left: {$c->border->width}px;" : '';
<div style="margin-bottom: 15px;"> <a href="http://easingslider.com/upgrade-to-pro" target="_blank"> <img src="<?php echo plugins_url(dirname(plugin_basename(EasingSliderLite::get_file()))) . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'banner-easingsliderpro.png'; ?> " width="285" height="100" alt="<?php _e('Need more slideshow? Click here.', 'easingsliderlite'); ?> " /> </a> </div> <div style="margin-bottom: 15px;"> <a href="http://rocketgalleries.com/" target="_blank"> <img src="<?php echo plugins_url(dirname(plugin_basename(EasingSliderLite::get_file()))) . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'banner-rocketgalleries.png'; ?> " width="285" height="100" alt="<?php _e('Rocket Galleries for WordPress', 'easingsliderlite'); ?> " /> </a> </div> <?php } ?> <!-- Manage Slides --> <div class="widgets-holder-wrap exclude"> <div class="sidebar-name"> <div class="sidebar-name-arrow"></div>
<?php /** Get the slideshow */ $slideshow = $s = EasingSliderLite::get_instance()->validate(get_option('easingsliderlite_slideshow')); ?> <div class="wrap"> <form name="post" action="admin.php?page=easingsliderlite_edit_slideshow" method="post"> <div id="icon-edit" class="icon32 icon32-posts-post"><br></div> <h2><?php _e('Edit Slideshow', 'easingsliderlite'); ?> </h2> <?php /** Display welcome message */ require 'editslideshow-welcome.php'; /** Security nonce field */ wp_nonce_field("easingsliderlite-save_easingsliderlite_edit_slideshow", "easingsliderlite-save_easingsliderlite_edit_slideshow", false); ?> <div class="main-panel"> <div class="clearfix"> <div class="thumbnails-container"> <div class="inner clearfix"> <?php /** We display the current slides anyway using PHP (rather than Javascript) to avoid any rendering delays */ if ($s->slides) { foreach ($s->slides as $slide) { /** Pretty rebust set of fallbacks for the slide thumbnail! Shouldn't ever fail. */ if (isset($slide->sizes->thumbnail)) { $thumbnail = $slide->sizes->thumbnail->url; } else { if (isset($slide->sizes->small)) {
/** * Does 2.1 plugin upgrade * * @since 2.1 */ public static final function do_210_upgrade() { global $wp_roles; /** Add the customizations database option */ add_option('easingsliderlite_customizations', json_encode(EasingSliderLite::get_instance()->customization_defaults())); /** Add the customization panel capability */ foreach ($wp_roles->roles as $role => $info) { EasingSliderLite::get_instance()->add_capability('easingsliderlite_can_customize', get_role($role)); } }