partials
1 year ago
settings-admincustom.php
6 years ago
settings-general.php
2 years ago
settings-posttypes.php
2 years ago
settings.php
6 years ago
settings-general.php
177 lines
| 1 | <?php |
| 2 | $allowsorting = get_option('nestedpages_allowsorting', []); |
| 3 | $allowsortview = $this->settings->sortViewEnabled(); |
| 4 | if ( $allowsorting == "" ) $allowsorting = []; |
| 5 | $sync_status = ( $this->settings->menuSyncEnabled() ) ? __('Currently Enabled', 'wp-nested-pages') : __('Currently Disabled', 'wp-nested-pages'); |
| 6 | ?> |
| 7 | <div class="nestedpages-settings-general-wrapper"> |
| 8 | <div class="nestedpages-settings-table"> |
| 9 | <form method="post" enctype="multipart/form-data" action="options.php"> |
| 10 | <?php settings_fields( 'nestedpages-general' ); ?> |
| 11 | <div class="row-container"> |
| 12 | <div class="row"> |
| 13 | <div class="description"> |
| 14 | <p><strong><?php _e('Nested Pages Version', 'wp-nested-pages'); ?></strong></p> |
| 15 | </div> |
| 16 | <div class="field"> |
| 17 | <p><?php echo get_option('nestedpages_version'); ?></p> |
| 18 | </div> |
| 19 | </div><!-- .row --> |
| 20 | |
| 21 | <div class="row"> |
| 22 | <div class="description"> |
| 23 | <p><strong><?php _e('Display Options', 'wp-nested-pages'); ?></strong></p> |
| 24 | </div> |
| 25 | <div class="field"> |
| 26 | <p><label> |
| 27 | <input type="checkbox" name="nestedpages_ui[datepicker]" value="true" <?php if ( $this->settings->datepickerEnabled() ) echo 'checked'; ?> /> |
| 28 | <?php _e('Enable Date Picker in Quick Edit', 'wp-nested-pages'); ?> |
| 29 | </label></p> |
| 30 | <p><label> |
| 31 | <input type="checkbox" name="nestedpages_ui[non_indent]" value="true" <?php if ( $this->settings->nonIndentEnabled() ) echo 'checked'; ?> /> |
| 32 | <?php _e('Use the classic (non-indented) hierarchy display.', 'wp-nested-pages'); ?> |
| 33 | </label></p> |
| 34 | </div> |
| 35 | </div><!-- .row --> |
| 36 | |
| 37 | <div class="row"> |
| 38 | <div class="description"> |
| 39 | <p><strong><?php _e('Menu Sync', 'wp-nested-pages'); ?></strong></p> |
| 40 | </div> |
| 41 | <div class="field"> |
| 42 | <?php if ( !$this->settings->menusDisabled() ) : ?> |
| 43 | <p data-menu-enabled-option data-menu-hide-checkbox> |
| 44 | <label> |
| 45 | <input type="checkbox" name="nestedpages_ui[hide_menu_sync]" value="true" <?php if ( $this->settings->hideMenuSync() && !$this->settings->menusDisabled() ) echo 'checked'; ?> /> |
| 46 | <?php printf(__('Hide Menu Sync Checkbox (%s)', 'wp-nested-pages'), esc_html($sync_status)); ?> |
| 47 | </label> |
| 48 | </p> |
| 49 | <p data-menu-enabled-option data-menu-private> |
| 50 | <label> |
| 51 | <input type="checkbox" name="nestedpages_ui[include_private]" value="true" <?php if ( $this->settings->privateMenuEnabled() && !$this->settings->menusDisabled() ) echo 'checked'; ?> /> |
| 52 | <?php _e('Include private items in the menu.', 'wp-nested-pages'); ?> |
| 53 | </label> |
| 54 | </p> |
| 55 | <?php endif; ?> |
| 56 | <p data-menu-enabled-option data-menu-disable-auto> |
| 57 | <label> |
| 58 | <input type="checkbox" name="nestedpages_ui[manual_menu_sync]" value="true" <?php if ( $this->settings->autoMenuDisabled() && !$this->settings->menusDisabled() ) echo 'checked'; ?> data-menu-disable-auto-checkbox /> |
| 59 | <?php _e('Manually sync menu.', 'wp-nested-pages'); ?><br> |
| 60 | </label> |
| 61 | </p> |
| 62 | <p> |
| 63 | <label> |
| 64 | <input type="checkbox" name="nestedpages_ui[manual_page_order_sync]" value="true" <?php if ( $this->settings->autoPageOrderDisabled() ) echo 'checked'; ?> /> |
| 65 | <?php _e('Manually sync page order.', 'wp-nested-pages'); ?> |
| 66 | </label> |
| 67 | </p> |
| 68 | <p data-menu-enabled-option data-menu-disable-auto> |
| 69 | <label> |
| 70 | <input type="checkbox" name="nestedpages_ui[menu_sync_default_hide]" value="true" <?php if ( $this->settings->defaultHideInNav() ) echo 'checked'; ?> /> |
| 71 | <?php _e('Default new pages to hide in nav menu.', 'wp-nested-pages'); ?> |
| 72 | </label> |
| 73 | </p> |
| 74 | <p> |
| 75 | <label> |
| 76 | <input type="checkbox" name="nestedpages_disable_menu" value="true" <?php if ( $this->settings->menusDisabled() ) echo 'checked'; ?> data-disable-menu-checkbox /> |
| 77 | <?php _e('Disable menu sync completely', 'wp-nested-pages'); ?> |
| 78 | </label> |
| 79 | </p> |
| 80 | </div> |
| 81 | </div><!-- .row --> |
| 82 | |
| 83 | <div class="row"> |
| 84 | <div class="description"> |
| 85 | <p><strong><?php _e('Allow Page Sorting', 'wp-nested-pages'); ?></strong></p> |
| 86 | <p><?php _e('Page sorting capability is also controlled through the nestedpages_sorting_$type capability', 'wp-nested-pages'); ?></p> |
| 87 | </div> |
| 88 | <div class="field"> |
| 89 | <?php foreach ( $this->user_repo->allRoles() as $role ) : ?> |
| 90 | <label> |
| 91 | <input type="checkbox" name="nestedpages_allowsorting[]" value="<?php echo $role['name']; ?>" <?php if ( in_array($role['name'], $allowsorting) ) echo 'checked'; ?> > |
| 92 | <?php echo esc_html($role['label']); ?> |
| 93 | </label> |
| 94 | <br /> |
| 95 | <?php endforeach; ?> |
| 96 | <input type="hidden" name="nestedpages_menusync" value="<?php echo get_option('nestedpages_menusync'); ?>"> |
| 97 | <p><em><?php _e('Admins always have sorting ability.', 'wp-nested-pages'); ?></em></p> |
| 98 | </div> |
| 99 | </div><!-- .row --> |
| 100 | |
| 101 | <div class="row"> |
| 102 | <div class="description"> |
| 103 | <p><strong><?php _e('Allow Sort View', 'wp-nested-pages'); ?></strong></p> |
| 104 | <p><?php _e('Sort view access is also filterable through the nestedpages_sort_view_$type filter.', 'wp-nested-pages'); ?></p> |
| 105 | </div> |
| 106 | <div class="field"> |
| 107 | <input type="hidden" name="nestedpages_allowsortview[]" value="<?php echo 'administrator'; ?>" > |
| 108 | <?php foreach ( $this->user_repo->allRoles(['Administrator']) as $role ) : ?> |
| 109 | <label> |
| 110 | <?php |
| 111 | $checked = false; |
| 112 | if ( !$allowsortview ) $checked = true; |
| 113 | if ( is_array($allowsortview) && in_array($role['name'], $allowsortview) ) $checked = true; |
| 114 | ?> |
| 115 | <input type="checkbox" name="nestedpages_allowsortview[]" value="<?php echo $role['name']; ?>" <?php if ( $checked ) echo 'checked'; ?> > |
| 116 | <?php echo esc_html($role['label']); ?> |
| 117 | </label> |
| 118 | <br /> |
| 119 | <?php endforeach; ?> |
| 120 | <p><em><?php _e('Admins may always view the sort view.', 'wp-nested-pages'); ?></em></p> |
| 121 | </div> |
| 122 | </div><!-- .row --> |
| 123 | |
| 124 | <div class="row"> |
| 125 | <div class="description"> |
| 126 | <p><strong><?php _e('Reset Plugin Settings', 'wp-nested-pages'); ?></strong></p> |
| 127 | <p><?php _e('Warning: Resetting plugin settings will remove all menu settings, post type customizations, role customizations and any other Nested Pages settings. These will be replaced with the default settings. This action cannot be undone.', 'wp-nested-pages'); ?></p> |
| 128 | </div> |
| 129 | <div class="field"> |
| 130 | <p><button class="np-btn np-btn-trash" data-nestedpages-reset-settings><?php _e('Reset Nested Pages Settings', 'wp-nested-pages'); ?></button></p> |
| 131 | <div class="nestedpages-reset-settings-complete" style="display:none;"> |
| 132 | <p><?php _e('Settings have been successfully reset.', 'wp-nested-pages'); ?></p> |
| 133 | </div> |
| 134 | </div> |
| 135 | </div><!-- .row --> |
| 136 | |
| 137 | <div class="row"> |
| 138 | <div class="description"> |
| 139 | <p><strong><?php _e('Reset User Preferences', 'wp-nested-pages'); ?></strong></p> |
| 140 | <p><?php _e('Toggle states are saved for each user. This action will clear these preferences for all users. If PHP errors appear within the nested view after an update, this may help clear them.', 'wp-nested-pages'); ?></p> |
| 141 | </div> |
| 142 | <div class="field"> |
| 143 | <div class="nestedpages-reset-user-prefs"> |
| 144 | <p> |
| 145 | <button class="np-btn np-btn-trash" data-nestedpages-reset-user-prefs><?php _e('Reset User Preferences', 'wp-nested-pages'); ?></button> |
| 146 | </p> |
| 147 | </div> |
| 148 | <div class="nestedpages-reset-user-prefs-complete" style="display:none;"> |
| 149 | <p><?php _e('User preferences have been successfully reset.', 'wp-nested-pages'); ?></p> |
| 150 | </div> |
| 151 | </div> |
| 152 | </div><!-- .row --> |
| 153 | <div class="row submit"> |
| 154 | <?php submit_button(); ?> |
| 155 | </div> |
| 156 | </div><!-- .row-container --> |
| 157 | </form> |
| 158 | </div><!-- .nestedpages-settings-table --> |
| 159 | |
| 160 | <div class="nestedpages-settings-support"> |
| 161 | <div class="inner"> |
| 162 | <h3><?php _e('Show Some Love!', 'wp-nested-pages'); ?></h3> |
| 163 | <h4><?php _e('Sponsor this Plugin', 'wp-nested-pages'); ?></h4> |
| 164 | <p><?php _e('You can help support the continued development and upkeep of this plugin by sponsoring on Github. Whether you are an individual using this on a side project, a business, or an agency using this plugin across multiple sites… every bit helps!', 'wp-nested-pages'); ?></p> |
| 165 | <p style="margin-bottom:0;"><a href="https://github.com/sponsors/kylephillips" target="_blank" class="support-button"><svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path class="heart" d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/></svg><?php _e('Sponsor on Github', 'wp-nested-pages'); ?></a></p> |
| 166 | <p class="or"><?php _e('- or Donate through Paypal -', 'wp-nested-pages'); ?></p> |
| 167 | <form class="paypal-form" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"> |
| 168 | <input type="hidden" name="cmd" value="_s-xclick" /> |
| 169 | <input type="hidden" name="hosted_button_id" value="CDX8VVMMMMLAU" /> |
| 170 | <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" title="PayPal - The safer, easier way to pay online!" alt="Donate with PayPal button" /> |
| 171 | <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" /> |
| 172 | </form> |
| 173 | </div><!-- .inner --> |
| 174 | </div><!-- .nestedpages-settings-table --> |
| 175 | |
| 176 | </div><!-- .nestedpages-general-wrapper --> |
| 177 |