listing.php
110 lines
| 1 | <?php |
| 2 | $wpml_pages = ( $this->integrations->plugins->wpml->installed && $this->integrations->plugins->wpml->isDefaultLanguage()) ? true : false; |
| 3 | if ( !$this->integrations->plugins->wpml->installed ) $wpml_pages = true; |
| 4 | ?> |
| 5 | <div class="wrap nestedpages"> |
| 6 | <h2 class="nestedpages-listing-title"> |
| 7 | <?php esc_html_e($this->post_type->labels->name); ?> |
| 8 | |
| 9 | <a href="<?php echo $this->post_type_repo->addNewPostLink($this->post_type->name); ?>" class="add-new-h2"> |
| 10 | <?php esc_html_e($this->post_type->labels->add_new); ?> |
| 11 | </a> |
| 12 | |
| 13 | <?php if ( current_user_can('publish_pages') && !$this->listing_repo->isSearch() && $wpml_pages ) : ?> |
| 14 | <a href="#" class="add-new-h2 open-bulk-modal" title="<?php _e('Add Multiple', 'wp-nested-pages'); ?>" data-parentid="0"> |
| 15 | <?php esc_html_e('Add Multiple', 'wp-nested-pages'); ?> |
| 16 | </a> |
| 17 | <?php endif; ?> |
| 18 | |
| 19 | <?php if ( current_user_can('publish_pages') && $this->post_type->name == 'page' && !$this->listing_repo->isSearch() && !$this->settings->menusDisabled() && !$this->integrations->plugins->wpml->installed ) : ?> |
| 20 | <a href="#" class="add-new-h2 open-redirect-modal" title="<?php _e('Add Link', 'wp-nested-pages'); ?>" data-parentid="0"> |
| 21 | <?php esc_html_e('Add Link', 'wp-nested-pages'); ?> |
| 22 | </a> |
| 23 | <?php endif; ?> |
| 24 | </h2> |
| 25 | |
| 26 | <?php if ( $this->confirmation->getMessage() ) : ?> |
| 27 | <div id="message" class="updated notice is-dismissible"><p><?php echo $this->confirmation->getMessage(); ?></p><button type="button" class="notice-dismiss"><span class="screen-reader-text"><?php esc_html_e('Dismiss this notice.', 'wp-nested-pages'); ?></span></button></div> |
| 28 | <?php endif; ?> |
| 29 | |
| 30 | <div data-nestedpages-error class="updated error notice is-dismissible" style="display:none;"><p></p><button type="button" class="notice-dismiss"><span class="screen-reader-text"><?php esc_html_e('Dismiss this notice.', 'wp-nested-pages'); ?></span></button></div> |
| 31 | |
| 32 | <div class="nestedpages-top-toggles"> |
| 33 | <?php if ( $this->post_type->hierarchical && !$this->listing_repo->isSearch() ) : ?> |
| 34 | <a href="#" class="np-btn nestedpages-toggleall" data-toggle="closed"><?php esc_html_e('Expand All', 'wp-nested-pages'); ?></a> |
| 35 | <?php endif; ?> |
| 36 | |
| 37 | <?php if ( $this->user->canSortPages() && !$this->listing_repo->isSearch() && !$this->listing_repo->isFiltered() ) : ?> |
| 38 | <div class="np-sync-menu-cont" <?php if ( $this->confirmation->getMessage() ) echo 'style="margin-top:2px;"';?>> |
| 39 | |
| 40 | <?php if ( $this->settings->autoPageOrderDisabled() ) : ?> |
| 41 | <a href="#" class="np-btn" data-np-manual-order-sync><?php echo __('Sync', 'wp-nested-pages') . ' ' . esc_html($this->post_type->labels->singular_name) . ' ' . __('Order', 'wp-nested-pages'); ?></a> |
| 42 | <?php endif; ?> |
| 43 | |
| 44 | <?php |
| 45 | $wpml = $this->integrations->plugins->wpml->installed; |
| 46 | $primary_language = ( $wpml && $this->integrations->plugins->wpml->isDefaultLanguage() ) ? true : false; |
| 47 | if ( !$wpml ) $primary_language = true; |
| 48 | |
| 49 | if ( $this->post_type->name == 'page' && |
| 50 | !$this->settings->hideMenuSync() && |
| 51 | !$this->settings->menusDisabled() && |
| 52 | $primary_language ) : |
| 53 | ?> |
| 54 | |
| 55 | <?php if ( !$this->settings->autoMenuDisabled() ) : ?> |
| 56 | <label> |
| 57 | <input type="checkbox" name="np_sync_menu" class="np-sync-menu" value="sync" <?php if ( get_option('nestedpages_menusync') == 'sync' ) echo 'checked'; ?>/> |
| 58 | <?php |
| 59 | esc_html_e('Sync Menu', 'wp-nested-pages'); |
| 60 | if ( $wpml ) echo ' (' . esc_html($this->integrations->plugins->wpml->getCurrentLanguage('name')) . ')'; |
| 61 | ?> |
| 62 | </label> |
| 63 | <?php else : ?> |
| 64 | <a href="#" class="np-btn" data-np-manual-menu-sync><?php esc_html_e('Sync Menu', 'wp-nested-pages'); ?></a> |
| 65 | <?php endif; ?> |
| 66 | |
| 67 | |
| 68 | <?php endif; ?> |
| 69 | |
| 70 | <?php if ( $wpml && !$primary_language ) echo $this->integrations->plugins->wpml->syncMenusButton(); ?> |
| 71 | |
| 72 | </div> |
| 73 | <?php endif; ?> |
| 74 | |
| 75 | <img src="<?php echo NestedPages\Helpers::plugin_url(); ?>/assets/images/spinner-2x.gif" alt="loading" id="nested-loading" /> |
| 76 | </div><!-- .nestedpages-top-toggles --> |
| 77 | |
| 78 | <?php include(NestedPages\Helpers::view('partials/tool-list')); ?> |
| 79 | |
| 80 | <div id="np-error" class="updated error" style="clear:both;display:none;"></div> |
| 81 | |
| 82 | |
| 83 | <div class="nestedpages"> |
| 84 | <?php $this->getPosts(); ?> |
| 85 | |
| 86 | <div class="quick-edit quick-edit-form np-inline-modal" style="display:none;"> |
| 87 | <?php include( NestedPages\Helpers::view('forms/quickedit-post') ); ?> |
| 88 | </div> |
| 89 | |
| 90 | <?php if ( current_user_can('publish_pages') && !$this->integrations->plugins->wpml->installed ) : ?> |
| 91 | <div class="quick-edit quick-edit-form-redirect np-inline-modal" style="display:none;"> |
| 92 | <?php include( NestedPages\Helpers::view('forms/quickedit-link') ); ?> |
| 93 | </div> |
| 94 | |
| 95 | <div class="new-child new-child-form np-inline-modal" style="display:none;"> |
| 96 | <?php include( NestedPages\Helpers::view('forms/new-child') ); ?> |
| 97 | </div> |
| 98 | <?php endif; ?> |
| 99 | </div> |
| 100 | |
| 101 | </div><!-- .wrap --> |
| 102 | |
| 103 | <?php |
| 104 | include( NestedPages\Helpers::view('forms/more-options-modal') ); |
| 105 | include( NestedPages\Helpers::view('forms/empty-trash-modal') ); |
| 106 | include( NestedPages\Helpers::view('forms/clone-form') ); |
| 107 | if ( !$this->integrations->plugins->wpml->installed) include( NestedPages\Helpers::view('forms/link-form') ); |
| 108 | include( NestedPages\Helpers::view('forms/bulk-add') ); |
| 109 | include( NestedPages\Helpers::view('forms/delete-confirmation-modal') ); |
| 110 | if ( $this->integrations->plugins->wpml->installed ) include( NestedPages\Helpers::view('partials/wpml-translations') ); |