admin-content.php
7 years ago
folder-deactivate-form.php
7 years ago
general-settings.php
7 years ago
help.php
7 years ago
upgrade-to-pro.php
7 years ago
general-settings.php
92 lines
| 1 | <?php |
| 2 | defined('ABSPATH') or die('Nope, not accessing this'); |
| 3 | ?> |
| 4 | <style> |
| 5 | span.upgrade-message { |
| 6 | padding: 5px 10px; |
| 7 | background: #fff; |
| 8 | display: inline-block; |
| 9 | font-size: 14px; |
| 10 | color: #000; |
| 11 | } |
| 12 | a.pink, span.pink { |
| 13 | color: #FF5983; |
| 14 | text-decoration: none; |
| 15 | font-weight: bold; |
| 16 | } |
| 17 | #setting-form { |
| 18 | float: left; |
| 19 | width: 300px; |
| 20 | } |
| 21 | <?php if ( function_exists( 'is_rtl' ) && is_rtl() ) { ?> |
| 22 | #setting-form { |
| 23 | float: right; |
| 24 | } |
| 25 | <?php } ?> |
| 26 | </style> |
| 27 | <div class="wrap"> |
| 28 | <h1><?php _e( 'Folders Settings', WCP_FOLDER ); ?></h1> |
| 29 | <form action="options.php" method="post" id="setting-form"> |
| 30 | <?php |
| 31 | settings_fields( 'folders_settings' ); |
| 32 | $options = get_option('folders_settings'); |
| 33 | do_settings_sections( __FILE__ ); |
| 34 | ?> |
| 35 | <table class="form-table"> |
| 36 | <?php |
| 37 | $post_types = get_post_types( array( 'public' => true ), 'objects' ); |
| 38 | $post_array = array("page", "post", "attachment"); |
| 39 | foreach ( $post_types as $post_type ) : ?> |
| 40 | <?php |
| 41 | if ( ! $post_type->show_ui) continue; |
| 42 | if(in_array($post_type->name, $post_array)){ |
| 43 | ?> |
| 44 | <tr> |
| 45 | <th> |
| 46 | <label for="folders_<?php echo $post_type->name; ?>" ><?php echo __( 'Use folders with:', WCP_FOLDER )." ".$post_type->label; ?></label> |
| 47 | </th> |
| 48 | <td> |
| 49 | <input type="checkbox" id="folders_<?php echo $post_type->name; ?>" name="folders_settings[]" value="<?php echo $post_type->name; ?>"<?php if ( in_array( $post_type->name, $options ) ) echo ' checked="checked"'; ?>/> |
| 50 | </td> |
| 51 | </tr> |
| 52 | <?php |
| 53 | } else { ?> |
| 54 | <tr> |
| 55 | <th> |
| 56 | <label for="folders_<?php echo $post_type->name; ?>" ><?php echo __( 'Use folders with:', WCP_FOLDER )." ".$post_type->label; ?></label> |
| 57 | </th> |
| 58 | <td> |
| 59 | <input type="checkbox" id="folders_<?php echo $post_type->name; ?>" name="folders_settings[]" value="<?php echo $post_type->name; ?>"<?php if ( in_array( $post_type->name, $options ) ) echo ' checked="checked"'; ?>/> |
| 60 | </td> |
| 61 | </tr> |
| 62 | <?php } endforeach; ?> |
| 63 | <tr> |
| 64 | <th> |
| 65 | <label for="folders_<?php echo $post_type->name; ?>" ><?php echo __( 'Show Folders in Menu:', WCP_FOLDER ); ?></label> |
| 66 | </th> |
| 67 | <td> |
| 68 | <?php $val = get_option("folders_show_in_menu"); ?> |
| 69 | <input type="hidden" name="folders_show_in_menu" value="off" /> |
| 70 | <input type="checkbox" name="folders_show_in_menu" value="on" <?php echo ($val == "on")?"checked='checked'":"" ?>/> |
| 71 | </td> |
| 72 | </tr> |
| 73 | <tr> |
| 74 | <td colspan="2" style="padding: 10px 0"> |
| 75 | <?php |
| 76 | $total_folders = get_option("folder_old_plugin_folder_status"); |
| 77 | if($total_folders == false || $total_folders < 10) { |
| 78 | $total_folders = 10; |
| 79 | } |
| 80 | $total = WCP_Folders::get_total_term_folders(); |
| 81 | if($total > $total_folders) { |
| 82 | $total_folders = $total; |
| 83 | } |
| 84 | ?> |
| 85 | <span class="upgrade-message">You have used <?php echo "<span class='pink'>".$total."</span>/".$total_folders ?> Folders. <a class="pink" href="<?php echo admin_url("admin.php?page=wcp_folders_upgrade") ?>"><?php echo __("Upgrade", WCP_FOLDER) ?></a></span> |
| 86 | </td> |
| 87 | </tr> |
| 88 | </table> |
| 89 | <input type="hidden" name="folders_settings1[premio_folder_option]" value="yes" /> |
| 90 | <?php submit_button(); ?> |
| 91 | </form> |
| 92 | </div> |