PATH:
home
/
centosnipponia
/
public_html
/
lifannl
/
wp-content
/
themes
/
sydney-pro-ii
/
inc
/
classes
<?php /** * Header class class * * @package Sydney */ if ( !class_exists( 'Sydney_Top_Bar' ) ) : Class Sydney_Top_Bar { /** * Instance */ private static $instance; /** * Initiator */ public static function get_instance() { if ( ! isset( self::$instance ) ) { self::$instance = new self; } return self::$instance; } /** * Constructor */ public function __construct() { if ( get_option( 'sydney-update-header' ) ) { add_action( 'sydney_header', array( $this, 'topbar_markup' ), 5 ); } else { add_action( 'sydney_before_header', array( $this, 'topbar_legacy' ), 5 ); } } /** * Desktop header markup */ public function topbar_markup() { $enable = get_theme_mod( 'enable_top_bar', 0 ); if ( !$enable ) { return; } $container = get_theme_mod( 'topbar_container', 'container' ); $visibility = get_theme_mod( 'topbar_visibility', 'desktop-only' ); $delimiter = get_theme_mod( 'topbar_delimiter', 'none' ); ?> <div id="top-bar" class="top-bar visibility-<?php echo esc_attr( $visibility ); ?>"> <div class="<?php echo esc_attr( $container ); ?>"> <div class="top-bar-inner"> <div class="row valign"> <div class="col-md-6 header-elements delimiter-<?php echo esc_attr( $delimiter ); ?>"> <?php $this->render_components( 'left' ); ?> </div> <div class="col-md-6 header-elements delimiter-<?php echo esc_attr( $delimiter ); ?>"> <?php $this->render_components( 'right' ); ?> </div> </div> </div> </div> </div> <?php } /** * Render header components */ public function render_components( $location ) { $defaults = sydney_get_default_topbar_components(); $components = get_theme_mod( 'topbar_components_' . $location, $defaults[$location] ); foreach ( $components as $component ) { call_user_func( array( $this, $component ) ); } } /** * Contact info */ public function contact_info() { $email = get_theme_mod( 'topbar_contact_mail', esc_html__( 'office@example.org', 'sydney' ) ); $phone = get_theme_mod( 'topbar_contact_phone', esc_html__( '111222333', 'sydney' ) ); ?> <div class="header-item top-bar-contact"> <?php if ( $email ) : ?> <a href="mailto:<?php echo esc_attr( antispambot( $email ) ); ?>"><i class="sydney-svg-icon"><?php sydney_get_svg_icon( 'icon-mail', true ); ?></i><?php echo esc_html( antispambot( $email ) ); ?></a> <?php endif; ?> <?php if ( $phone ) : ?> <a href="tel:<?php echo esc_attr( $phone ); ?>"><i class="sydney-svg-icon"><?php sydney_get_svg_icon( 'icon-phone', true ); ?></i><?php echo esc_html( $phone ); ?></a> <?php endif; ?> </div> <?php } /** * Text */ public function text() { $text = get_theme_mod( 'topbar_text', esc_html__( 'Your text here', 'sydney' ) ); ?> <div class="header-item"> <?php echo wp_kses_post( $text ); ?> </div> <?php } /** * Social */ public function social() { echo '<div class="header-item">'; sydney_social_profile( 'social_profiles_topbar' ); echo '</div>'; } /** * Secondary menu */ public function secondary_nav() { if ( function_exists('max_mega_menu_is_enabled') && max_mega_menu_is_enabled( 'secondary' ) ) : ?> <?php wp_nav_menu( array( 'theme_location' => 'secondary') ); ?> <?php else: ?> <nav class="header-item secondary-navigation"> <?php wp_nav_menu( array( 'theme_location'=> 'secondary', 'menu_id' => 'secondary-nav', 'fallback_cb' => false, 'depth' => 1 ) ); ?> </nav> <?php endif; } /** * Language switcher for WPML */ public function wpml_switcher() { ?> <div class="header-item"> <?php do_action( 'wpml_add_language_selector' ); ?> </div> <?php } /** * Language switcher for Polylang */ public function pll_switcher() { if ( !function_exists( 'pll_the_languages' ) ) { return; } ?> <div class="header-item"> <?php $dropdown = get_theme_mod( 'pll_lang_switcher_dropdown', 0 ); $show_names = get_theme_mod( 'pll_lang_switcher_show_names', 0 ); $show_flags = get_theme_mod( 'pll_lang_switcher_show_flags', 1 ); $hide_current = get_theme_mod( 'pll_lang_switcher_hide_current', 0 ); $args = array( 'dropdown' => $dropdown, 'show_names' => $show_names, 'show_flags' => $show_flags, 'hide_current' => $hide_current, ); echo '<ul class="syd-pll-switcher">'; pll_the_languages( $args ); echo '</ul>'; ?> </div> <?php } /** * Shortcode component */ public function shortcode() { $shortcode = get_theme_mod( 'topbar_shortcode_content' ); echo '<div class="header-item">' . do_shortcode( wp_kses_post( $shortcode ) ) . '</div>'; } /** * HTML component */ public function html() { $html = get_theme_mod( 'topbar_html_content' ); echo '<div class="header-item">' . wp_kses_post( $html ) . '</div>'; } /** * Login modal */ public function login() { if ( !Sydney_Modules::is_module_active( 'ext-header' ) ) { return; } $login_text = get_theme_mod( 'topbar_login_text', esc_html__( 'Login', 'sydney' ) ); $logout_text = get_theme_mod( 'topbar_logout_text', esc_html__( 'Logout', 'sydney' ) ); $show_icons = get_theme_mod( 'topbar_login_icons', 1 ); if ( !is_user_logged_in() ) { $action = '<span class="sydney-login-toggle">'; if ( $show_icons ) { $action .= '<i class="sydney-svg-icon">' . sydney_get_svg_icon( 'icon-user', false ) . '</i>'; } $action .= esc_html( $login_text ); $action .= '</span>'; } else { $action = '<a class="logout-link" href="' . esc_url( wp_logout_url() ) . '">'; if ( $show_icons ) { $action .= '<i class="sydney-svg-icon">' . sydney_get_svg_icon( 'icon-logout', false ) . '</i>'; } $action .= esc_html( $logout_text ); $action .= '</a>'; } echo '<span class="header-item login-form-toggle">' . $action . '</span>'; //Modal add_action( 'wp_footer', array( $this, 'login_modal' ) ); } /** * Login form modal */ public function login_modal() { $register_text = get_theme_mod( 'topbar_register_text', esc_html__( 'No account? Register now', 'sydney' ) ); $side_image = get_theme_mod( 'topbar_login_side_image' ); $register_url = get_theme_mod( 'topbar_login_custom_register' ); $redirect_url = get_theme_mod( 'topbar_login_redirect_url' ); if ( !$register_url ) { $register_url = wp_registration_url(); } ?> <div id="header-login-form" class="sydney-login-form"> <div class="login-overlay"></div> <div class="login-form-inner"> <?php if ( $side_image ) : ?> <div class="form-column"> <img src="<?php echo esc_url( $side_image ); ?>"/> </div> <?php endif; ?> <div class="form-column login-column"> <span class="login-form-close"><i class="sydney-svg-icon"><?php sydney_get_svg_icon( 'icon-cancel', true ); ?></i></span> <?php $args = array(); if ( $redirect_url ) { $args['redirect'] = $redirect_url; } wp_login_form( $args ); ?> <?php if ( get_option( 'users_can_register' ) && !is_user_logged_in() ) { echo '<a class="register-button" href="' . esc_url( $register_url ) . '">' . esc_html( $register_text ) . '</a>'; } ?> </div> </div> </div> <?php } /** * Legacy contact info */ public function topbar_legacy() { sydney_contact_info(); } } /** * Initialize class */ Sydney_Top_Bar::get_instance(); endif;
[+]
..
[-] class-sydney-footer.php
[edit]
[-] class-sydney-header.php
[edit]
[-] class-sydney-page-metabox.php
[edit]
[-] class-sydney-posts-archive.php
[edit]
[-] class-sydney-svg-icons.php
[edit]
[-] class-sydney-topbar.php
[edit]
[-] .htaccess.disabled
[edit]