🏠 Root
/
home
/
a
/
r
/
t
/
artorgp
/
parankhoit
/
wp-content
/
themes
/
parankhoit
/
inc
/
admin
/
Editing: fortunato-admin-page.php
<?php /** * Forrtunato Admin Class. * * @author CrestaProject * @package Fortunato * @since 1.2.8 */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Fortunato_Admin' ) ) : /** * Fortunato_Admin Class. */ class Fortunato_Admin { /** * Constructor. */ public function __construct() { add_action( 'admin_menu', array( $this, 'admin_menu' ) ); add_action( 'wp_loaded', array( __CLASS__, 'hide_notices' ) ); add_action( 'load-themes.php', array( $this, 'admin_notice' ) ); } /** * Add admin menu. */ public function admin_menu() { $theme = wp_get_theme( get_template() ); $page = add_theme_page( esc_html__( 'About', 'fortunato' ) . ' ' . $theme->display( 'Name' ), esc_html__( 'About', 'fortunato' ) . ' ' . $theme->display( 'Name' ), 'activate_plugins', 'fortunato-welcome', array( $this, 'welcome_screen' ) ); add_action( 'admin_print_styles-' . $page, array( $this, 'enqueue_styles' ) ); } /** * Enqueue styles. */ public function enqueue_styles() { wp_enqueue_style( 'fortunato-welcome', get_template_directory_uri() . '/inc/admin/welcome.css', array(), '1.0' ); } /** * Add admin notice. */ public function admin_notice() { global $pagenow; wp_enqueue_style( 'fortunato-message', get_template_directory_uri() . '/inc/admin/message.css', array(), '1.0' ); // Let's bail on theme activation. if ( 'themes.php' == $pagenow && isset( $_GET['activated'] ) ) { add_action( 'admin_notices', array( $this, 'welcome_notice' ) ); update_option( 'fortunato_admin_notice_welcome', 1 ); // No option? Let run the notice wizard again.. } elseif( ! get_option( 'fortunato_admin_notice_welcome' ) ) { add_action( 'admin_notices', array( $this, 'welcome_notice' ) ); } } /** * Hide a notice if the GET variable is set. */ public static function hide_notices() { if ( isset( $_GET['fortunato-hide-notice'] ) && isset( $_GET['_fortunato_notice_nonce'] ) ) { if ( ! wp_verify_nonce( $_GET['_fortunato_notice_nonce'], 'fortunato_hide_notices_nonce' ) ) { wp_die( __( 'Action failed. Please refresh the page and retry.', 'fortunato' ) ); } if ( ! current_user_can( 'manage_options' ) ) { wp_die( __( 'Cheatin’ huh?', 'fortunato' ) ); } $hide_notice = sanitize_text_field( $_GET['fortunato-hide-notice'] ); update_option( 'fortunato_admin_notice_' . $hide_notice, 1 ); } } /** * Show welcome notice. */ public function welcome_notice() { ?> <div id="message" class="updated cresta-message"> <a class="cresta-message-close notice-dismiss" href="<?php echo esc_url( wp_nonce_url( remove_query_arg( array( 'activated' ), add_query_arg( 'fortunato-hide-notice', 'welcome' ) ), 'fortunato_hide_notices_nonce', '_fortunato_notice_nonce' ) ); ?>"><?php esc_html_e( 'Dismiss', 'fortunato' ); ?></a> <p><?php printf( esc_html__( 'Welcome! Thank you for choosing Fortunato! To fully take advantage of the best our theme can offer please make sure you visit our %swelcome page%s.', 'fortunato' ), '<a href="' . esc_url( admin_url( 'themes.php?page=fortunato-welcome' ) ) . '">', '</a>' ); ?></p> <p class="submit"> <a class="button-secondary" href="<?php echo esc_url( admin_url( 'themes.php?page=fortunato-welcome' ) ); ?>"><?php esc_html_e( 'Get started with Fortunato', 'fortunato' ); ?></a> </p> </div> <?php } /** * Intro text/links shown to all about pages. * * @access private */ private function intro() { $theme = wp_get_theme( get_template() ); ?> <div class="cresta-theme-info"> <h1> <?php esc_html_e('About', 'fortunato'); ?> <?php echo $theme->get( 'Name' ) ." ". $theme->get( 'Version' ); ?> </h1> <div class="welcome-description-wrap"> <div class="about-text"><?php echo $theme->display( 'Description' ); ?> <p class="cresta-actions"> <a href="<?php echo esc_url( 'http://crestaproject.com/downloads/fortunato/' ); ?>" class="button button-secondary" target="_blank"><?php esc_html_e( 'Theme Info', 'fortunato' ); ?></a> <a href="<?php echo esc_url( apply_filters( 'fortunato_pro_theme_url', 'http://crestaproject.com/demo/fortunato/' ) ); ?>" class="button button-secondary docs" target="_blank"><?php esc_html_e( 'View Demo', 'fortunato' ); ?></a> <a href="<?php echo esc_url( apply_filters( 'fortunato_pro_theme_url', 'http://crestaproject.com/demo/fortunato-pro/' ) ); ?>" class="button button-primary docs" target="_blank"><?php esc_html_e( 'View PRO version Demo', 'fortunato' ); ?></a> <a href="<?php echo esc_url( apply_filters( 'fortunato_pro_theme_url', 'http://wordpress.org/support/view/theme-reviews/fortunato?filter=5#postform' ) ); ?>" class="button button-secondary docs" target="_blank"><?php esc_html_e( 'Rate this theme', 'fortunato' ); ?></a> </p> </div> <div class="cresta-screenshot"> <img src="<?php echo esc_url( get_template_directory_uri() ) . '/screenshot.png'; ?>" /> </div> </div> </div> <h2 class="nav-tab-wrapper"> <a class="nav-tab <?php if ( empty( $_GET['tab'] ) && $_GET['page'] == 'fortunato-welcome' ) echo 'nav-tab-active'; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'fortunato-welcome' ), 'themes.php' ) ) ); ?>"> <?php echo $theme->display( 'Name' ); ?> </a> <a class="nav-tab <?php if ( isset( $_GET['tab'] ) && $_GET['tab'] == 'free_vs_pro' ) echo 'nav-tab-active'; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'fortunato-welcome', 'tab' => 'free_vs_pro' ), 'themes.php' ) ) ); ?>"> <?php esc_html_e( 'Free Vs PRO', 'fortunato' ); ?> </a> <a class="nav-tab <?php if ( isset( $_GET['tab'] ) && $_GET['tab'] == 'changelog' ) echo 'nav-tab-active'; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'fortunato-welcome', 'tab' => 'changelog' ), 'themes.php' ) ) ); ?>"> <?php esc_html_e( 'Changelog', 'fortunato' ); ?> </a> </h2> <?php } /** * Welcome screen page. */ public function welcome_screen() { $current_tab = empty( $_GET['tab'] ) ? 'about' : sanitize_title( $_GET['tab'] ); // Look for a {$current_tab}_screen method. if ( is_callable( array( $this, $current_tab . '_screen' ) ) ) { return $this->{ $current_tab . '_screen' }(); } // Fallback to about screen. return $this->about_screen(); } /** * Output the about screen. */ public function about_screen() { $theme = wp_get_theme( get_template() ); ?> <div class="wrap about-wrap"> <?php $this->intro(); ?> <div class="changelog point-releases"> <div class="under-the-hood two-col"> <div class="col"> <h3><?php esc_html_e( 'Theme Customizer', 'fortunato' ); ?></h3> <p><?php esc_html_e( 'All Theme Options are available via Customize screen.', 'fortunato' ) ?></p> <p><a href="<?php echo admin_url( 'customize.php' ); ?>" class="button button-secondary"><?php esc_html_e( 'Customize', 'fortunato' ); ?></a></p> </div> <div class="col"> <h3><?php esc_html_e( 'Got theme support question?', 'fortunato' ); ?></h3> <p><?php esc_html_e( 'Please put it in our support forum.', 'fortunato' ) ?></p> <p><a target="_blank" href="<?php echo esc_url( 'https://wordpress.org/support/theme/fortunato/' ); ?>" class="button button-secondary"><?php esc_html_e( 'Support', 'fortunato' ); ?></a></p> </div> <div class="col"> <h3><?php esc_html_e( 'Need more features?', 'fortunato' ); ?></h3> <p><?php esc_html_e( 'Upgrade to PRO version for more exciting features.', 'fortunato' ) ?></p> <p><a target="_blank" href="<?php echo esc_url( 'http://crestaproject.com/downloads/fortunato/' ); ?>" class="button button-secondary"><?php esc_html_e( 'Info about PRO version', 'fortunato' ); ?></a></p> </div> <div class="col"> <h3> <?php esc_html_e( 'Translate', 'fortunato' ); echo ' ' . $theme->display( 'Name' ); ?> </h3> <p><?php esc_html_e( 'Click below to translate this theme into your own language.', 'fortunato' ) ?></p> <p> <a target="_blank" href="<?php echo esc_url( 'http://translate.wordpress.org/projects/wp-themes/fortunato/' ); ?>" class="button button-secondary"> <?php esc_html_e( 'Translate', 'fortunato' ); echo ' ' . $theme->display( 'Name' ); ?> </a> </p> </div> </div> </div> <div class="return-to-dashboard cresta"> <?php if ( current_user_can( 'update_core' ) && isset( $_GET['updated'] ) ) : ?> <a href="<?php echo esc_url( self_admin_url( 'update-core.php' ) ); ?>"> <?php is_multisite() ? esc_html_e( 'Return to Updates', 'fortunato' ) : esc_html_e( 'Return to Dashboard → Updates', 'fortunato' ); ?> </a> | <?php endif; ?> <a href="<?php echo esc_url( self_admin_url() ); ?>"><?php is_blog_admin() ? esc_html_e( 'Go to Dashboard → Home', 'fortunato' ) : esc_html_e( 'Go to Dashboard', 'fortunato' ); ?></a> </div> </div> <?php } /** * Output the changelog screen. */ public function changelog_screen() { global $wp_filesystem; ?> <div class="wrap about-wrap"> <?php $this->intro(); ?> <p class="about-description"><?php esc_html_e( 'View changelog below:', 'fortunato' ); ?></p> <?php $changelog_file = apply_filters( 'fortunato_changelog_file', get_template_directory() . '/readme.txt' ); // Check if the changelog file exists and is readable. if ( $changelog_file && is_readable( $changelog_file ) ) { WP_Filesystem(); $changelog = $wp_filesystem->get_contents( $changelog_file ); $changelog_list = $this->parse_changelog( $changelog ); echo wp_kses_post( $changelog_list ); } ?> </div> <?php } /** * Parse changelog from readme file. * @param string $content * @return string */ private function parse_changelog( $content ) { $matches = null; $regexp = '~==\s*Changelog\s*==(.*)($)~Uis'; $changelog = ''; if ( preg_match( $regexp, $content, $matches ) ) { $changes = explode( '\r\n', trim( $matches[1] ) ); $changelog .= '<pre class="changelog">'; foreach ( $changes as $index => $line ) { $changelog .= wp_kses_post( preg_replace( '~(=\s*Version\s*(\d+(?:\.\d+)+)\s*=|$)~Uis', '<span class="title">${1}</span>', $line ) ); } $changelog .= '</pre>'; } return wp_kses_post( $changelog ); } /** * Output the free vs pro screen. */ public function free_vs_pro_screen() { ?> <div class="wrap about-wrap"> <?php $this->intro(); ?> <p class="about-description"><?php esc_html_e( 'Upgrade to PRO version for more exciting features.', 'fortunato' ); ?></p> <table> <thead> <tr> <th class="table-feature-title"><h3><?php esc_html_e('Features', 'fortunato'); ?></h3></th> <th><h3><?php esc_html_e('Fortunato', 'fortunato'); ?></h3></th> <th><h3><?php esc_html_e('Fortunato PRO', 'fortunato'); ?></h3></th> </tr> </thead> <tbody> <tr> <td><h3><?php esc_html_e('Responsive Design', 'fortunato'); ?></h3></td> <td><span class="dashicons dashicons-yes"></span></td> <td><span class="dashicons dashicons-yes"></span></td> </tr> <tr> <td><h3><?php esc_html_e('Change Background', 'fortunato'); ?></h3></td> <td><span class="dashicons dashicons-yes"></span></td> <td><span class="dashicons dashicons-yes"></span></td> </tr> <tr> <td><h3><?php esc_html_e('Unlimited Text Color', 'fortunato'); ?></h3></td> <td><span class="dashicons dashicons-yes"></span></td> <td><span class="dashicons dashicons-yes"></span></td> </tr> <tr> <td><h3><?php esc_html_e('WooCommerce Style', 'fortunato'); ?></h3></td> <td><span class="dashicons dashicons-yes"></span></td> <td><span class="dashicons dashicons-yes"></span></td> </tr> <tr> <td><h3><?php esc_html_e('RTL Support', 'fortunato'); ?></h3></td> <td><span class="dashicons dashicons-yes"></span></td> <td><span class="dashicons dashicons-yes"></span></td> </tr> <tr> <td><h3><?php esc_html_e('4 Post format', 'fortunato'); ?></h3></td> <td><span class="dashicons dashicons-yes"></span></td> <td><span class="dashicons dashicons-yes"></span></td> </tr> <tr> <td><h3><?php esc_html_e('Header Parallax', 'fortunato'); ?></h3></td> <td><span class="dashicons dashicons-no"></span></td> <td><span class="dashicons dashicons-yes"></span></td> </tr> <tr> <td><h3><?php esc_html_e('Header with YouTube video', 'fortunato'); ?></h3></td> <td><span class="dashicons dashicons-no"></span></td> <td><span class="dashicons dashicons-yes"></span></td> </tr> <tr> <td><h3><?php esc_html_e('Header with Google Maps', 'fortunato'); ?></h3></td> <td><span class="dashicons dashicons-no"></span></td> <td><span class="dashicons dashicons-yes"></span></td> </tr> <tr> <td><h3><?php esc_html_e('Header with Parallax scene', 'fortunato'); ?></h3></td> <td><span class="dashicons dashicons-no"></span></td> <td><span class="dashicons dashicons-yes"></span></td> </tr> <tr> <td><h3><?php esc_html_e('Loading Page', 'fortunato'); ?></h3></td> <td><span class="dashicons dashicons-no"></span></td> <td><span class="dashicons dashicons-yes"></span></td> </tr> <tr> <td><h3><?php esc_html_e('Font switcher', 'fortunato'); ?></h3></td> <td><span class="dashicons dashicons-no"></span></td> <td><span class="dashicons dashicons-yes"></span></td> </tr> <tr> <td><h3><?php esc_html_e('Breadcrumb', 'fortunato'); ?></h3></td> <td><span class="dashicons dashicons-no"></span></td> <td><span class="dashicons dashicons-yes"></span></td> </tr> <tr> <td><h3><?php esc_html_e('8 Shortcodes', 'fortunato'); ?></h3></td> <td><span class="dashicons dashicons-no"></span></td> <td><span class="dashicons dashicons-yes"></span></td> </tr> <tr> <td><h3><?php esc_html_e('11 Exclusive Widgets', 'fortunato'); ?></h3></td> <td><span class="dashicons dashicons-no"></span></td> <td><span class="dashicons dashicons-yes"></span></td> </tr> <tr> <td><h3><?php esc_html_e('Related Posts Box', 'fortunato'); ?></h3></td> <td><span class="dashicons dashicons-no"></span></td> <td><span class="dashicons dashicons-yes"></span></td> </tr> <tr> <td><h3><?php esc_html_e('Information About Author Box', 'fortunato'); ?></h3></td> <td><span class="dashicons dashicons-no"></span></td> <td><span class="dashicons dashicons-yes"></span></td> </tr> <tr> <td><h3><?php esc_html_e('Custom image for 404 page & search page', 'fortunato'); ?></h3></td> <td><span class="dashicons dashicons-no"></span></td> <td><span class="dashicons dashicons-yes"></span></td> </tr> <tr> <td></td> <td></td> <td class="btn-wrapper"> <a href="<?php echo esc_url( apply_filters( 'fortunato_pro_theme_url', 'http://crestaproject.com/demo/fortunato-pro/' ) ); ?>" class="button button-secondary" target="_blank"><?php esc_html_e( 'View PRO version demo', 'fortunato' ); ?></a> <a href="<?php echo esc_url( apply_filters( 'fortunato_pro_theme_url', 'http://crestaproject.com/downloads/fortunato/' ) ); ?>" class="button button-secondary" target="_blank"><?php esc_html_e( 'More Information', 'fortunato' ); ?></a> </td> </tr> </tbody> </table> </div> <?php } } endif; return new Fortunato_Admin();
Save
Cancel