settings-general.php
75 lines
| 1 | <?php |
| 2 | $allowsorting = get_option('nestedpages_allowsorting', array()); |
| 3 | if ( $allowsorting == "" ) $allowsorting = array(); |
| 4 | $sync_status = ( $this->settings->menuSyncEnabled() ) ? __('Currently Enabled', 'wp-nested-pages') : __('Currently Disabled', 'wp-nested-pages'); |
| 5 | settings_fields( 'nestedpages-general' ); |
| 6 | ?> |
| 7 | <table class="form-table"> |
| 8 | <tr valign="top"> |
| 9 | <th scope="row"><?php _e('Nested Pages Version', 'wp-nested-pages'); ?></th> |
| 10 | <td><strong><?php echo get_option('nestedpages_version'); ?></strong></td> |
| 11 | </tr> |
| 12 | <?php if ( !$this->settings->menusDisabled() ) : ?> |
| 13 | <tr valign="top"> |
| 14 | <th scope="row"><?php _e('Menu Name', 'wp-nested-pages'); ?></th> |
| 15 | <td> |
| 16 | <input type="text" name="nestedpages_menu" id="nestedpages_menu" value="<?php echo $this->menu->name; ?>"> |
| 17 | <p><em><?php _e('Important: Once the menu name has changed, theme files should be updated to reference the new name.', 'wp-nested-pages'); ?></em></p> |
| 18 | </td> |
| 19 | </tr> |
| 20 | <?php endif; ?> |
| 21 | <tr valign="top"> |
| 22 | <th scope="row"><?php _e('Display Options', 'wp-nested-pages'); ?></th> |
| 23 | <td> |
| 24 | <label> |
| 25 | <input type="checkbox" name="nestedpages_ui[datepicker]" value="true" <?php if ( $this->settings->datepickerEnabled() ) echo 'checked'; ?> /> |
| 26 | <?php _e('Enable Date Picker in Quick Edit', 'wp-nested-pages'); ?> |
| 27 | </label> |
| 28 | </td> |
| 29 | </tr> |
| 30 | <tr valign="top"> |
| 31 | <th scope="row"><?php _e('Menu Sync', 'wp-nested-pages'); ?></th> |
| 32 | <td> |
| 33 | <?php if ( !$this->settings->menusDisabled() ) : ?> |
| 34 | <p data-menu-enabled-option data-menu-hide-checkbox> |
| 35 | <label> |
| 36 | <input type="checkbox" name="nestedpages_ui[hide_menu_sync]" value="true" <?php if ( $this->settings->hideMenuSync() ) echo 'checked'; ?> /> |
| 37 | <?php _e('Hide Menu Sync Checkbox', 'wp-nested-pages'); ?> (<?php echo esc_html($sync_status); ?>) |
| 38 | </label> |
| 39 | </p> |
| 40 | <?php endif; ?> |
| 41 | <p data-menu-enabled-option data-menu-disable-auto> |
| 42 | <label> |
| 43 | <input type="checkbox" name="nestedpages_ui[manual_menu_sync]" value="true" <?php if ( $this->settings->autoMenuDisabled() ) echo 'checked'; ?> data-menu-disable-auto-checkbox /> |
| 44 | <?php _e('Manually sync menu.', 'wp-nested-pages'); ?> |
| 45 | </label> |
| 46 | </p> |
| 47 | <p> |
| 48 | <label> |
| 49 | <input type="checkbox" name="nestedpages_ui[manual_page_order_sync]" value="true" <?php if ( $this->settings->autoPageOrderDisabled() ) echo 'checked'; ?> /> |
| 50 | <?php _e('Manually sync page order.', 'wp-nested-pages'); ?> |
| 51 | </label> |
| 52 | </p> |
| 53 | <p> |
| 54 | <label> |
| 55 | <input type="checkbox" name="nestedpages_disable_menu" value="true" <?php if ( $this->settings->menusDisabled() ) echo 'checked'; ?> data-disable-menu-checkbox /> |
| 56 | <?php _e('Disable menu sync completely', 'wp-nested-pages'); ?> |
| 57 | </label> |
| 58 | </p> |
| 59 | </td> |
| 60 | </tr> |
| 61 | <tr valign="top"> |
| 62 | <th scope="row"><?php _e('Allow Page Sorting', 'wp-nested-pages'); ?></th> |
| 63 | <td> |
| 64 | <?php foreach ( $this->user_repo->allRoles() as $role ) : ?> |
| 65 | <label> |
| 66 | <input type="checkbox" name="nestedpages_allowsorting[]" value="<?php echo $role['name']; ?>" <?php if ( in_array($role['name'], $allowsorting) ) echo 'checked'; ?> > |
| 67 | <?php echo esc_html($role['label']); ?> |
| 68 | </label> |
| 69 | <br /> |
| 70 | <?php endforeach; ?> |
| 71 | <input type="hidden" name="nestedpages_menusync" value="<?php echo get_option('nestedpages_menusync'); ?>"> |
| 72 | <p><em><?php _e('Admins always have sorting ability.', 'wp-nested-pages'); ?></em></p> |
| 73 | </td> |
| 74 | </tr> |
| 75 | </table> |