manage-tokens.php
1 year ago
settings-log.php
1 year ago
status.php
1 year ago
tutor_pages.php
3 years ago
tutor_pages.php
124 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Tutor pages |
| 4 | * |
| 5 | * @package Tutor\Views |
| 6 | * @author Themeum <support@themeum.com> |
| 7 | * @link https://themeum.com |
| 8 | * @since 2.0.0 |
| 9 | */ |
| 10 | |
| 11 | $tutor_pages = tutor_utils()->tutor_pages(); |
| 12 | ?> |
| 13 | |
| 14 | <div id="tools-tutor-pages" class="tools-tutor-pages"> |
| 15 | <table class="tutor-table tutor-pages-table"> |
| 16 | <thead> |
| 17 | <tr> |
| 18 | <th><?php esc_html_e( 'ID', 'tutor' ); ?></th> |
| 19 | <th><?php esc_html_e( 'Page Name', 'tutor' ); ?></th> |
| 20 | <th><?php esc_html_e( 'Status', 'tutor' ); ?></th> |
| 21 | </tr> |
| 22 | </thead> |
| 23 | <tbody> |
| 24 | <?php |
| 25 | foreach ( $tutor_pages as $page ) { |
| 26 | $page_id = $page['page_id']; |
| 27 | ?> |
| 28 | <tr> |
| 29 | <td><?php echo esc_attr( $page_id ); ?></td> |
| 30 | <td> |
| 31 | <p> |
| 32 | <?php |
| 33 | if ( $page['page_exists'] ) { |
| 34 | $edit_url = admin_url( "post.php?post={$page_id}&action=edit" ); |
| 35 | echo '<a href="' . esc_url( $edit_url ) . '" target="_blank">' . esc_html( $page['page_name'] ) . '</a>'; |
| 36 | } else { |
| 37 | echo esc_html( $page['page_name'] ); |
| 38 | } |
| 39 | ?> |
| 40 | </p> |
| 41 | </td> |
| 42 | |
| 43 | <td> |
| 44 | <?php if ( ! $page_id ) : ?> |
| 45 | <p style="color: red;"> |
| 46 | <i class="dashicons dashicons-warning"></i> <?php esc_html_e( ' Page not set', 'tutor' ); ?> |
| 47 | </p> |
| 48 | <?php endif; ?> |
| 49 | |
| 50 | <?php if ( ! $page['page_exists'] ) : ?> |
| 51 | <p style="color: red;"> |
| 52 | <i class="dashicons dashicons-warning"></i> |
| 53 | <?php esc_html_e( ' Page deleted, please set new one', 'tutor' ); ?> |
| 54 | </p> |
| 55 | <?php endif; ?> |
| 56 | |
| 57 | <?php if ( $page['page_exists'] && ! $page['page_visible'] ) : ?> |
| 58 | <p style="color: red;"> |
| 59 | <i class="dashicons dashicons-warning"></i> |
| 60 | <?php esc_html_e( 'Page visibility is not public', 'tutor' ); ?> |
| 61 | </p> |
| 62 | <?php endif; ?> |
| 63 | |
| 64 | <?php |
| 65 | if ( $page['page_exists'] && $page['page_visible'] ) { |
| 66 | $page = get_post( $page_id ); |
| 67 | echo '<a href="' . esc_url( get_permalink( $page ) ) . '" target="_blank" style="color: green;"> |
| 68 | <i class="dashicons dashicons-yes-alt"></i> /' . esc_attr( $page->post_name ) . ' |
| 69 | </a>'; |
| 70 | } |
| 71 | ?> |
| 72 | </td> |
| 73 | </tr> |
| 74 | <?php |
| 75 | } |
| 76 | ?> |
| 77 | <tr> |
| 78 | <td><?php echo esc_html( $page_id ); ?></td> |
| 79 | <td> |
| 80 | <?php |
| 81 | echo '<p>'; |
| 82 | |
| 83 | if ( $page['page_exists'] ) { |
| 84 | $edit_url = admin_url( "post.php?post={$page_id}&action=edit" ); |
| 85 | echo "<a href=' " . esc_url( $edit_url ) . " ' target='_blank'>"; |
| 86 | } |
| 87 | echo esc_html( $page['page_name'] ); |
| 88 | |
| 89 | if ( $page['page_exists'] ) { |
| 90 | echo '</a>'; |
| 91 | } |
| 92 | echo '</p>'; |
| 93 | ?> |
| 94 | </td> |
| 95 | |
| 96 | <td> |
| 97 | <?php |
| 98 | if ( ! $page_id ) { |
| 99 | echo '<p style="color: red;">'; |
| 100 | echo "<i class='dashicons dashicons-warning'></i> "; |
| 101 | esc_html_e( ' Page not set', 'tutor' ); |
| 102 | echo '</p>'; |
| 103 | } |
| 104 | ?> |
| 105 | |
| 106 | <form action="" method="post"> |
| 107 | <?php |
| 108 | tutor_action_field( 'regenerate_tutor_pages' ); |
| 109 | tutor_nonce_field(); |
| 110 | ?> |
| 111 | |
| 112 | <p> |
| 113 | <button class="tutor-btn" type="submit"><?php esc_html_e( 'Re-Generate Tutor Pages', 'tutor' ); ?></button> |
| 114 | </p> |
| 115 | </form> |
| 116 | </td> |
| 117 | </tr> |
| 118 | </tbody> |
| 119 | </table> |
| 120 | <?php |
| 121 | tutor_alert( __( 'Note: This tool will install all the missing Tutor pages. Pages already defined and set up will not be replaced.', 'tutor' ), 'info' ); |
| 122 | ?> |
| 123 | </div> |
| 124 |