addons.php
7 years ago
class-strong-testimonials-about.php
7 years ago
how-to.php
7 years ago
links.php
7 years ago
privacy.php
7 years ago
upsell.php
7 years ago
whats-new.php
7 years ago
class-strong-testimonials-about.php
102 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Class Strong_Testimonials_About |
| 4 | * |
| 5 | * @since 2.27.0 |
| 6 | */ |
| 7 | class Strong_Testimonials_About { |
| 8 | |
| 9 | /** |
| 10 | * Strong_Testimonials_About constructor. |
| 11 | */ |
| 12 | public function __construct() { |
| 13 | $this->add_actions(); |
| 14 | } |
| 15 | |
| 16 | /** |
| 17 | * Add actions and filters. |
| 18 | */ |
| 19 | public function add_actions() { |
| 20 | add_filter( 'wpmtst_submenu_pages', array( $this, 'add_submenu' ) ); |
| 21 | } |
| 22 | |
| 23 | /** |
| 24 | * Add submenu page. |
| 25 | * |
| 26 | * @param $pages |
| 27 | * |
| 28 | * @return mixed |
| 29 | */ |
| 30 | public function add_submenu( $pages ) { |
| 31 | $pages[90] = $this->get_submenu(); |
| 32 | return $pages; |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * Return submenu page parameters. |
| 37 | * |
| 38 | * @return array |
| 39 | */ |
| 40 | public function get_submenu() { |
| 41 | return array( |
| 42 | 'page_title' => __( 'About', 'strong-testimonials' ), |
| 43 | 'menu_title' => __( 'About', 'strong-testimonials' ), |
| 44 | 'capability' => 'strong_testimonials_about', |
| 45 | 'menu_slug' => 'about-strong-testimonials', |
| 46 | 'function' => array( $this, 'about_page' ), |
| 47 | ); |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * Print the About page. |
| 52 | */ |
| 53 | public function about_page() { |
| 54 | $major_minor = strtok( WPMTST_VERSION, '.' ) . '.' . strtok( '.' ); |
| 55 | $active_tab = isset( $_GET['tab'] ) ? $_GET['tab'] : 'how-to'; |
| 56 | $url = admin_url( 'edit.php?post_type=wpm-testimonial&page=about-strong-testimonials' ); |
| 57 | ?> |
| 58 | <div class="wrap about-wrap"> |
| 59 | |
| 60 | <img class="wpmst-mascot" src="<?php echo esc_url( WPMTST_ADMIN_URL ); ?>/img/mascot.png" /> |
| 61 | |
| 62 | <?php /* translators: %s is the plugin version number */ ?> |
| 63 | <h1><?php printf( __( 'Welcome to Strong Testimonials %s', 'strong-testimonials' ), $major_minor ); ?></h1> |
| 64 | |
| 65 | <p class="about-text"> |
| 66 | <?php esc_html_e( 'Thank you for updating to the latest version!', 'strong-testimonials' ); ?> |
| 67 | <?php /* translators: %s is the plugin version number */ ?> |
| 68 | </p> |
| 69 | <br/> |
| 70 | |
| 71 | <h2 class="nav-tab-wrapper wp-clearfix"> |
| 72 | |
| 73 | <a href="<?php echo add_query_arg( 'tab', 'how-to', $url ); ?>" class="nav-tab <?php echo $active_tab == 'how-to' ? 'nav-tab-active' : ''; ?>"><?php _e( 'How To', 'strong-testimonials' ); ?></a> |
| 74 | <a href="<?php echo esc_url( add_query_arg( 'tab', 'privacy', $url ) ); ?>" class="nav-tab <?php echo $active_tab == 'privacy' ? 'nav-tab-active' : ''; ?>"><?php esc_html_e( 'Privacy', 'strong-testimonials' ); ?></a> |
| 75 | |
| 76 | </h2> |
| 77 | |
| 78 | |
| 79 | <?php |
| 80 | switch( $active_tab ) { |
| 81 | case 'privacy': |
| 82 | include WPMTST_ADMIN . 'about/privacy.php'; |
| 83 | break; |
| 84 | default: |
| 85 | include WPMTST_ADMIN . 'about/how-to.php'; |
| 86 | break; |
| 87 | } |
| 88 | |
| 89 | include WPMTST_ADMIN . 'about/upsell.php'; |
| 90 | include WPMTST_ADMIN . 'about/links.php'; |
| 91 | include WPMTST_ADMIN . 'about/addons.php'; |
| 92 | ?> |
| 93 | |
| 94 | </div> |
| 95 | <?php |
| 96 | } |
| 97 | |
| 98 | |
| 99 | } |
| 100 | |
| 101 | new Strong_Testimonials_About(); |
| 102 |