admin-content.php
5 years ago
folder-deactivate-form.php
6 years ago
folder-popup.php
5 years ago
general-settings.php
5 years ago
help.php
6 years ago
media-replace.php
5 years ago
recommended-plugins.php
5 years ago
update.php
6 years ago
upgrade-table.php
5 years ago
upgrade-to-pro.php
5 years ago
general-settings.php
719 lines
| 1 | <?php |
| 2 | if ( ! defined( 'ABSPATH' ) ) exit; |
| 3 | ?> |
| 4 | <!-- do not change here, Free/Pro URL Change --> |
| 5 | <link rel='stylesheet' href='<?php echo WCP_FOLDER_URL ?>assets/css/settings.css' type='text/css' media='all' /> |
| 6 | <link rel='stylesheet' href='<?php echo WCP_FOLDER_URL ?>assets/css/folder-icon.css' type='text/css' media='all' /> |
| 7 | <link rel='stylesheet' href='<?php echo WCP_FOLDER_URL ?>assets/css/spectrum.min.css' type='text/css' media='all' /> |
| 8 | <script src="<?php echo WCP_FOLDER_URL ?>assets/js/spectrum.min.js"></script> |
| 9 | <style> |
| 10 | <?php if ( function_exists( 'is_rtl' ) && is_rtl() ) { ?> |
| 11 | #setting-form { |
| 12 | float: right; |
| 13 | } |
| 14 | <?php } ?> |
| 15 | </style> |
| 16 | <script> |
| 17 | (function (factory) { |
| 18 | "use strict"; |
| 19 | if (typeof define === 'function' && define.amd) { |
| 20 | define(['jquery'], factory); |
| 21 | } |
| 22 | else if(typeof module !== 'undefined' && module.exports) { |
| 23 | module.exports = factory(require('jquery')); |
| 24 | } |
| 25 | else { |
| 26 | factory(jQuery); |
| 27 | } |
| 28 | }(function ($, undefined) { |
| 29 | var selectedItem; |
| 30 | var importTitle = "<?php esc_html_e("Import folders from %plugin%", "folders"); ?>"; |
| 31 | var importDesc = "<?php esc_html_e("Are you sure you'd like to import %d folders from %plugin%?", "folders"); ?>"; |
| 32 | var removeTitle = "<?php esc_html_e("Are you sure?", "folders"); ?>"; |
| 33 | var removeDesc = "<?php esc_html_e("You're about to delete %plugin%'s folders. Are you sure you'd like to proceed?", "folders"); ?>"; |
| 34 | $(document).ready(function(){ |
| 35 | $(document).on("click",".form-cancel-btn, .close-popup-button, .folder-popup-form",function(){ |
| 36 | $(".folder-popup-form").hide(); |
| 37 | }); |
| 38 | $(document).on("click",".popup-form-content", function(e){ |
| 39 | e.stopPropagation(); |
| 40 | e.stopImmediatePropagation(); |
| 41 | }); |
| 42 | $(document).on("click",".folder-select",function(){ |
| 43 | if($(this).is(":checked")) { |
| 44 | $(this).closest("tr").find(".hide-show-option").removeClass("hide-option"); |
| 45 | } else { |
| 46 | $(this).closest("tr").find(".hide-show-option").addClass("hide-option"); |
| 47 | } |
| 48 | }); |
| 49 | $(document).on("click", ".accordion-header", function(){ |
| 50 | if($(this).hasClass("active")) { |
| 51 | $(this).closest(".accordion").find(".accordion-content").slideUp(); |
| 52 | $(this).removeClass("active"); |
| 53 | } else { |
| 54 | $(this).closest(".accordion").find(".accordion-content").slideDown(); |
| 55 | $(this).addClass("active"); |
| 56 | } |
| 57 | }); |
| 58 | $(".accordion-header:first").trigger("click"); |
| 59 | $("#folder_font, #folder_size").change(function(){ |
| 60 | setCSSProperties(); |
| 61 | }); |
| 62 | setCSSProperties(); |
| 63 | $('.color-field').spectrum({ |
| 64 | chooseText: "Submit", |
| 65 | preferredFormat: "hex", |
| 66 | showInput: true, |
| 67 | cancelText: "Cancel", |
| 68 | move: function (color) { |
| 69 | $(this).val(color.toHexString()); |
| 70 | setCSSProperties(); |
| 71 | }, |
| 72 | change: function (color) { |
| 73 | $(this).val(color.toHexString()); |
| 74 | setCSSProperties(); |
| 75 | } |
| 76 | }); |
| 77 | $(document).on("click", ".import-folder-data", function(e){ |
| 78 | selectedItem = $(this).closest("tr").data("plugin"); |
| 79 | if(!$(this).hasClass("in-popup")) { |
| 80 | var pluginName = $(this).closest("tr").find(".plugin-name").html(); |
| 81 | var pluginFolders = parseInt($(this).closest("tr").data("folders")); |
| 82 | var popupTitle = importTitle.replace("%plugin%", pluginName); |
| 83 | $(".import-folder-title").html(popupTitle); |
| 84 | var popupDesc = importDesc.replace("%plugin%", "<b>" + pluginName + "</b>"); |
| 85 | popupDesc = popupDesc.replace("%d", "<b>" + pluginFolders + "</b>"); |
| 86 | $(".import-folder-note").html(popupDesc); |
| 87 | $("#import-plugin-data").show(); |
| 88 | } else { |
| 89 | importPluginData(); |
| 90 | } |
| 91 | }); |
| 92 | $(document).on("click", "#import-folder-button", function(e){ |
| 93 | importPluginData(); |
| 94 | }); |
| 95 | $(document).on("click", ".remove-folder-data", function(e){ |
| 96 | selectedItem = $(this).closest("tr").data("plugin"); |
| 97 | var pluginName = $(this).closest("tr").find(".plugin-name").html(); |
| 98 | var pluginFolders = parseInt($(this).closest("tr").data("folders")); |
| 99 | var popupTitle = removeTitle.replace("%plugin%", pluginName); |
| 100 | $(".remove-folder-title").html(popupTitle); |
| 101 | var popupDesc = removeDesc.replace("%plugin%", "<b>" + pluginName + "</b>"); |
| 102 | popupDesc = popupDesc.replace("%d", "<b>" + pluginFolders + "</b>"); |
| 103 | $(".remove-folder-note").html(popupDesc); |
| 104 | $("#remove-plugin-data").show(); |
| 105 | }); |
| 106 | $(document).on("click", "#remove-folder-button", function(){ |
| 107 | removePluginData(); |
| 108 | }); |
| 109 | }); |
| 110 | |
| 111 | function importPluginData() { |
| 112 | $("#import-folder-button").addClass("button"); |
| 113 | $("#import-folder-button").prop("disabled", true); |
| 114 | $(".other-plugins-"+selectedItem+" .import-folder-data").prop("disabled", true); |
| 115 | $(".other-plugins-"+selectedItem+" .import-folder-data .spinner").addClass("active"); |
| 116 | $.ajax({ |
| 117 | url: "<?php echo admin_url("admin-ajax.php") ?>", |
| 118 | data: { |
| 119 | 'plugin': $(".other-plugins-"+selectedItem).data("plugin"), |
| 120 | 'nonce': $(".other-plugins-"+selectedItem).data("nonce"), |
| 121 | 'action': 'wcp_import_plugin_folders_data' |
| 122 | }, |
| 123 | type: 'post', |
| 124 | success: function(res){ |
| 125 | var response = $.parseJSON(res); |
| 126 | if(response.status == -1) { |
| 127 | $(".other-plugins-"+selectedItem+" .import-folder-data").prop("disabled", false); |
| 128 | $(".other-plugins-"+selectedItem+" .import-folder-data .spinner").removeClass("active"); |
| 129 | $("#import-third-party-plugin-data").hide(); |
| 130 | $("#no-more-folder-credit").show(); |
| 131 | $("#import-folder-button").removeClass("button"); |
| 132 | $("#import-folder-button").prop("disabled", false); |
| 133 | } else if(response.status) { |
| 134 | $(".other-plugins-"+response.data.plugin+" .import-message").html(response.message).addClass("success-import"); |
| 135 | $(".other-plugins-"+response.data.plugin+" .import-folder-data").remove(); |
| 136 | } else { |
| 137 | $(".other-plugins-"+response.data.plugin+" .import-message").html(response.message).addClass("error-import"); |
| 138 | $(".other-plugins-"+response.data.plugin+" .import-folder-data").remove(); |
| 139 | } |
| 140 | $("#import-folder-button").prop("disabled", false); |
| 141 | $("#import-plugin-data").hide(); |
| 142 | } |
| 143 | }); |
| 144 | } |
| 145 | |
| 146 | function removePluginData() { |
| 147 | $(".other-plugins-"+selectedItem+" .remove-folder-data .spinner").addClass("active"); |
| 148 | $.ajax({ |
| 149 | url: "<?php echo admin_url("admin-ajax.php") ?>", |
| 150 | data: { |
| 151 | 'plugin': $(".other-plugins-"+selectedItem).data("plugin"), |
| 152 | 'nonce': $(".other-plugins-"+selectedItem).data("nonce"), |
| 153 | 'action': 'wcp_remove_plugin_folders_data' |
| 154 | }, |
| 155 | type: 'post', |
| 156 | success: function(res){ |
| 157 | var response = $.parseJSON(res); |
| 158 | $("#remove-plugin-data").hide(); |
| 159 | if(response.status) { |
| 160 | $(".other-plugins-"+response.data.plugin).remove(); |
| 161 | } else { |
| 162 | $(".other-plugins-"+response.data.plugin+" .import-message").html(response.message).addClass("error-import"); |
| 163 | $(".other-plugins-"+response.data.plugin+" .remove-folder-data .spinner").removeClass("active"); |
| 164 | } |
| 165 | } |
| 166 | }); |
| 167 | } |
| 168 | |
| 169 | function setCSSProperties() { |
| 170 | if($("#new_folder_color").val() != "") { |
| 171 | $("#add-new-folder").css("border-color", $("#new_folder_color").val()); |
| 172 | $("#add-new-folder").css("background-color", $("#new_folder_color").val()); |
| 173 | } |
| 174 | if($("#bulk_organize_button_color").val() != "") { |
| 175 | $(".organize-button").css("border-color", $("#bulk_organize_button_color").val()); |
| 176 | $(".organize-button").css("background-color", $("#bulk_organize_button_color").val()); |
| 177 | $(".organize-button").css("color", "#ffffff"); |
| 178 | } |
| 179 | if($("#dropdown_color").val() != "") { |
| 180 | $(".media-select").css("border-color", $("#dropdown_color").val()); |
| 181 | $(".media-select").css("color", $("#dropdown_color").val()); |
| 182 | } |
| 183 | if($("#folder_bg_color").val() != "") { |
| 184 | $(".all-posts.active-item").css("border-color", $("#folder_bg_color").val()); |
| 185 | $(".all-posts.active-item").css("background-color", $("#folder_bg_color").val()); |
| 186 | $(".all-posts.active-item").css("color", "#ffffff"); |
| 187 | } |
| 188 | $("#custom-css").html(""); |
| 189 | if($("#folder_font").val() != "") { |
| 190 | font_val = $("#folder_font").val(); |
| 191 | $('head').append('<link href="https://fonts.googleapis.com/css?family=' + font_val + ':400,600,700" rel="stylesheet" type="text/css" class="chaty-google-font">'); |
| 192 | $('.preview-box').css('font-family', font_val); |
| 193 | } else { |
| 194 | $('.preview-box').css('style', ""); |
| 195 | } |
| 196 | if($("#folder_size").val() != "") { |
| 197 | $(".folder-list li a span, .header-posts a, .un-categorised-items a").css("font-size", $("#folder_size").val()+"px"); |
| 198 | } else { |
| 199 | $(".folder-list li a span, .header-posts a, .un-categorised-items a").css("font-size", "14px"); |
| 200 | } |
| 201 | } |
| 202 | })); |
| 203 | </script> |
| 204 | <div id="custom-css"> |
| 205 | |
| 206 | </div> |
| 207 | <div class="wrap"> |
| 208 | <h1><?php esc_html_e( 'Folders Settings', WCP_FOLDER ); ?></h1> |
| 209 | <?php |
| 210 | settings_fields('folders_settings'); |
| 211 | settings_fields('default_folders'); |
| 212 | settings_fields('customize_folders'); |
| 213 | $options = get_option('folders_settings'); |
| 214 | $default_folders = get_option('default_folders'); |
| 215 | $customize_folders = get_option('customize_folders'); |
| 216 | $default_folders = (empty($default_folders) || !is_array($default_folders))?array():$default_folders; |
| 217 | do_settings_sections( __FILE__ ); |
| 218 | ?> |
| 219 | <?php if($setting_page!="upgrade-to-pro") { ?> |
| 220 | <form action="options.php" method="post" id="setting-form"> |
| 221 | <?php } ?> |
| 222 | <div class="folders-tabs"> |
| 223 | <div class="folder-tab-menu"> |
| 224 | <ul> |
| 225 | <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', WCP_FOLDER ); ?></a></li> |
| 226 | <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', WCP_FOLDER ); ?></a></li> |
| 227 | <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( 'Import', WCP_FOLDER ); ?></a></li> |
| 228 | <?php if($isInSettings) { ?> |
| 229 | <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', WCP_FOLDER ); ?></a></li> |
| 230 | <?php } ?> |
| 231 | </ul> |
| 232 | </div> |
| 233 | <div class="folder-tab-content"> |
| 234 | <div class="tab-content <?php echo esc_attr(($setting_page=="folder-settings")?"active":"") ?>" id="folder-settings"> |
| 235 | <div class="accordion-content no-bp"> |
| 236 | <div class="accordion-left"> |
| 237 | <table class="form-table"> |
| 238 | <tboby> |
| 239 | <?php |
| 240 | $post_types = get_post_types( array( ), 'objects' ); |
| 241 | $post_array = array("page", "post", "attachment"); |
| 242 | foreach ( $post_types as $post_type ) : ?> |
| 243 | <?php |
| 244 | if ( ! $post_type->show_ui) continue; |
| 245 | $is_checked = !in_array( $post_type->name, $options )?"hide-option":""; |
| 246 | $selected_id = (isset($default_folders[$post_type->name]))?$default_folders[$post_type->name]:"all"; |
| 247 | if(in_array($post_type->name, $post_array)){ |
| 248 | ?> |
| 249 | <tr> |
| 250 | <td class="no-padding"> |
| 251 | <label label for="folders_<?php echo esc_attr($post_type->name); ?>" class="custom-checkbox"> |
| 252 | <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"'; ?>/> |
| 253 | <span></span> |
| 254 | </label> |
| 255 | </td> |
| 256 | <td width="220px"> |
| 257 | <label for="folders_<?php echo esc_attr($post_type->name); ?>" ><?php esc_html_e( 'Use Folders with: ', WCP_FOLDER )." ".esc_html_e($post_type->label); ?></label> |
| 258 | </td> |
| 259 | <td class="default-folder"> |
| 260 | <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: ', WCP_FOLDER ) ?></label> |
| 261 | </td> |
| 262 | <td> |
| 263 | <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); ?>]" ?>"> |
| 264 | <option value="">All <?php echo esc_attr($post_type->label) ?> Folder</option> |
| 265 | <option value="-1" <?php echo ($selected_id == -1)?"selected":"" ?>>Unassigned <?php echo esc_attr($post_type->label) ?></option> |
| 266 | <?php |
| 267 | if(isset($terms_data[$post_type->name]) && !empty($terms_data[$post_type->name])) { |
| 268 | foreach ($terms_data[$post_type->name] as $term) { |
| 269 | $selected = ($selected_id == $term->slug)?"selected":""; |
| 270 | echo "<option ".esc_attr($selected)." value='".esc_attr($term->slug)."'>".esc_attr($term->name)."</option>"; |
| 271 | } |
| 272 | } ?> |
| 273 | </select> |
| 274 | </td> |
| 275 | </tr> |
| 276 | <?php |
| 277 | } else { ?> |
| 278 | <tr> |
| 279 | <td class="no-padding"> |
| 280 | <label label for="folders_<?php echo esc_attr($post_type->name); ?>" class="custom-checkbox"> |
| 281 | <input type="checkbox" class="sr-only folder-select" 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"'; ?>/> |
| 282 | <span></span> |
| 283 | </label> |
| 284 | </td> |
| 285 | <td> |
| 286 | <label for="folders_<?php echo esc_attr($post_type->name); ?>" ><?php esc_html_e( 'Use Folders with: ', WCP_FOLDER )." ".esc_html_e($post_type->label); ?></label> |
| 287 | </td> |
| 288 | <td class="default-folder"> |
| 289 | <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: ', WCP_FOLDER ) ?></label> |
| 290 | </td> |
| 291 | <td> |
| 292 | <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); ?>]" ?>"> |
| 293 | <option value="">All <?php echo esc_attr($post_type->label) ?> Folder</option> |
| 294 | <option value="-1" <?php echo ($selected_id == -1)?"selected":"" ?>>Unassigned <?php echo esc_attr($post_type->label) ?></option> |
| 295 | <?php |
| 296 | if(isset($terms_data[$post_type->name]) && !empty($terms_data[$post_type->name])) { |
| 297 | foreach ($terms_data[$post_type->name] as $term) { |
| 298 | $selected = ($selected_id == $term->slug)?"selected":""; |
| 299 | echo "<option ".esc_attr($selected)." value='".esc_attr($term->slug)."'>".esc_attr($term->name)."</option>"; |
| 300 | } |
| 301 | } ?> |
| 302 | </select> |
| 303 | </td> |
| 304 | </tr> |
| 305 | <?php } |
| 306 | endforeach; ?> |
| 307 | <?php |
| 308 | $show_in_page = !isset($customize_folders['show_folder_in_settings'])?"no":$customize_folders['show_folder_in_settings']; |
| 309 | ?> |
| 310 | <tr> |
| 311 | <td class="no-padding"> |
| 312 | <input type="hidden" name="customize_folders[show_folder_in_settings]" value="no"> |
| 313 | <div class="custom-checkbox"> |
| 314 | <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"> |
| 315 | <span></span> |
| 316 | </div> |
| 317 | </td> |
| 318 | <td colspan="3"> |
| 319 | <label for="show_folder_in_settings" ><?php esc_html_e( 'Place the Folders settings page nested under "Settings"', WCP_FOLDER ); ?></label> |
| 320 | </td> |
| 321 | </tr> |
| 322 | <tr> |
| 323 | <td width="20" class="no-padding"> |
| 324 | <?php $val = get_option("folders_show_in_menu"); ?> |
| 325 | <input type="hidden" name="folders_show_in_menu" value="off" /> |
| 326 | <label for="folders_show_in_menu" class="custom-checkbox"> |
| 327 | <input class="sr-only" type="checkbox" id="folders_show_in_menu" name="folders_show_in_menu" value="on" <?php echo ($val == "on")?"checked='checked'":"" ?>/> |
| 328 | <span></span> |
| 329 | </label> |
| 330 | </td> |
| 331 | <td colspan="3"> |
| 332 | <label for="folders_show_in_menu" ><?php esc_html_e( 'Show the folders also in WordPress menu', WCP_FOLDER ); ?></label> |
| 333 | </td> |
| 334 | </tr> |
| 335 | <!-- Do not make changes here, Only for Free --> |
| 336 | </tboby> |
| 337 | </table> |
| 338 | <input type="hidden" name="folders_settings1[premio_folder_option]" value="yes" /> |
| 339 | </div> |
| 340 | <div class="accordion-right"> |
| 341 | <div class="premio-help"> |
| 342 | <a href="https://premio.io/help/folders/?utm_source=pluginspage" target="_blank"> |
| 343 | <div class="premio-help-btn"> |
| 344 | <img src="<?php echo esc_url(WCP_FOLDER_URL."assets/images/premio-help.png") ?>" alt="Premio Help" class="Premio Help" /> |
| 345 | <div class="need-help">Need Help</div> |
| 346 | <div class="visit-our">Visit our</div> |
| 347 | <div class="knowledge-base">knowledge base</div> |
| 348 | </div> |
| 349 | </a> |
| 350 | </div> |
| 351 | </div> |
| 352 | <div class="clear"></div> |
| 353 | <?php submit_button(); ?> |
| 354 | <div class="separator"></div> |
| 355 | <table class="form-table"> |
| 356 | <tfoot> |
| 357 | <tr> |
| 358 | <td class="no-padding" width="20px"> |
| 359 | <span class="dashicons dashicons-editor-help"></span> |
| 360 | </td> |
| 361 | <td width="220px"> |
| 362 | <?php |
| 363 | $tlfs = get_option("folder_old_plugin_folder_status"); |
| 364 | if($tlfs == false || $tlfs < 10) { |
| 365 | $tlfs = 10; |
| 366 | } |
| 367 | $total = WCP_Folders::get_ttl_fldrs(); |
| 368 | if($total > $tlfs) { |
| 369 | $tlfs = $total; |
| 370 | } |
| 371 | ?> |
| 372 | You have used <b><?php echo esc_attr($total) ?></b>/<?php echo esc_attr($tlfs) ?> Folders. |
| 373 | </td> |
| 374 | <td class="no-padding" colspan="2"> |
| 375 | <a class="upgrade-btn" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>"><?php esc_html_e("Upgrade", WCP_FOLDER) ?></a> |
| 376 | </td> |
| 377 | </tr> |
| 378 | </tfoot> |
| 379 | </table> |
| 380 | </div> |
| 381 | </div> |
| 382 | <div class="tab-content <?php echo esc_attr(($setting_page=="customize-folders")?"active":"") ?>" id="customize-folders"> |
| 383 | <div class="accordion-content"> |
| 384 | <div class="accordion-left"> |
| 385 | <table class="form-table"> |
| 386 | <?php |
| 387 | $color = !isset($customize_folders['new_folder_color'])||empty($customize_folders['new_folder_color'])?"#FA166B":$customize_folders['new_folder_color']; |
| 388 | ?> |
| 389 | <tr> |
| 390 | <td width="220px" class="no-padding"> |
| 391 | <label for="new_folder_color" ><b>"New Folder"</b> button color</label> |
| 392 | </td> |
| 393 | <td width="32px"> |
| 394 | <input type="text" class="color-field" name="customize_folders[new_folder_color]" id="new_folder_color" value="<?php echo esc_attr($color) ?>" /> |
| 395 | </td> |
| 396 | <td rowspan="4" > |
| 397 | |
| 398 | </td> |
| 399 | </tr> |
| 400 | <?php |
| 401 | $color = !isset($customize_folders['bulk_organize_button_color'])||empty($customize_folders['bulk_organize_button_color'])?"#FA166B":$customize_folders['bulk_organize_button_color']; |
| 402 | ?> |
| 403 | <tr> |
| 404 | <td class="no-padding"> |
| 405 | <label for="bulk_organize_button_color" ><b>"Bulk Organize"</b> button color</label> |
| 406 | </td> |
| 407 | <td> |
| 408 | <input type="text" class="color-field" name="customize_folders[bulk_organize_button_color]" id="bulk_organize_button_color" value="<?php echo esc_attr($color) ?>" /> |
| 409 | </td> |
| 410 | </tr> |
| 411 | <?php |
| 412 | $color = !isset($customize_folders['media_replace_button'])||empty($customize_folders['media_replace_button'])?"#FA166B":$customize_folders['media_replace_button']; |
| 413 | ?> |
| 414 | <tr> |
| 415 | <td class="no-padding"> |
| 416 | <label for="bulk_organize_button_color" ><b>"Replace File"</b> media library button</label> |
| 417 | </td> |
| 418 | <td> |
| 419 | <input type="text" class="color-field" name="customize_folders[media_replace_button]" id="media_replace_button" value="<?php echo esc_attr($color) ?>" /> |
| 420 | </td> |
| 421 | </tr> |
| 422 | <?php |
| 423 | $color = !isset($customize_folders['dropdown_color'])||empty($customize_folders['dropdown_color'])?"#484848":$customize_folders['dropdown_color']; |
| 424 | ?> |
| 425 | <tr> |
| 426 | <td class="no-padding"> |
| 427 | <label for="dropdown_color" >Dropdown color</label> |
| 428 | </td> |
| 429 | <td> |
| 430 | <input type="text" class="color-field" name="customize_folders[dropdown_color]" id="dropdown_color" value="<?php echo esc_attr($color) ?>" /> |
| 431 | </td> |
| 432 | </tr> |
| 433 | <?php |
| 434 | $color = !isset($customize_folders['folder_bg_color'])||empty($customize_folders['folder_bg_color'])?"#FA166B":$customize_folders['folder_bg_color']; |
| 435 | ?> |
| 436 | <tr> |
| 437 | <td class="no-padding"> |
| 438 | <label for="folder_bg_color" >Folders background color</label> |
| 439 | </td> |
| 440 | <td> |
| 441 | <input type="text" class="color-field" name="customize_folders[folder_bg_color]" id="folder_bg_color" value="<?php echo esc_attr($color) ?>" /> |
| 442 | </td> |
| 443 | </tr> |
| 444 | <tr> |
| 445 | <td class="no-padding"> |
| 446 | <label for="folder_font" >Folders font</label> |
| 447 | </td> |
| 448 | <td colspan="2"> |
| 449 | <?php |
| 450 | $font = !isset($customize_folders['folder_font'])||empty($customize_folders['folder_font'])?"":$customize_folders['folder_font']; |
| 451 | $index = 0; |
| 452 | ?> |
| 453 | <select name="customize_folders[folder_font]" id="folder_font" > |
| 454 | <?php $group = ''; |
| 455 | foreach ($fonts as $key => $value): |
| 456 | $title = $key; |
| 457 | if($index == 0) { |
| 458 | $key = ""; |
| 459 | } |
| 460 | $index++; |
| 461 | if ($value != $group) { |
| 462 | echo '<optgroup label="' . $value . '">'; |
| 463 | $group = $value; |
| 464 | } |
| 465 | ?> |
| 466 | <option value="<?php echo $key; ?>" <?php selected($font, $key); ?>><?php echo $title; ?></option> |
| 467 | <?php endforeach; ?> |
| 468 | </select> |
| 469 | </td> |
| 470 | </tr> |
| 471 | <tr> |
| 472 | <td class="no-padding"> |
| 473 | <label for="folder_size" >Folders size</label> |
| 474 | </td> |
| 475 | <td colspan="2"> |
| 476 | <?php |
| 477 | $sizes = array( |
| 478 | "12" => "Small", |
| 479 | "16" => "Medium", |
| 480 | "20" => "Large" |
| 481 | ); |
| 482 | $size = !isset($customize_folders['folder_size'])||empty($customize_folders['folder_size'])?"16":$customize_folders['folder_size']; |
| 483 | ?> |
| 484 | <select name="customize_folders[folder_size]" id="folder_size" > |
| 485 | <?php |
| 486 | foreach ($sizes as $key=>$value) { |
| 487 | $selected = ($key == $size)?"selected":""; |
| 488 | echo "<option ".$selected." value='".$key."'>".$value."</option>"; |
| 489 | } |
| 490 | ?> |
| 491 | </select> |
| 492 | </td> |
| 493 | </tr> |
| 494 | <?php |
| 495 | $show_in_page = !isset($customize_folders['show_in_page'])||empty($customize_folders['show_in_page'])?"show":$customize_folders['show_in_page']; |
| 496 | if(empty($show_in_page)) { |
| 497 | $show_in_page = "show"; |
| 498 | } |
| 499 | ?> |
| 500 | <tr> |
| 501 | <td colspan="3" class="no-padding"> |
| 502 | <input type="hidden" name="customize_folders[show_in_page]" value="hide"> |
| 503 | <div class="custom-checkbox"> |
| 504 | <input id="show_folders" class="sr-only" <?php checked($show_in_page, "show") ?> type="checkbox" name="customize_folders[show_in_page]" value="show"> |
| 505 | <span></span> |
| 506 | </div> |
| 507 | <label for="show_folders">Show Folders in upper position</label> |
| 508 | </td> |
| 509 | </tr> |
| 510 | </table> |
| 511 | </div> |
| 512 | <div class="accordion-right"> |
| 513 | <div class="preview-text"> |
| 514 | Preview |
| 515 | <div class="preview-text-info">See the full functionality on your media library, posts, pages, and custom posts</div> |
| 516 | </div> |
| 517 | <div class="preview-inner-box"> |
| 518 | <div class="preview-box"> |
| 519 | <div class="wcp-custom-form"> |
| 520 | <div class="form-title"> |
| 521 | Folders |
| 522 | <a href="javascript:;" class="add-new-folder" id="add-new-folder"> |
| 523 | <span class="create_new_folder"><i class="pfolder-add-folder"></i></span> |
| 524 | <span>New Folder</span> |
| 525 | </a> |
| 526 | <div class="clear"></div> |
| 527 | </div> |
| 528 | <div class="form-options"> |
| 529 | <ul> |
| 530 | <li> |
| 531 | <div class="custom-checkbox"> |
| 532 | <input type="checkbox" class="sr-only" > |
| 533 | <span></span> |
| 534 | </div> |
| 535 | </li> |
| 536 | <li> |
| 537 | <a href="javascript:;" id="inline-update"><span class="icon pfolder-edit-folder"><span class="path2"></span></span> <span class="text">Rename</span> </a> |
| 538 | </li> |
| 539 | <li> |
| 540 | <a href="javascript:;" id="inline-remove"><span class="icon pfolder-remove"></span> <span class="text">Delete</span> </a> |
| 541 | </li> |
| 542 | <li class="last"> |
| 543 | <a href="javascript:;" id="expand-collapse-list" data-tooltip="Expand"><span class="icon pfolder-arrow-down"></span></a> |
| 544 | </li> |
| 545 | <li class="last"> |
| 546 | <a href="javascript:;" ><span class="icon pfolder-arrow-sort"></span></a> |
| 547 | </li> |
| 548 | </ul> |
| 549 | </div> |
| 550 | </div> |
| 551 | <div class="shadow-box"> |
| 552 | <div class="header-posts"> |
| 553 | <a href="javascript:;" class="all-posts active-item">All Files <span class="total-count">215</span></a> |
| 554 | </div> |
| 555 | <div class="un-categorised-items ui-droppable"> |
| 556 | <a href="javascript:;" class="un-categorized-posts">Unassigned Files <span class="total-count total-empty">191</span> </a> |
| 557 | </div> |
| 558 | <div class="separator"></div> |
| 559 | <ul class="folder-list"> |
| 560 | <li><a href="javascript:;"><i class="wcp-icon pfolder-folder-close"></i> <span>Folder 1</span><span class="total-count">20</span><span class="clear"></span></a></li> |
| 561 | <li><a href="javascript:;"><i class="wcp-icon pfolder-folder-close"></i> <span>Folder 2</span><span class="total-count">13</span><span class="clear"></span></a></li> |
| 562 | <li><a href="javascript:;"><i class="wcp-icon pfolder-folder-close"></i> <span>Folder 3</span><span class="total-count">5</span><span class="clear"></span></a></li> |
| 563 | </ul> |
| 564 | <div class="separator"></div> |
| 565 | <div class="media-buttons"> |
| 566 | <select class="media-select"> |
| 567 | <option>All Files</option> |
| 568 | <option>Folder 1</option> |
| 569 | <option>Folder 2</option> |
| 570 | <option>Folder 3</option> |
| 571 | </select> |
| 572 | <button type="button" class="button organize-button">Bulk Organize</button> |
| 573 | <div style="clear: both;"></div> |
| 574 | </div> |
| 575 | </div> |
| 576 | </div> |
| 577 | </div> |
| 578 | </div> |
| 579 | <div class="clear"></div> |
| 580 | <?php submit_button(); ?> |
| 581 | </div> |
| 582 | </div> |
| 583 | <div class="tab-content <?php echo esc_attr(($setting_page=="folders-import")?"active":"") ?>" id="folder-import"> |
| 584 | <?php if($is_plugin_exists) { ?> |
| 585 | <div class="import-folder-table"> |
| 586 | <table> |
| 587 | <tbody> |
| 588 | <?php foreach ($plugin_info as $slug=>$plugin) { |
| 589 | if($plugin['is_exists']) { ?> |
| 590 | <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']) ?>"> |
| 591 | <th class="plugin-name"><?php echo esc_attr__($plugin['name']) ?></th> |
| 592 | <td> |
| 593 | <span class="import-message"><?php printf(esc_html__("%s folder%s and %s attachment%s", "folders"), "<b>".$plugin['total_folders']."</b>", ($plugin['total_folders']>1)?esc_html__("s"):"" ,"<b>".$plugin['total_attachments']."</b>", ($plugin['total_attachments']>1)?esc_html__("s"):"") ?></span> |
| 594 | <button type="button" class="button button-primary import-folder-data"><?php esc_html_e("Import", "folders"); ?> <span class="spinner"></span></button> |
| 595 | <button type="button" class="button button-secondary remove-folder-data"><?php esc_html_e("Delete plugin data", "folders"); ?> <span class="spinner"></span></button> |
| 596 | </td> |
| 597 | </tr> |
| 598 | <?php } |
| 599 | } ?> |
| 600 | </tbody> |
| 601 | </table> |
| 602 | </div> |
| 603 | <?php } else { ?> |
| 604 | <div class="no-plugin-message"> |
| 605 | <p><?php esc_html_e("We couldn't detect any external folders that can be imported.", WCP_FOLDER); ?></p> |
| 606 | <p><?php echo sprintf(esc_html__("If you have external folders that were not detected, please contact us at %s", WCP_FOLDER), "<a href='mailto:contact@premio.io'>contact@premio.io</a>"); ?></p> |
| 607 | </div> |
| 608 | <?php } ?> |
| 609 | </div> |
| 610 | <div class="tab-content <?php echo esc_attr(($setting_page=="upgrade-to-pro")?"active":"") ?>"> |
| 611 | <?php if($setting_page=="upgrade-to-pro") { ?> |
| 612 | <?php include_once "upgrade-table.php" ?> |
| 613 | <?php } ?> |
| 614 | </div> |
| 615 | </div> |
| 616 | </div> |
| 617 | <?php |
| 618 | ?> |
| 619 | <input type="hidden" name="folder_nonce" value="<?php echo wp_create_nonce("folder_settings") ?>"> |
| 620 | <input type="hidden" name="folder_page" value="<?php echo $_SERVER['REQUEST_URI'] ?>"> |
| 621 | <?php if($setting_page!="upgrade-to-pro") { ?> |
| 622 | </form> |
| 623 | <?php } ?> |
| 624 | </div> |
| 625 | |
| 626 | <div class="folder-popup-form" id="import-plugin-data"> |
| 627 | <div class="popup-form-content"> |
| 628 | <div class="popup-content"> |
| 629 | <div class="close-popup-button"> |
| 630 | <a class="" href="javascript:;"><span></span></a> |
| 631 | </div> |
| 632 | <div class="import-folder-title"></div> |
| 633 | <div class="import-folder-note">Are you sure you'd like to import $x folders from $plugin?</div> |
| 634 | <div class="folder-form-buttons"> |
| 635 | <button type="submit" class="form-submit-btn" id="import-folder-button"><?php esc_html_e("Import", WCP_FOLDER); ?></button> |
| 636 | <a href="javascript:;" class="form-cancel-btn"><?php esc_html_e("Cancel", WCP_FOLDER); ?></a> |
| 637 | </div> |
| 638 | </div> |
| 639 | </div> |
| 640 | </div> |
| 641 | |
| 642 | <div class="folder-popup-form" id="remove-plugin-data"> |
| 643 | <div class="popup-form-content"> |
| 644 | <div class="popup-content"> |
| 645 | <div class="close-popup-button"> |
| 646 | <a class="" href="javascript:;"><span></span></a> |
| 647 | </div> |
| 648 | <div class="remove-folder-title">Are you sure?</div> |
| 649 | <div class="remove-folder-note">You're about to delete $plugin's folders. Are you sure you'd like to proceed?</div> |
| 650 | <div class="folder-form-buttons"> |
| 651 | <button type="submit" class="form-submit-btn delete-folder-plugin" id="remove-folder-button"><?php esc_html_e("Delete plugin data", WCP_FOLDER); ?></button> |
| 652 | <a href="javascript:;" class="form-cancel-btn"><?php esc_html_e("Cancel", WCP_FOLDER); ?></a> |
| 653 | </div> |
| 654 | </div> |
| 655 | </div> |
| 656 | </div> |
| 657 | |
| 658 | <?php |
| 659 | $option = get_option("folder_intro_box"); |
| 660 | if(($option == "show" || get_option("folder_redirect_status") == 2) && $is_plugin_exists) { ?> |
| 661 | <div class="folder-popup-form" id="import-third-party-plugin-data" style="display: block" ?> |
| 662 | <div class="popup-form-content"> |
| 663 | <div class="popup-content"> |
| 664 | <div class="close-popup-button"> |
| 665 | <a class="" href="javascript:;"><span></span></a> |
| 666 | </div> |
| 667 | <div class="import-plugin-title"><?php esc_html_e("Import data", WCP_FOLDER); ?></div> |
| 668 | <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", WCP_FOLDER) ?></div> |
| 669 | <div class="plugin-import-table"> |
| 670 | <div class="import-folder-table"> |
| 671 | <table> |
| 672 | <tbody> |
| 673 | <?php foreach ($plugin_info as $slug=>$plugin) { |
| 674 | if($plugin['is_exists']) { ?> |
| 675 | <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']) ?>"> |
| 676 | <th class="plugin-name"><?php echo esc_attr__($plugin['name']) ?></th> |
| 677 | <td> |
| 678 | <button type="button" class="button button-primary import-folder-data in-popup"><?php esc_html_e("Import", "folders"); ?> <span class="spinner"></span></button> |
| 679 | <span class="import-message"><?php printf(esc_html__("%s folder%s and %s attachment%s", "folders"), "<b>".$plugin['total_folders']."</b>", ($plugin['total_folders']>1)?esc_html__("s"):"" ,"<b>".$plugin['total_attachments']."</b>", ($plugin['total_attachments']>1)?esc_html__("s"):"") ?></span> |
| 680 | </td> |
| 681 | </tr> |
| 682 | <?php } |
| 683 | } ?> |
| 684 | </tbody> |
| 685 | </table> |
| 686 | </div> |
| 687 | </div> |
| 688 | <div class="folder-form-buttons"> |
| 689 | <div class=""></div> |
| 690 | <a href="javascript:;" id="cancel-plugin-import" class="form-cancel-btn"><?php esc_html_e("Close", WCP_FOLDER); ?></a> |
| 691 | </div> |
| 692 | </div> |
| 693 | </div> |
| 694 | </div> |
| 695 | <?php |
| 696 | if($option != "show") { |
| 697 | update_option("folder_redirect_status", 3); |
| 698 | } |
| 699 | } ?> |
| 700 | <div class="folder-popup-form" id="no-more-folder-credit"> |
| 701 | <div class="popup-form-content"> |
| 702 | <div class="popup-content"> |
| 703 | <div class="close-popup-button"> |
| 704 | <a class="" href="javascript:;"><span></span></a> |
| 705 | </div> |
| 706 | <div class="add-update-folder-title" id="folder-limitation-message"> |
| 707 | You've reached the 10 folder limitation! |
| 708 | </div> |
| 709 | <div class="folder-form-message"> |
| 710 | Unlock unlimited amount of folders by upgrading to one of our pro plans. |
| 711 | </div> |
| 712 | <div class="folder-form-buttons"> |
| 713 | <a href="javascript:;" class="form-cancel-btn">Cancel</a> |
| 714 | <a href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" target="_blank" class="form-submit-btn">See Pro Plans</a> |
| 715 | </div> |
| 716 | </div> |
| 717 | </div> |
| 718 | </div> |
| 719 |