Addons.php
8 years ago
Columns.php
8 years ago
Help.php
8 years ago
Settings.php
8 years ago
Upgrade.php
8 years ago
Welcome.php
8 years ago
Welcome.php
98 lines
| 1 | <?php |
| 2 | |
| 3 | if ( ! defined( 'ABSPATH' ) ) { |
| 4 | exit; |
| 5 | } |
| 6 | |
| 7 | class AC_Admin_Page_Welcome extends AC_Admin_Page { |
| 8 | |
| 9 | public function __construct() { |
| 10 | $this |
| 11 | ->set_slug( 'welcome' ) |
| 12 | ->set_label( __( 'Welcome', 'codepress-admin-columns' ) ) |
| 13 | ->set_show_in_menu( false ); |
| 14 | } |
| 15 | |
| 16 | private function get_sub_tabs() { |
| 17 | return array( |
| 18 | '' => 'Welcome', |
| 19 | 'changelog' => 'Changelog', |
| 20 | ); |
| 21 | } |
| 22 | |
| 23 | private function get_current_tab() { |
| 24 | return filter_input( INPUT_GET, 'sub_tab' ); |
| 25 | } |
| 26 | |
| 27 | private function display_changelog() { |
| 28 | ?> |
| 29 | <h3><?php echo __( "Changelog for", 'codepress-admin-columns' ) . ' ' . AC()->get_version(); ?></h3> |
| 30 | <?php |
| 31 | |
| 32 | $items = file_get_contents( AC()->get_plugin_dir() . 'readme.txt' ); |
| 33 | $items = explode( '= ' . AC()->get_version() . ' =', $items ); |
| 34 | $items = end( $items ); |
| 35 | $items = explode( "\n\n", $items ); |
| 36 | |
| 37 | $changelog = false; |
| 38 | foreach ( $items as $item ) { |
| 39 | if ( 0 === strpos( $item, '*' ) ) { |
| 40 | $changelog = $item; |
| 41 | break; |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | $items = array_filter( array_map( 'trim', explode( "*", $changelog ) ) ); |
| 46 | ?> |
| 47 | <ul class="cpac-changelog"> |
| 48 | <?php echo implode( '<br/>', $items ); ?> |
| 49 | </ul> |
| 50 | <?php |
| 51 | } |
| 52 | |
| 53 | public function display() { |
| 54 | ?> |
| 55 | |
| 56 | <div id="cpac-welcome" class="wrap about-wrap"> |
| 57 | |
| 58 | <h1><?php echo __( "Welcome to Admin Columns", 'codepress-admin-columns' ) . ' ' . AC()->get_version(); ?></h1> |
| 59 | |
| 60 | <div class="about-text"> |
| 61 | <?php _e( "Thank you for updating to the latest version!", 'codepress-admin-columns' ); ?> |
| 62 | <?php _e( "Admin Columns is more polished and enjoyable than ever before. We hope you like it.", 'codepress-admin-columns' ); ?> |
| 63 | </div> |
| 64 | |
| 65 | <div class="cpac-content-body"> |
| 66 | <h2 class="nav-tab-wrapper"> |
| 67 | <?php foreach ( $this->get_sub_tabs() as $slug => $label ) { |
| 68 | echo ac_helper()->html->link( add_query_arg( array( 'sub_tab' => $slug ), $this->get_link() ), $label, array( 'class' => 'cpac-tab-toggle nav-tab' . ( $this->get_current_tab() == $slug ? ' nav-tab-active' : '' ) ) ); |
| 69 | } ?> |
| 70 | |
| 71 | </h2> |
| 72 | |
| 73 | <?php switch ( $this->get_current_tab() ) { |
| 74 | |
| 75 | case 'changelog' : |
| 76 | $this->display_changelog(); |
| 77 | break; |
| 78 | |
| 79 | default : |
| 80 | ?> |
| 81 | <h3>Changes</h3> |
| 82 | <p>*</p> |
| 83 | <?php |
| 84 | } |
| 85 | ?> |
| 86 | |
| 87 | </div> |
| 88 | |
| 89 | <div class="cpac-content-footer"> |
| 90 | <a class="button-primary button-large" href="<?php echo esc_url( AC()->admin_columns_screen()->get_link() ); ?>"><?php _e( "Start using Admin Columns", 'codepress-admin-columns' ); ?></a> |
| 91 | </div> |
| 92 | |
| 93 | </div> |
| 94 | <?php |
| 95 | } |
| 96 | |
| 97 | } |
| 98 |