<p> <input type="checkbox" name="wsi_hide_cross" id="wsi_hide_cross" <?php if ($siBean->isWsi_hide_cross() == 'true') { echo "checked='checked'"; } ?> /> <label for="wsi_hide_cross"><?php echo __('Hide', 'wp-splash-image'); ?> <img src="<?php echo WsiCommons::getURL(); ?> /style/jqueryTools/close.png" class="little_cross" /></label> </p> </div> </li> <li> <div class="collapsible-header"> <i class="material-icons">color_lens</i> <?php echo __('Style', 'wp-splash-image'); ?> </div> <div class="collapsible-body">
<?php /** * This file remove tables and options of WSI. */ // if(!defined(WP_UNINSTALL_PLUGIN)) exit(); if (!defined('ABSPATH') && !defined('WP_UNINSTALL_PLUGIN')) { exit; } include 'wsi/DAO/MainManager.class.php'; include 'wsi/DAO/ConfigManager.class.php'; include 'wsi/DAO/SplashImageManager.class.php'; include 'wsi/WsiCommons.class.php'; // Liste des tables qui seront supprimées $list_tables = WsiCommons::getWsiTablesList(); foreach ($list_tables as $table) { MainManager::getInstance()->drop_wsi_table($table); } // Liste des options qui seront supprimées $list_options = WsiCommons::getWsiOptionsList(); foreach ($list_options as $option) { MainManager::getInstance()->delete_wsi_option($option); }
/** * Delete WSI option * @return true if option is deleted, false in other cases */ public function delete_wsi_option($wsi_option_name) { $wsi_tables_list = WsiCommons::getWsiOptionsList(); if (!in_array($wsi_option_name, $wsi_tables_list)) { return false; } return delete_option($wsi_option_name); }
/** * Fontion utililée dans le blog (dans le footer) */ public function wsi_addSplashImageWpFooter() { // Chargement des données en base $configBean = ConfigManager::getInstance()->get(); $siBean = SplashImageManager::getInstance()->get(1); // Si le plugin n'est pas activé dans ses options, on ne fait rien if ($configBean->isSplash_active() != 'true') { return; } // If not in First Load Mode, exit the function if ($configBean->isWsi_first_load_mode_active() == 'true') { return; } // Si la Splash Image n'est pas dans sa plage de validité, on ne fait rien if (WsiCommons::getdate_is_in_validities_dates() == "false") { return; } // If option selected, hide splash image on mobile devices if ($siBean->isWsi_hide_on_mobile_devices() == 'true') { if (is_mobile_browser()) { return; } } // If wsi_display_always option is activated, not paying attention to idle time if ($siBean->isWsi_display_always() != 'true') { // Si l'utilisateur n'a pas été inactif assez longtemps, on ne fait rien if (WsiCommons::enough_idle_to_splash($this->last_display) == false) { return; } } require "splash/content.inc.php"; }
/** * Fonction utilisée dans la partie Admin */ public function wp_splash_image_options() { // L'utilisateur a-t-il les droits suffisants pour afficher la page if (!current_user_can('manage_options')) { wp_die(__("You do not have sufficient permissions to access this page.", 'wp-splash-image')); } $updated = false; $reseted = false; if (isset($_POST['action'])) { switch ($_POST['action']) { case 'update': require "actions/UpdateAction.inc.php"; $updated = true; break; case 'reset': require "actions/ResetAction.inc.php"; $reseted = true; break; } } // Pour le moment on ne charge que le 1er splash screen $configBean = ConfigManager::getInstance()->get(); $siBean = SplashImageManager::getInstance()->get(1); ?> <div class="wsi-back wrap"> <!-- Logo Info --> <div id="display_info"> <a href="https://wordpress.org/plugins/wsi/" target="_blank"> <img id="info_img" class="tooltipped" data-position="bottom" data-tooltip="<?php echo __('Infos', 'wp-splash-image'); ?> " alt="<?php echo __('Infos', 'wp-splash-image'); ?> " src="<?php echo WsiCommons::getURL(); ?> /style/info.png" /> </a> </div> <!-- Logo Feedback --> <div id="display_feedback"> <a target="_blank" href="https://gitter.im/ben-barbier/WP-Splash-Image"> <img id="feedback_img" class="tooltipped" data-position="bottom" data-tooltip="<?php echo __('Chat', 'wp-splash-image'); ?> " alt="<?php echo __('Chat', 'wp-splash-image'); ?> " src="<?php echo WsiCommons::getURL(); ?> /style/chat_logo.png" /> </a> </div> <!-- Logo "Buy me a Beer" --> <div id="display_buyMeABeer"> <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CKGNM6TBHU72C" target="_blank"> <img id="buyMeABeer_img" class="tooltipped" data-position="bottom" data-tooltip="<?php echo __('Buy me a Beer', 'wp-splash-image'); ?> " alt="<?php echo __('Buy me a Beer', 'wp-splash-image'); ?> " src="<?php echo WsiCommons::getURL(); ?> /style/beer.png" /> </a> </div> <!-- Logo Reset --> <div id="display_reset" title="<?php echo __('Reset', 'wp-splash-image'); ?> "> <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?> " style="height:32px;"> <?php wp_nonce_field('reset', 'nonce_reset_field'); ?> <input type="hidden" name="action" value="reset" /> <!-- Fix old tooltip problem --> <input type="image" id="reset_img" class="tooltipped" data-position="bottom" data-tooltip="<?php echo __('Reset original settings', 'wp-splash-image'); ?> " src="<?php echo WsiCommons::getURL(); ?> /style/reset.png" /> </form> </div> <!-- Logo GitHub --> <img id="github_img1" alt="github" src="<?php echo WsiCommons::getURL(); ?> /style/github/ForkMe_Blk.png" usemap="#github_map" /> <img id="github_img2" alt="github" src="<?php echo WsiCommons::getURL(); ?> /style/github/ForkMe_Wht.png" usemap="#github_map" /> <map name="github_map"><area shape="poly" id="github_area" coords="8,0,46,0,141,92,141,133" href="https://github.com/ben-barbier/WP-Splash-Image" target="_blank" /></map> <h2>WP Splash Image</h2> <!-- Information message --> <?php if ($updated) { WsiCommons::showMessage(__('Options Updated...', 'wp-splash-image')); } ?> <?php if (WsiCommons::has_a_new_version()) { WsiCommons::showMessage(__('A new version of "WP Splash Image" is out !', 'wp-splash-image') . " (<a href='" . WsiCommons::getUpdateURL() . "'>" . __('update automatically', 'wp-splash-image') . "</a>)"); } ?> <!-- ------ --> <!-- Forms --> <!-- ------ --> <?php require "forms/MainForm.inc.php"; ?> </div> <script type="text/javascript"> jQuery(document).ready(function ($) { // Récupération du type de splash <?php if (isset($_POST['wsi_type'])) { ?> var wsi_type = '<?php echo $_POST['wsi_type']; ?> '; <?php $wsi_type = $_POST['wsi_type']; ?> <?php } else { if ($siBean->getWsi_type() != "") { ?> var wsi_type = '<?php echo $siBean->getWsi_type(); ?> '; <?php $wsi_type = $siBean->getWsi_type(); ?> <?php } else { ?> var wsi_type = 'picture'; <?php $wsi_type = $siBean->getWsi_type(); ?> <?php } } ?> // Gestion de l'affichage de la zone "block_splash_test_active" if($("#splash_active").attr("checked")=="checked") { $("#block_splash_test_active").css("display","table-row"); } else { $("#block_splash_test_active").css("display","none"); } $("#splash_active").click(function() { if($("#splash_active").attr("checked")=="checked") {$("#block_splash_test_active").fadeIn("slow");} else{$("#block_splash_test_active").fadeOut("slow");} }); // Gestion de l'affichage des zones block_idle_time en fonction de "wsi_display_always" if($("#wsi_display_always").attr("checked")=="checked") { $("#block_idle_time").css("display","none"); }else{ $("#block_idle_time").css("display","block"); } $("#wsi_display_always").click(function() { if($("#wsi_display_always").attr("checked")=="checked") { $("#block_idle_time").fadeOut("slow"); }else{ $("#block_idle_time").fadeIn("slow"); } }); // GitHub banner effect. $('#github_area').mouseover(function() { $('#github_img2').fadeIn("400"); }); $('#github_area').mouseout(function() { $('#github_img2').fadeOut("400"); }); // Color on select input radio function color_box(boxId) { $(".box_type").velocity({ backgroundColor: "#FFFFFF" }, 200); $(boxId).velocity({ backgroundColor: "#D9FFB2" }, 500); } $("#radio_picture").click(function() { color_box("#box_picture")}); $("#radio_youtube").click(function() { color_box("#box_youtube")}); $("#radio_yahoo").click(function() { color_box("#box_yahoo")}); $("#radio_dailymotion").click(function() { color_box("#box_dailymotion")}); $("#radio_metacafe").click(function() { color_box("#box_metacafe")}); $("#radio_swf").click(function() { color_box("#box_swf")}); $("#radio_html").click(function() { color_box("#box_html")}); $("#radio_include").click(function() { color_box("#box_include")}); // Color on plugin init $("#box_<?php echo $wsi_type; ?> ").velocity({ backgroundColor: "#D9FFB2" }, 500); // Splash Color field management $("#splash_color_demo").css("background-color", "#"+$("#splash_color").val()); $("#splash_color").keyup(function() { $("#splash_color_demo").css("background-color", "#"+$("#splash_color").val()); }); // Fields filters $('#splash_color').keyfilter(/[0-9a-f]/i); $('#splash_image_height').keyfilter(/[\d\.]/); $('#splash_image_width').keyfilter(/[\d\.]/); // Live Preview $('#live_preview_button').click(function() { $.post('<?php echo WsiCommons::getURL(); ?> /wsi/back/splash/demo.php', { url_splash_image: $("#url_splash_image").val(), splash_image_width: $("#splash_image_width").val(), splash_image_height: $("#splash_image_height").val(), wsi_margin_top: $("#wsi_margin_top").val(), splash_color: $('#splash_color').val(), wsi_display_time: $("[name='wsi_display_time']").val(), wsi_fixed_splash: $("#wsi_fixed_splash:checked").is(":checked"), wsi_picture_link_url: $("#wsi_picture_link_url").val(), wsi_picture_link_target: $("#wsi_picture_link_target").val(), wsi_include_url: $("#wsi_include_url").val(), wsi_close_on_esc_function: $("#wsi_close_on_esc_function:checked").is(":checked"), wsi_close_on_click_function: $("#wsi_close_on_click_function:checked").is(":checked"), wsi_hide_cross: $("#wsi_hide_cross:checked").is(":checked"), wsi_disable_shadow_border: $("#wsi_disable_shadow_border:checked").is(":checked"), wsi_type: $("[name='wsi_type']:checked").val(), wsi_opacity: $("[name='wsi_opacity']").val(), wsi_youtube: $("#wsi_youtube").val(), wsi_youtube_autoplay: $("#wsi_youtube_autoplay:checked").is(":checked"), wsi_youtube_loop: $("#wsi_youtube_loop:checked").is(":checked"), wsi_yahoo: $("#wsi_yahoo").val(), wsi_dailymotion: $("#wsi_dailymotion").val(), wsi_metacafe: $("#wsi_metacafe").val(), wsi_swf: $("#wsi_swf").val(), wsi_html: $("#wsi_html").val() }, function(files) { $('#live_preview_div').html(files); }); }); // Materializecss $('.tooltipped').tooltip({delay: 10}); var pickadateConfig = { format:'yyyy-mm-dd', selectMonths: true, // Creates a dropdown to control month selectYears: 5, // Creates a dropdown of 5 years to control year onClose: function () { // Warning sur les dates de validités var startDate = datepickerStart.pickadate('picker').get('select', 'yyyymmdd'); var endDate = datepickerEnd.pickadate('picker').get('select', 'yyyymmdd'); var currentDate = getCurrentDate(); if (needToDisplayDateAlertMessage(startDate, endDate, currentDate)) { $("#box_datepickers_warning").velocity("fadeIn", { display: "inline" }); } else { $("#box_datepickers_warning").velocity("fadeOut"); } } }; var datepickerStart = $('#datepicker_start').pickadate(pickadateConfig); var datepickerEnd = $('#datepicker_end').pickadate(pickadateConfig); function getCurrentDate() { var today = new Date(); var dd = today.getDate(); var mm = today.getMonth() + 1; //January is 0! var yyyy = today.getFullYear(); if (dd < 10) { dd = '0' + dd } if (mm < 10) { mm = '0' + mm } return '' + yyyy + mm + dd; } function needToDisplayDateAlertMessage (startDate, endDate, currentDate) { if (startDate && startDate > currentDate) { return true; } if (endDate && endDate < currentDate) { return true; } return false; } $('select').material_select(); $('.modal-trigger').leanModal(); }); </script> <?php }