admin-content.php
3 years ago
folder-deactivate-form.php
4 years ago
folder-popup.php
3 years ago
folder-user-settings.php
3 years ago
general-settings.php
3 years ago
help.php
4 years ago
media-cleaning.php
4 years ago
media-replace.php
3 years ago
recommended-plugins.php
4 years ago
update.php
4 years ago
upgrade-table.php
3 years ago
upgrade-to-pro.php
4 years ago
general-settings.php
1704 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Admin folders settings |
| 4 | * |
| 5 | * @author : Premio <contact@premio.io> |
| 6 | * @license : GPL2 |
| 7 | * */ |
| 8 | |
| 9 | if (! defined('ABSPATH')) { |
| 10 | exit; |
| 11 | } |
| 12 | ?> |
| 13 | <!-- do not change here, Free/Pro URL Change --> |
| 14 | <style> |
| 15 | <?php if (function_exists('is_rtl') && is_rtl()) { ?> |
| 16 | #setting-form { |
| 17 | float: right; |
| 18 | } |
| 19 | <?php } ?> |
| 20 | </style> |
| 21 | <script> |
| 22 | (function (factory) { |
| 23 | "use strict"; |
| 24 | if (typeof define === 'function' && define.amd) { |
| 25 | define(['jquery'], factory); |
| 26 | } |
| 27 | else if(typeof module !== 'undefined' && module.exports) { |
| 28 | module.exports = factory(require('jquery')); |
| 29 | } |
| 30 | else { |
| 31 | factory(jQuery); |
| 32 | } |
| 33 | }(function ($, undefined) { |
| 34 | var selectedItem; |
| 35 | var importTitle = "<?php esc_html_e("Import folders from %plugin%", "folders"); ?>"; |
| 36 | var importDesc = "<?php esc_html_e("Are you sure you'd like to import %d folders from %plugin%?", "folders"); ?>"; |
| 37 | var removeTitle = "<?php esc_html_e("Are you sure?", "folders"); ?>"; |
| 38 | var removeDesc = "<?php esc_html_e("You're about to delete %plugin%'s folders. Are you sure you'd like to proceed?", "folders"); ?>"; |
| 39 | $(document).ready(function(){ |
| 40 | <?php if ($setting_page == "folder-settings") { ?> |
| 41 | $(".select2-box").select2(); |
| 42 | <?php } ?> |
| 43 | $(document).on("click",".form-cancel-btn, .close-popup-button, .folder-popup-form",function(){ |
| 44 | if($(this).hasClass("cancel-folders") || $(this).hasClass("remove-folders-box") || $(this).hasClass("close-remove-folders")) { |
| 45 | $("#remove_folders_when_removed").prop("checked", false); |
| 46 | setFoldersRemoveStatus("off"); |
| 47 | } |
| 48 | if($(this).hasClass("delete-button")) { |
| 49 | setFoldersRemoveStatus("on"); |
| 50 | } |
| 51 | $(".folder-popup-form").hide(); |
| 52 | if($(this).closest(".folder-popup-form").attr("id") == "import-third-party-plugin-data") { |
| 53 | if($("#wordpress-popup").length) { |
| 54 | $("#wordpress-popup").show(); |
| 55 | } |
| 56 | } |
| 57 | }); |
| 58 | $(document).on("click",".import-folders-button", function(e){ |
| 59 | $("#import-folders-popup").show(); |
| 60 | }); |
| 61 | $(document).on("click",".popup-form-content", function(e){ |
| 62 | e.stopPropagation(); |
| 63 | e.stopImmediatePropagation(); |
| 64 | }); |
| 65 | $(document).on("click",".folder-select",function(){ |
| 66 | if($(this).is(":checked")) { |
| 67 | $(this).closest("tr").find(".hide-show-option").removeClass("hide-option"); |
| 68 | } else { |
| 69 | $(this).closest("tr").find(".hide-show-option").addClass("hide-option"); |
| 70 | } |
| 71 | }); |
| 72 | $(document).on("click", ".accordion-header", function(){ |
| 73 | if($(this).hasClass("active")) { |
| 74 | $(this).closest(".accordion").find(".accordion-content").slideUp(); |
| 75 | $(this).removeClass("active"); |
| 76 | } else { |
| 77 | $(this).closest(".accordion").find(".accordion-content").slideDown(); |
| 78 | $(this).addClass("active"); |
| 79 | } |
| 80 | }); |
| 81 | $(document).on("change", ".hide-show-option", function(){ |
| 82 | if($(this).val() == "folders-pro") { |
| 83 | $(this).find("option").prop("selected", false); |
| 84 | $(this).find("option:first").prop("selected", true); |
| 85 | window.open("<?php echo esc_url($this->getFoldersUpgradeURL()) ?>", "_blank"); |
| 86 | } |
| 87 | }); |
| 88 | $(document).on("change", "#folder_font", function(){ |
| 89 | if($(this).val() == "folders-pro") { |
| 90 | $(this).val("").trigger("change"); |
| 91 | window.open("<?php echo esc_url($this->getFoldersUpgradeURL()) ?>", "_blank"); |
| 92 | } |
| 93 | }); |
| 94 | $(document).on("click",".view-shortcodes", function(e){ |
| 95 | e.preventDefault(); |
| 96 | $("#keyboard-shortcut").show(); |
| 97 | }); |
| 98 | $(document).on("change", "#folder_size", function(){ |
| 99 | if($(this).val() == "folders-pro" || $(this).val() == "folders-pro-item" || $(this).val() == "folders-item-pro") { |
| 100 | $(this).val("16").trigger("change"); |
| 101 | window.open("<?php echo esc_url($this->getFoldersUpgradeURL()) ?>", "_blank"); |
| 102 | } |
| 103 | }); |
| 104 | $(".accordion-header:first").trigger("click"); |
| 105 | $("#folder_font, #folder_size").change(function(){ |
| 106 | setCSSProperties(); |
| 107 | }); |
| 108 | $(document).on("click", "input[name='customize_folders[show_media_details]']", function(){ |
| 109 | if($("#show_media_details").is(":checked")) { |
| 110 | $(".media-setting-box").addClass("active"); |
| 111 | } else { |
| 112 | $(".media-setting-box").removeClass("active"); |
| 113 | } |
| 114 | }); |
| 115 | setCSSProperties(); |
| 116 | $('.color-field').spectrum({ |
| 117 | chooseText: "Submit", |
| 118 | preferredFormat: "hex", |
| 119 | showInput: true, |
| 120 | cancelText: "Cancel", |
| 121 | move: function (color) { |
| 122 | $(this).val(color.toHexString()); |
| 123 | setCSSProperties(); |
| 124 | }, |
| 125 | change: function (color) { |
| 126 | $(this).val(color.toHexString()); |
| 127 | setCSSProperties(); |
| 128 | } |
| 129 | }); |
| 130 | $(document).on("click", "input[name='customize_folders[remove_folders_when_removed]']", function(e){ |
| 131 | if($(this).is(":checked")) { |
| 132 | $("#remove-folders-data-box").show(); |
| 133 | //setFoldersRemoveStatus("on"); |
| 134 | } else { |
| 135 | setFoldersRemoveStatus("off"); |
| 136 | } |
| 137 | }) |
| 138 | $(document).on("click", ".import-folder-data", function(e){ |
| 139 | selectedItem = $(this).closest("tr").data("plugin"); |
| 140 | if(!$(this).hasClass("in-popup")) { |
| 141 | var pluginName = $(this).closest("tr").find(".plugin-name").html(); |
| 142 | var pluginFolders = parseInt($(this).closest("tr").data("folders")); |
| 143 | var popupTitle = importTitle.replace("%plugin%", pluginName); |
| 144 | $(".import-folder-title").html(popupTitle); |
| 145 | var popupDesc = importDesc.replace("%plugin%", "<b>" + pluginName + "</b>"); |
| 146 | popupDesc = popupDesc.replace("%d", "<b>" + pluginFolders + "</b>"); |
| 147 | $(".import-folder-note").html(popupDesc); |
| 148 | $("#import-plugin-data").show(); |
| 149 | } else { |
| 150 | importPluginData(); |
| 151 | } |
| 152 | }); |
| 153 | $(document).on("click", ".remove-folders-data", function(e){ |
| 154 | e.preventDefault(); |
| 155 | $("#remove-confirmation-box").show(); |
| 156 | $("#delete-input").focus(); |
| 157 | }); |
| 158 | $(document).on("keyup", "#delete-input", function(){ |
| 159 | if($.trim($(this).val()) != "") { |
| 160 | var inputVal = $.trim($(this).val()).toLowerCase(); |
| 161 | if (inputVal == "delete") { |
| 162 | $("#remove-folders-data-button").prop("disabled", false); |
| 163 | $(".delete-confirmation-message").html("<?php esc_html_e('This will delete all existing folders & settings', 'folders'); ?>"); |
| 164 | } else { |
| 165 | $("#remove-folders-data-button").prop("disabled", true); |
| 166 | if (inputVal != "") { |
| 167 | var textLen = inputVal.length; |
| 168 | var curStr = ("delete").substring(0, textLen); |
| 169 | if (curStr != inputVal) { |
| 170 | $(".delete-confirmation-message").html("<?php esc_html_e('Please type DELETE and click on the "Delete" button to confirm', 'folders'); ?>"); |
| 171 | } else { |
| 172 | $(".delete-confirmation-message").html(""); |
| 173 | } |
| 174 | } else { |
| 175 | $(".delete-confirmation-message").html(""); |
| 176 | } |
| 177 | } |
| 178 | } else { |
| 179 | $(".delete-confirmation-message").html(""); |
| 180 | } |
| 181 | }); |
| 182 | $(document).on("submit", "#remove_folders_data", function(e){ |
| 183 | e.preventDefault(); |
| 184 | if($.trim($("#delete-input").val()).toLowerCase() == "delete") { |
| 185 | $.ajax({ |
| 186 | url: "<?php echo admin_url("admin-ajax.php") ?>", |
| 187 | data: { |
| 188 | action: 'wcp_remove_all_folders_data', |
| 189 | nonce: $("#remove-folder-nonce").val() |
| 190 | }, |
| 191 | type: 'post', |
| 192 | success: function(res) { |
| 193 | <?php |
| 194 | $redirectURL = $this->getFolderSettingsURL(); |
| 195 | if (!empty($redirectURL)) { |
| 196 | $page = filter_input(INPUT_POST, 'tab_page'); |
| 197 | $type = filter_input(INPUT_GET, 'setting_page'); |
| 198 | $type = empty($type) ? "" : "&setting_page=".esc_attr($type); |
| 199 | $redirectURL = $redirectURL.$type; |
| 200 | if (!empty($page)) { |
| 201 | $redirectURL .= "&setting_page=".esc_attr($page); |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | $redirectURL = $redirectURL."¬e=2"; |
| 206 | ?> |
| 207 | window.location = "<?php echo esc_url($redirectURL) ?>"; |
| 208 | } |
| 209 | }); |
| 210 | } |
| 211 | return false; |
| 212 | }); |
| 213 | $(document).on("change", "#delete-input", function(){ |
| 214 | if($.trim($(this).val()).toLowerCase() == "delete") { |
| 215 | $("#remove-folders-data-button").prop("disabled", false); |
| 216 | } else { |
| 217 | $("#remove-folders-data-button").prop("disabled", true); |
| 218 | } |
| 219 | }); |
| 220 | $(document).on("click", "#import-folder-button", function(e){ |
| 221 | importPluginData(); |
| 222 | }); |
| 223 | $(document).on("click", "#folders_by_user_roles", function(e){ |
| 224 | if($(this).is(":checked")) { |
| 225 | $(".folder-user-settings").addClass("active"); |
| 226 | } else { |
| 227 | $(".folder-user-settings").removeClass("active"); |
| 228 | } |
| 229 | }); |
| 230 | $(document).on("click", ".remove-folder-data", function(e){ |
| 231 | selectedItem = $(this).closest("tr").data("plugin"); |
| 232 | var pluginName = $(this).closest("tr").find(".plugin-name").html(); |
| 233 | var pluginFolders = parseInt($(this).closest("tr").data("folders")); |
| 234 | var popupTitle = removeTitle.replace("%plugin%", pluginName); |
| 235 | $(".remove-folder-title").html(popupTitle); |
| 236 | var popupDesc = removeDesc.replace("%plugin%", "<b>" + pluginName + "</b>"); |
| 237 | popupDesc = popupDesc.replace("%d", "<b>" + pluginFolders + "</b>"); |
| 238 | $(".remove-folder-note").html(popupDesc); |
| 239 | $("#remove-plugin-data").show(); |
| 240 | }); |
| 241 | $(document).on("click", "#remove-folder-button", function(){ |
| 242 | removePluginData(); |
| 243 | }); |
| 244 | setTooltipPosition(); |
| 245 | |
| 246 | $(document).on("click", ".checkbox-color", function(){ |
| 247 | setCSSProperties(); |
| 248 | }); |
| 249 | |
| 250 | $(document).on("change", ".checkbox-color", function(){ |
| 251 | setCSSProperties(); |
| 252 | }); |
| 253 | $(document).on("click", "#use_folder_undo", function(){ |
| 254 | if($(this).is(":checked")) { |
| 255 | $(".timeout-settings").addClass("active"); |
| 256 | } else { |
| 257 | $(".timeout-settings").removeClass("active"); |
| 258 | } |
| 259 | }); |
| 260 | $('.enable-replace-media').hover( |
| 261 | function(){ |
| 262 | //$(this).addClass('hover') |
| 263 | }, |
| 264 | function(){ |
| 265 | $(this).removeClass('show') |
| 266 | } |
| 267 | ) |
| 268 | $('.enable-replace-media .html-tooltip').hover( |
| 269 | function(){ |
| 270 | $(this).closest(".enable-replace-media").addClass('show') |
| 271 | }, |
| 272 | function(){ |
| 273 | //$(this).removeClass('show') |
| 274 | } |
| 275 | ) |
| 276 | }); |
| 277 | |
| 278 | function setFoldersRemoveStatus(status) { |
| 279 | $.ajax({ |
| 280 | url: "<?php echo admin_url("admin-ajax.php") ?>", |
| 281 | data: { |
| 282 | 'action': 'wcp_update_folders_uninstall_status', |
| 283 | 'status': status, |
| 284 | 'nonce': "<?php echo wp_create_nonce("wcp_folders_uninstall_status") ?>" |
| 285 | }, |
| 286 | type: 'post', |
| 287 | success: function (res) { |
| 288 | |
| 289 | } |
| 290 | }); |
| 291 | } |
| 292 | |
| 293 | var totalAttachments = 0; |
| 294 | |
| 295 | function importPluginData() { |
| 296 | $("#import-folder-button").addClass("button"); |
| 297 | $("#import-folder-button").prop("disabled", true); |
| 298 | $(".import-folder-data").prop("disabled", true); |
| 299 | $(".other-plugins-"+selectedItem+" .import-folder-data .spinner").addClass("active"); |
| 300 | totalAttachments = 0; |
| 301 | importPluginDataByPage(1); |
| 302 | } |
| 303 | |
| 304 | function importPluginDataByPage(pageNo) { |
| 305 | $.ajax({ |
| 306 | url: "<?php echo admin_url("admin-ajax.php") ?>", |
| 307 | data: { |
| 308 | 'plugin': $(".other-plugins-"+selectedItem).data("plugin"), |
| 309 | 'nonce': $(".other-plugins-"+selectedItem).data("nonce"), |
| 310 | 'action': 'wcp_import_plugin_folders_data', |
| 311 | 'paged' : pageNo, |
| 312 | 'attached': totalAttachments |
| 313 | }, |
| 314 | type: 'post', |
| 315 | success: function(res){ |
| 316 | var response = $.parseJSON(res); |
| 317 | if(response.status == -1) { |
| 318 | totalAttachments = 0; |
| 319 | $(".import-folder-data").prop("disabled", false); |
| 320 | $(".other-plugins-"+selectedItem+" .import-folder-data .spinner").removeClass("active"); |
| 321 | $("#import-third-party-plugin-data").hide(); |
| 322 | $("#no-more-folder-credit").show(); |
| 323 | $("#import-folder-button").removeClass("button"); |
| 324 | $("#import-folder-button").prop("disabled", false); |
| 325 | } else if(response.status) { |
| 326 | $(".other-plugins-"+response.data.plugin+" .import-message").html(response.message).addClass("success-import"); |
| 327 | |
| 328 | if(parseInt(response.data.pages) > parseInt(response.data.current)) { |
| 329 | totalAttachments = response.data.attachments; |
| 330 | importPluginDataByPage(parseInt(response.data.current)+1); |
| 331 | } else { |
| 332 | totalAttachments = 0; |
| 333 | $(".other-plugins-"+response.data.plugin+" .import-folder-data").remove(); |
| 334 | $(".import-folder-data").prop("disabled", false); |
| 335 | } |
| 336 | } else { |
| 337 | $(".other-plugins-"+response.data.plugin+" .import-message").html(response.message).addClass("error-import"); |
| 338 | $(".other-plugins-"+response.data.plugin+" .import-folder-data").remove(); |
| 339 | $(".import-folder-data").prop("disabled", false); |
| 340 | totalAttachments = 0; |
| 341 | } |
| 342 | $("#import-folder-button").prop("disabled", false); |
| 343 | $("#import-plugin-data").hide(); |
| 344 | } |
| 345 | }); |
| 346 | } |
| 347 | |
| 348 | function removePluginData() { |
| 349 | $(".other-plugins-"+selectedItem+" .remove-folder-data .spinner").addClass("active"); |
| 350 | $.ajax({ |
| 351 | url: "<?php echo admin_url("admin-ajax.php") ?>", |
| 352 | data: { |
| 353 | 'plugin': $(".other-plugins-"+selectedItem).data("plugin"), |
| 354 | 'nonce': $(".other-plugins-"+selectedItem).data("nonce"), |
| 355 | 'action': 'wcp_remove_plugin_folders_data' |
| 356 | }, |
| 357 | type: 'post', |
| 358 | success: function(res){ |
| 359 | var response = $.parseJSON(res); |
| 360 | $("#remove-plugin-data").hide(); |
| 361 | if(response.status) { |
| 362 | $(".other-plugins-"+response.data.plugin).remove(); |
| 363 | } else { |
| 364 | $(".other-plugins-"+response.data.plugin+" .import-message").html(response.message).addClass("error-import"); |
| 365 | $(".other-plugins-"+response.data.plugin+" .remove-folder-data .spinner").removeClass("active"); |
| 366 | } |
| 367 | |
| 368 | if($("#import-folders-popup .plugin-import-table tr").length == 0) { |
| 369 | $("#import-folders-popup").hide(); |
| 370 | $(".has-other-plugins").remove(); |
| 371 | $(".no-more-plugins").addClass("active"); |
| 372 | } |
| 373 | } |
| 374 | }); |
| 375 | } |
| 376 | |
| 377 | function setCSSProperties() { |
| 378 | if(jQuery("#new_folder_color").length && $("#new_folder_color").val() != "") { |
| 379 | $("#add-new-folder").css("border-color", $("#new_folder_color").val()); |
| 380 | $("#add-new-folder").css("background-color", $("#new_folder_color").val()); |
| 381 | } else if ($("input[name='customize_folders[new_folder_color]']:checked").length) { |
| 382 | $("#add-new-folder").css("border-color", $("input[name='customize_folders[new_folder_color]']:checked").val()); |
| 383 | $("#add-new-folder").css("background-color", $("input[name='customize_folders[new_folder_color]']:checked").val()); |
| 384 | } |
| 385 | |
| 386 | if($("#bulk_organize_button_color").length && $("#bulk_organize_button_color").val() != "") { |
| 387 | $(".organize-button").css("border-color", $("#bulk_organize_button_color").val()); |
| 388 | $(".organize-button").css("background-color", $("#bulk_organize_button_color").val()); |
| 389 | $(".organize-button").css("color", "#ffffff"); |
| 390 | } else if ($("input[name='customize_folders[bulk_organize_button_color]']:checked").length) { |
| 391 | $(".organize-button").css("border-color", $("input[name='customize_folders[bulk_organize_button_color]']:checked").val()); |
| 392 | $(".organize-button").css("background-color", $("input[name='customize_folders[bulk_organize_button_color]']:checked").val()); |
| 393 | $(".organize-button").css("color", "#ffffff"); |
| 394 | } |
| 395 | |
| 396 | if($("#dropdown_color").length && $("#dropdown_color").val() != "") { |
| 397 | $(".media-select").css("border-color", $("#dropdown_color").val()); |
| 398 | $(".media-select").css("color", $("#dropdown_color").val()); |
| 399 | } else if ($("input[name='customize_folders[dropdown_color]']:checked").length) { |
| 400 | $(".media-select").css("border-color", $("input[name='customize_folders[dropdown_color]']:checked").val()); |
| 401 | $(".media-select").css("color", $("input[name='customize_folders[dropdown_color]']:checked").val()); |
| 402 | } |
| 403 | |
| 404 | if($("#folder_bg_color").length && $("#folder_bg_color").val() != "") { |
| 405 | $(".all-posts.active-item-link").css("border-color", $("#folder_bg_color").val()); |
| 406 | $(".all-posts.active-item-link").css("background-color", $("#folder_bg_color").val()); |
| 407 | $(".all-posts.active-item-link").css("color", "#ffffff"); |
| 408 | } else if ($("input[name='customize_folders[folder_bg_color]']:checked").length) { |
| 409 | $(".all-posts.active-item-link").css("border-color", $("input[name='customize_folders[folder_bg_color]']:checked").val()); |
| 410 | $(".all-posts.active-item-link").css("background-color", $("input[name='customize_folders[folder_bg_color]']:checked").val()); |
| 411 | $(".all-posts.active-item-link").css("color", "#ffffff"); |
| 412 | } |
| 413 | |
| 414 | $("#custom-css").html(""); |
| 415 | if($("#folder_font").val() != "") { |
| 416 | font_val = $("#folder_font").val(); |
| 417 | if(font_val == "System Stack") { |
| 418 | font_val = "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"; |
| 419 | } else { |
| 420 | $('head').append('<link href="https://fonts.googleapis.com/css?family=' + font_val + ':400,600,700" rel="stylesheet" type="text/css" class="chaty-google-font">'); |
| 421 | } |
| 422 | $('.preview-box').css('font-family', font_val); |
| 423 | } else { |
| 424 | $('.preview-box').css('style', ""); |
| 425 | } |
| 426 | if($("#folder_size").val() != "") { |
| 427 | $(".folder-list li a span, .header-posts a, .un-categorised-items a").css("font-size", $("#folder_size").val()+"px"); |
| 428 | } else { |
| 429 | $(".folder-list li a span, .header-posts a, .un-categorised-items a").css("font-size", "14px"); |
| 430 | } |
| 431 | } |
| 432 | |
| 433 | $(window).on("scroll", function(){ |
| 434 | setTooltipPosition(); |
| 435 | }).on("resize", function(){ |
| 436 | setTooltipPosition(); |
| 437 | }); |
| 438 | |
| 439 | function setTooltipPosition() { |
| 440 | if($(".html-tooltip:not(.no-position)").length) { |
| 441 | $(".html-tooltip:not(.no-position)").each(function(){ |
| 442 | if($(this).offset().top - $(window).scrollTop() > 540) { |
| 443 | $(this).addClass("top").removeClass("side").removeClass("bottom"); |
| 444 | $(this).find(".tooltip-text").attr("style",""); |
| 445 | $(this).find(".tooltip-text").removeClass("hide-arrow"); |
| 446 | } else if($(window).height() - ($(this).offset().top - $(window).scrollTop()) > 460) { |
| 447 | $(this).addClass("bottom").removeClass("top").removeClass("side"); |
| 448 | $(this).find(".tooltip-text").attr("style",""); |
| 449 | $(this).find(".tooltip-text").removeClass("hide-arrow"); |
| 450 | } else { |
| 451 | $(this).addClass("side").removeClass("top").removeClass("bottom"); |
| 452 | if($(this).find(".tooltip-text").length) { |
| 453 | $(this).find(".tooltip-text").attr("style",""); |
| 454 | $(this).find(".tooltip-text").removeClass("hide-arrow"); |
| 455 | |
| 456 | if($(this).find(".tooltip-text").offset().top - $(window).scrollTop() - 50 < 0) { |
| 457 | $(this).find(".tooltip-text").css("margin-top", Math.abs($(this).find(".tooltip-text").offset().top - $(window).scrollTop() - 50)+"px"); |
| 458 | $(this).find(".tooltip-text").addClass("hide-arrow"); |
| 459 | } else { |
| 460 | $(this).find(".tooltip-text").attr("style",""); |
| 461 | if(($(this).find(".tooltip-text").offset().top + parseInt($(this).find(".tooltip-text").outerHeight()) - $(window).scrollTop() - $(window).height()) > 0) { |
| 462 | $(this).find(".tooltip-text").css("margin-top", ((-1)*Math.abs($(this).find(".tooltip-text").offset().top + parseInt($(this).find(".tooltip-text").outerHeight()) - $(window).scrollTop() - $(window).height()) - 10)+"px"); |
| 463 | $(this).find(".tooltip-text").addClass("hide-arrow"); |
| 464 | } |
| 465 | } |
| 466 | } |
| 467 | } |
| 468 | }); |
| 469 | } |
| 470 | } |
| 471 | })); |
| 472 | </script> |
| 473 | <div id="custom-css"> |
| 474 | |
| 475 | </div> |
| 476 | <?php |
| 477 | // Check website is hosted on wp.org or not |
| 478 | $wp_status = get_option("is_web_hosted_on_wp"); |
| 479 | if ($wp_status === false) { |
| 480 | $site_url = site_url("/"); |
| 481 | $domain = parse_url($site_url); |
| 482 | |
| 483 | $options = [ |
| 484 | 'http' => ['ignore_errors' => true], |
| 485 | ]; |
| 486 | |
| 487 | $webLink = $domain['host']; |
| 488 | |
| 489 | $context = stream_context_create($options); |
| 490 | $response = @file_get_contents( |
| 491 | 'https://public-api.wordpress.com/rest/v1/sites/'.$webLink, |
| 492 | false, |
| 493 | $context |
| 494 | ); |
| 495 | $response = json_decode($response, true); |
| 496 | |
| 497 | if (!empty($response) && is_array($response)) { |
| 498 | if (isset($response['ID']) && !empty($response['ID'])) { |
| 499 | add_option("is_web_hosted_on_wp", "yes"); |
| 500 | $wp_status = "yes"; |
| 501 | } |
| 502 | } |
| 503 | }//end if |
| 504 | |
| 505 | if ($wp_status === false) { |
| 506 | if (!function_exists("get_current_user_id")) { |
| 507 | add_option("is_web_hosted_on_wp", "yes"); |
| 508 | $wp_status = "yes"; |
| 509 | } |
| 510 | } |
| 511 | |
| 512 | if ($wp_status === false) { |
| 513 | add_option("is_web_hosted_on_wp", "no"); |
| 514 | } |
| 515 | |
| 516 | $show_media_popup = false; |
| 517 | if ($wp_status == "yes") { |
| 518 | $popup_shown = get_option("is_wp_media_popup_shown"); |
| 519 | if ($popup_shown === false) { |
| 520 | $show_media_popup = true; |
| 521 | add_option("is_wp_media_popup_shown", 1); |
| 522 | } else { |
| 523 | if (!is_numeric($popup_shown)) { |
| 524 | $popup_shown = 1; |
| 525 | } |
| 526 | |
| 527 | $popup_shown++; |
| 528 | if ($popup_shown < 4) { |
| 529 | $show_media_popup = true; |
| 530 | } |
| 531 | |
| 532 | update_option("is_wp_media_popup_shown", $popup_shown); |
| 533 | } |
| 534 | } |
| 535 | |
| 536 | ?> |
| 537 | <div class="wrap"> |
| 538 | <h1><?php esc_html_e('Folders Settings', 'folders'); ?></h1> |
| 539 | <?php |
| 540 | settings_fields('folders_settings'); |
| 541 | settings_fields('default_folders'); |
| 542 | settings_fields('customize_folders'); |
| 543 | $options = get_option('folders_settings'); |
| 544 | $default_folders = get_option('default_folders'); |
| 545 | $customize_folders = get_option('customize_folders'); |
| 546 | $default_folders = (empty($default_folders) || !is_array($default_folders)) ? [] : $default_folders; |
| 547 | do_settings_sections(__FILE__); |
| 548 | delete_transient("premio_folders_without_trash"); |
| 549 | $note = filter_input(INPUT_GET, "note"); |
| 550 | ?> |
| 551 | <?php if ($note == 1) { ?> |
| 552 | <div class="folder-notification notice notice-success is-dismissible"> |
| 553 | <div class="folder-notification-title"><?php esc_html_e("Changes Saved", "folders") ?></div> |
| 554 | <div class="folder-notification-note"><?php esc_html_e("Your changes have been saved.", "folders") ?></div> |
| 555 | </div> |
| 556 | <?php } else if ($note == 2) {?> |
| 557 | <div class="folder-notification notice notice-error is-dismissible"> |
| 558 | <div class="folder-notification-title"><?php esc_html_e("Folders Deleted", "folders") ?></div> |
| 559 | <div class="folder-notification-note"><?php esc_html_e("All folders has been successfully deleted.", "folders") ?></div> |
| 560 | </div> |
| 561 | <?php } ?> |
| 562 | <?php if ($setting_page != "license-key") { ?> |
| 563 | <form action="options.php" method="post" id="setting-form"> |
| 564 | <input type="hidden" name="tab_page" value="<?php echo esc_attr($setting_page) ?>"> |
| 565 | <?php } ?> |
| 566 | <div class="folders-tabs"> |
| 567 | <div class="folder-tab-menu"> |
| 568 | <ul> |
| 569 | <li><a class="<?php echo esc_attr(($setting_page == "folder-settings") ? "active" : "") ?>" href="<?php echo esc_url($settingURL."&setting_page=folder-settings") ?>"><?php esc_html_e('Folders Settings', 'folders'); ?></a></li> |
| 570 | <li><a class="<?php echo esc_attr(($setting_page == "folders-by-user") ? "active" : "") ?>" href="<?php echo esc_url($settingURL."&setting_page=folders-by-user") ?>"><?php esc_html_e('User Restrictions', 'folders'); ?></a></li> |
| 571 | <li><a class="<?php echo esc_attr(($setting_page == "customize-folders") ? "active" : "") ?>" href="<?php echo esc_url($settingURL."&setting_page=customize-folders") ?>"><?php esc_html_e('Customize Folders', 'folders'); ?></a></li> |
| 572 | <li><a class="<?php echo esc_attr(($setting_page == "folders-import") ? "active" : "") ?>" href="<?php echo esc_url($settingURL."&setting_page=folders-import") ?>"><?php esc_html_e('Tools', 'folders'); ?></a></li> |
| 573 | <?php if ($isInSettings) { ?> |
| 574 | <li><a class="<?php echo esc_attr(($setting_page == "upgrade-to-pro") ? "active" : "") ?>" href="<?php echo esc_url($settingURL."&setting_page=upgrade-to-pro") ?>"><?php esc_html_e('Upgrade to Pro', 'folders'); ?></a></li> |
| 575 | <?php } ?> |
| 576 | </ul> |
| 577 | </div> |
| 578 | <div class="folder-tab-content"> |
| 579 | |
| 580 | <div class="tab-content <?php echo esc_attr(($setting_page == "folder-settings") ? "active" : "") ?>" id="folder-settings"> |
| 581 | <div class="accordion-content no-bp"> |
| 582 | <div class="accordion-left"> |
| 583 | <table class="form-table"> |
| 584 | <tboby> |
| 585 | <?php |
| 586 | $post_types = get_post_types( array( ), 'objects' ); |
| 587 | $post_array = array("page", "post", "attachment"); |
| 588 | foreach ( $post_types as $post_type ) { |
| 589 | if ( ! $post_type->show_ui) continue; |
| 590 | $is_checked = !in_array( $post_type->name, $options )?"hide-option":""; |
| 591 | $selected_id = (isset($default_folders[$post_type->name]))?$default_folders[$post_type->name]:"all"; |
| 592 | $is_exists = WCP_Folders::check_for_setting($post_type->name, "default_folders"); |
| 593 | $is_customized = WCP_Folders::check_for_setting($post_type->name, "folders_settings"); |
| 594 | if(in_array($post_type->name, $post_array) || $is_customized === true){ |
| 595 | ?> |
| 596 | <tr> |
| 597 | <td class="no-padding"> |
| 598 | <label label for="folders_<?php echo esc_attr($post_type->name); ?>" class="custom-checkbox"> |
| 599 | <input type="checkbox" class="folder-select sr-only" id="folders_<?php echo esc_attr($post_type->name); ?>" name="folders_settings[]" value="<?php echo esc_attr($post_type->name); ?>"<?php if ( in_array( $post_type->name, $options ) ) echo ' checked="checked"'; ?>/> |
| 600 | <span></span> |
| 601 | </label> |
| 602 | </td> |
| 603 | <td class="" width="260px"> |
| 604 | <label for="folders_<?php echo esc_attr($post_type->name); ?>" ><?php esc_html_e( 'Use Folders with: ', 'folders')." ".esc_html_e($post_type->label); ?></label> |
| 605 | </td> |
| 606 | <td class="default-folder"> |
| 607 | <label class="hide-show-option <?php echo esc_attr($is_checked) ?>" for="folders_for_<?php echo esc_attr($post_type->name); ?>" ><?php esc_html_e( 'Default folder: ', 'folders'); ?></label> |
| 608 | </td> |
| 609 | <td> |
| 610 | <select class="hide-show-option <?php echo esc_attr($is_checked) ?>" id="folders_for_<?php echo esc_attr($post_type->name); ?>" name="default_folders[<?php echo esc_attr($post_type->name); ?>]" ?> |
| 611 | <option value="">All <?php echo esc_attr($post_type->label) ?> Folder</option> |
| 612 | <option value="-1" <?php echo ($selected_id == -1)?"selected":"" ?>>Unassigned <?php echo esc_attr($post_type->label) ?></option> |
| 613 | <?php |
| 614 | if(isset($terms_data[$post_type->name]) && !empty($terms_data[$post_type->name])) { |
| 615 | foreach ($terms_data[$post_type->name] as $term) { |
| 616 | if(empty($is_exists) || $is_exists === false) { |
| 617 | echo "<option class='pro-select-item' value='folders-pro'>" . esc_attr( $term->name ). " (Pro) 🔑</option>"; |
| 618 | } else { |
| 619 | $selected = ( $selected_id == $term->slug ) ? "selected" : ""; |
| 620 | echo "<option " . esc_attr( $selected ) . " value='" . esc_attr( $term->slug ) . "'>" . esc_attr( $term->name ) . "</option>"; |
| 621 | } |
| 622 | } |
| 623 | } ?> |
| 624 | </select> |
| 625 | </td> |
| 626 | </tr> |
| 627 | <?php |
| 628 | } else { |
| 629 | $show_media_details = "off"; |
| 630 | ?> |
| 631 | <tr> |
| 632 | <td style="padding: 15px 10px 15px 0px" colspan="4"> |
| 633 | <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 634 | <label for="" class="custom-checkbox send-user-to-pro"> |
| 635 | <input disabled type="checkbox" class="sr-only" name="customize_folders[show_media_details]" id="show_media_details" value="on" <?php checked($show_media_details, "on") ?>> |
| 636 | <span></span> |
| 637 | </label> |
| 638 | <label for="" class="send-user-to-pro"> |
| 639 | <?php esc_html_e( 'Use Folders with: ', 'folders')." ".esc_html_e($post_type->label); ?> |
| 640 | <button type="button" class="upgrade-link" ><?php esc_html_e("Upgrade to Pro", 'folders'); ?></button> |
| 641 | </label> |
| 642 | </a> |
| 643 | </td> |
| 644 | </tr> |
| 645 | <?php } |
| 646 | } ?> |
| 647 | <?php |
| 648 | $show_in_page = !isset($customize_folders['use_shortcuts']) ? "yes" : $customize_folders['use_shortcuts']; |
| 649 | ?> |
| 650 | <tr> |
| 651 | <td class="no-padding"> |
| 652 | <input type="hidden" name="customize_folders[use_shortcuts]" value="no"> |
| 653 | <label for="use_shortcuts" class="custom-checkbox"> |
| 654 | <input id="use_shortcuts" class="sr-only" <?php checked($show_in_page, "yes") ?> type="checkbox" name="customize_folders[use_shortcuts]" value="yes"> |
| 655 | <span></span> |
| 656 | </label> |
| 657 | </td> |
| 658 | <td colspan="3"> |
| 659 | <label for="use_shortcuts" ><?php esc_html_e('Use keyboard shortcuts to navigate faster', 'folders'); ?> <a href="#" class="view-shortcodes">(<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M13 10V3L4 14h7v7l9-11h-7z" /></svg> <?php esc_html_e('View shortcuts', 'folders'); ?>)</a> |
| 660 | </td> |
| 661 | </tr> |
| 662 | <tr> |
| 663 | <td style="padding: 15px 10px 15px 0px" colspan="4"> |
| 664 | <?php $dynamic_folders = "off"; ?> |
| 665 | <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 666 | <label for="" class="custom-checkbox send-user-to-pro"> |
| 667 | <input disabled type="checkbox" class="sr-only" name="customize_folders[dynamic_folders]" id="dynamic_folders" value="on" <?php checked($dynamic_folders, "on") ?>> |
| 668 | <span></span> |
| 669 | </label> |
| 670 | <label for="" class="send-user-to-pro"> |
| 671 | <?php esc_html_e("Dynamic Folders", "folders"); ?> |
| 672 | <button type="button" class="upgrade-link" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>"><?php esc_html_e("Upgrade to Pro", 'folders') ?></button> |
| 673 | <span class="html-tooltip dynamic "> |
| 674 | <span class="dashicons dashicons-editor-help"></span> |
| 675 | <span class="tooltip-text top" style=""> |
| 676 | <?php esc_html_e("Automatically filter posts/pages/custom posts/media files based on author, date, file types & more", "folders") ?> |
| 677 | <img src="<?php echo esc_url(WCP_FOLDER_URL."assets/images/dynamic-folders.gif") ?>"> |
| 678 | </span> |
| 679 | </span> |
| 680 | <span class="recommanded"><?php esc_html_e("Recommended", "folders") ?></span> |
| 681 | </label> |
| 682 | </a> |
| 683 | </td> |
| 684 | </tr> |
| 685 | <?php |
| 686 | $show_in_page = !isset($customize_folders['use_folder_undo']) ? "yes" : $customize_folders['use_folder_undo']; |
| 687 | ?> |
| 688 | <tr> |
| 689 | <td class="no-padding"> |
| 690 | <input type="hidden" name="customize_folders[use_folder_undo]" value="no"> |
| 691 | <label for="use_folder_undo" class="custom-checkbox"> |
| 692 | <input id="use_folder_undo" class="sr-only" <?php checked($show_in_page, "yes") ?> type="checkbox" name="customize_folders[use_folder_undo]" value="yes"> |
| 693 | <span></span> |
| 694 | </label> |
| 695 | </td> |
| 696 | <td colspan="3"> |
| 697 | <label for="use_folder_undo" ><?php esc_html_e('Use folders with Undo action after performing tasks', 'folders'); ?> <span class="recommanded"><?php esc_html_e("Recommended", "folders") ?></span></label> |
| 698 | </td> |
| 699 | </tr> |
| 700 | <?php |
| 701 | $default_timeout = !isset($customize_folders['default_timeout']) ? "5" : $customize_folders['default_timeout']; |
| 702 | ?> |
| 703 | <tr class="timeout-settings <?php echo ($show_in_page == "yes") ? "active" : "" ?>"> |
| 704 | <td style="padding: 10px 0;" colspan="4"> |
| 705 | <label for="default_timeout" ><?php esc_html_e('Default timeout', 'folders'); ?></label> |
| 706 | <div class="seconds-box"> |
| 707 | <input type="number" class="seconds-input" name="customize_folders[default_timeout]" value="<?php echo esc_attr($default_timeout) ?>" /> |
| 708 | </div> |
| 709 | </td> |
| 710 | </tr> |
| 711 | |
| 712 | <tr> |
| 713 | <td style="padding: 15px 10px 15px 0px" colspan="4"> |
| 714 | <?php $replace_media_title = "off"; ?> |
| 715 | <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 716 | <label for="" class="custom-checkbox send-user-to-pro"> |
| 717 | <input disabled type="checkbox" class="sr-only" id="enable_media_trash" value="off"> |
| 718 | <span></span> |
| 719 | </label> |
| 720 | <label for="" class="send-user-to-pro"> |
| 721 | <?php esc_html_e("Move files to trash by default before deleting", "folders"); ?> |
| 722 | <span class="folder-tooltip" data-title="<?php esc_html_e("When enabled, files will be moved to trash to prevent mistakes, and then you can delete permanently from the trash", "folders") ?>"><span class="dashicons dashicons-editor-help"></span></span></label> |
| 723 | <button type="button" class="upgrade-link" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>"><?php esc_html_e("Upgrade to Pro", 'folders') ?></button> |
| 724 | </label> |
| 725 | </a> |
| 726 | </td> |
| 727 | </tr> |
| 728 | <?php |
| 729 | $show_in_page = !isset($customize_folders['folders_media_cleaning']) ? "yes" : $customize_folders['folders_media_cleaning']; |
| 730 | ?> |
| 731 | <tr> |
| 732 | <td style="padding: 15px 10px 15px 0px" colspan="4"> |
| 733 | <?php $replace_media_title = "off"; ?> |
| 734 | <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 735 | <label for="" class="custom-checkbox send-user-to-pro"> |
| 736 | <input type="hidden" class="sr-only" name="customize_folders[folders_media_cleaning]" value="<?php echo esc_attr($show_in_page) ?>" /> |
| 737 | <input disabled type="checkbox" class="sr-only" id="folders_media_cleaning" value="off"> |
| 738 | <span></span> |
| 739 | </label> |
| 740 | <label for="" class="send-user-to-pro"> |
| 741 | <?php esc_html_e("Use Media Cleaning to clear unused media files", "folders"); ?> |
| 742 | <span class="folder-tooltip" data-title="<?php esc_html_e("The Media Cleaning feature enables you to clean unused media files for your WordPress site and adds a Media Cleaning item under Media", "folders") ?>"><span class="dashicons dashicons-editor-help"></span></span> |
| 743 | <button type="button" class="upgrade-link" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>"><?php esc_html_e("Upgrade to Pro", 'folders') ?></button> |
| 744 | </label> |
| 745 | </a> |
| 746 | </td> |
| 747 | </tr> |
| 748 | <tr> |
| 749 | <td style="padding: 15px 10px 15px 0px" colspan="4"> |
| 750 | <input type="hidden" name="folders_settings1" value="folders"> |
| 751 | <?php |
| 752 | $show_media_details = !isset($customize_folders['show_media_details']) ? "on" : $customize_folders['show_media_details']; |
| 753 | $show_media_details = "off"; |
| 754 | ?> |
| 755 | <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 756 | <label for="" class="custom-checkbox send-user-to-pro"> |
| 757 | <input disabled type="checkbox" class="sr-only" name="customize_folders[show_media_details]" id="show_media_details" value="on" <?php checked($show_media_details, "on") ?>> |
| 758 | <span></span> |
| 759 | </label> |
| 760 | <label for="" class="send-user-to-pro"> |
| 761 | <?php esc_html_e("Show media details on hover", "folders"); ?> |
| 762 | <button type="button" class="upgrade-link" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>"><?php esc_html_e("Upgrade to Pro", 'folders'); ?></button> |
| 763 | <span class="html-tooltip bottom"> |
| 764 | <span class="dashicons dashicons-editor-help"></span> |
| 765 | <span class="tooltip-text top" style=""> |
| 766 | <?php esc_html_e("Show useful metadata including title, size, type, date, dimension & more on hover.", "folders"); ?> |
| 767 | <img src="<?php echo esc_url(WCP_FOLDER_URL."assets/images/folders-media.gif") ?>"> |
| 768 | </span> |
| 769 | </span> |
| 770 | <span class="recommanded"><?php esc_html_e("Recommended", "folders") ?></span> |
| 771 | </label> |
| 772 | </a> |
| 773 | </td> |
| 774 | </tr> |
| 775 | <tr> |
| 776 | <td colspan="4"> |
| 777 | <div class=""> |
| 778 | <div class=""> |
| 779 | <?php |
| 780 | $media_settings = [ |
| 781 | 'image_title' => [ |
| 782 | "title" => esc_html__("Title", "folders"), |
| 783 | "default" => "on", |
| 784 | ], |
| 785 | 'image_alt_text' => [ |
| 786 | "title" => esc_html__("Alternative Text", "folders"), |
| 787 | "default" => "off", |
| 788 | ], |
| 789 | 'image_file_url' => [ |
| 790 | "title" => esc_html__("File URL", "folders"), |
| 791 | "default" => "off", |
| 792 | ], |
| 793 | 'image_dimensions' => [ |
| 794 | "title" => esc_html__("Dimensions", "folders"), |
| 795 | "default" => "on", |
| 796 | ], |
| 797 | 'image_size' => [ |
| 798 | "title" => esc_html__("Size", "folders"), |
| 799 | "default" => "off", |
| 800 | ], |
| 801 | 'image_file_name' => [ |
| 802 | "title" => esc_html__("Filename", "folders"), |
| 803 | "default" => "off", |
| 804 | ], |
| 805 | 'image_type' => [ |
| 806 | "title" => esc_html__("Type", "folders"), |
| 807 | "default" => "on", |
| 808 | ], |
| 809 | 'image_date' => [ |
| 810 | "title" => esc_html__("Date", "folders"), |
| 811 | "default" => "on", |
| 812 | ], |
| 813 | 'image_uploaded_by' => [ |
| 814 | "title" => esc_html__("Uploaded by", "folders"), |
| 815 | "default" => "off", |
| 816 | ], |
| 817 | ]; |
| 818 | $media_col_settings = isset($customize_folders['media_col_settings']) && is_array($customize_folders['media_col_settings']) ? $customize_folders['media_col_settings'] : [ |
| 819 | "image_title", |
| 820 | "image_dimensions", |
| 821 | "image_type", |
| 822 | "image_date", |
| 823 | ]; |
| 824 | ?> |
| 825 | <input type="hidden" name="customize_folders[media_col_settings][]" value="all"> |
| 826 | <div class="media-setting-box active send-user-to-pro" > |
| 827 | <div class="normal-box"> |
| 828 | <select disabled multiple="multiple" name="customize_folders[media_col_settings][]" class="select2-box"> |
| 829 | <?php foreach ($media_settings as $key => $media) { |
| 830 | $selected = $media['default']; |
| 831 | ?> |
| 832 | <option <?php selected($selected, "on") ?> value="<?php echo esc_attr($key) ?>"><?php echo esc_attr($media['title']) ?></option> |
| 833 | <?php } ?> |
| 834 | </select> |
| 835 | </div> |
| 836 | <a class="upgrade-box" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 837 | <button type="button"><?php esc_html_e("Upgrade to Pro", 'folders'); ?></button> |
| 838 | </a> |
| 839 | </div> |
| 840 | </div> |
| 841 | </div> |
| 842 | </td> |
| 843 | </tr> |
| 844 | <?php |
| 845 | $show_in_page = !isset($customize_folders['folders_enable_replace_media']) ? "yes" : $customize_folders['folders_enable_replace_media']; |
| 846 | ?> |
| 847 | <tr> |
| 848 | <td class="no-padding"> |
| 849 | <input type="hidden" name="customize_folders[folders_enable_replace_media]" value="no"> |
| 850 | <label for="folders_enable_replace_media" class="custom-checkbox"> |
| 851 | <input id="folders_enable_replace_media" class="sr-only" <?php checked($show_in_page, "yes") ?> type="checkbox" name="customize_folders[folders_enable_replace_media]" value="yes"> |
| 852 | <span></span> |
| 853 | </label> |
| 854 | </td> |
| 855 | <td colspan="3" class="enable-replace-media"> |
| 856 | <label for="folders_enable_replace_media" ><?php esc_html_e('Enable Replace Media', 'folders'); ?> |
| 857 | <span class="html-tooltip no-position top"> |
| 858 | <span class="dashicons dashicons-editor-help"></span> |
| 859 | <span class="tooltip-text top" style=""> |
| 860 | <?php esc_html_e("The Replace Media feature will allow you to replace your media files throughout your website with the click of a button, which means the file will be replaced for all your posts, pages, etc", "folders") ?> |
| 861 | <span class="new"><?php printf(esc_html__("%sPro version ✨%s includes updating all previous links of the file in the database, changing dates & more", "folders"), "<a href='".esc_url($this->getFoldersUpgradeURL())."' target='_blank'>", "</a>") ?></span> |
| 862 | </span> |
| 863 | </span> |
| 864 | <span class="recommanded"><?php esc_html_e("Recommended", "folders") ?></span> |
| 865 | </label> |
| 866 | </td> |
| 867 | </tr> |
| 868 | <?php |
| 869 | $show_in_page = !isset($customize_folders['show_folder_in_settings']) ? "no" : $customize_folders['show_folder_in_settings']; |
| 870 | ?> |
| 871 | <tr> |
| 872 | <td class="no-padding"> |
| 873 | <input type="hidden" name="customize_folders[show_folder_in_settings]" value="no"> |
| 874 | <label for="show_folder_in_settings" class="custom-checkbox"> |
| 875 | <input id="show_folder_in_settings" class="sr-only" <?php checked($show_in_page, "yes") ?> type="checkbox" name="customize_folders[show_folder_in_settings]" value="yes"> |
| 876 | <span></span> |
| 877 | </label> |
| 878 | </td> |
| 879 | <td colspan="3"> |
| 880 | <label for="show_folder_in_settings" ><?php esc_html_e('Place the Folders settings page nested under "Settings"', 'folders'); ?></label> |
| 881 | </td> |
| 882 | </tr> |
| 883 | <?php $val = get_option("folders_show_in_menu"); ?> |
| 884 | <input type="hidden" name="folders_show_in_menu" value="off" /> |
| 885 | <tr> |
| 886 | <td width="20" class="no-padding"> |
| 887 | <label for="folders_show_in_menu" class="custom-checkbox"> |
| 888 | <input class="sr-only" type="checkbox" id="folders_show_in_menu" name="folders_show_in_menu" value="on" <?php checked($val, "on") ?>/> |
| 889 | <span></span> |
| 890 | </label> |
| 891 | </td> |
| 892 | <td colspan="3"> |
| 893 | <label for="folders_show_in_menu" ><?php esc_html_e('Show the folders also in WordPress menu', 'folders'); ?></label> |
| 894 | </td> |
| 895 | </tr> |
| 896 | <tr> |
| 897 | <td style="padding: 15px 10px 15px 0px" colspan="4"> |
| 898 | <?php $replace_media_title = "off"; ?> |
| 899 | <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 900 | <label for="" class="custom-checkbox send-user-to-pro"> |
| 901 | <input disabled type="checkbox" class="sr-only" name="customize_folders[replace_media_title]" id="replace_media_title" value="on" <?php checked($replace_media_title, "on") ?>> |
| 902 | <span></span> |
| 903 | </label> |
| 904 | <label for="" class="send-user-to-pro"> |
| 905 | <?php esc_html_e("Auto Rename file based on title", "folders"); ?> |
| 906 | <span class="folder-tooltip" data-title="<?php esc_html_e("Replace the actual file name of media files with the title from the WordPress editor.", "folders") ?>"><span class="dashicons dashicons-editor-help"></span></span></label> |
| 907 | <button type="button" class="upgrade-link" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>"><?php esc_html_e("Upgrade to Pro", 'folders') ?></button> |
| 908 | </label> |
| 909 | </a> |
| 910 | </td> |
| 911 | </tr> |
| 912 | <!-- Do not make changes here, Only for Free --> |
| 913 | </tboby> |
| 914 | </table> |
| 915 | <input type="hidden" name="customize_folders[show_media_details]" value="off"> |
| 916 | </div> |
| 917 | <div class="accordion-right"> |
| 918 | <div class="premio-help"> |
| 919 | <a href="https://premio.io/help/folders/?utm_source=pluginspage" target="_blank"> |
| 920 | <div class="premio-help-btn"> |
| 921 | <img src="<?php echo esc_url(WCP_FOLDER_URL."assets/images/premio-help.png") ?>" alt="Premio Help" class="Premio Help" /> |
| 922 | <div class="need-help">Need Help?</div> |
| 923 | <div class="visit-our">Visit our</div> |
| 924 | <div class="knowledge-base">knowledge base</div> |
| 925 | </div> |
| 926 | </a> |
| 927 | </div> |
| 928 | <?php if ($wp_status == "yes") { ?> |
| 929 | <div class="premio-help"> |
| 930 | <div class="premio-help-btn wp-folder-user"> |
| 931 | <div class="folder-help-icon"><span class="dashicons dashicons-wordpress"></span></div> |
| 932 | <div class="need-help"><?php esc_html_e("WordPress.com User?", "folders") ?></div> |
| 933 | <div class="visit-our"><a target="_blank" href="https://premio.io/help/folders/how-to-activate-folders-for-wordpress-com-media-library/">Enable Folders</a> for your Media Library</div> |
| 934 | </div> |
| 935 | </div> |
| 936 | <?php } ?> |
| 937 | </div> |
| 938 | <div class="clear"></div> |
| 939 | <div class="submit-button"> |
| 940 | <?php submit_button(); ?> |
| 941 | </div> |
| 942 | </div> |
| 943 | </div> |
| 944 | |
| 945 | <div class="tab-content <?php echo esc_attr(($setting_page == "customize-folders") ? "active" : "") ?>" id="customize-folders"> |
| 946 | <div class="accordion-content"> |
| 947 | <div class="accordion-left"> |
| 948 | <table class="form-table"> |
| 949 | <?php |
| 950 | $colors = [ |
| 951 | "#FA166B", |
| 952 | "#0073AA", |
| 953 | "#484848", |
| 954 | ]; |
| 955 | $color = !isset($customize_folders['new_folder_color'])||empty($customize_folders['new_folder_color']) ? "#FA166B" : $customize_folders['new_folder_color']; |
| 956 | $setting_color = WCP_Folders::check_for_setting("new_folder_color", "customize_folders"); |
| 957 | ?> |
| 958 | <tr> |
| 959 | <td width="255px" class="no-padding"> |
| 960 | <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 961 | <label for="new_folder_color" ><b>"New Folder"</b> button color <button type="button" class="upgrade-link" ><?php esc_html_e("Upgrade to Pro", 'folders'); ?></button></label> |
| 962 | </a> |
| 963 | </td> |
| 964 | <td> |
| 965 | <ul class="color-list"> |
| 966 | <?php $field_name = "new_folder_color"; foreach ($colors as $key => $value) { ?> |
| 967 | <li> |
| 968 | <label class="color-checkbox <?php echo ($color == $value) ? "active" : "" ?>" for="<?php echo esc_attr($field_name)."-".esc_attr($key) ?>"> |
| 969 | <input type="radio" id="<?php echo esc_attr($field_name)."-".esc_attr($key) ?>" name="customize_folders[<?php echo esc_attr($field_name) ?>]" class="sr-only checkbox-color" value="<?php echo esc_attr($value) ?>" <?php checked($color, $value) ?> /> |
| 970 | <span style="background: <?php echo esc_attr($value) ?>"></span> |
| 971 | </label> |
| 972 | </li> |
| 973 | <?php } $key = 3; ?> |
| 974 | <?php if ($setting_color !== false && $setting_color != "#FA166B") { ?> |
| 975 | <li> |
| 976 | <label class="color-checkbox <?php echo ($color == $setting_color) ? "active" : "" ?>" for="<?php echo esc_attr($field_name)."-".esc_attr($key) ?>"> |
| 977 | <input type="radio" id="<?php echo esc_attr($field_name)."-".esc_attr($key) ?>" name="customize_folders[<?php echo esc_attr($field_name) ?>]" class="sr-only checkbox-color" value="<?php echo esc_attr($setting_color) ?>" <?php checked($color, $setting_color) ?> /> |
| 978 | <span style="background: <?php echo esc_attr($setting_color) ?>"></span> |
| 979 | </label> |
| 980 | </li> |
| 981 | <?php } ?> |
| 982 | <li> |
| 983 | <a class="upgrade-box-link d-block" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 984 | <span class="color-box"><span class="gradient"></span> <span class="color-box-area"><?php echo esc_html_e("Custom", "folders") ?></span></span> |
| 985 | <span class="upgrade-link"><?php echo esc_html_e("Upgrade to Pro", "folders") ?></span> |
| 986 | </a> |
| 987 | </li> |
| 988 | </ul> |
| 989 | </td> |
| 990 | <td rowspan="4" > |
| 991 | |
| 992 | </td> |
| 993 | </tr> |
| 994 | <?php |
| 995 | $color = !isset($customize_folders['bulk_organize_button_color'])||empty($customize_folders['bulk_organize_button_color']) ? "#FA166B" : $customize_folders['bulk_organize_button_color']; |
| 996 | $setting_color = WCP_Folders::check_for_setting("bulk_organize_button_color", "customize_folders"); |
| 997 | ?> |
| 998 | <tr> |
| 999 | <td class="no-padding"> |
| 1000 | <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 1001 | <label for="bulk_organize_button_color" ><b>"Bulk Organize"</b> button color <button type="button" class="upgrade-link" ><?php esc_html_e("Upgrade to Pro", 'folders'); ?></button></label> |
| 1002 | </a> |
| 1003 | </td> |
| 1004 | <td> |
| 1005 | <ul class="color-list"> |
| 1006 | <?php $field_name = "bulk_organize_button_color"; foreach ($colors as $key => $value) { ?> |
| 1007 | <li> |
| 1008 | <label class="color-checkbox <?php echo ($color == $value) ? "active" : "" ?>" for="<?php echo esc_attr($field_name)."-".esc_attr($key) ?>"> |
| 1009 | <input type="radio" id="<?php echo esc_attr($field_name)."-".esc_attr($key) ?>" name="customize_folders[<?php echo esc_attr($field_name) ?>]" class="sr-only checkbox-color" value="<?php echo esc_attr($value) ?>" <?php checked($color, $value) ?> /> |
| 1010 | <span style="background: <?php echo esc_attr($value) ?>"></span> |
| 1011 | </label> |
| 1012 | </li> |
| 1013 | <?php } $key = 3; ?> |
| 1014 | <?php if ($setting_color !== false && $setting_color != "#FA166B") { ?> |
| 1015 | <li> |
| 1016 | <label class="color-checkbox <?php echo ($color == $setting_color) ? "active" : "" ?>" for="<?php echo esc_attr($field_name)."-".esc_attr($key) ?>"> |
| 1017 | <input type="radio" id="<?php echo esc_attr($field_name)."-".esc_attr($key) ?>" name="customize_folders[<?php echo esc_attr($field_name) ?>]" class="sr-only checkbox-color" value="<?php echo esc_attr($setting_color) ?>" <?php checked($color, $setting_color) ?> /> |
| 1018 | <span style="background: <?php echo esc_attr($setting_color) ?>"></span> |
| 1019 | </label> |
| 1020 | </li> |
| 1021 | <?php } ?> |
| 1022 | <li> |
| 1023 | <a class="upgrade-box-link d-block" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 1024 | <span class="color-box"><span class="gradient"></span> <span class="color-box-area"><?php echo esc_html_e("Custom", "folders") ?></span></span> |
| 1025 | <span class="upgrade-link"><?php echo esc_html_e("Upgrade to Pro", "folders") ?></span> |
| 1026 | </a> |
| 1027 | </li> |
| 1028 | </ul> |
| 1029 | </td> |
| 1030 | </tr> |
| 1031 | <?php |
| 1032 | $color = !isset($customize_folders['media_replace_button'])||empty($customize_folders['media_replace_button']) ? "#FA166B" : $customize_folders['media_replace_button']; |
| 1033 | $setting_color = WCP_Folders::check_for_setting("media_replace_button", "customize_folders"); |
| 1034 | ?> |
| 1035 | <tr> |
| 1036 | <td class="no-padding"> |
| 1037 | <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 1038 | <label for="media_replace_button" ><b>"Replace File"</b> media library button <button type="button" class="upgrade-link" ><?php esc_html_e("Upgrade to Pro", 'folders'); ?></button></label> |
| 1039 | </a> |
| 1040 | </td> |
| 1041 | <td> |
| 1042 | <ul class="color-list"> |
| 1043 | <?php $field_name = "media_replace_button"; foreach ($colors as $key => $value) { ?> |
| 1044 | <li> |
| 1045 | <label class="color-checkbox <?php echo ($color == $value) ? "active" : "" ?>" for="<?php echo esc_attr($field_name)."-".esc_attr($key) ?>"> |
| 1046 | <input type="radio" id="<?php echo esc_attr($field_name)."-".esc_attr($key) ?>" name="customize_folders[<?php echo esc_attr($field_name) ?>]" class="sr-only checkbox-color" value="<?php echo esc_attr($value) ?>" <?php checked($color, $value) ?> /> |
| 1047 | <span style="background: <?php echo esc_attr($value) ?>"></span> |
| 1048 | </label> |
| 1049 | </li> |
| 1050 | <?php } $key = 3; ?> |
| 1051 | <?php if ($setting_color !== false && $setting_color != "#FA166B") { ?> |
| 1052 | <li> |
| 1053 | <label class="color-checkbox <?php echo ($color == $setting_color) ? "active" : "" ?>" for="<?php echo esc_attr($field_name)."-".esc_attr($key) ?>"> |
| 1054 | <input type="radio" id="<?php echo esc_attr($field_name)."-".esc_attr($key) ?>" name="customize_folders[<?php echo esc_attr($field_name) ?>]" class="sr-only checkbox-color" value="<?php echo esc_attr($setting_color) ?>" <?php checked($color, $setting_color) ?> /> |
| 1055 | <span style="background: <?php echo esc_attr($setting_color) ?>"></span> |
| 1056 | </label> |
| 1057 | </li> |
| 1058 | <?php } ?> |
| 1059 | <li> |
| 1060 | <a class="upgrade-box-link d-block" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 1061 | <span class="color-box"><span class="gradient"></span> <span class="color-box-area"><?php echo esc_html_e("Custom", "folders") ?></span></span> |
| 1062 | <span class="upgrade-link"><?php echo esc_html_e("Upgrade to Pro", "folders") ?></span> |
| 1063 | </a> |
| 1064 | </li> |
| 1065 | </ul> |
| 1066 | </td> |
| 1067 | </tr> |
| 1068 | <?php |
| 1069 | $color = !isset($customize_folders['dropdown_color'])||empty($customize_folders['dropdown_color']) ? "#484848" : $customize_folders['dropdown_color']; |
| 1070 | $setting_color = WCP_Folders::check_for_setting("dropdown_color", "customize_folders"); |
| 1071 | ?> |
| 1072 | <tr> |
| 1073 | <td class="no-padding"> |
| 1074 | <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 1075 | <label for="dropdown_color" ><?php echo esc_html_e("Dropdown color", "folders") ?> <button type="button" class="upgrade-link" ><?php esc_html_e("Upgrade to Pro", 'folders'); ?></button></label> |
| 1076 | </a> |
| 1077 | </td> |
| 1078 | <td> |
| 1079 | <ul class="color-list"> |
| 1080 | <?php $field_name = "dropdown_color"; foreach ($colors as $key => $value) { ?> |
| 1081 | <li> |
| 1082 | <label class="color-checkbox <?php echo ($color == $value) ? "active" : "" ?>" for="<?php echo esc_attr($field_name)."-".esc_attr($key) ?>"> |
| 1083 | <input type="radio" id="<?php echo esc_attr($field_name)."-".esc_attr($key) ?>" name="customize_folders[<?php echo esc_attr($field_name) ?>]" class="sr-only checkbox-color" value="<?php echo esc_attr($value) ?>" <?php checked($color, $value) ?> /> |
| 1084 | <span style="background: <?php echo esc_attr($value) ?>"></span> |
| 1085 | </label> |
| 1086 | </li> |
| 1087 | <?php } $key = 3; ?> |
| 1088 | <?php if ($setting_color !== false && $setting_color != "#484848") { ?> |
| 1089 | <li> |
| 1090 | <label class="color-checkbox <?php echo ($color == $setting_color) ? "active" : "" ?>" for="<?php echo esc_attr($field_name)."-".esc_attr($key) ?>"> |
| 1091 | <input type="radio" id="<?php echo esc_attr($field_name)."-".esc_attr($key) ?>" name="customize_folders[<?php echo esc_attr($field_name) ?>]" class="sr-only checkbox-color" value="<?php echo esc_attr($setting_color) ?>" <?php checked($color, $setting_color) ?> /> |
| 1092 | <span style="background: <?php echo esc_attr($setting_color) ?>"></span> |
| 1093 | </label> |
| 1094 | </li> |
| 1095 | <?php } ?> |
| 1096 | <li> |
| 1097 | <a class="upgrade-box-link d-block" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 1098 | <span class="color-box"><span class="gradient"></span> <span class="color-box-area"><?php echo esc_html_e("Custom", "folders") ?></span></span> |
| 1099 | <span class="upgrade-link"><?php echo esc_html_e("Upgrade to Pro", "folders") ?></span> |
| 1100 | </a> |
| 1101 | </li> |
| 1102 | </ul> |
| 1103 | </td> |
| 1104 | </tr> |
| 1105 | <?php |
| 1106 | $color = !isset($customize_folders['folder_bg_color'])||empty($customize_folders['folder_bg_color']) ? "#FA166B" : $customize_folders['folder_bg_color']; |
| 1107 | $setting_color = WCP_Folders::check_for_setting("folder_bg_color", "customize_folders"); |
| 1108 | ?> |
| 1109 | <tr> |
| 1110 | <td class="no-padding"> |
| 1111 | <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 1112 | <label for="folder_bg_color" ><?php echo esc_html_e("Folders background color", "folders") ?> <button type="button" class="upgrade-link" ><?php esc_html_e("Upgrade to Pro", 'folders'); ?></button></label> |
| 1113 | </a> |
| 1114 | </td> |
| 1115 | <td> |
| 1116 | <ul class="color-list"> |
| 1117 | <?php $field_name = "folder_bg_color"; foreach ($colors as $key => $value) { ?> |
| 1118 | <li> |
| 1119 | <label class="color-checkbox <?php echo ($color == $value) ? "active" : "" ?>" for="<?php echo esc_attr($field_name)."-".esc_attr($key) ?>"> |
| 1120 | <input type="radio" id="<?php echo esc_attr($field_name)."-".esc_attr($key) ?>" name="customize_folders[<?php echo esc_attr($field_name) ?>]" class="sr-only checkbox-color" value="<?php echo esc_attr($value) ?>" <?php checked($color, $value) ?> /> |
| 1121 | <span style="background: <?php echo esc_attr($value) ?>"></span> |
| 1122 | </label> |
| 1123 | </li> |
| 1124 | <?php } $key = 3; ?> |
| 1125 | <?php if ($setting_color !== false && $setting_color != "#FA166B") { ?> |
| 1126 | <li> |
| 1127 | <label class="color-checkbox <?php echo ($color == $setting_color) ? "active" : "" ?>" for="<?php echo esc_attr($field_name)."-".esc_attr($key) ?>"> |
| 1128 | <input type="radio" id="<?php echo esc_attr($field_name)."-".esc_attr($key) ?>" name="customize_folders[<?php echo esc_attr($field_name) ?>]" class="sr-only checkbox-color" value="<?php echo esc_attr($setting_color) ?>" <?php checked($color, $setting_color) ?> /> |
| 1129 | <span style="background: <?php echo esc_attr($setting_color) ?>"></span> |
| 1130 | </label> |
| 1131 | </li> |
| 1132 | <?php } ?> |
| 1133 | <li> |
| 1134 | <a class="upgrade-box-link d-block" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 1135 | <span class="color-box"><span class="gradient"></span> <span class="color-box-area"><?php echo esc_html_e("Custom", "folders") ?></span></span> |
| 1136 | <span class="upgrade-link"><?php echo esc_html_e("Upgrade to Pro", "folders") ?></span> |
| 1137 | </a> |
| 1138 | </li> |
| 1139 | </ul> |
| 1140 | </td> |
| 1141 | </tr> |
| 1142 | <?php |
| 1143 | $font = !isset($customize_folders['folder_font'])||empty($customize_folders['folder_font']) ? "" : $customize_folders['folder_font']; |
| 1144 | $setting_font = WCP_Folders::check_for_setting("folder_font", "customize_folders"); |
| 1145 | $index = 0; |
| 1146 | ?> |
| 1147 | <tr> |
| 1148 | <td class="no-padding"> |
| 1149 | <label for="folder_font" > |
| 1150 | <?php if ($setting_font !== false && $setting_font != "" && !in_array($setting_font, ["Arial", "Tahoma", "Verdana", "Helvetica", "Times New Roman", "Trebuchet MS", "Georgia", "System Stack"])) { |
| 1151 | esc_html_e("Folders font", 'folders'); |
| 1152 | } else { ?> |
| 1153 | <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 1154 | <?php esc_html_e('Folders font', 'folders'); ?> <button type="button" class="upgrade-link" ><?php esc_html_e("Upgrade to Pro", 'folders'); ?></button> |
| 1155 | </a> |
| 1156 | <?php } ?> |
| 1157 | </label> |
| 1158 | </td> |
| 1159 | <td colspan="2"> |
| 1160 | <select name="customize_folders[folder_font]" id="folder_font" > |
| 1161 | <?php $group = ''; |
| 1162 | foreach ($fonts as $key => $value) : |
| 1163 | $title = $key; |
| 1164 | if ($index == 0) { |
| 1165 | $key = ""; |
| 1166 | } |
| 1167 | |
| 1168 | $index++; |
| 1169 | if ($value != $group) { |
| 1170 | echo '<optgroup label="'.esc_attr($value).'">'; |
| 1171 | $group = $value; |
| 1172 | } |
| 1173 | |
| 1174 | if (($setting_font !== false && $setting_font != "" && !in_array($setting_font, ["Arial", "Tahoma", "Verdana", "Helvetica", "Times New Roman", "Trebuchet MS", "Georgia"])) || $value != "Google Fonts") { ?> |
| 1175 | <option value="<?php echo esc_attr($key); ?>" <?php selected($font, $key); ?>><?php echo esc_attr($title); ?></option> |
| 1176 | <?php } else { ?> |
| 1177 | <option class="pro-select-item" value="folders-pro"><?php echo esc_attr($title); ?> (Pro) 🔑</option> |
| 1178 | <?php } ?> |
| 1179 | <?php endforeach; ?> |
| 1180 | </select> |
| 1181 | </td> |
| 1182 | </tr> |
| 1183 | <?php |
| 1184 | $size = ! isset($customize_folders['folder_size']) || empty($customize_folders['folder_size']) ? "16" : $customize_folders['folder_size']; |
| 1185 | $folder_size = WCP_Folders::check_for_setting("folder_size", "customize_folders"); |
| 1186 | ?> |
| 1187 | <tr> |
| 1188 | <td class="no-padding"> |
| 1189 | <label for="folder_size" > |
| 1190 | <?php if ($folder_size === false || intval($folder_size) === 16) { ?> |
| 1191 | <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 1192 | <?php esc_html_e('Folders size', 'folders'); ?> <button type="button" class="upgrade-link" ><?php esc_html_e("Upgrade to Pro", 'folders'); ?></button> |
| 1193 | </a> |
| 1194 | <?php } else { ?> |
| 1195 | <?php esc_html_e("Folders size", 'folders'); ?> |
| 1196 | <?php } ?> |
| 1197 | </label> |
| 1198 | </td> |
| 1199 | <td colspan="2"> |
| 1200 | <?php |
| 1201 | if ($folder_size === false || intval($folder_size) == 16) { |
| 1202 | $sizes = [ |
| 1203 | "folders-pro" => "Small (Pro) 🔑", |
| 1204 | "16" => "Medium", |
| 1205 | "folders-pro-item" => "Large (Pro) 🔑", |
| 1206 | "folders-item-pro" => "Custom (Pro) 🔑", |
| 1207 | ]; |
| 1208 | $size = 16; |
| 1209 | } else { |
| 1210 | $sizes = [ |
| 1211 | "12" => "Small", |
| 1212 | "16" => "Medium", |
| 1213 | "20" => "Large", |
| 1214 | ]; |
| 1215 | } |
| 1216 | ?> |
| 1217 | <select name="customize_folders[folder_size]" id="folder_size" > |
| 1218 | <?php |
| 1219 | foreach ($sizes as $key => $value) { |
| 1220 | $selected = ($key == $size) ? "selected" : ""; |
| 1221 | echo "<option ".esc_attr($selected)." value='".esc_attr($key)."'>".esc_attr($value)."</option>"; |
| 1222 | } |
| 1223 | ?> |
| 1224 | </select> |
| 1225 | </td> |
| 1226 | </tr> |
| 1227 | <?php $enable_horizontal_scroll = ! isset($customize_folders['enable_horizontal_scroll']) || empty($customize_folders['enable_horizontal_scroll']) ? "on" : $customize_folders['enable_horizontal_scroll']; ?> |
| 1228 | <tr> |
| 1229 | <td class="no-padding"> |
| 1230 | <label for="enable_horizontal_scroll" > |
| 1231 | <?php esc_html_e("Enable Horizontal Scroll", 'folders'); ?> <span class="folder-tooltip" data-title="<?php esc_html_e("When a folder has too much text or you have many levels of sub-folders, a horizontal scroll bar will appear on the bottom to scroll & view Folder names", "folders") ?>"><span class="dashicons dashicons-editor-help"></span></span> |
| 1232 | </label> |
| 1233 | </td> |
| 1234 | <td colspan="2"> |
| 1235 | <input type="hidden" name="customize_folders[enable_horizontal_scroll]" value="off" /> |
| 1236 | <div class="inline-checkbox"> |
| 1237 | <label class="folder-switch " for="enable_horizontal_scroll"> |
| 1238 | <input type="checkbox" class="sr-only normal-input" name="customize_folders[enable_horizontal_scroll]" id="enable_horizontal_scroll" value="on" <?php checked($enable_horizontal_scroll, "on") ?>> |
| 1239 | <div class="folder-slider normal round"></div> |
| 1240 | </label> |
| 1241 | </div> |
| 1242 | </td> |
| 1243 | </tr> |
| 1244 | <?php |
| 1245 | $show_in_page = isset($customize_folders['show_in_page']) ? $customize_folders['show_in_page'] : "hide"; |
| 1246 | $show_folder = WCP_Folders::check_for_setting("show_in_page", "customize_folders"); |
| 1247 | if (empty($show_in_page)) { |
| 1248 | $show_in_page = "hide"; |
| 1249 | } |
| 1250 | ?> |
| 1251 | <tr> |
| 1252 | <td colspan="3" style="padding: 15px 20px 15px 0"> |
| 1253 | <input type="hidden" name="customize_folders[show_in_page]" value="hide"> |
| 1254 | <?php if ($show_folder === false || $show_folder === "hide") { ?> |
| 1255 | <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 1256 | <label for="" class="custom-checkbox send-user-to-pro"> |
| 1257 | <input disabled type="checkbox" class="sr-only" name="customize_folders[show_in_page]" id="show_in_page" value="on" <?php checked($show_in_page, "show") ?>> |
| 1258 | <span></span> |
| 1259 | </label> |
| 1260 | <label for="" class="send-user-to-pro"> |
| 1261 | <?php esc_html_e("Show Folders in upper position", "folders"); ?> |
| 1262 | <button type="button" class="upgrade-link" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>"><?php esc_html_e("Upgrade to Pro", 'folders'); ?></button> |
| 1263 | </label> |
| 1264 | </a> |
| 1265 | <?php } else { ?> |
| 1266 | <div class="custom-checkbox"> |
| 1267 | <input id="show_folders" class="sr-only" <?php checked($show_in_page, "show") ?> type="checkbox" name="customize_folders[show_in_page]" value="show"> |
| 1268 | <span></span> |
| 1269 | </div> |
| 1270 | <label for="show_folders"><?php esc_html_e("Show Folders in upper position", 'folders'); ?></label> |
| 1271 | <?php } ?> |
| 1272 | </td> |
| 1273 | </tr> |
| 1274 | </table> |
| 1275 | </div> |
| 1276 | <div class="accordion-right"> |
| 1277 | <div class="preview-text"> |
| 1278 | Preview |
| 1279 | <div class="preview-text-info"><?php esc_html_e("See the full functionality on your media library, posts, pages, and custom posts", 'folders'); ?></div> |
| 1280 | </div> |
| 1281 | <div class="preview-inner-box"> |
| 1282 | <div class="preview-box"> |
| 1283 | <div class="wcp-custom-form"> |
| 1284 | <div class="form-title"> |
| 1285 | <?php esc_html_e("Folders", 'folders'); ?> |
| 1286 | <a href="javascript:;" class="add-new-folder" id="add-new-folder"> |
| 1287 | <span class="create_new_folder"><i class="pfolder-add-folder"></i></span> |
| 1288 | <span><?php esc_html_e("New Folder", 'folders'); ?></span> |
| 1289 | </a> |
| 1290 | <div class="clear"></div> |
| 1291 | </div> |
| 1292 | <div class="form-options"> |
| 1293 | <ul> |
| 1294 | <li> |
| 1295 | <div class="custom-checkbox"> |
| 1296 | <input type="checkbox" class="sr-only" > |
| 1297 | <span></span> |
| 1298 | </div> |
| 1299 | </li> |
| 1300 | <li> |
| 1301 | <a href="javascript:;" id="inline-update"><span class="icon pfolder-edit-folder"><span class="path2"></span></span> <span class="text"><?php esc_html_e("Rename", 'folders'); ?></span> </a> |
| 1302 | </li> |
| 1303 | <li> |
| 1304 | <a href="javascript:;" id="inline-remove"><span class="icon pfolder-remove"></span> <span class="text"><?php esc_html_e("Delete", 'folders'); ?></span> </a> |
| 1305 | </li> |
| 1306 | <li class="last"> |
| 1307 | <a href="javascript:;" id="expand-collapse-list" data-tooltip="Expand"><span class="icon pfolder-arrow-down"></span></a> |
| 1308 | </li> |
| 1309 | <li class="last"> |
| 1310 | <a href="javascript:;" ><span class="icon pfolder-arrow-sort"></span></a> |
| 1311 | </li> |
| 1312 | </ul> |
| 1313 | </div> |
| 1314 | </div> |
| 1315 | <div class="shadow-box"> |
| 1316 | <div class="header-posts"> |
| 1317 | <a href="javascript:;" class="all-posts active-item-link"><?php esc_html_e("All Files", 'folders'); ?> <span class="total-count">215</span></a> |
| 1318 | </div> |
| 1319 | <div class="un-categorised-items ui-droppable"> |
| 1320 | <a href="javascript:;" class="un-categorized-posts"><?php esc_html_e("Unassigned Files", 'folders'); ?> <span class="total-count total-empty">191</span> </a> |
| 1321 | </div> |
| 1322 | <div class="separator"></div> |
| 1323 | <ul class="folder-list"> |
| 1324 | <li><a href="javascript:;"><i class="wcp-icon pfolder-folder-close"></i> <span><?php esc_html_e("Folder 1", 'folders'); ?></span><span class="total-count">20</span><span class="clear"></span></a></li> |
| 1325 | <li><a href="javascript:;"><i class="wcp-icon pfolder-folder-close"></i> <span><?php esc_html_e("Folder 2", 'folders'); ?></span><span class="total-count">13</span><span class="clear"></span></a></li> |
| 1326 | <li><a href="javascript:;"><i class="wcp-icon pfolder-folder-close"></i> <span><?php esc_html_e("Folder 3", 'folders'); ?></span><span class="total-count">5</span><span class="clear"></span></a></li> |
| 1327 | </ul> |
| 1328 | <div class="separator"></div> |
| 1329 | <div class="media-buttons"> |
| 1330 | <select class="media-select"> |
| 1331 | <option><?php esc_html_e("All Files", 'folders'); ?></option> |
| 1332 | <option><?php esc_html_e("Folder 1", 'folders'); ?></option> |
| 1333 | <option><?php esc_html_e("Folder 2", 'folders'); ?></option> |
| 1334 | <option><?php esc_html_e("Folder 3", 'folders'); ?></option> |
| 1335 | </select> |
| 1336 | <button type="button" class="button organize-button"><?php esc_html_e("Bulk Organize", 'folders'); ?></button> |
| 1337 | <div style="clear: both;"></div> |
| 1338 | </div> |
| 1339 | </div> |
| 1340 | </div> |
| 1341 | </div> |
| 1342 | </div> |
| 1343 | <div class="clear"></div> |
| 1344 | <?php submit_button(); ?> |
| 1345 | </div> |
| 1346 | </div> |
| 1347 | |
| 1348 | <div class="tab-content <?php echo esc_attr(($setting_page == "folders-import") ? "active" : "") ?>" id="folder-import"> |
| 1349 | <?php |
| 1350 | $remove_folders_when_removed = !isset($customize_folders['remove_folders_when_removed']) ? "off" : $customize_folders['remove_folders_when_removed']; |
| 1351 | ?> |
| 1352 | <input type="hidden" name="customize_folders[remove_folders_when_removed]" value="off" /> |
| 1353 | <div class="folder-danger-zone"> |
| 1354 | <table class="import-export-table"> |
| 1355 | <?php if ($is_plugin_exists) { ?> |
| 1356 | <tr class="has-other-plugins"> |
| 1357 | <td> |
| 1358 | <span class="folder-info"><span class="dashicons dashicons-admin-generic"></span> <?php esc_html_e("Export/Import", "folders"); ?></span> |
| 1359 | <span class="folder-text"><span><?php esc_html_e("External folders found.", "folders"); ?></span> <?php esc_html_e("Click import to start importing external folders.", "folders"); ?></span> |
| 1360 | </td> |
| 1361 | <td class="last-td"> |
| 1362 | <a href="#" class="import-folders-button"><?php esc_html_e("Import", "folders"); ?></a> |
| 1363 | </td> |
| 1364 | </tr> |
| 1365 | <?php } ?> |
| 1366 | <tr class="no-more-plugins <?php echo (!$is_plugin_exists) ? "active" : "" ?>"> |
| 1367 | <td> |
| 1368 | <span class="folder-info"><span class="dashicons dashicons-admin-generic"></span> <?php esc_html_e("Export/Import", "folders"); ?></span> |
| 1369 | <span class="folder-text"><?php esc_html_e("Couldn't detect any external folders that can be imported. Please contact us if you have external folders that were not detected", "folders"); ?></span> |
| 1370 | </td> |
| 1371 | <td class="last-td"> |
| 1372 | <a href="https://premio.io/contact/" target="_blank" class="contact-folders-button"><?php esc_html_e("Contact Us", "folders"); ?></a> |
| 1373 | </td> |
| 1374 | </tr> |
| 1375 | <tr> |
| 1376 | <td colspan="2"><span class="danzer-title"><span class="dashicons dashicons-warning"></span> <?php esc_html_e("Danger Zone", "folders"); ?></span></td> |
| 1377 | </tr> |
| 1378 | <tr> |
| 1379 | <td> |
| 1380 | <span class="danger-info"><?php esc_html_e("Delete plugin data upon deletion", "folders"); ?></span> |
| 1381 | <span class="danger-data"><?php esc_html_e("Delete all folders when the plugin is removed. This feature will remove all existing folders created by the plugin upon deletion.", "folders"); ?> <b><?php esc_html_e("(Not recommended)", "folders"); ?></span></b> |
| 1382 | </td> |
| 1383 | <td class="last-td" > |
| 1384 | <div class="inline-checkbox"> |
| 1385 | <label class="folder-switch" for="remove_folders_when_removed"> |
| 1386 | <input type="checkbox" class="sr-only change-folder-status" name="customize_folders[remove_folders_when_removed]" id="remove_folders_when_removed" value="on" <?php checked($remove_folders_when_removed, "on") ?>> |
| 1387 | <div class="folder-slider round"></div> |
| 1388 | </label> |
| 1389 | </div> |
| 1390 | </td> |
| 1391 | </tr> |
| 1392 | <tr> |
| 1393 | <td> |
| 1394 | <span class="danger-info"><?php esc_html_e("Manual Data Removal", "folders"); ?></span> |
| 1395 | <span class="danger-data"><?php esc_html_e("Delete all folders data manually This feature will remove all existing folders created by the plugin. Use this feature with caution.", "folders"); ?> |
| 1396 | </td> |
| 1397 | <td class="last-td"> |
| 1398 | <a href="#" class="remove-folders-data"><?php esc_html_e("Delete Now", "folders"); ?></a> |
| 1399 | </td> |
| 1400 | </tr> |
| 1401 | </table> |
| 1402 | </div> |
| 1403 | </div> |
| 1404 | |
| 1405 | <div class="tab-content <?php echo esc_attr(($setting_page == "upgrade-to-pro") ? "active" : "") ?>"> |
| 1406 | <?php if ($setting_page == "upgrade-to-pro") { ?> |
| 1407 | <?php include_once "upgrade-table.php"; ?> |
| 1408 | <?php } ?> |
| 1409 | </div> |
| 1410 | |
| 1411 | <div class="tab-content <?php echo esc_attr(($setting_page == "folders-by-user") ? "active" : "") ?>" id="folders-by-user"> |
| 1412 | <?php |
| 1413 | $folders_by_users = !isset($customize_folders['folders_by_users']) ? "off" : $customize_folders['folders_by_users']; |
| 1414 | $dynamic_folders_for_admin_only = !isset($customize_folders['dynamic_folders_for_admin_only']) ? "off" : $customize_folders['dynamic_folders_for_admin_only']; |
| 1415 | ?> |
| 1416 | <?php if ($setting_page == "folders-by-user") { |
| 1417 | include "folder-user-settings.php"; |
| 1418 | }//end if |
| 1419 | ?> |
| 1420 | </div> |
| 1421 | |
| 1422 | </div> |
| 1423 | </div> |
| 1424 | <?php |
| 1425 | ?> |
| 1426 | <input type="hidden" name="folder_nonce" value="<?php echo wp_create_nonce("folder_settings") ?>"> |
| 1427 | <input type="hidden" name="folder_page" value="<?php echo filter_input(INPUT_SERVER, "REQUEST_URI") ?>"> |
| 1428 | <?php if ($setting_page != "upgrade-to-pro") { ?> |
| 1429 | </form> |
| 1430 | <?php } ?> |
| 1431 | </div> |
| 1432 | |
| 1433 | <div class="folder-popup-form" id="import-plugin-data"> |
| 1434 | <div class="popup-form-content"> |
| 1435 | <div class="popup-content"> |
| 1436 | <div class="close-popup-button"> |
| 1437 | <a class="" href="javascript:;"><span></span></a> |
| 1438 | </div> |
| 1439 | <div class="import-folder-title"></div> |
| 1440 | <div class="import-folder-note">Are you sure you'd like to import $x folders from $plugin?</div> |
| 1441 | <div class="folder-form-buttons"> |
| 1442 | <button type="submit" class="form-submit-btn" id="import-folder-button"><?php esc_html_e("Import", 'folders'); ?></button> |
| 1443 | <a href="javascript:;" class="form-cancel-btn"><?php esc_html_e("Cancel", 'folders'); ?></a> |
| 1444 | </div> |
| 1445 | </div> |
| 1446 | </div> |
| 1447 | </div> |
| 1448 | |
| 1449 | <?php |
| 1450 | // if($plugin['is_exists']) { ?> |
| 1451 | <div class="folder-popup-form" id="import-folders-popup"> |
| 1452 | <div class="popup-form-content"> |
| 1453 | <div class="popup-content"> |
| 1454 | <div class="close-popup-button"> |
| 1455 | <a class="" href="javascript:;"><span></span></a> |
| 1456 | </div> |
| 1457 | <div class="import-plugin-title"><?php esc_html_e("Import data", 'folders'); ?></div> |
| 1458 | <div class="plugin-import-table"> |
| 1459 | <div class="import-folder-table"> |
| 1460 | <table> |
| 1461 | <tbody> |
| 1462 | <?php foreach ($plugin_info as $slug => $plugin) { ?> |
| 1463 | <?php if ($plugin['is_exists']) { ?> |
| 1464 | <tr class="other-plugins-<?php echo esc_attr__($slug) ?>" data-plugin="<?php echo esc_attr__($slug) ?>" data-nonce="<?php echo wp_create_nonce("import_data_from_".$slug) ?>" data-folders="<?php echo esc_attr($plugin['total_folders']) ?>" data-attachments="<?php echo esc_attr($plugin['total_attachments']) ?>"> |
| 1465 | <th class="plugin-name"><?php echo esc_attr__($plugin['name']) ?></th> |
| 1466 | <td> |
| 1467 | <span class="import-message"><?php printf(esc_html__("%s folder%s and %s attachment%s", "folders"), "<b>".esc_attr($plugin['total_folders'])."</b>", ($plugin['total_folders'] > 1) ? esc_html__("s") : "", "<b>".esc_attr($plugin['total_attachments'])."</b>", ($plugin['total_attachments'] > 1) ? esc_html__("s") : "") ?></span> |
| 1468 | <button type="button" class="button button-primary import-folder-data in-popup"><?php esc_html_e("Import", "folders"); ?> <span class="spinner"></span></button> |
| 1469 | <button type="button" class="button button-secondary remove-folder-data in-popup"><?php esc_html_e("Delete plugin data", "folders"); ?> <span class="spinner"></span></button> |
| 1470 | </td> |
| 1471 | </tr> |
| 1472 | <?php } ?> |
| 1473 | <?php } ?> |
| 1474 | </tbody> |
| 1475 | </table> |
| 1476 | </div> |
| 1477 | </div> |
| 1478 | <div class="folder-form-buttons"> |
| 1479 | <div class=""></div> |
| 1480 | <a href="javascript:;" class="form-cancel-btn"><?php esc_html_e("Close", 'folders'); ?></a> |
| 1481 | </div> |
| 1482 | </div> |
| 1483 | </div> |
| 1484 | </div> |
| 1485 | <?php |
| 1486 | // } ?> |
| 1487 | |
| 1488 | <div class="folder-popup-form" id="remove-plugin-data"> |
| 1489 | <div class="popup-form-content"> |
| 1490 | <div class="popup-content"> |
| 1491 | <div class="close-popup-button"> |
| 1492 | <a class="" href="javascript:;"><span></span></a> |
| 1493 | </div> |
| 1494 | <div class="remove-folder-title"><?php esc_html_e("Are you sure?", 'folders'); ?></div> |
| 1495 | <div class="remove-folder-note"></div> |
| 1496 | <div class="folder-form-buttons"> |
| 1497 | <button type="submit" class="form-submit-btn delete-folder-plugin" id="remove-folder-button"><?php esc_html_e("Delete plugin data", 'folders'); ?></button> |
| 1498 | <a href="javascript:;" class="form-cancel-btn"><?php esc_html_e("Cancel", 'folders'); ?></a> |
| 1499 | </div> |
| 1500 | </div> |
| 1501 | </div> |
| 1502 | </div> |
| 1503 | |
| 1504 | <div class="folder-popup-form remove-folders-box" id="remove-folders-data-box"> |
| 1505 | <div class="popup-form-content"> |
| 1506 | <div class="popup-content"> |
| 1507 | <div class="close-popup-button close-remove-folders"> |
| 1508 | <a class="" href="javascript:;"><span></span></a> |
| 1509 | </div> |
| 1510 | <div class="remove-folder-title"><?php esc_html_e("Are you sure?", 'folders'); ?></div> |
| 1511 | <div class="remove-folder-note"><?php printf(esc_html__("Folders will remove all created folders once you remove the plugin. We recommend you %snot to use this feature%s if you plan to use Folders in future.", 'folders'), "<b>", "</b>"); ?></div> |
| 1512 | <div class="folder-form-buttons"> |
| 1513 | <a href="javascript:;" class="form-cancel-btn cancel-folders"><?php esc_html_e("Cancel", 'folders'); ?></a> |
| 1514 | <button type="submit" class="form-cancel-btn delete-button"><?php esc_html_e("I want to delete anyway", 'folders'); ?></button> |
| 1515 | </div> |
| 1516 | </div> |
| 1517 | </div> |
| 1518 | </div> |
| 1519 | |
| 1520 | <div class="folder-popup-form" id="remove-confirmation-box"> |
| 1521 | <div class="popup-form-content"> |
| 1522 | <div class="popup-content"> |
| 1523 | <form id="remove_folders_data" autocomplete="off" > |
| 1524 | <div class="close-popup-button"> |
| 1525 | <a class="" href="javascript:;"><span></span></a> |
| 1526 | </div> |
| 1527 | <div class="remove-folder-title"></div> |
| 1528 | <div class="remove-folder-note text-left"> |
| 1529 | <b><?php esc_html_e("Type DELETE to confirm", 'folders'); ?></b> |
| 1530 | <div class="input-box"> |
| 1531 | <input autocomplete="off" type="text" id="delete-input" name="delete" > |
| 1532 | </div> |
| 1533 | <div class="delete-confirmation-message"><?php esc_html_e('', 'folders'); ?></div> |
| 1534 | </div> |
| 1535 | <div class="folder-form-buttons"> |
| 1536 | <input type="hidden" name="nonce" id="remove-folder-nonce" value="<?php echo wp_create_nonce("remove_folders_data") ?>"> |
| 1537 | <input type="hidden" name="action" value="remove_all_folders_data"> |
| 1538 | <button disabled type="submit" class="form-submit-btn delete-button" id="remove-folders-data-button"><?php esc_html_e("Delete", 'folders'); ?></button> |
| 1539 | <a href="javascript:;" class="form-cancel-btn"><?php esc_html_e("Cancel", 'folders'); ?></a> |
| 1540 | </div> |
| 1541 | </form> |
| 1542 | </div> |
| 1543 | </div> |
| 1544 | </div> |
| 1545 | |
| 1546 | <?php |
| 1547 | if ($wp_status == "yes" && $show_media_popup) { |
| 1548 | add_option("is_wp_media_popup_shown", "yes"); |
| 1549 | ?> |
| 1550 | <div class="folder-popup-form" id="wordpress-popup"> |
| 1551 | <div class="popup-form-content"> |
| 1552 | <div class="popup-content"> |
| 1553 | <div class="popup-form-data"> |
| 1554 | <div class="close-popup-button"> |
| 1555 | <a class="" href="javascript:;"><span></span></a> |
| 1556 | </div> |
| 1557 | <div class="popup-folder-title"> |
| 1558 | <?php esc_html_e("Seems you’re using WordPress.com", "folders") ?> |
| 1559 | </div> |
| 1560 | <div class="folder-form-message" style="padding: 25px 10px;" > |
| 1561 | <?php esc_html_e('You need to alter a setting to make Folders compatible with WordPress.com media library.', "folders") ?> |
| 1562 | </div> |
| 1563 | <div class="folder-form-buttons" style="display:block;"> |
| 1564 | <a class="form-submit-btn a-inline" target="_blank" href="https://premio.io/help/folders/how-to-activate-folders-for-wordpress-com-media-library/" ><?php esc_html_e("Learn how to enable Folders on media library", 'folders'); ?></a> |
| 1565 | </div> |
| 1566 | </div> |
| 1567 | </div> |
| 1568 | </div> |
| 1569 | </div> |
| 1570 | <?php }//end if |
| 1571 | ?> |
| 1572 | |
| 1573 | <?php |
| 1574 | $option = get_option("folder_intro_box"); |
| 1575 | if (($option == "show" || get_option("folder_redirect_status") == 2) && $is_plugin_exists) { ?> |
| 1576 | <div class="folder-popup-form" id="import-third-party-plugin-data" style="display: block" ?> |
| 1577 | <div class="popup-form-content"> |
| 1578 | <div class="popup-content"> |
| 1579 | <div class="close-popup-button"> |
| 1580 | <a class="" href="javascript:;"><span></span></a> |
| 1581 | </div> |
| 1582 | <div class="import-plugin-title"><?php esc_html_e("Import data", 'folders'); ?></div> |
| 1583 | <div class="import-plugin-note"><?php esc_html_e("We've detected that you use another folders plugin. Would you like the Folders plugin to import your current folders? Keep in mind you can always do it in Folders Settings -> Import", 'folders'); ?></div> |
| 1584 | <div class="plugin-import-table"> |
| 1585 | <div class="import-folder-table"> |
| 1586 | <table> |
| 1587 | <tbody> |
| 1588 | <?php foreach ($plugin_info as $slug => $plugin) { |
| 1589 | if ($plugin['is_exists']) { ?> |
| 1590 | <tr class="other-plugins-<?php echo esc_attr__($slug) ?>" data-plugin="<?php echo esc_attr__($slug) ?>" data-nonce="<?php echo wp_create_nonce("import_data_from_".$slug) ?>" data-folders="<?php echo esc_attr($plugin['total_folders']) ?>" data-attachments="<?php echo esc_attr($plugin['total_attachments']) ?>"> |
| 1591 | <th class="plugin-name"><?php echo esc_attr__($plugin['name']) ?></th> |
| 1592 | <td> |
| 1593 | <button type="button" class="button button-primary import-folder-data in-popup"><?php esc_html_e("Import", "folders"); ?> <span class="spinner"></span></button> |
| 1594 | <span class="import-message"><?php printf(esc_html__("%s folder%s and %s attachment%s", "folders"), "<b>".esc_attr($plugin['total_folders'])."</b>", ($plugin['total_folders'] > 1) ? esc_html__("s") : "", "<b>".esc_attr($plugin['total_attachments'])."</b>", ($plugin['total_attachments'] > 1) ? esc_html__("s") : "") ?></span> |
| 1595 | </td> |
| 1596 | </tr> |
| 1597 | <?php } |
| 1598 | } ?> |
| 1599 | </tbody> |
| 1600 | </table> |
| 1601 | </div> |
| 1602 | </div> |
| 1603 | <div class="folder-form-buttons"> |
| 1604 | <div class=""></div> |
| 1605 | <a href="javascript:;" id="cancel-plugin-import" class="form-cancel-btn"><?php esc_html_e("Close", 'folders'); ?></a> |
| 1606 | </div> |
| 1607 | </div> |
| 1608 | </div> |
| 1609 | </div> |
| 1610 | <?php |
| 1611 | if ($option != "show") { |
| 1612 | update_option("folder_redirect_status", 3); |
| 1613 | } |
| 1614 | }//end if |
| 1615 | ?> |
| 1616 | |
| 1617 | <div class="folder-popup-form" id="no-more-folder-credit"> |
| 1618 | <div class="popup-form-content"> |
| 1619 | <div class="popup-content"> |
| 1620 | <div class="close-popup-button"> |
| 1621 | <a class="" href="javascript:;"><span></span></a> |
| 1622 | </div> |
| 1623 | <div class="add-update-folder-title" id="folder-limitation-message"> |
| 1624 | <?php esc_html_e("You've reached the 10 folder limitation!", 'folders'); ?> |
| 1625 | </div> |
| 1626 | <div class="folder-form-message"> |
| 1627 | <?php esc_html_e("Unlock unlimited amount of folders by upgrading to one of our pro plans.", 'folders'); ?> |
| 1628 | </div> |
| 1629 | <div class="folder-form-buttons"> |
| 1630 | <a href="javascript:;" class="form-cancel-btn"><?php esc_html_e("Cancel", 'folders'); ?></a> |
| 1631 | <a href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" target="_blank" class="form-submit-btn"><?php esc_html_e("See Pro Plans", 'folders'); ?></a> |
| 1632 | </div> |
| 1633 | </div> |
| 1634 | </div> |
| 1635 | </div> |
| 1636 | <?php require_once "help.php" ?> |
| 1637 | |
| 1638 | <div class="folder-popup-form" id="keyboard-shortcut"> |
| 1639 | <div class="popup-form-content"> |
| 1640 | <div class="popup-content"> |
| 1641 | <div class="close-popup-button"> |
| 1642 | <a class="" href="javascript:;"><span></span></a> |
| 1643 | </div> |
| 1644 | <div class="import-plugin-title"><?php esc_html_e("Keyboard shortcuts (Ctrl+K)", 'folders'); ?></div> |
| 1645 | <div class="plugin-import-table"> |
| 1646 | <table class="keyboard-shortcut"> |
| 1647 | <tr> |
| 1648 | <th><?php esc_html_e("Create New Folder", "folders") ?></th> |
| 1649 | <td><span class="key-button">Shift</span><span class="plus-button">+</span><span class="key-button">N</span> </td> |
| 1650 | </tr> |
| 1651 | <tr> |
| 1652 | <th><?php esc_html_e("Rename Folder", "folders") ?></th> |
| 1653 | <td><span class="key-button">F2</span></td> |
| 1654 | </tr> |
| 1655 | <tr> |
| 1656 | <th><?php esc_html_e("Copy Folder", "folders") ?></th> |
| 1657 | <td><span class="key-button">Ctrl</span><span class="plus-button">+</span><span class="key-button">C</span> </td> |
| 1658 | </tr> |
| 1659 | <tr> |
| 1660 | <th><?php esc_html_e("Cut Folder", "folders") ?></th> |
| 1661 | <td><span class="key-button">Ctrl</span><span class="plus-button">+</span><span class="key-button">X</span> </td> |
| 1662 | </tr> |
| 1663 | <tr> |
| 1664 | <th><?php esc_html_e("Paste Folder", "folders") ?></th> |
| 1665 | <td><span class="key-button">Ctrl</span><span class="plus-button">+</span><span class="key-button">V</span> </td> |
| 1666 | </tr> |
| 1667 | <tr> |
| 1668 | <th><?php esc_html_e("Duplicate Folder", "folders") ?></th> |
| 1669 | <td><span class="key-button">Ctrl</span><span class="plus-button">+</span><span class="key-button">D</span> </td> |
| 1670 | </tr> |
| 1671 | <tr> |
| 1672 | <th><?php esc_html_e("Delete Folder", "folders") ?></th> |
| 1673 | <td><span class="key-button">Delete</span></td> |
| 1674 | </tr> |
| 1675 | <tr> |
| 1676 | <th><?php esc_html_e("Next Folder", "folders") ?></th> |
| 1677 | <td><span class="key-button"><span class="dashicons dashicons-arrow-down-alt"></span></span> </td> |
| 1678 | </tr> |
| 1679 | <tr> |
| 1680 | <th><?php esc_html_e("Previous Folder", "folders") ?></th> |
| 1681 | <td><span class="key-button"><span class="dashicons dashicons-arrow-up-alt"></span></span> </td> |
| 1682 | </tr> |
| 1683 | <tr> |
| 1684 | <th><?php esc_html_e("Expand Folder", "folders") ?></th> |
| 1685 | <td><span class="key-button"><span class="dashicons dashicons-arrow-right-alt"></span></span> </td> |
| 1686 | </tr> |
| 1687 | <tr> |
| 1688 | <th><?php esc_html_e("Collapse Folder", "folders") ?></th> |
| 1689 | <td><span class="key-button"><span class="dashicons dashicons-arrow-left-alt"></span></span> </td> |
| 1690 | </tr> |
| 1691 | <tr> |
| 1692 | <th><?php esc_html_e("Re-order folders to upwards", "folders") ?></th> |
| 1693 | <td><span class="key-button">Ctrl</span><span class="plus-button">+</span><span class="key-button"><span class="dashicons dashicons-arrow-up-alt"></span></span></td> |
| 1694 | </tr> |
| 1695 | <tr> |
| 1696 | <th><?php esc_html_e("Re-order folders to downwards", "folders") ?></th> |
| 1697 | <td><span class="key-button">Ctrl</span><span class="plus-button">+</span><span class="key-button"><span class="dashicons dashicons-arrow-down-alt"></span></span></td> |
| 1698 | </tr> |
| 1699 | </table> |
| 1700 | </div> |
| 1701 | </div> |
| 1702 | </div> |
| 1703 | </div> |
| 1704 |