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
1748 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_setting = apply_filters("check_for_folders_post_args", ["show_in_menu" => 1]); |
| 587 | $post_types = get_post_types( $post_setting, 'objects' ); |
| 588 | $post_array = array("page", "post", "attachment"); |
| 589 | foreach ( $post_types as $post_type ) { |
| 590 | if ( ! $post_type->show_ui) continue; |
| 591 | $is_checked = !in_array( $post_type->name, $options )?"hide-option":""; |
| 592 | $selected_id = (isset($default_folders[$post_type->name]))?$default_folders[$post_type->name]:"all"; |
| 593 | $is_exists = WCP_Folders::check_for_setting($post_type->name, "default_folders"); |
| 594 | $is_customized = WCP_Folders::check_for_setting($post_type->name, "folders_settings"); |
| 595 | if(in_array($post_type->name, $post_array) || $is_customized === true){ |
| 596 | ?> |
| 597 | <tr> |
| 598 | <td class="no-padding"> |
| 599 | <label label for="folders_<?php echo esc_attr($post_type->name); ?>" class="custom-checkbox"> |
| 600 | <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"'; ?>/> |
| 601 | <span></span> |
| 602 | </label> |
| 603 | </td> |
| 604 | <td class="" width="260px"> |
| 605 | <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> |
| 606 | </td> |
| 607 | <td class="default-folder"> |
| 608 | <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> |
| 609 | </td> |
| 610 | <td> |
| 611 | <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); ?>]" ?> |
| 612 | <option value="">All <?php echo esc_attr($post_type->label) ?> Folder</option> |
| 613 | <option value="-1" <?php echo ($selected_id == -1)?"selected":"" ?>>Unassigned <?php echo esc_attr($post_type->label) ?></option> |
| 614 | <?php |
| 615 | if(isset($terms_data[$post_type->name]) && !empty($terms_data[$post_type->name])) { |
| 616 | foreach ($terms_data[$post_type->name] as $term) { |
| 617 | if(empty($is_exists) || $is_exists === false) { |
| 618 | echo "<option class='pro-select-item' value='folders-pro'>" . esc_attr( $term->name ). " (Pro) 🔑</option>"; |
| 619 | } else { |
| 620 | $selected = ( $selected_id == $term->slug ) ? "selected" : ""; |
| 621 | echo "<option " . esc_attr( $selected ) . " value='" . esc_attr( $term->slug ) . "'>" . esc_attr( $term->name ) . "</option>"; |
| 622 | } |
| 623 | } |
| 624 | } ?> |
| 625 | </select> |
| 626 | </td> |
| 627 | </tr> |
| 628 | <?php if($post_type->name == "attachment") { ?> |
| 629 | <tr> |
| 630 | <td style="padding: 15px 10px 15px 0px" colspan="4"> |
| 631 | <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 632 | <label for="" class="custom-checkbox send-user-to-pro"> |
| 633 | <input disabled type="checkbox" class="sr-only" name="customize_folders[show_media_details]" id="show_media_details" value="on" > |
| 634 | <span></span> |
| 635 | </label> |
| 636 | <label for="" class="send-user-to-pro"> |
| 637 | <?php esc_html_e( 'Use Folders with: Plugins', 'folders'); ?> |
| 638 | <button type="button" class="upgrade-link" ><?php esc_html_e("Upgrade to Pro", 'folders'); ?></button> |
| 639 | </label> |
| 640 | </a> |
| 641 | </td> |
| 642 | </tr> |
| 643 | <?php } |
| 644 | } else { |
| 645 | $show_media_details = "off"; |
| 646 | ?> |
| 647 | <tr> |
| 648 | <td style="padding: 15px 10px 15px 0px" colspan="4"> |
| 649 | <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 650 | <label for="" class="custom-checkbox send-user-to-pro"> |
| 651 | <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") ?>> |
| 652 | <span></span> |
| 653 | </label> |
| 654 | <label for="" class="send-user-to-pro"> |
| 655 | <?php esc_html_e( 'Use Folders with: ', 'folders')." ".esc_html_e($post_type->label); ?> |
| 656 | <button type="button" class="upgrade-link" ><?php esc_html_e("Upgrade to Pro", 'folders'); ?></button> |
| 657 | </label> |
| 658 | </a> |
| 659 | </td> |
| 660 | </tr> |
| 661 | <?php } |
| 662 | } ?> |
| 663 | <?php |
| 664 | $show_in_page = !isset($customize_folders['use_shortcuts']) ? "yes" : $customize_folders['use_shortcuts']; |
| 665 | ?> |
| 666 | |
| 667 | <tr> |
| 668 | <td class="no-padding"> |
| 669 | <input type="hidden" name="customize_folders[use_shortcuts]" value="no"> |
| 670 | <label for="use_shortcuts" class="custom-checkbox"> |
| 671 | <input id="use_shortcuts" class="sr-only" <?php checked($show_in_page, "yes") ?> type="checkbox" name="customize_folders[use_shortcuts]" value="yes"> |
| 672 | <span></span> |
| 673 | </label> |
| 674 | </td> |
| 675 | <td colspan="3"> |
| 676 | <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> |
| 677 | </td> |
| 678 | </tr> |
| 679 | <tr> |
| 680 | <td style="padding: 15px 10px 15px 0px" colspan="4"> |
| 681 | <?php $dynamic_folders = "off"; ?> |
| 682 | <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 683 | <label for="" class="custom-checkbox send-user-to-pro"> |
| 684 | <input disabled type="checkbox" class="sr-only" name="customize_folders[dynamic_folders]" id="dynamic_folders" value="on" <?php checked($dynamic_folders, "on") ?>> |
| 685 | <span></span> |
| 686 | </label> |
| 687 | <label for="" class="send-user-to-pro"> |
| 688 | <?php esc_html_e("Dynamic Folders", "folders"); ?> |
| 689 | <button type="button" class="upgrade-link" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>"><?php esc_html_e("Upgrade to Pro", 'folders') ?></button> |
| 690 | <span class="html-tooltip dynamic "> |
| 691 | <span class="dashicons dashicons-editor-help"></span> |
| 692 | <span class="tooltip-text top" style=""> |
| 693 | <?php esc_html_e("Automatically filter posts/pages/custom posts/media files based on author, date, file types & more", "folders") ?> |
| 694 | <img src="<?php echo esc_url(WCP_FOLDER_URL."assets/images/dynamic-folders.gif") ?>"> |
| 695 | </span> |
| 696 | </span> |
| 697 | <span class="recommanded"><?php esc_html_e("Recommended", "folders") ?></span> |
| 698 | </label> |
| 699 | </a> |
| 700 | </td> |
| 701 | </tr> |
| 702 | <?php |
| 703 | $show_in_page = !isset($customize_folders['use_folder_undo']) ? "yes" : $customize_folders['use_folder_undo']; |
| 704 | ?> |
| 705 | <tr> |
| 706 | <td class="no-padding"> |
| 707 | <input type="hidden" name="customize_folders[use_folder_undo]" value="no"> |
| 708 | <label for="use_folder_undo" class="custom-checkbox"> |
| 709 | <input id="use_folder_undo" class="sr-only" <?php checked($show_in_page, "yes") ?> type="checkbox" name="customize_folders[use_folder_undo]" value="yes"> |
| 710 | <span></span> |
| 711 | </label> |
| 712 | </td> |
| 713 | <td colspan="3"> |
| 714 | <label for="use_folder_undo" ><?php esc_html_e('Use folders with Undo action after performing tasks', 'folders'); ?> |
| 715 | <span class="html-tooltip"> |
| 716 | <span class="dashicons dashicons-editor-help"></span> |
| 717 | <span class="tooltip-text top height-auto" style="height:auto"> |
| 718 | <?php esc_html_e("Undo any action on Folders. Undo move, copy, rename etc actions with this feature", "folders") ?> |
| 719 | <img src="<?php echo esc_url(WCP_FOLDER_URL."assets/images/undo-feature-folders.gif") ?>"> |
| 720 | </span> |
| 721 | </span> |
| 722 | <span class="recommanded"><?php esc_html_e("Recommended", "folders") ?></span> |
| 723 | </label> |
| 724 | </td> |
| 725 | </tr> |
| 726 | <?php |
| 727 | $default_timeout = !isset($customize_folders['default_timeout']) ? "5" : $customize_folders['default_timeout']; |
| 728 | ?> |
| 729 | <tr class="timeout-settings <?php echo ($show_in_page == "yes") ? "active" : "" ?>"> |
| 730 | <td style="padding: 10px 0;" colspan="4"> |
| 731 | <label for="default_timeout" ><?php esc_html_e('Default timeout', 'folders'); ?></label> |
| 732 | <div class="seconds-box"> |
| 733 | <input type="number" class="seconds-input" name="customize_folders[default_timeout]" value="<?php echo esc_attr($default_timeout) ?>" /> |
| 734 | </div> |
| 735 | </td> |
| 736 | </tr> |
| 737 | |
| 738 | <tr> |
| 739 | <td style="padding: 15px 10px 15px 0px" colspan="4"> |
| 740 | <?php $replace_media_title = "off"; ?> |
| 741 | <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 742 | <label for="" class="custom-checkbox send-user-to-pro"> |
| 743 | <input disabled type="checkbox" class="sr-only" id="enable_media_trash" value="off"> |
| 744 | <span></span> |
| 745 | </label> |
| 746 | <label for="" class="send-user-to-pro"> |
| 747 | <?php esc_html_e("Move files to trash by default before deleting", "folders"); ?> |
| 748 | <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> |
| 749 | <button type="button" class="upgrade-link" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>"><?php esc_html_e("Upgrade to Pro", 'folders') ?></button> |
| 750 | </label> |
| 751 | </a> |
| 752 | </td> |
| 753 | </tr> |
| 754 | <?php |
| 755 | $show_in_page = !isset($customize_folders['folders_media_cleaning']) ? "yes" : $customize_folders['folders_media_cleaning']; |
| 756 | ?> |
| 757 | <tr> |
| 758 | <td style="padding: 15px 10px 15px 0px" colspan="4"> |
| 759 | <?php $replace_media_title = "off"; ?> |
| 760 | <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 761 | <label for="" class="custom-checkbox send-user-to-pro"> |
| 762 | <input type="hidden" class="sr-only" name="customize_folders[folders_media_cleaning]" value="<?php echo esc_attr($show_in_page) ?>" /> |
| 763 | <input disabled type="checkbox" class="sr-only" id="folders_media_cleaning" value="off"> |
| 764 | <span></span> |
| 765 | </label> |
| 766 | <label for="" class="send-user-to-pro"> |
| 767 | <?php esc_html_e("Use Media Cleaning to clear unused media files", "folders"); ?> |
| 768 | <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> |
| 769 | <button type="button" class="upgrade-link" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>"><?php esc_html_e("Upgrade to Pro", 'folders') ?></button> |
| 770 | </label> |
| 771 | </a> |
| 772 | </td> |
| 773 | </tr> |
| 774 | <tr> |
| 775 | <td style="padding: 15px 10px 15px 0px" colspan="4"> |
| 776 | <input type="hidden" name="folders_settings1" value="folders"> |
| 777 | <?php |
| 778 | $show_media_details = !isset($customize_folders['show_media_details']) ? "on" : $customize_folders['show_media_details']; |
| 779 | $show_media_details = "off"; |
| 780 | ?> |
| 781 | <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 782 | <label for="" class="custom-checkbox send-user-to-pro"> |
| 783 | <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") ?>> |
| 784 | <span></span> |
| 785 | </label> |
| 786 | <label for="" class="send-user-to-pro"> |
| 787 | <?php esc_html_e("Show media details on hover", "folders"); ?> |
| 788 | <button type="button" class="upgrade-link" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>"><?php esc_html_e("Upgrade to Pro", 'folders'); ?></button> |
| 789 | <span class="html-tooltip bottom"> |
| 790 | <span class="dashicons dashicons-editor-help"></span> |
| 791 | <span class="tooltip-text top" style=""> |
| 792 | <?php esc_html_e("Show useful metadata including title, size, type, date, dimension & more on hover.", "folders"); ?> |
| 793 | <img src="<?php echo esc_url(WCP_FOLDER_URL."assets/images/folders-media.gif") ?>"> |
| 794 | </span> |
| 795 | </span> |
| 796 | <span class="recommanded"><?php esc_html_e("Recommended", "folders") ?></span> |
| 797 | </label> |
| 798 | </a> |
| 799 | </td> |
| 800 | </tr> |
| 801 | <tr> |
| 802 | <td colspan="4"> |
| 803 | <div class=""> |
| 804 | <div class=""> |
| 805 | <?php |
| 806 | $media_settings = [ |
| 807 | 'image_title' => [ |
| 808 | "title" => esc_html__("Title", "folders"), |
| 809 | "default" => "on", |
| 810 | ], |
| 811 | 'image_alt_text' => [ |
| 812 | "title" => esc_html__("Alternative Text", "folders"), |
| 813 | "default" => "off", |
| 814 | ], |
| 815 | 'image_file_url' => [ |
| 816 | "title" => esc_html__("File URL", "folders"), |
| 817 | "default" => "off", |
| 818 | ], |
| 819 | 'image_dimensions' => [ |
| 820 | "title" => esc_html__("Dimensions", "folders"), |
| 821 | "default" => "on", |
| 822 | ], |
| 823 | 'image_size' => [ |
| 824 | "title" => esc_html__("Size", "folders"), |
| 825 | "default" => "off", |
| 826 | ], |
| 827 | 'image_file_name' => [ |
| 828 | "title" => esc_html__("Filename", "folders"), |
| 829 | "default" => "off", |
| 830 | ], |
| 831 | 'image_type' => [ |
| 832 | "title" => esc_html__("Type", "folders"), |
| 833 | "default" => "on", |
| 834 | ], |
| 835 | 'image_date' => [ |
| 836 | "title" => esc_html__("Date", "folders"), |
| 837 | "default" => "on", |
| 838 | ], |
| 839 | 'image_uploaded_by' => [ |
| 840 | "title" => esc_html__("Uploaded by", "folders"), |
| 841 | "default" => "off", |
| 842 | ], |
| 843 | ]; |
| 844 | $media_col_settings = isset($customize_folders['media_col_settings']) && is_array($customize_folders['media_col_settings']) ? $customize_folders['media_col_settings'] : [ |
| 845 | "image_title", |
| 846 | "image_dimensions", |
| 847 | "image_type", |
| 848 | "image_date", |
| 849 | ]; |
| 850 | ?> |
| 851 | <input type="hidden" name="customize_folders[media_col_settings][]" value="all"> |
| 852 | <div class="media-setting-box active send-user-to-pro" > |
| 853 | <div class="normal-box"> |
| 854 | <select disabled multiple="multiple" name="customize_folders[media_col_settings][]" class="select2-box"> |
| 855 | <?php foreach ($media_settings as $key => $media) { |
| 856 | $selected = $media['default']; |
| 857 | ?> |
| 858 | <option <?php selected($selected, "on") ?> value="<?php echo esc_attr($key) ?>"><?php echo esc_attr($media['title']) ?></option> |
| 859 | <?php } ?> |
| 860 | </select> |
| 861 | </div> |
| 862 | <a class="upgrade-box" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 863 | <button type="button"><?php esc_html_e("Upgrade to Pro", 'folders'); ?></button> |
| 864 | </a> |
| 865 | </div> |
| 866 | </div> |
| 867 | </div> |
| 868 | </td> |
| 869 | </tr> |
| 870 | <?php |
| 871 | $show_in_page = !isset($customize_folders['folders_enable_replace_media']) ? "yes" : $customize_folders['folders_enable_replace_media']; |
| 872 | ?> |
| 873 | <tr> |
| 874 | <td class="no-padding"> |
| 875 | <input type="hidden" name="customize_folders[folders_enable_replace_media]" value="no"> |
| 876 | <label for="folders_enable_replace_media" class="custom-checkbox"> |
| 877 | <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"> |
| 878 | <span></span> |
| 879 | </label> |
| 880 | </td> |
| 881 | <td colspan="3" class="enable-replace-media"> |
| 882 | <label for="folders_enable_replace_media" ><?php esc_html_e('Enable Replace Media', 'folders'); ?> |
| 883 | <span class="html-tooltip no-position top"> |
| 884 | <span class="dashicons dashicons-editor-help"></span> |
| 885 | <span class="tooltip-text top" style=""> |
| 886 | <?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") ?> |
| 887 | <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> |
| 888 | </span> |
| 889 | </span> |
| 890 | <span class="recommanded"><?php esc_html_e("Recommended", "folders") ?></span> |
| 891 | </label> |
| 892 | </td> |
| 893 | </tr> |
| 894 | <?php |
| 895 | $show_in_page = !isset($customize_folders['show_folder_in_settings']) ? "no" : $customize_folders['show_folder_in_settings']; |
| 896 | ?> |
| 897 | <tr> |
| 898 | <td class="no-padding"> |
| 899 | <input type="hidden" name="customize_folders[show_folder_in_settings]" value="no"> |
| 900 | <label for="show_folder_in_settings" class="custom-checkbox"> |
| 901 | <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"> |
| 902 | <span></span> |
| 903 | </label> |
| 904 | </td> |
| 905 | <td colspan="3"> |
| 906 | <label for="show_folder_in_settings" ><?php esc_html_e('Place the Folders settings page nested under "Settings"', 'folders'); ?></label> |
| 907 | <span class="folder-tooltip" data-title="<?php esc_html_e("When this setting is enabled, you will be able to access the Folders settings page by clicking on 'Settings' in the WordPress dashboard and then selecting 'Folders' from the submenu.", "folders") ?>"> |
| 908 | <span class="dashicons dashicons-editor-help"></span> |
| 909 | </span> |
| 910 | </td> |
| 911 | </tr> |
| 912 | <?php $val = get_option("folders_show_in_menu"); ?> |
| 913 | <input type="hidden" name="folders_show_in_menu" value="off" /> |
| 914 | <tr> |
| 915 | <td width="20" class="no-padding"> |
| 916 | <label for="folders_show_in_menu" class="custom-checkbox"> |
| 917 | <input class="sr-only" type="checkbox" id="folders_show_in_menu" name="folders_show_in_menu" value="on" <?php checked($val, "on") ?>/> |
| 918 | <span></span> |
| 919 | </label> |
| 920 | </td> |
| 921 | <td colspan="3"> |
| 922 | <label for="folders_show_in_menu" ><?php esc_html_e('Show the folders also in WordPress menu', 'folders'); ?></label> |
| 923 | <span class="html-tooltip bottom"> |
| 924 | <span class="dashicons dashicons-editor-help"></span> |
| 925 | <span class="tooltip-text top tooltip-image-height" style=""> |
| 926 | <?php esc_html_e("Show folders separately on your WordPress sidebar for quick and easy access to folders of Media, Posts, Pages etc", "folders"); ?> |
| 927 | <img style="width: auto; margin: 0 auto" src="<?php echo esc_url(WCP_FOLDER_URL."assets/images/page-folders.png") ?>"> |
| 928 | </span> |
| 929 | </span> |
| 930 | </td> |
| 931 | </tr> |
| 932 | <tr> |
| 933 | <td style="padding: 15px 10px 15px 0px" colspan="4"> |
| 934 | <?php $replace_media_title = "off"; ?> |
| 935 | <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 936 | <label for="" class="custom-checkbox send-user-to-pro"> |
| 937 | <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") ?>> |
| 938 | <span></span> |
| 939 | </label> |
| 940 | <label for="" class="send-user-to-pro"> |
| 941 | <?php esc_html_e("Auto Rename file based on title", "folders"); ?> |
| 942 | <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> |
| 943 | <button type="button" class="upgrade-link" ><?php esc_html_e("Upgrade to Pro", 'folders') ?></button> |
| 944 | </label> |
| 945 | </a> |
| 946 | </td> |
| 947 | </tr> |
| 948 | <!-- Do not make changes here, Only for Free --> |
| 949 | </tboby> |
| 950 | </table> |
| 951 | <input type="hidden" name="customize_folders[show_media_details]" value="off"> |
| 952 | </div> |
| 953 | <div class="accordion-right"> |
| 954 | <div class="premio-help"> |
| 955 | <a href="https://premio.io/help/folders/?utm_source=pluginspage" target="_blank"> |
| 956 | <div class="premio-help-btn"> |
| 957 | <img src="<?php echo esc_url(WCP_FOLDER_URL."assets/images/premio-help.png") ?>" alt="Premio Help" class="Premio Help" /> |
| 958 | <div class="need-help">Need Help?</div> |
| 959 | <div class="visit-our">Visit our</div> |
| 960 | <div class="knowledge-base">knowledge base</div> |
| 961 | </div> |
| 962 | </a> |
| 963 | </div> |
| 964 | <?php if ($wp_status == "yes") { ?> |
| 965 | <div class="premio-help"> |
| 966 | <div class="premio-help-btn wp-folder-user"> |
| 967 | <div class="folder-help-icon"><span class="dashicons dashicons-wordpress"></span></div> |
| 968 | <div class="need-help"><?php esc_html_e("WordPress.com User?", "folders") ?></div> |
| 969 | <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> |
| 970 | </div> |
| 971 | </div> |
| 972 | <?php } ?> |
| 973 | </div> |
| 974 | <div class="clear"></div> |
| 975 | <div class="submit-button"> |
| 976 | <?php submit_button(); ?> |
| 977 | </div> |
| 978 | </div> |
| 979 | </div> |
| 980 | |
| 981 | <div class="tab-content <?php echo esc_attr(($setting_page == "customize-folders") ? "active" : "") ?>" id="customize-folders"> |
| 982 | <div class="accordion-content"> |
| 983 | <div class="accordion-left"> |
| 984 | <table class="form-table"> |
| 985 | <?php |
| 986 | $colors = [ |
| 987 | "#FA166B", |
| 988 | "#0073AA", |
| 989 | "#484848", |
| 990 | ]; |
| 991 | $color = !isset($customize_folders['new_folder_color'])||empty($customize_folders['new_folder_color']) ? "#FA166B" : $customize_folders['new_folder_color']; |
| 992 | $setting_color = WCP_Folders::check_for_setting("new_folder_color", "customize_folders"); |
| 993 | ?> |
| 994 | <tr> |
| 995 | <td width="255px" class="no-padding"> |
| 996 | <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 997 | <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> |
| 998 | </a> |
| 999 | </td> |
| 1000 | <td> |
| 1001 | <ul class="color-list"> |
| 1002 | <?php $field_name = "new_folder_color"; foreach ($colors as $key => $value) { ?> |
| 1003 | <li> |
| 1004 | <label class="color-checkbox <?php echo ($color == $value) ? "active" : "" ?>" for="<?php echo esc_attr($field_name)."-".esc_attr($key) ?>"> |
| 1005 | <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) ?> /> |
| 1006 | <span style="background: <?php echo esc_attr($value) ?>"></span> |
| 1007 | </label> |
| 1008 | </li> |
| 1009 | <?php } $key = 3; ?> |
| 1010 | <?php if ($setting_color !== false && $setting_color != "#FA166B") { ?> |
| 1011 | <li> |
| 1012 | <label class="color-checkbox <?php echo ($color == $setting_color) ? "active" : "" ?>" for="<?php echo esc_attr($field_name)."-".esc_attr($key) ?>"> |
| 1013 | <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) ?> /> |
| 1014 | <span style="background: <?php echo esc_attr($setting_color) ?>"></span> |
| 1015 | </label> |
| 1016 | </li> |
| 1017 | <?php } ?> |
| 1018 | <li> |
| 1019 | <a class="upgrade-box-link d-block" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 1020 | <span class="color-box"><span class="gradient"></span> <span class="color-box-area"><?php echo esc_html_e("Custom", "folders") ?></span></span> |
| 1021 | <span class="upgrade-link"><?php echo esc_html_e("Upgrade to Pro", "folders") ?></span> |
| 1022 | </a> |
| 1023 | </li> |
| 1024 | </ul> |
| 1025 | </td> |
| 1026 | <td rowspan="4" > |
| 1027 | |
| 1028 | </td> |
| 1029 | </tr> |
| 1030 | <?php |
| 1031 | $color = !isset($customize_folders['bulk_organize_button_color'])||empty($customize_folders['bulk_organize_button_color']) ? "#FA166B" : $customize_folders['bulk_organize_button_color']; |
| 1032 | $setting_color = WCP_Folders::check_for_setting("bulk_organize_button_color", "customize_folders"); |
| 1033 | ?> |
| 1034 | <tr> |
| 1035 | <td class="no-padding"> |
| 1036 | <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 1037 | <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> |
| 1038 | </a> |
| 1039 | </td> |
| 1040 | <td> |
| 1041 | <ul class="color-list"> |
| 1042 | <?php $field_name = "bulk_organize_button_color"; foreach ($colors as $key => $value) { ?> |
| 1043 | <li> |
| 1044 | <label class="color-checkbox <?php echo ($color == $value) ? "active" : "" ?>" for="<?php echo esc_attr($field_name)."-".esc_attr($key) ?>"> |
| 1045 | <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) ?> /> |
| 1046 | <span style="background: <?php echo esc_attr($value) ?>"></span> |
| 1047 | </label> |
| 1048 | </li> |
| 1049 | <?php } $key = 3; ?> |
| 1050 | <?php if ($setting_color !== false && $setting_color != "#FA166B") { ?> |
| 1051 | <li> |
| 1052 | <label class="color-checkbox <?php echo ($color == $setting_color) ? "active" : "" ?>" for="<?php echo esc_attr($field_name)."-".esc_attr($key) ?>"> |
| 1053 | <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) ?> /> |
| 1054 | <span style="background: <?php echo esc_attr($setting_color) ?>"></span> |
| 1055 | </label> |
| 1056 | </li> |
| 1057 | <?php } ?> |
| 1058 | <li> |
| 1059 | <a class="upgrade-box-link d-block" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 1060 | <span class="color-box"><span class="gradient"></span> <span class="color-box-area"><?php echo esc_html_e("Custom", "folders") ?></span></span> |
| 1061 | <span class="upgrade-link"><?php echo esc_html_e("Upgrade to Pro", "folders") ?></span> |
| 1062 | </a> |
| 1063 | </li> |
| 1064 | </ul> |
| 1065 | </td> |
| 1066 | </tr> |
| 1067 | <?php |
| 1068 | $color = !isset($customize_folders['media_replace_button'])||empty($customize_folders['media_replace_button']) ? "#FA166B" : $customize_folders['media_replace_button']; |
| 1069 | $setting_color = WCP_Folders::check_for_setting("media_replace_button", "customize_folders"); |
| 1070 | ?> |
| 1071 | <tr> |
| 1072 | <td class="no-padding"> |
| 1073 | <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 1074 | <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> |
| 1075 | </a> |
| 1076 | </td> |
| 1077 | <td> |
| 1078 | <ul class="color-list"> |
| 1079 | <?php $field_name = "media_replace_button"; foreach ($colors as $key => $value) { ?> |
| 1080 | <li> |
| 1081 | <label class="color-checkbox <?php echo ($color == $value) ? "active" : "" ?>" for="<?php echo esc_attr($field_name)."-".esc_attr($key) ?>"> |
| 1082 | <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) ?> /> |
| 1083 | <span style="background: <?php echo esc_attr($value) ?>"></span> |
| 1084 | </label> |
| 1085 | </li> |
| 1086 | <?php } $key = 3; ?> |
| 1087 | <?php if ($setting_color !== false && $setting_color != "#FA166B") { ?> |
| 1088 | <li> |
| 1089 | <label class="color-checkbox <?php echo ($color == $setting_color) ? "active" : "" ?>" for="<?php echo esc_attr($field_name)."-".esc_attr($key) ?>"> |
| 1090 | <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) ?> /> |
| 1091 | <span style="background: <?php echo esc_attr($setting_color) ?>"></span> |
| 1092 | </label> |
| 1093 | </li> |
| 1094 | <?php } ?> |
| 1095 | <li> |
| 1096 | <a class="upgrade-box-link d-block" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 1097 | <span class="color-box"><span class="gradient"></span> <span class="color-box-area"><?php echo esc_html_e("Custom", "folders") ?></span></span> |
| 1098 | <span class="upgrade-link"><?php echo esc_html_e("Upgrade to Pro", "folders") ?></span> |
| 1099 | </a> |
| 1100 | </li> |
| 1101 | </ul> |
| 1102 | </td> |
| 1103 | </tr> |
| 1104 | <?php |
| 1105 | $color = !isset($customize_folders['dropdown_color'])||empty($customize_folders['dropdown_color']) ? "#484848" : $customize_folders['dropdown_color']; |
| 1106 | $setting_color = WCP_Folders::check_for_setting("dropdown_color", "customize_folders"); |
| 1107 | ?> |
| 1108 | <tr> |
| 1109 | <td class="no-padding"> |
| 1110 | <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 1111 | <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> |
| 1112 | </a> |
| 1113 | </td> |
| 1114 | <td> |
| 1115 | <ul class="color-list"> |
| 1116 | <?php $field_name = "dropdown_color"; foreach ($colors as $key => $value) { ?> |
| 1117 | <li> |
| 1118 | <label class="color-checkbox <?php echo ($color == $value) ? "active" : "" ?>" for="<?php echo esc_attr($field_name)."-".esc_attr($key) ?>"> |
| 1119 | <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) ?> /> |
| 1120 | <span style="background: <?php echo esc_attr($value) ?>"></span> |
| 1121 | </label> |
| 1122 | </li> |
| 1123 | <?php } $key = 3; ?> |
| 1124 | <?php if ($setting_color !== false && $setting_color != "#484848") { ?> |
| 1125 | <li> |
| 1126 | <label class="color-checkbox <?php echo ($color == $setting_color) ? "active" : "" ?>" for="<?php echo esc_attr($field_name)."-".esc_attr($key) ?>"> |
| 1127 | <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) ?> /> |
| 1128 | <span style="background: <?php echo esc_attr($setting_color) ?>"></span> |
| 1129 | </label> |
| 1130 | </li> |
| 1131 | <?php } ?> |
| 1132 | <li> |
| 1133 | <a class="upgrade-box-link d-block" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 1134 | <span class="color-box"><span class="gradient"></span> <span class="color-box-area"><?php echo esc_html_e("Custom", "folders") ?></span></span> |
| 1135 | <span class="upgrade-link"><?php echo esc_html_e("Upgrade to Pro", "folders") ?></span> |
| 1136 | </a> |
| 1137 | </li> |
| 1138 | </ul> |
| 1139 | </td> |
| 1140 | </tr> |
| 1141 | <?php |
| 1142 | $color = !isset($customize_folders['folder_bg_color'])||empty($customize_folders['folder_bg_color']) ? "#FA166B" : $customize_folders['folder_bg_color']; |
| 1143 | $setting_color = WCP_Folders::check_for_setting("folder_bg_color", "customize_folders"); |
| 1144 | ?> |
| 1145 | <tr> |
| 1146 | <td class="no-padding"> |
| 1147 | <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 1148 | <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> |
| 1149 | </a> |
| 1150 | </td> |
| 1151 | <td> |
| 1152 | <ul class="color-list"> |
| 1153 | <?php $field_name = "folder_bg_color"; foreach ($colors as $key => $value) { ?> |
| 1154 | <li> |
| 1155 | <label class="color-checkbox <?php echo ($color == $value) ? "active" : "" ?>" for="<?php echo esc_attr($field_name)."-".esc_attr($key) ?>"> |
| 1156 | <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) ?> /> |
| 1157 | <span style="background: <?php echo esc_attr($value) ?>"></span> |
| 1158 | </label> |
| 1159 | </li> |
| 1160 | <?php } $key = 3; ?> |
| 1161 | <?php if ($setting_color !== false && $setting_color != "#FA166B") { ?> |
| 1162 | <li> |
| 1163 | <label class="color-checkbox <?php echo ($color == $setting_color) ? "active" : "" ?>" for="<?php echo esc_attr($field_name)."-".esc_attr($key) ?>"> |
| 1164 | <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) ?> /> |
| 1165 | <span style="background: <?php echo esc_attr($setting_color) ?>"></span> |
| 1166 | </label> |
| 1167 | </li> |
| 1168 | <?php } ?> |
| 1169 | <li> |
| 1170 | <a class="upgrade-box-link d-block" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 1171 | <span class="color-box"><span class="gradient"></span> <span class="color-box-area"><?php echo esc_html_e("Custom", "folders") ?></span></span> |
| 1172 | <span class="upgrade-link"><?php echo esc_html_e("Upgrade to Pro", "folders") ?></span> |
| 1173 | </a> |
| 1174 | </li> |
| 1175 | </ul> |
| 1176 | </td> |
| 1177 | </tr> |
| 1178 | <?php |
| 1179 | $font = !isset($customize_folders['folder_font'])||empty($customize_folders['folder_font']) ? "" : $customize_folders['folder_font']; |
| 1180 | $setting_font = WCP_Folders::check_for_setting("folder_font", "customize_folders"); |
| 1181 | $index = 0; |
| 1182 | ?> |
| 1183 | <tr> |
| 1184 | <td class="no-padding"> |
| 1185 | <label for="folder_font" > |
| 1186 | <?php if ($setting_font !== false && $setting_font != "" && !in_array($setting_font, ["Arial", "Tahoma", "Verdana", "Helvetica", "Times New Roman", "Trebuchet MS", "Georgia", "System Stack"])) { |
| 1187 | esc_html_e("Folders font", 'folders'); |
| 1188 | } else { ?> |
| 1189 | <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 1190 | <?php esc_html_e('Folders font', 'folders'); ?> <button type="button" class="upgrade-link" ><?php esc_html_e("Upgrade to Pro", 'folders'); ?></button> |
| 1191 | </a> |
| 1192 | <?php } ?> |
| 1193 | </label> |
| 1194 | </td> |
| 1195 | <td colspan="2"> |
| 1196 | <select name="customize_folders[folder_font]" id="folder_font" > |
| 1197 | <?php $group = ''; |
| 1198 | foreach ($fonts as $key => $value) : |
| 1199 | $title = $key; |
| 1200 | if ($index == 0) { |
| 1201 | $key = ""; |
| 1202 | } |
| 1203 | |
| 1204 | $index++; |
| 1205 | if ($value != $group) { |
| 1206 | echo '<optgroup label="'.esc_attr($value).'">'; |
| 1207 | $group = $value; |
| 1208 | } |
| 1209 | |
| 1210 | if (($setting_font !== false && $setting_font != "" && !in_array($setting_font, ["Arial", "Tahoma", "Verdana", "Helvetica", "Times New Roman", "Trebuchet MS", "Georgia"])) || $value != "Google Fonts") { ?> |
| 1211 | <option value="<?php echo esc_attr($key); ?>" <?php selected($font, $key); ?>><?php echo esc_attr($title); ?></option> |
| 1212 | <?php } else { ?> |
| 1213 | <option class="pro-select-item" value="folders-pro"><?php echo esc_attr($title); ?> (Pro) 🔑</option> |
| 1214 | <?php } ?> |
| 1215 | <?php endforeach; ?> |
| 1216 | </select> |
| 1217 | </td> |
| 1218 | </tr> |
| 1219 | <?php |
| 1220 | $size = ! isset($customize_folders['folder_size']) || empty($customize_folders['folder_size']) ? "16" : $customize_folders['folder_size']; |
| 1221 | $folder_size = WCP_Folders::check_for_setting("folder_size", "customize_folders"); |
| 1222 | ?> |
| 1223 | <tr> |
| 1224 | <td class="no-padding"> |
| 1225 | <label for="folder_size" > |
| 1226 | <?php if ($folder_size === false || intval($folder_size) === 16) { ?> |
| 1227 | <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 1228 | <?php esc_html_e('Folders size', 'folders'); ?> <button type="button" class="upgrade-link" ><?php esc_html_e("Upgrade to Pro", 'folders'); ?></button> |
| 1229 | </a> |
| 1230 | <?php } else { ?> |
| 1231 | <?php esc_html_e("Folders size", 'folders'); ?> |
| 1232 | <?php } ?> |
| 1233 | </label> |
| 1234 | </td> |
| 1235 | <td colspan="2"> |
| 1236 | <?php |
| 1237 | if ($folder_size === false || intval($folder_size) == 16) { |
| 1238 | $sizes = [ |
| 1239 | "folders-pro" => "Small (Pro) 🔑", |
| 1240 | "16" => "Medium", |
| 1241 | "folders-pro-item" => "Large (Pro) 🔑", |
| 1242 | "folders-item-pro" => "Custom (Pro) 🔑", |
| 1243 | ]; |
| 1244 | $size = 16; |
| 1245 | } else { |
| 1246 | $sizes = [ |
| 1247 | "12" => "Small", |
| 1248 | "16" => "Medium", |
| 1249 | "20" => "Large", |
| 1250 | ]; |
| 1251 | } |
| 1252 | ?> |
| 1253 | <select name="customize_folders[folder_size]" id="folder_size" > |
| 1254 | <?php |
| 1255 | foreach ($sizes as $key => $value) { |
| 1256 | $selected = ($key == $size) ? "selected" : ""; |
| 1257 | echo "<option ".esc_attr($selected)." value='".esc_attr($key)."'>".esc_attr($value)."</option>"; |
| 1258 | } |
| 1259 | ?> |
| 1260 | </select> |
| 1261 | </td> |
| 1262 | </tr> |
| 1263 | <?php $enable_horizontal_scroll = ! isset($customize_folders['enable_horizontal_scroll']) || empty($customize_folders['enable_horizontal_scroll']) ? "on" : $customize_folders['enable_horizontal_scroll']; ?> |
| 1264 | <tr> |
| 1265 | <td class="no-padding"> |
| 1266 | <label for="enable_horizontal_scroll" > |
| 1267 | <?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> |
| 1268 | </label> |
| 1269 | </td> |
| 1270 | <td colspan="2"> |
| 1271 | <input type="hidden" name="customize_folders[enable_horizontal_scroll]" value="off" /> |
| 1272 | <div class="inline-checkbox"> |
| 1273 | <label class="folder-switch " for="enable_horizontal_scroll"> |
| 1274 | <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") ?>> |
| 1275 | <div class="folder-slider normal round"></div> |
| 1276 | </label> |
| 1277 | </div> |
| 1278 | </td> |
| 1279 | </tr> |
| 1280 | <?php |
| 1281 | $show_in_page = isset($customize_folders['show_in_page']) ? $customize_folders['show_in_page'] : "hide"; |
| 1282 | $show_folder = WCP_Folders::check_for_setting("show_in_page", "customize_folders"); |
| 1283 | if (empty($show_in_page)) { |
| 1284 | $show_in_page = "hide"; |
| 1285 | } |
| 1286 | ?> |
| 1287 | <tr> |
| 1288 | <td colspan="3" style="padding: 15px 20px 15px 0"> |
| 1289 | <input type="hidden" name="customize_folders[show_in_page]" value="hide"> |
| 1290 | <?php if ($show_folder === false || $show_folder === "hide") { ?> |
| 1291 | <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" > |
| 1292 | <label for="" class="custom-checkbox send-user-to-pro"> |
| 1293 | <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") ?>> |
| 1294 | <span></span> |
| 1295 | </label> |
| 1296 | <label for="" class="send-user-to-pro"> |
| 1297 | <?php esc_html_e("Show Folders in upper position", "folders"); ?> |
| 1298 | <span class="folder-tooltip" data-title="<?php esc_html_e("The list of your folders will also appear at the top of the page, e.g. under 'Media library'.", "folders"); ?>"> |
| 1299 | <span class="dashicons dashicons-editor-help"></span> |
| 1300 | </span> |
| 1301 | <button type="button" class="upgrade-link" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>"><?php esc_html_e("Upgrade to Pro", 'folders'); ?></button> |
| 1302 | </label> |
| 1303 | </a> |
| 1304 | <?php } else { ?> |
| 1305 | <div class="custom-checkbox"> |
| 1306 | <input id="show_folders" class="sr-only" <?php checked($show_in_page, "show") ?> type="checkbox" name="customize_folders[show_in_page]" value="show"> |
| 1307 | <span></span> |
| 1308 | </div> |
| 1309 | <label for="show_folders"> |
| 1310 | <?php esc_html_e("Show Folders in upper position", 'folders'); ?> |
| 1311 | <span class="folder-tooltip" data-title="<?php esc_html_e("The list of your folders will also appear at the top of the page, e.g. under 'Media library'.", "folders"); ?>"> |
| 1312 | <span class="dashicons dashicons-editor-help"></span> |
| 1313 | </span> |
| 1314 | </label> |
| 1315 | <?php } ?> |
| 1316 | </td> |
| 1317 | </tr> |
| 1318 | </table> |
| 1319 | </div> |
| 1320 | <div class="accordion-right"> |
| 1321 | <div class="preview-text"> |
| 1322 | Preview |
| 1323 | <div class="preview-text-info"><?php esc_html_e("See the full functionality on your media library, posts, pages, and custom posts", 'folders'); ?></div> |
| 1324 | </div> |
| 1325 | <div class="preview-inner-box"> |
| 1326 | <div class="preview-box"> |
| 1327 | <div class="wcp-custom-form"> |
| 1328 | <div class="form-title"> |
| 1329 | <?php esc_html_e("Folders", 'folders'); ?> |
| 1330 | <a href="javascript:;" class="add-new-folder" id="add-new-folder"> |
| 1331 | <span class="create_new_folder"><i class="pfolder-add-folder"></i></span> |
| 1332 | <span><?php esc_html_e("New Folder", 'folders'); ?></span> |
| 1333 | </a> |
| 1334 | <div class="clear"></div> |
| 1335 | </div> |
| 1336 | <div class="form-options"> |
| 1337 | <ul> |
| 1338 | <li> |
| 1339 | <div class="custom-checkbox"> |
| 1340 | <input type="checkbox" class="sr-only" > |
| 1341 | <span></span> |
| 1342 | </div> |
| 1343 | </li> |
| 1344 | <li> |
| 1345 | <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> |
| 1346 | </li> |
| 1347 | <li> |
| 1348 | <a href="javascript:;" id="inline-remove"><span class="icon pfolder-remove"></span> <span class="text"><?php esc_html_e("Delete", 'folders'); ?></span> </a> |
| 1349 | </li> |
| 1350 | <li class="last"> |
| 1351 | <a href="javascript:;" id="expand-collapse-list" data-tooltip="Expand"><span class="icon pfolder-arrow-down"></span></a> |
| 1352 | </li> |
| 1353 | <li class="last"> |
| 1354 | <a href="javascript:;" ><span class="icon pfolder-arrow-sort"></span></a> |
| 1355 | </li> |
| 1356 | </ul> |
| 1357 | </div> |
| 1358 | </div> |
| 1359 | <div class="shadow-box"> |
| 1360 | <div class="header-posts"> |
| 1361 | <a href="javascript:;" class="all-posts active-item-link"><?php esc_html_e("All Files", 'folders'); ?> <span class="total-count">215</span></a> |
| 1362 | </div> |
| 1363 | <div class="un-categorised-items ui-droppable"> |
| 1364 | <a href="javascript:;" class="un-categorized-posts"><?php esc_html_e("Unassigned Files", 'folders'); ?> <span class="total-count total-empty">191</span> </a> |
| 1365 | </div> |
| 1366 | <div class="separator"></div> |
| 1367 | <ul class="folder-list"> |
| 1368 | <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> |
| 1369 | <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> |
| 1370 | <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> |
| 1371 | </ul> |
| 1372 | <div class="separator"></div> |
| 1373 | <div class="media-buttons"> |
| 1374 | <select class="media-select"> |
| 1375 | <option><?php esc_html_e("All Files", 'folders'); ?></option> |
| 1376 | <option><?php esc_html_e("Folder 1", 'folders'); ?></option> |
| 1377 | <option><?php esc_html_e("Folder 2", 'folders'); ?></option> |
| 1378 | <option><?php esc_html_e("Folder 3", 'folders'); ?></option> |
| 1379 | </select> |
| 1380 | <button type="button" class="button organize-button"><?php esc_html_e("Bulk Organize", 'folders'); ?></button> |
| 1381 | <div style="clear: both;"></div> |
| 1382 | </div> |
| 1383 | </div> |
| 1384 | </div> |
| 1385 | </div> |
| 1386 | </div> |
| 1387 | <div class="clear"></div> |
| 1388 | <?php submit_button(); ?> |
| 1389 | </div> |
| 1390 | </div> |
| 1391 | |
| 1392 | <div class="tab-content <?php echo esc_attr(($setting_page == "folders-import") ? "active" : "") ?>" id="folder-import"> |
| 1393 | <?php |
| 1394 | $remove_folders_when_removed = !isset($customize_folders['remove_folders_when_removed']) ? "off" : $customize_folders['remove_folders_when_removed']; |
| 1395 | ?> |
| 1396 | <input type="hidden" name="customize_folders[remove_folders_when_removed]" value="off" /> |
| 1397 | <div class="folder-danger-zone"> |
| 1398 | <table class="import-export-table"> |
| 1399 | <?php if ($is_plugin_exists) { ?> |
| 1400 | <tr class="has-other-plugins"> |
| 1401 | <td> |
| 1402 | <span class="folder-info"><span class="dashicons dashicons-admin-generic"></span> <?php esc_html_e("Import", "folders"); ?></span> |
| 1403 | <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> |
| 1404 | </td> |
| 1405 | <td class="last-td"> |
| 1406 | <a href="#" class="import-folders-button"><?php esc_html_e("Import", "folders"); ?></a> |
| 1407 | </td> |
| 1408 | </tr> |
| 1409 | <?php } ?> |
| 1410 | <tr class="no-more-plugins <?php echo (!$is_plugin_exists) ? "active" : "" ?>"> |
| 1411 | <td> |
| 1412 | <span class="folder-info"><span class="dashicons dashicons-admin-generic"></span> <?php esc_html_e("Import", "folders"); ?></span> |
| 1413 | <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> |
| 1414 | </td> |
| 1415 | <td class="last-td"> |
| 1416 | <a href="https://premio.io/contact/" target="_blank" class="contact-folders-button"><?php esc_html_e("Contact Us", "folders"); ?></a> |
| 1417 | </td> |
| 1418 | </tr> |
| 1419 | <tr> |
| 1420 | <td colspan="2"><span class="danzer-title"><span class="dashicons dashicons-warning"></span> <?php esc_html_e("Danger Zone", "folders"); ?></span></td> |
| 1421 | </tr> |
| 1422 | <tr> |
| 1423 | <td> |
| 1424 | <span class="danger-info"><?php esc_html_e("Delete plugin data upon deletion", "folders"); ?></span> |
| 1425 | <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> |
| 1426 | </td> |
| 1427 | <td class="last-td" > |
| 1428 | <div class="inline-checkbox"> |
| 1429 | <label class="folder-switch" for="remove_folders_when_removed"> |
| 1430 | <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") ?>> |
| 1431 | <div class="folder-slider round"></div> |
| 1432 | </label> |
| 1433 | </div> |
| 1434 | </td> |
| 1435 | </tr> |
| 1436 | <tr> |
| 1437 | <td> |
| 1438 | <span class="danger-info"><?php esc_html_e("Manual Data Removal", "folders"); ?></span> |
| 1439 | <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"); ?> |
| 1440 | </td> |
| 1441 | <td class="last-td"> |
| 1442 | <a href="#" class="remove-folders-data"><?php esc_html_e("Delete Now", "folders"); ?></a> |
| 1443 | </td> |
| 1444 | </tr> |
| 1445 | </table> |
| 1446 | </div> |
| 1447 | </div> |
| 1448 | |
| 1449 | <div class="tab-content <?php echo esc_attr(($setting_page == "upgrade-to-pro") ? "active" : "") ?>"> |
| 1450 | <?php if ($setting_page == "upgrade-to-pro") { ?> |
| 1451 | <?php include_once "upgrade-table.php"; ?> |
| 1452 | <?php } ?> |
| 1453 | </div> |
| 1454 | |
| 1455 | <div class="tab-content <?php echo esc_attr(($setting_page == "folders-by-user") ? "active" : "") ?>" id="folders-by-user"> |
| 1456 | <?php |
| 1457 | $folders_by_users = !isset($customize_folders['folders_by_users']) ? "off" : $customize_folders['folders_by_users']; |
| 1458 | $dynamic_folders_for_admin_only = !isset($customize_folders['dynamic_folders_for_admin_only']) ? "off" : $customize_folders['dynamic_folders_for_admin_only']; |
| 1459 | ?> |
| 1460 | <?php if ($setting_page == "folders-by-user") { |
| 1461 | include "folder-user-settings.php"; |
| 1462 | }//end if |
| 1463 | ?> |
| 1464 | </div> |
| 1465 | |
| 1466 | </div> |
| 1467 | </div> |
| 1468 | <?php |
| 1469 | ?> |
| 1470 | <input type="hidden" name="folder_nonce" value="<?php echo wp_create_nonce("folder_settings") ?>"> |
| 1471 | <input type="hidden" name="folder_page" value="<?php echo filter_input(INPUT_SERVER, "REQUEST_URI") ?>"> |
| 1472 | <?php if ($setting_page != "upgrade-to-pro") { ?> |
| 1473 | </form> |
| 1474 | <?php } ?> |
| 1475 | </div> |
| 1476 | |
| 1477 | <div class="folder-popup-form" id="import-plugin-data"> |
| 1478 | <div class="popup-form-content"> |
| 1479 | <div class="popup-content"> |
| 1480 | <div class="close-popup-button"> |
| 1481 | <a class="" href="javascript:;"><span></span></a> |
| 1482 | </div> |
| 1483 | <div class="import-folder-title"></div> |
| 1484 | <div class="import-folder-note">Are you sure you'd like to import $x folders from $plugin?</div> |
| 1485 | <div class="folder-form-buttons"> |
| 1486 | <button type="submit" class="form-submit-btn" id="import-folder-button"><?php esc_html_e("Import", 'folders'); ?></button> |
| 1487 | <a href="javascript:;" class="form-cancel-btn"><?php esc_html_e("Cancel", 'folders'); ?></a> |
| 1488 | </div> |
| 1489 | </div> |
| 1490 | </div> |
| 1491 | </div> |
| 1492 | |
| 1493 | <?php |
| 1494 | // if($plugin['is_exists']) { ?> |
| 1495 | <div class="folder-popup-form" id="import-folders-popup"> |
| 1496 | <div class="popup-form-content"> |
| 1497 | <div class="popup-content"> |
| 1498 | <div class="close-popup-button"> |
| 1499 | <a class="" href="javascript:;"><span></span></a> |
| 1500 | </div> |
| 1501 | <div class="import-plugin-title"><?php esc_html_e("Import data", 'folders'); ?></div> |
| 1502 | <div class="plugin-import-table"> |
| 1503 | <div class="import-folder-table"> |
| 1504 | <table> |
| 1505 | <tbody> |
| 1506 | <?php foreach ($plugin_info as $slug => $plugin) { ?> |
| 1507 | <?php if ($plugin['is_exists']) { ?> |
| 1508 | <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']) ?>"> |
| 1509 | <th class="plugin-name"><?php echo esc_attr__($plugin['name']) ?></th> |
| 1510 | <td> |
| 1511 | <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> |
| 1512 | <button type="button" class="button button-primary import-folder-data in-popup"><?php esc_html_e("Import", "folders"); ?> <span class="spinner"></span></button> |
| 1513 | <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> |
| 1514 | </td> |
| 1515 | </tr> |
| 1516 | <?php } ?> |
| 1517 | <?php } ?> |
| 1518 | </tbody> |
| 1519 | </table> |
| 1520 | </div> |
| 1521 | </div> |
| 1522 | <div class="folder-form-buttons"> |
| 1523 | <div class=""></div> |
| 1524 | <a href="javascript:;" class="form-cancel-btn"><?php esc_html_e("Close", 'folders'); ?></a> |
| 1525 | </div> |
| 1526 | </div> |
| 1527 | </div> |
| 1528 | </div> |
| 1529 | <?php |
| 1530 | // } ?> |
| 1531 | |
| 1532 | <div class="folder-popup-form" id="remove-plugin-data"> |
| 1533 | <div class="popup-form-content"> |
| 1534 | <div class="popup-content"> |
| 1535 | <div class="close-popup-button"> |
| 1536 | <a class="" href="javascript:;"><span></span></a> |
| 1537 | </div> |
| 1538 | <div class="remove-folder-title"><?php esc_html_e("Are you sure?", 'folders'); ?></div> |
| 1539 | <div class="remove-folder-note"></div> |
| 1540 | <div class="folder-form-buttons"> |
| 1541 | <button type="submit" class="form-submit-btn delete-folder-plugin" id="remove-folder-button"><?php esc_html_e("Delete plugin data", 'folders'); ?></button> |
| 1542 | <a href="javascript:;" class="form-cancel-btn"><?php esc_html_e("Cancel", 'folders'); ?></a> |
| 1543 | </div> |
| 1544 | </div> |
| 1545 | </div> |
| 1546 | </div> |
| 1547 | |
| 1548 | <div class="folder-popup-form remove-folders-box" id="remove-folders-data-box"> |
| 1549 | <div class="popup-form-content"> |
| 1550 | <div class="popup-content"> |
| 1551 | <div class="close-popup-button close-remove-folders"> |
| 1552 | <a class="" href="javascript:;"><span></span></a> |
| 1553 | </div> |
| 1554 | <div class="remove-folder-title"><?php esc_html_e("Are you sure?", 'folders'); ?></div> |
| 1555 | <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> |
| 1556 | <div class="folder-form-buttons"> |
| 1557 | <a href="javascript:;" class="form-cancel-btn cancel-folders"><?php esc_html_e("Cancel", 'folders'); ?></a> |
| 1558 | <button type="submit" class="form-cancel-btn delete-button"><?php esc_html_e("I want to delete anyway", 'folders'); ?></button> |
| 1559 | </div> |
| 1560 | </div> |
| 1561 | </div> |
| 1562 | </div> |
| 1563 | |
| 1564 | <div class="folder-popup-form" id="remove-confirmation-box"> |
| 1565 | <div class="popup-form-content"> |
| 1566 | <div class="popup-content"> |
| 1567 | <form id="remove_folders_data" autocomplete="off" > |
| 1568 | <div class="close-popup-button"> |
| 1569 | <a class="" href="javascript:;"><span></span></a> |
| 1570 | </div> |
| 1571 | <div class="remove-folder-title"></div> |
| 1572 | <div class="remove-folder-note text-left"> |
| 1573 | <b><?php esc_html_e("Type DELETE to confirm", 'folders'); ?></b> |
| 1574 | <div class="input-box"> |
| 1575 | <input autocomplete="off" type="text" id="delete-input" name="delete" > |
| 1576 | </div> |
| 1577 | <div class="delete-confirmation-message"><?php esc_html_e('', 'folders'); ?></div> |
| 1578 | </div> |
| 1579 | <div class="folder-form-buttons"> |
| 1580 | <input type="hidden" name="nonce" id="remove-folder-nonce" value="<?php echo wp_create_nonce("remove_folders_data") ?>"> |
| 1581 | <input type="hidden" name="action" value="remove_all_folders_data"> |
| 1582 | <button disabled type="submit" class="form-submit-btn delete-button" id="remove-folders-data-button"><?php esc_html_e("Delete", 'folders'); ?></button> |
| 1583 | <a href="javascript:;" class="form-cancel-btn"><?php esc_html_e("Cancel", 'folders'); ?></a> |
| 1584 | </div> |
| 1585 | </form> |
| 1586 | </div> |
| 1587 | </div> |
| 1588 | </div> |
| 1589 | |
| 1590 | <?php |
| 1591 | if ($wp_status == "yes" && $show_media_popup) { |
| 1592 | add_option("is_wp_media_popup_shown", "yes"); |
| 1593 | ?> |
| 1594 | <div class="folder-popup-form" id="wordpress-popup"> |
| 1595 | <div class="popup-form-content"> |
| 1596 | <div class="popup-content"> |
| 1597 | <div class="popup-form-data"> |
| 1598 | <div class="close-popup-button"> |
| 1599 | <a class="" href="javascript:;"><span></span></a> |
| 1600 | </div> |
| 1601 | <div class="popup-folder-title"> |
| 1602 | <?php esc_html_e("Seems you’re using WordPress.com", "folders") ?> |
| 1603 | </div> |
| 1604 | <div class="folder-form-message" style="padding: 25px 10px;" > |
| 1605 | <?php esc_html_e('You need to alter a setting to make Folders compatible with WordPress.com media library.', "folders") ?> |
| 1606 | </div> |
| 1607 | <div class="folder-form-buttons" style="display:block;"> |
| 1608 | <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> |
| 1609 | </div> |
| 1610 | </div> |
| 1611 | </div> |
| 1612 | </div> |
| 1613 | </div> |
| 1614 | <?php }//end if |
| 1615 | ?> |
| 1616 | |
| 1617 | <?php |
| 1618 | $option = get_option("folder_intro_box"); |
| 1619 | if (($option == "show" || get_option("folder_redirect_status") == 2) && $is_plugin_exists) { ?> |
| 1620 | <div class="folder-popup-form" id="import-third-party-plugin-data" style="display: block" ?> |
| 1621 | <div class="popup-form-content"> |
| 1622 | <div class="popup-content"> |
| 1623 | <div class="close-popup-button"> |
| 1624 | <a class="" href="javascript:;"><span></span></a> |
| 1625 | </div> |
| 1626 | <div class="import-plugin-title"><?php esc_html_e("Import data", 'folders'); ?></div> |
| 1627 | <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> |
| 1628 | <div class="plugin-import-table"> |
| 1629 | <div class="import-folder-table"> |
| 1630 | <table> |
| 1631 | <tbody> |
| 1632 | <?php foreach ($plugin_info as $slug => $plugin) { |
| 1633 | if ($plugin['is_exists']) { ?> |
| 1634 | <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']) ?>"> |
| 1635 | <th class="plugin-name"><?php echo esc_attr__($plugin['name']) ?></th> |
| 1636 | <td> |
| 1637 | <button type="button" class="button button-primary import-folder-data in-popup"><?php esc_html_e("Import", "folders"); ?> <span class="spinner"></span></button> |
| 1638 | <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> |
| 1639 | </td> |
| 1640 | </tr> |
| 1641 | <?php } |
| 1642 | } ?> |
| 1643 | </tbody> |
| 1644 | </table> |
| 1645 | </div> |
| 1646 | </div> |
| 1647 | <div class="folder-form-buttons"> |
| 1648 | <div class=""></div> |
| 1649 | <a href="javascript:;" id="cancel-plugin-import" class="form-cancel-btn"><?php esc_html_e("Close", 'folders'); ?></a> |
| 1650 | </div> |
| 1651 | </div> |
| 1652 | </div> |
| 1653 | </div> |
| 1654 | <?php |
| 1655 | if ($option != "show") { |
| 1656 | update_option("folder_redirect_status", 3); |
| 1657 | } |
| 1658 | }//end if |
| 1659 | ?> |
| 1660 | |
| 1661 | <div class="folder-popup-form" id="no-more-folder-credit"> |
| 1662 | <div class="popup-form-content"> |
| 1663 | <div class="popup-content"> |
| 1664 | <div class="close-popup-button"> |
| 1665 | <a class="" href="javascript:;"><span></span></a> |
| 1666 | </div> |
| 1667 | <div class="add-update-folder-title" id="folder-limitation-message"> |
| 1668 | <?php esc_html_e("You've reached the 10 folder limitation!", 'folders'); ?> |
| 1669 | </div> |
| 1670 | <div class="folder-form-message"> |
| 1671 | <?php esc_html_e("Unlock unlimited amount of folders by upgrading to one of our pro plans.", 'folders'); ?> |
| 1672 | </div> |
| 1673 | <div class="folder-form-buttons"> |
| 1674 | <a href="javascript:;" class="form-cancel-btn"><?php esc_html_e("Cancel", 'folders'); ?></a> |
| 1675 | <a href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" target="_blank" class="form-submit-btn"><?php esc_html_e("See Pro Plans", 'folders'); ?></a> |
| 1676 | </div> |
| 1677 | </div> |
| 1678 | </div> |
| 1679 | </div> |
| 1680 | <?php require_once "help.php" ?> |
| 1681 | |
| 1682 | <div class="folder-popup-form" id="keyboard-shortcut"> |
| 1683 | <div class="popup-form-content"> |
| 1684 | <div class="popup-content"> |
| 1685 | <div class="close-popup-button"> |
| 1686 | <a class="" href="javascript:;"><span></span></a> |
| 1687 | </div> |
| 1688 | <div class="import-plugin-title"><?php esc_html_e("Keyboard shortcuts (Ctrl+K)", 'folders'); ?></div> |
| 1689 | <div class="plugin-import-table"> |
| 1690 | <table class="keyboard-shortcut"> |
| 1691 | <tr> |
| 1692 | <th><?php esc_html_e("Create New Folder", "folders") ?></th> |
| 1693 | <td><span class="key-button">Shift</span><span class="plus-button">+</span><span class="key-button">N</span> </td> |
| 1694 | </tr> |
| 1695 | <tr> |
| 1696 | <th><?php esc_html_e("Rename Folder", "folders") ?></th> |
| 1697 | <td><span class="key-button">F2</span></td> |
| 1698 | </tr> |
| 1699 | <tr> |
| 1700 | <th><?php esc_html_e("Copy Folder", "folders") ?></th> |
| 1701 | <td><span class="key-button">Ctrl</span><span class="plus-button">+</span><span class="key-button">C</span> </td> |
| 1702 | </tr> |
| 1703 | <tr> |
| 1704 | <th><?php esc_html_e("Cut Folder", "folders") ?></th> |
| 1705 | <td><span class="key-button">Ctrl</span><span class="plus-button">+</span><span class="key-button">X</span> </td> |
| 1706 | </tr> |
| 1707 | <tr> |
| 1708 | <th><?php esc_html_e("Paste Folder", "folders") ?></th> |
| 1709 | <td><span class="key-button">Ctrl</span><span class="plus-button">+</span><span class="key-button">V</span> </td> |
| 1710 | </tr> |
| 1711 | <tr> |
| 1712 | <th><?php esc_html_e("Duplicate Folder", "folders") ?></th> |
| 1713 | <td><span class="key-button">Ctrl</span><span class="plus-button">+</span><span class="key-button">D</span> </td> |
| 1714 | </tr> |
| 1715 | <tr> |
| 1716 | <th><?php esc_html_e("Delete Folder", "folders") ?></th> |
| 1717 | <td><span class="key-button">Delete</span></td> |
| 1718 | </tr> |
| 1719 | <tr> |
| 1720 | <th><?php esc_html_e("Next Folder", "folders") ?></th> |
| 1721 | <td><span class="key-button"><span class="dashicons dashicons-arrow-down-alt"></span></span> </td> |
| 1722 | </tr> |
| 1723 | <tr> |
| 1724 | <th><?php esc_html_e("Previous Folder", "folders") ?></th> |
| 1725 | <td><span class="key-button"><span class="dashicons dashicons-arrow-up-alt"></span></span> </td> |
| 1726 | </tr> |
| 1727 | <tr> |
| 1728 | <th><?php esc_html_e("Expand Folder", "folders") ?></th> |
| 1729 | <td><span class="key-button"><span class="dashicons dashicons-arrow-right-alt"></span></span> </td> |
| 1730 | </tr> |
| 1731 | <tr> |
| 1732 | <th><?php esc_html_e("Collapse Folder", "folders") ?></th> |
| 1733 | <td><span class="key-button"><span class="dashicons dashicons-arrow-left-alt"></span></span> </td> |
| 1734 | </tr> |
| 1735 | <tr> |
| 1736 | <th><?php esc_html_e("Re-order folders to upwards", "folders") ?></th> |
| 1737 | <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> |
| 1738 | </tr> |
| 1739 | <tr> |
| 1740 | <th><?php esc_html_e("Re-order folders to downwards", "folders") ?></th> |
| 1741 | <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> |
| 1742 | </tr> |
| 1743 | </table> |
| 1744 | </div> |
| 1745 | </div> |
| 1746 | </div> |
| 1747 | </div> |
| 1748 |