first commit
This commit is contained in:
@@ -0,0 +1,421 @@
|
||||
<?php
|
||||
|
||||
foreach ( glob( ELATED_FRAMEWORK_HEADER_TYPES_ROOT_DIR . '/*/admin/custom-styles/*.php' ) as $options_load ) {
|
||||
include_once $options_load;
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_header_menu_area_styles' ) ) {
|
||||
/**
|
||||
* Generates styles for menu area
|
||||
*/
|
||||
function calla_elated_header_menu_area_styles() {
|
||||
|
||||
$background_color = calla_elated_options()->getOptionValue( 'menu_area_background_color' );
|
||||
$background_color_transparency = calla_elated_options()->getOptionValue( 'menu_area_background_transparency' );
|
||||
$menu_area_height = calla_elated_options()->getOptionValue( 'menu_area_height' );
|
||||
$menu_area_shadow = calla_elated_options()->getOptionValue( 'menu_area_shadow' );
|
||||
$border = calla_elated_options()->getOptionValue( 'menu_area_border' );
|
||||
$border_color = calla_elated_options()->getOptionValue( 'menu_area_border_color' );
|
||||
|
||||
$menu_area_in_grid = calla_elated_options()->getOptionValue( 'menu_area_in_grid' );
|
||||
$background_color_grid = calla_elated_options()->getOptionValue( 'menu_area_grid_background_color' );
|
||||
$background_color_transparency_grid = calla_elated_options()->getOptionValue( 'menu_area_grid_background_transparency' );
|
||||
$menu_area_shadow_grid = calla_elated_options()->getOptionValue( 'menu_area_in_grid_shadow' );
|
||||
$border_grid = calla_elated_options()->getOptionValue( 'menu_area_in_grid_border' );
|
||||
$border_color_grid = calla_elated_options()->getOptionValue( 'menu_area_in_grid_border_color' );
|
||||
|
||||
$menu_area_styles = array();
|
||||
|
||||
if ( $background_color !== '' ) {
|
||||
$menu_area_background_color = $background_color;
|
||||
$menu_area_background_transparency = 1;
|
||||
|
||||
if ( $background_color_transparency !== '' ) {
|
||||
$menu_area_background_transparency = $background_color_transparency;
|
||||
}
|
||||
|
||||
$menu_area_styles['background-color'] = calla_elated_rgba_color( $menu_area_background_color, $menu_area_background_transparency );
|
||||
}
|
||||
|
||||
if ( $menu_area_height !== '' ) {
|
||||
$menu_area_styles['height'] = calla_elated_filter_px( $menu_area_height ) . 'px !important';
|
||||
}
|
||||
|
||||
if ( $menu_area_shadow == 'yes' ) {
|
||||
$menu_area_styles['box-shadow'] = '0px 1px 3px rgba(0,0,0,0.15)';
|
||||
}
|
||||
|
||||
if ( $border == 'yes' ) {
|
||||
$header_border_color = $border_color;
|
||||
|
||||
if ( $header_border_color !== '' ) {
|
||||
$menu_area_styles['border-bottom'] = '1px solid ' . $header_border_color;
|
||||
}
|
||||
}
|
||||
|
||||
echo calla_elated_dynamic_css( '.eltdf-page-header .eltdf-menu-area', $menu_area_styles );
|
||||
|
||||
$menu_area_grid_styles = array();
|
||||
|
||||
if ( $menu_area_in_grid == 'yes' && $background_color_grid !== '' ) {
|
||||
$menu_area_grid_background_color = $background_color_grid;
|
||||
$menu_area_grid_background_transparency = 1;
|
||||
|
||||
if ( $background_color_transparency_grid !== '' ) {
|
||||
$menu_area_grid_background_transparency = $background_color_transparency_grid;
|
||||
}
|
||||
|
||||
$menu_area_grid_styles['background-color'] = calla_elated_rgba_color( $menu_area_grid_background_color, $menu_area_grid_background_transparency );
|
||||
}
|
||||
|
||||
if ( $menu_area_shadow_grid == 'yes' ) {
|
||||
$menu_area_grid_styles['box-shadow'] = '0px 1px 3px rgba(0,0,0,0.15)';
|
||||
}
|
||||
|
||||
if ( $menu_area_in_grid == 'yes' && $border_grid == 'yes' ) {
|
||||
|
||||
$header_gird_border_color = $border_color_grid;
|
||||
|
||||
if ( $header_gird_border_color !== '' ) {
|
||||
$menu_area_grid_styles['border-bottom'] = '1px solid ' . $header_gird_border_color;
|
||||
}
|
||||
}
|
||||
|
||||
echo calla_elated_dynamic_css( '.eltdf-page-header .eltdf-menu-area .eltdf-grid .eltdf-vertical-align-containers', $menu_area_grid_styles );
|
||||
|
||||
$menu_container_selector = '.eltdf-page-header .eltdf-vertical-align-containers';
|
||||
$menu_container_styles = array();
|
||||
$container_side_padding = calla_elated_options()->getOptionValue( 'menu_area_side_padding' );
|
||||
|
||||
if ( $container_side_padding !== '' ) {
|
||||
if ( calla_elated_string_ends_with( $container_side_padding, 'px' ) || calla_elated_string_ends_with( $container_side_padding, '%' ) ) {
|
||||
$menu_container_styles['padding-left'] = $container_side_padding;
|
||||
$menu_container_styles['padding-right'] = $container_side_padding;
|
||||
} else {
|
||||
$menu_container_styles['padding-left'] = calla_elated_filter_px( $container_side_padding ) . 'px';
|
||||
$menu_container_styles['padding-right'] = calla_elated_filter_px( $container_side_padding ) . 'px';
|
||||
}
|
||||
|
||||
echo calla_elated_dynamic_css( $menu_container_selector, $menu_container_styles );
|
||||
}
|
||||
}
|
||||
|
||||
add_action( 'calla_elated_style_dynamic', 'calla_elated_header_menu_area_styles' );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_header_logo_area_styles' ) ) {
|
||||
/**
|
||||
* Generates styles for menu area
|
||||
*/
|
||||
function calla_elated_header_logo_area_styles() {
|
||||
|
||||
$background_color = calla_elated_options()->getOptionValue( 'logo_area_background_color' );
|
||||
$background_color_transparency = calla_elated_options()->getOptionValue( 'logo_area_background_transparency' );
|
||||
$logo_area_height = calla_elated_options()->getOptionValue( 'logo_area_height' );
|
||||
$border = calla_elated_options()->getOptionValue( 'logo_area_border' );
|
||||
$border_color = calla_elated_options()->getOptionValue( 'logo_area_border_color' );
|
||||
|
||||
$logo_area_in_grid = calla_elated_options()->getOptionValue( 'logo_area_in_grid' );
|
||||
$background_color_grid = calla_elated_options()->getOptionValue( 'logo_area_grid_background_color' );
|
||||
$background_color_transparency_grid = calla_elated_options()->getOptionValue( 'logo_area_grid_background_transparency' );
|
||||
$border_grid = calla_elated_options()->getOptionValue( 'logo_area_in_grid_border' );
|
||||
$border_color_grid = calla_elated_options()->getOptionValue( 'logo_area_in_grid_border_color' );
|
||||
|
||||
$logo_area_styles = array();
|
||||
|
||||
if ( $background_color !== '' ) {
|
||||
$logo_area_background_color = $background_color;
|
||||
$logo_area_background_transparency = 1;
|
||||
|
||||
if ( $background_color_transparency !== '' ) {
|
||||
$logo_area_background_transparency = $background_color_transparency;
|
||||
}
|
||||
|
||||
$logo_area_styles['background-color'] = calla_elated_rgba_color( $logo_area_background_color, $logo_area_background_transparency );
|
||||
}
|
||||
|
||||
if ( $logo_area_height !== '' ) {
|
||||
$logo_area_styles['height'] = calla_elated_filter_px( $logo_area_height ) . 'px !important';
|
||||
}
|
||||
|
||||
if ( $border == 'yes' ) {
|
||||
$header_border_color = $border_color;
|
||||
|
||||
if ( $header_border_color !== '' ) {
|
||||
$logo_area_styles['border-bottom'] = '1px solid ' . $header_border_color;
|
||||
}
|
||||
}
|
||||
|
||||
echo calla_elated_dynamic_css( '.eltdf-page-header .eltdf-logo-area', $logo_area_styles );
|
||||
|
||||
$logo_area_grid_styles = array();
|
||||
|
||||
if ( $logo_area_in_grid == 'yes' && $background_color_grid !== '' ) {
|
||||
$logo_area_grid_background_color = $background_color_grid;
|
||||
$logo_area_grid_background_transparency = 1;
|
||||
|
||||
if ( $background_color_transparency_grid !== '' ) {
|
||||
$logo_area_grid_background_transparency = $background_color_transparency_grid;
|
||||
}
|
||||
|
||||
$logo_area_grid_styles['background-color'] = calla_elated_rgba_color( $logo_area_grid_background_color, $logo_area_grid_background_transparency );
|
||||
}
|
||||
|
||||
if ( $logo_area_in_grid == 'yes' && $border_grid == 'yes' ) {
|
||||
|
||||
$header_gird_border_color = $border_color_grid;
|
||||
|
||||
if ( $header_gird_border_color !== '' ) {
|
||||
$logo_area_grid_styles['border-bottom'] = '1px solid ' . $header_gird_border_color;
|
||||
}
|
||||
}
|
||||
|
||||
echo calla_elated_dynamic_css( '.eltdf-page-header .eltdf-logo-area .eltdf-grid .eltdf-vertical-align-containers', $logo_area_grid_styles );
|
||||
|
||||
if ( calla_elated_options()->getOptionValue( 'logo_wrapper_padding_header_centered' ) !== '' ) {
|
||||
echo calla_elated_dynamic_css( '.eltdf-header-centered .eltdf-logo-area .eltdf-logo-wrapper', array( 'padding' => calla_elated_options()->getOptionValue( 'logo_wrapper_padding_header_centered' ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
add_action( 'calla_elated_style_dynamic', 'calla_elated_header_logo_area_styles' );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_main_menu_styles' ) ) {
|
||||
/**
|
||||
* Generates styles for main menu
|
||||
*/
|
||||
function calla_elated_main_menu_styles() {
|
||||
|
||||
// main menu 1st level style
|
||||
|
||||
$menu_item_styles = calla_elated_get_typography_styles( 'menu' );
|
||||
$padding = calla_elated_options()->getOptionValue( 'menu_padding_left_right' );
|
||||
$margin = calla_elated_options()->getOptionValue( 'menu_margin_left_right' );
|
||||
|
||||
if ( ! empty( $padding ) ) {
|
||||
$menu_item_styles['padding'] = '0 ' . calla_elated_filter_px( $padding ) . 'px';
|
||||
}
|
||||
if ( ! empty( $margin ) ) {
|
||||
$menu_item_styles['margin'] = '0 ' . calla_elated_filter_px( $margin ) . 'px';
|
||||
}
|
||||
|
||||
$menu_item_selector = array(
|
||||
'.eltdf-main-menu > ul > li > a'
|
||||
);
|
||||
|
||||
echo calla_elated_dynamic_css( $menu_item_selector, $menu_item_styles );
|
||||
|
||||
$hover_color = calla_elated_options()->getOptionValue( 'menu_hovercolor' );
|
||||
|
||||
$menu_item_hover_styles = array();
|
||||
if ( ! empty( $hover_color ) ) {
|
||||
$menu_item_hover_styles['color'] = $hover_color;
|
||||
}
|
||||
|
||||
$menu_item_hover_selector = array(
|
||||
'.eltdf-main-menu > ul > li > a:hover'
|
||||
);
|
||||
|
||||
echo calla_elated_dynamic_css( $menu_item_hover_selector, $menu_item_hover_styles );
|
||||
|
||||
$active_color = calla_elated_options()->getOptionValue( 'menu_activecolor' );
|
||||
|
||||
$menu_item_active_styles = array();
|
||||
if ( ! empty( $active_color ) ) {
|
||||
$menu_item_active_styles['color'] = $active_color;
|
||||
}
|
||||
|
||||
$menu_item_active_selector = array(
|
||||
'.eltdf-main-menu > ul > li.eltdf-active-item > a'
|
||||
);
|
||||
|
||||
echo calla_elated_dynamic_css( $menu_item_active_selector, $menu_item_active_styles );
|
||||
|
||||
$light_hover_color = calla_elated_options()->getOptionValue( 'menu_light_hovercolor' );
|
||||
|
||||
$menu_item_light_hover_styles = array();
|
||||
if ( ! empty( $light_hover_color ) ) {
|
||||
$menu_item_light_hover_styles['color'] = $light_hover_color;
|
||||
}
|
||||
|
||||
$menu_item_light_hover_selector = array(
|
||||
'.eltdf-light-header .eltdf-page-header > div:not(.eltdf-sticky-header):not(.eltdf-fixed-wrapper) .eltdf-main-menu > ul > li > a:hover'
|
||||
);
|
||||
|
||||
echo calla_elated_dynamic_css( $menu_item_light_hover_selector, $menu_item_light_hover_styles );
|
||||
|
||||
$light_active_color = calla_elated_options()->getOptionValue( 'menu_light_activecolor' );
|
||||
|
||||
$menu_item_light_active_styles = array();
|
||||
if ( ! empty( $light_active_color ) ) {
|
||||
$menu_item_light_active_styles['color'] = $light_active_color;
|
||||
}
|
||||
|
||||
$menu_item_light_active_selector = array(
|
||||
'.eltdf-light-header .eltdf-page-header > div:not(.eltdf-sticky-header):not(.eltdf-fixed-wrapper) .eltdf-main-menu > ul > li.eltdf-active-item > a'
|
||||
);
|
||||
|
||||
echo calla_elated_dynamic_css( $menu_item_light_active_selector, $menu_item_light_active_styles );
|
||||
|
||||
$dark_hover_color = calla_elated_options()->getOptionValue( 'menu_dark_hovercolor' );
|
||||
|
||||
$menu_item_dark_hover_styles = array();
|
||||
if ( ! empty( $dark_hover_color ) ) {
|
||||
$menu_item_dark_hover_styles['color'] = $dark_hover_color;
|
||||
}
|
||||
|
||||
$menu_item_dark_hover_selector = array(
|
||||
'.eltdf-dark-header .eltdf-page-header > div:not(.eltdf-sticky-header):not(.eltdf-fixed-wrapper) .eltdf-main-menu > ul > li > a:hover'
|
||||
);
|
||||
|
||||
echo calla_elated_dynamic_css( $menu_item_dark_hover_selector, $menu_item_dark_hover_styles );
|
||||
|
||||
$dark_active_color = calla_elated_options()->getOptionValue( 'menu_dark_activecolor' );
|
||||
|
||||
$menu_item_dark_active_styles = array();
|
||||
if ( ! empty( $dark_active_color ) ) {
|
||||
$menu_item_dark_active_styles['color'] = $dark_active_color;
|
||||
}
|
||||
|
||||
$menu_item_dark_active_selector = array(
|
||||
'.eltdf-dark-header .eltdf-page-header > div:not(.eltdf-sticky-header):not(.eltdf-fixed-wrapper) .eltdf-main-menu > ul > li.eltdf-active-item > a'
|
||||
);
|
||||
|
||||
echo calla_elated_dynamic_css( $menu_item_dark_active_selector, $menu_item_dark_active_styles );
|
||||
|
||||
// main menu 2nd level style
|
||||
|
||||
$dropdown_menu_item_styles = calla_elated_get_typography_styles( 'dropdown' );
|
||||
|
||||
$dropdown_menu_item_selector = array(
|
||||
'.eltdf-drop-down .second .inner > ul > li > a'
|
||||
);
|
||||
|
||||
echo calla_elated_dynamic_css( $dropdown_menu_item_selector, $dropdown_menu_item_styles );
|
||||
|
||||
$dropdown_hover_color = calla_elated_options()->getOptionValue( 'dropdown_hovercolor' );
|
||||
|
||||
$dropdown_menu_item_hover_styles = array();
|
||||
if ( ! empty( $dropdown_hover_color ) ) {
|
||||
$dropdown_menu_item_hover_styles['color'] = $dropdown_hover_color . ' !important';
|
||||
}
|
||||
|
||||
$dropdown_menu_item_hover_selector = array(
|
||||
'.eltdf-drop-down .second .inner > ul > li > a:hover',
|
||||
'.eltdf-drop-down .second .inner > ul > li.current-menu-ancestor > a',
|
||||
'.eltdf-drop-down .second .inner > ul > li.current-menu-item > a'
|
||||
);
|
||||
|
||||
echo calla_elated_dynamic_css( $dropdown_menu_item_hover_selector, $dropdown_menu_item_hover_styles );
|
||||
|
||||
// main menu 2nd level wide style
|
||||
|
||||
$dropdown_wide_menu_item_styles = calla_elated_get_typography_styles( 'dropdown_wide' );
|
||||
|
||||
$dropdown_wide_menu_item_selector = array(
|
||||
'.eltdf-drop-down .wide .second .inner > ul > li > a'
|
||||
);
|
||||
|
||||
echo calla_elated_dynamic_css( $dropdown_wide_menu_item_selector, $dropdown_wide_menu_item_styles );
|
||||
|
||||
$dropdown_wide_hover_color = calla_elated_options()->getOptionValue( 'dropdown_wide_hovercolor' );
|
||||
|
||||
$dropdown_wide_menu_item_hover_styles = array();
|
||||
if ( ! empty( $dropdown_wide_hover_color ) ) {
|
||||
$dropdown_wide_menu_item_hover_styles['color'] = $dropdown_wide_hover_color . ' !important';
|
||||
}
|
||||
|
||||
$dropdown_wide_menu_item_hover_selector = array(
|
||||
'.eltdf-drop-down .wide .second .inner > ul > li > a:hover',
|
||||
'.eltdf-drop-down .wide .second .inner > ul > li.current-menu-ancestor > a',
|
||||
'.eltdf-drop-down .wide .second .inner > ul > li.current-menu-item > a'
|
||||
);
|
||||
|
||||
echo calla_elated_dynamic_css( $dropdown_wide_menu_item_hover_selector, $dropdown_wide_menu_item_hover_styles );
|
||||
|
||||
// main menu 3rd level style
|
||||
|
||||
$dropdown_menu_item_styles_thirdlvl = calla_elated_get_typography_styles( 'dropdown', '_thirdlvl' );
|
||||
|
||||
$dropdown_menu_item_selector_thirdlvl = array(
|
||||
'.eltdf-drop-down .second .inner ul li ul li a'
|
||||
);
|
||||
|
||||
echo calla_elated_dynamic_css( $dropdown_menu_item_selector_thirdlvl, $dropdown_menu_item_styles_thirdlvl );
|
||||
|
||||
$dropdown_hover_color_thirdlvl = calla_elated_options()->getOptionValue( 'dropdown_hovercolor_thirdlvl' );
|
||||
|
||||
$dropdown_menu_item_hover_styles_thirdlvl = array();
|
||||
if ( ! empty( $dropdown_hover_color_thirdlvl ) ) {
|
||||
$dropdown_menu_item_hover_styles_thirdlvl['color'] = $dropdown_hover_color_thirdlvl . ' !important';
|
||||
}
|
||||
|
||||
$dropdown_menu_item_hover_selector_thirdlvl = array(
|
||||
'.eltdf-drop-down .second .inner ul li ul li a:hover',
|
||||
'.eltdf-drop-down .second .inner ul li ul li.current-menu-ancestor > a',
|
||||
'.eltdf-drop-down .second .inner ul li ul li.current-menu-item > a'
|
||||
);
|
||||
|
||||
echo calla_elated_dynamic_css( $dropdown_menu_item_hover_selector_thirdlvl, $dropdown_menu_item_hover_styles_thirdlvl );
|
||||
|
||||
// main menu 3rd level wide style
|
||||
|
||||
$dropdown_wide_menu_item_styles_thirdlvl = calla_elated_get_typography_styles( 'dropdown_wide', '_thirdlvl' );
|
||||
|
||||
$dropdown_wide_menu_item_selector_thirdlvl = array(
|
||||
'.eltdf-drop-down .wide .second .inner ul li ul li a'
|
||||
);
|
||||
|
||||
echo calla_elated_dynamic_css( $dropdown_wide_menu_item_selector_thirdlvl, $dropdown_wide_menu_item_styles_thirdlvl );
|
||||
|
||||
$dropdown_wide_hover_color_thirdlvl = calla_elated_options()->getOptionValue( 'dropdown_wide_hovercolor_thirdlvl' );
|
||||
|
||||
$dropdown_wide_menu_item_hover_styles_thirdlvl = array();
|
||||
if ( ! empty( $dropdown_wide_hover_color_thirdlvl ) ) {
|
||||
$dropdown_wide_menu_item_hover_styles_thirdlvl['color'] = $dropdown_wide_hover_color_thirdlvl . ' !important';
|
||||
}
|
||||
|
||||
$dropdown_wide_menu_item_hover_selector_thirdlvl = array(
|
||||
'.eltdf-drop-down .wide .second .inner ul li ul li a:hover',
|
||||
'.eltdf-drop-down .wide .second .inner ul li ul li.current-menu-ancestor > a',
|
||||
'.eltdf-drop-down .wide .second .inner ul li ul li.current-menu-item > a'
|
||||
);
|
||||
|
||||
echo calla_elated_dynamic_css( $dropdown_wide_menu_item_hover_selector_thirdlvl, $dropdown_wide_menu_item_hover_styles_thirdlvl );
|
||||
|
||||
// main menu dropdown holder style
|
||||
|
||||
$dropdown_top_position = calla_elated_options()->getOptionValue( 'dropdown_top_position' );
|
||||
|
||||
$dropdown_styles = array();
|
||||
if ( $dropdown_top_position !== '' ) {
|
||||
$dropdown_styles['top'] = $dropdown_top_position . '%';
|
||||
}
|
||||
|
||||
$dropdown_selector = array(
|
||||
'.eltdf-page-header .eltdf-drop-down .second'
|
||||
);
|
||||
|
||||
echo calla_elated_dynamic_css( $dropdown_selector, $dropdown_styles );
|
||||
|
||||
$dropdown_background_color_selector = array(
|
||||
'.eltdf-drop-down .narrow .second .inner ul',
|
||||
'.eltdf-drop-down .wide .second .inner'
|
||||
);
|
||||
$dropdown_background_styles = array();
|
||||
|
||||
$dropdown_background_color = calla_elated_options()->getOptionValue( 'dropdown_background_color' );
|
||||
if ( $dropdown_background_color !== '' ) {
|
||||
$dropdown_background_transparency = calla_elated_options()->getOptionValue( 'dropdown_background_transparency' );
|
||||
if ( $dropdown_background_transparency === '' ) {
|
||||
$dropdown_background_transparency = '1';
|
||||
}
|
||||
|
||||
$dropdown_background_styles['background-color'] = calla_elated_rgba_color( $dropdown_background_color, $dropdown_background_transparency );
|
||||
}
|
||||
|
||||
echo calla_elated_dynamic_css( $dropdown_background_color_selector, $dropdown_background_styles );
|
||||
}
|
||||
|
||||
add_action( 'calla_elated_style_dynamic', 'calla_elated_main_menu_styles' );
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
<?php
|
||||
|
||||
if ( ! function_exists( 'calla_elated_header_types_meta_boxes' ) ) {
|
||||
function calla_elated_header_types_meta_boxes() {
|
||||
$header_type_options = apply_filters( 'calla_elated_header_type_meta_boxes', $header_type_options = array( '' => esc_html__( 'Default', 'calla' ) ) );
|
||||
|
||||
return $header_type_options;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_hide_dep_for_header_behavior_meta_boxes' ) ) {
|
||||
function calla_elated_get_hide_dep_for_header_behavior_meta_boxes() {
|
||||
$hide_dep_options = apply_filters( 'calla_elated_header_behavior_hide_meta_boxes', $hide_dep_options = array() );
|
||||
|
||||
return $hide_dep_options;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ( glob( ELATED_FRAMEWORK_HEADER_ROOT_DIR . '/admin/meta-boxes/*/*.php' ) as $meta_box_load ) {
|
||||
include_once $meta_box_load;
|
||||
}
|
||||
|
||||
foreach ( glob( ELATED_FRAMEWORK_HEADER_TYPES_ROOT_DIR . '/*/admin/meta-boxes/*.php' ) as $meta_box_load ) {
|
||||
include_once $meta_box_load;
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_map_header_meta' ) ) {
|
||||
function calla_elated_map_header_meta() {
|
||||
$header_type_meta_boxes = calla_elated_header_types_meta_boxes();
|
||||
$header_behavior_meta_boxes_hide_dep = calla_elated_get_hide_dep_for_header_behavior_meta_boxes();
|
||||
|
||||
$header_meta_box = calla_elated_create_meta_box(
|
||||
array(
|
||||
'scope' => apply_filters( 'calla_elated_set_scope_for_meta_boxes', array( 'page', 'post' ), 'header_meta' ),
|
||||
'title' => esc_html__( 'Header', 'calla' ),
|
||||
'name' => 'header_meta'
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_header_type_meta',
|
||||
'type' => 'select',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Choose Header Type', 'calla' ),
|
||||
'description' => esc_html__( 'Select header type layout', 'calla' ),
|
||||
'parent' => $header_meta_box,
|
||||
'options' => $header_type_meta_boxes
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_header_style_meta',
|
||||
'type' => 'select',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Header Skin', 'calla' ),
|
||||
'description' => esc_html__( 'Choose a header style to make header elements (logo, main menu, side menu button) in that predefined style', 'calla' ),
|
||||
'parent' => $header_meta_box,
|
||||
'options' => array(
|
||||
'' => esc_html__( 'Default', 'calla' ),
|
||||
'light-header' => esc_html__( 'Light', 'calla' ),
|
||||
'dark-header' => esc_html__( 'Dark', 'calla' )
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'parent' => $header_meta_box,
|
||||
'type' => 'select',
|
||||
'name' => 'eltdf_header_behaviour_meta',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Choose Header Behaviour', 'calla' ),
|
||||
'description' => esc_html__( 'Select the behaviour of header when you scroll down to page', 'calla' ),
|
||||
'options' => array(
|
||||
'' => esc_html__( 'Default', 'calla' ),
|
||||
'fixed-on-scroll' => esc_html__( 'Fixed on scroll', 'calla' ),
|
||||
'no-behavior' => esc_html__( 'No Behavior', 'calla' ),
|
||||
'sticky-header-on-scroll-up' => esc_html__( 'Sticky on scroll up', 'calla' ),
|
||||
'sticky-header-on-scroll-down-up' => esc_html__( 'Sticky on scroll up/down', 'calla' )
|
||||
),
|
||||
'dependency' => array(
|
||||
'hide' => array(
|
||||
'eltdf_header_type_meta' => $header_behavior_meta_boxes_hide_dep
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
//additional area
|
||||
do_action( 'calla_elated_additional_header_area_meta_boxes_map', $header_meta_box );
|
||||
|
||||
//top area
|
||||
do_action( 'calla_elated_header_top_area_meta_boxes_map', $header_meta_box );
|
||||
|
||||
//logo area
|
||||
do_action( 'calla_elated_header_logo_area_meta_boxes_map', $header_meta_box );
|
||||
|
||||
//menu area
|
||||
do_action( 'calla_elated_header_menu_area_meta_boxes_map', $header_meta_box );
|
||||
}
|
||||
|
||||
add_action( 'calla_elated_meta_boxes_map', 'calla_elated_map_header_meta', 50 );
|
||||
}
|
||||
@@ -0,0 +1,225 @@
|
||||
<?php
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_hide_dep_for_header_logo_area_meta_boxes' ) ) {
|
||||
function calla_elated_get_hide_dep_for_header_logo_area_meta_boxes() {
|
||||
$hide_dep_options = apply_filters( 'calla_elated_header_logo_area_hide_meta_boxes', $hide_dep_options = array() );
|
||||
|
||||
return $hide_dep_options;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_hide_dep_for_header_logo_area_widgets_meta_boxes' ) ) {
|
||||
function calla_elated_get_hide_dep_for_header_logo_area_widgets_meta_boxes() {
|
||||
$hide_dep_options = apply_filters( 'calla_elated_header_logo_area_widgets_hide_meta_boxes', $hide_dep_options = array() );
|
||||
|
||||
return $hide_dep_options;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_header_logo_area_meta_options_map' ) ) {
|
||||
function calla_elated_header_logo_area_meta_options_map( $header_meta_box ) {
|
||||
$hide_dep_options = calla_elated_get_hide_dep_for_header_logo_area_meta_boxes();
|
||||
$hide_dep_widgets = calla_elated_get_hide_dep_for_header_logo_area_widgets_meta_boxes();
|
||||
|
||||
$logo_area_container = calla_elated_add_admin_container_no_style(
|
||||
array(
|
||||
'type' => 'container',
|
||||
'name' => 'logo_area_container',
|
||||
'parent' => $header_meta_box,
|
||||
'dependency' => array(
|
||||
'hide' => array(
|
||||
'eltdf_header_type_meta' => $hide_dep_options
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_section_title(
|
||||
array(
|
||||
'parent' => $logo_area_container,
|
||||
'name' => 'logo_area_style',
|
||||
'title' => esc_html__( 'Logo Area Style', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_disable_header_widget_logo_area_meta',
|
||||
'type' => 'yesno',
|
||||
'default_value' => 'no',
|
||||
'label' => esc_html__( 'Disable Header Logo Area Widget', 'calla' ),
|
||||
'description' => esc_html__( 'Enabling this option will hide widget area from the logo area', 'calla' ),
|
||||
'parent' => $logo_area_container,
|
||||
'dependency' => array(
|
||||
'hide' => array(
|
||||
'eltdf_header_type_meta' => $hide_dep_widgets
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$calla_custom_sidebars = calla_elated_get_custom_sidebars();
|
||||
if ( count( $calla_custom_sidebars ) > 0 ) {
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_custom_logo_area_sidebar_meta',
|
||||
'type' => 'selectblank',
|
||||
'label' => esc_html__( 'Choose Custom Widget Area for Logo Area', 'calla' ),
|
||||
'description' => esc_html__( 'Choose custom widget area to display in header logo area"', 'calla' ),
|
||||
'parent' => $logo_area_container,
|
||||
'options' => $calla_custom_sidebars,
|
||||
'dependency' => array(
|
||||
'hide' => array(
|
||||
'eltdf_header_type_meta' => $hide_dep_widgets
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_logo_area_in_grid_meta',
|
||||
'type' => 'select',
|
||||
'label' => esc_html__( 'Logo Area In Grid', 'calla' ),
|
||||
'description' => esc_html__( 'Set menu area content to be in grid', 'calla' ),
|
||||
'parent' => $logo_area_container,
|
||||
'default_value' => '',
|
||||
'options' => calla_elated_get_yes_no_select_array()
|
||||
)
|
||||
);
|
||||
|
||||
$logo_area_in_grid_container = calla_elated_add_admin_container(
|
||||
array(
|
||||
'type' => 'container',
|
||||
'name' => 'logo_area_in_grid_container',
|
||||
'parent' => $logo_area_container,
|
||||
'dependency' => array(
|
||||
'show' => array(
|
||||
'eltdf_logo_area_in_grid_meta' => 'yes'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_logo_area_grid_background_color_meta',
|
||||
'type' => 'color',
|
||||
'label' => esc_html__( 'Grid Background Color', 'calla' ),
|
||||
'description' => esc_html__( 'Set grid background color for logo area', 'calla' ),
|
||||
'parent' => $logo_area_in_grid_container
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_logo_area_grid_background_transparency_meta',
|
||||
'type' => 'text',
|
||||
'label' => esc_html__( 'Grid Background Transparency', 'calla' ),
|
||||
'description' => esc_html__( 'Set grid background transparency for logo area (0 = fully transparent, 1 = opaque)', 'calla' ),
|
||||
'parent' => $logo_area_in_grid_container,
|
||||
'args' => array(
|
||||
'col_width' => 2
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_logo_area_in_grid_border_meta',
|
||||
'type' => 'select',
|
||||
'label' => esc_html__( 'Grid Area Border', 'calla' ),
|
||||
'description' => esc_html__( 'Set border on grid logo area', 'calla' ),
|
||||
'parent' => $logo_area_in_grid_container,
|
||||
'default_value' => '',
|
||||
'options' => calla_elated_get_yes_no_select_array()
|
||||
)
|
||||
);
|
||||
|
||||
$logo_area_in_grid_border_container = calla_elated_add_admin_container(
|
||||
array(
|
||||
'type' => 'container',
|
||||
'name' => 'logo_area_in_grid_border_container',
|
||||
'parent' => $logo_area_in_grid_container,
|
||||
'dependency' => array(
|
||||
'show' => array(
|
||||
'eltdf_logo_area_in_grid_border_meta' => 'yes'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_logo_area_in_grid_border_color_meta',
|
||||
'type' => 'color',
|
||||
'label' => esc_html__( 'Border Color', 'calla' ),
|
||||
'description' => esc_html__( 'Set border color for grid area', 'calla' ),
|
||||
'parent' => $logo_area_in_grid_border_container
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_logo_area_background_color_meta',
|
||||
'type' => 'color',
|
||||
'label' => esc_html__( 'Background Color', 'calla' ),
|
||||
'description' => esc_html__( 'Choose a background color for logo area', 'calla' ),
|
||||
'parent' => $logo_area_container
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_logo_area_background_transparency_meta',
|
||||
'type' => 'text',
|
||||
'label' => esc_html__( 'Transparency', 'calla' ),
|
||||
'description' => esc_html__( 'Choose a transparency for the logo area background color (0 = fully transparent, 1 = opaque)', 'calla' ),
|
||||
'parent' => $logo_area_container,
|
||||
'args' => array(
|
||||
'col_width' => 2
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_logo_area_border_meta',
|
||||
'type' => 'select',
|
||||
'label' => esc_html__( 'Logo Area Border', 'calla' ),
|
||||
'description' => esc_html__( 'Set border on logo area', 'calla' ),
|
||||
'parent' => $logo_area_container,
|
||||
'default_value' => '',
|
||||
'options' => calla_elated_get_yes_no_select_array()
|
||||
)
|
||||
);
|
||||
|
||||
$logo_area_border_bottom_color_container = calla_elated_add_admin_container(
|
||||
array(
|
||||
'type' => 'container',
|
||||
'name' => 'logo_area_border_bottom_color_container',
|
||||
'parent' => $logo_area_container,
|
||||
'dependency' => array(
|
||||
'show' => array(
|
||||
'eltdf_logo_area_border_meta' => 'yes'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_logo_area_border_color_meta',
|
||||
'type' => 'color',
|
||||
'label' => esc_html__( 'Border Color', 'calla' ),
|
||||
'description' => esc_html__( 'Choose color of header bottom border', 'calla' ),
|
||||
'parent' => $logo_area_border_bottom_color_container
|
||||
)
|
||||
);
|
||||
|
||||
do_action( 'calla_elated_header_logo_area_additional_meta_boxes_map', $logo_area_container );
|
||||
}
|
||||
|
||||
add_action( 'calla_elated_header_logo_area_meta_boxes_map', 'calla_elated_header_logo_area_meta_options_map', 10, 1 );
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
if ( ! function_exists( 'calla_elated_logo_meta_box_map' ) ) {
|
||||
function calla_elated_logo_meta_box_map() {
|
||||
|
||||
$logo_meta_box = calla_elated_create_meta_box(
|
||||
array(
|
||||
'scope' => apply_filters( 'calla_elated_set_scope_for_meta_boxes', array( 'page', 'post' ), 'logo_meta' ),
|
||||
'title' => esc_html__( 'Logo', 'calla' ),
|
||||
'name' => 'logo_meta'
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_logo_image_meta',
|
||||
'type' => 'image',
|
||||
'label' => esc_html__( 'Logo Image - Default', 'calla' ),
|
||||
'description' => esc_html__( 'Choose a default logo image to display ', 'calla' ),
|
||||
'parent' => $logo_meta_box
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_logo_image_dark_meta',
|
||||
'type' => 'image',
|
||||
'label' => esc_html__( 'Logo Image - Dark', 'calla' ),
|
||||
'description' => esc_html__( 'Choose a default logo image to display ', 'calla' ),
|
||||
'parent' => $logo_meta_box
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_logo_image_light_meta',
|
||||
'type' => 'image',
|
||||
'label' => esc_html__( 'Logo Image - Light', 'calla' ),
|
||||
'description' => esc_html__( 'Choose a default logo image to display ', 'calla' ),
|
||||
'parent' => $logo_meta_box
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_logo_image_sticky_meta',
|
||||
'type' => 'image',
|
||||
'label' => esc_html__( 'Logo Image - Sticky', 'calla' ),
|
||||
'description' => esc_html__( 'Choose a default logo image to display ', 'calla' ),
|
||||
'parent' => $logo_meta_box
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_logo_image_mobile_meta',
|
||||
'type' => 'image',
|
||||
'label' => esc_html__( 'Logo Image - Mobile', 'calla' ),
|
||||
'description' => esc_html__( 'Choose a default logo image to display ', 'calla' ),
|
||||
'parent' => $logo_meta_box
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
add_action( 'calla_elated_meta_boxes_map', 'calla_elated_logo_meta_box_map', 47 );
|
||||
}
|
||||
@@ -0,0 +1,280 @@
|
||||
<?php
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_hide_dep_for_header_menu_area_meta_boxes' ) ) {
|
||||
function calla_elated_get_hide_dep_for_header_menu_area_meta_boxes() {
|
||||
$hide_dep_options = apply_filters( 'calla_elated_header_menu_area_hide_meta_boxes', $hide_dep_options = array() );
|
||||
|
||||
return $hide_dep_options;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_hide_dep_for_header_menu_area_widgets_meta_boxes' ) ) {
|
||||
function calla_elated_get_hide_dep_for_header_menu_area_widgets_meta_boxes() {
|
||||
$hide_dep_options = apply_filters( 'calla_elated_header_menu_area_widgets_hide_meta_boxes', $hide_dep_options = array() );
|
||||
|
||||
return $hide_dep_options;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_header_menu_area_meta_options_map' ) ) {
|
||||
function calla_elated_header_menu_area_meta_options_map( $header_meta_box ) {
|
||||
$hide_dep_options = calla_elated_get_hide_dep_for_header_menu_area_meta_boxes();
|
||||
$hide_dep_widgets = calla_elated_get_hide_dep_for_header_menu_area_widgets_meta_boxes();
|
||||
|
||||
$menu_area_container = calla_elated_add_admin_container_no_style(
|
||||
array(
|
||||
'type' => 'container',
|
||||
'name' => 'menu_area_container',
|
||||
'parent' => $header_meta_box,
|
||||
'dependency' => array(
|
||||
'hide' => array(
|
||||
'eltdf_header_type_meta' => $hide_dep_options
|
||||
)
|
||||
),
|
||||
'args' => array(
|
||||
'enable_panels_for_default_value' => true
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_section_title(
|
||||
array(
|
||||
'parent' => $menu_area_container,
|
||||
'name' => 'menu_area_style',
|
||||
'title' => esc_html__( 'Menu Area Style', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_disable_header_widget_menu_area_meta',
|
||||
'type' => 'yesno',
|
||||
'default_value' => 'no',
|
||||
'label' => esc_html__( 'Disable Header Menu Area Widget', 'calla' ),
|
||||
'description' => esc_html__( 'Enabling this option will hide widget area from the menu area', 'calla' ),
|
||||
'parent' => $menu_area_container,
|
||||
'dependency' => array(
|
||||
'hide' => array(
|
||||
'eltdf_header_type_meta' => $hide_dep_widgets
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$calla_custom_sidebars = calla_elated_get_custom_sidebars();
|
||||
if ( count( $calla_custom_sidebars ) > 0 ) {
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_custom_menu_area_sidebar_meta',
|
||||
'type' => 'selectblank',
|
||||
'label' => esc_html__( 'Choose Custom Widget Area In Menu Area', 'calla' ),
|
||||
'description' => esc_html__( 'Choose custom widget area to display in header menu area"', 'calla' ),
|
||||
'parent' => $menu_area_container,
|
||||
'options' => $calla_custom_sidebars,
|
||||
'dependency' => array(
|
||||
'hide' => array(
|
||||
'eltdf_header_type_meta' => $hide_dep_widgets
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_menu_area_in_grid_meta',
|
||||
'type' => 'select',
|
||||
'label' => esc_html__( 'Menu Area In Grid', 'calla' ),
|
||||
'description' => esc_html__( 'Set menu area content to be in grid', 'calla' ),
|
||||
'parent' => $menu_area_container,
|
||||
'default_value' => '',
|
||||
'options' => calla_elated_get_yes_no_select_array()
|
||||
)
|
||||
);
|
||||
|
||||
$menu_area_in_grid_container = calla_elated_add_admin_container(
|
||||
array(
|
||||
'type' => 'container',
|
||||
'name' => 'menu_area_in_grid_container',
|
||||
'parent' => $menu_area_container,
|
||||
'dependency' => array(
|
||||
'show' => array(
|
||||
'eltdf_menu_area_in_grid_meta' => 'yes'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_menu_area_grid_background_color_meta',
|
||||
'type' => 'color',
|
||||
'label' => esc_html__( 'Grid Background Color', 'calla' ),
|
||||
'description' => esc_html__( 'Set grid background color for menu area', 'calla' ),
|
||||
'parent' => $menu_area_in_grid_container
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_menu_area_grid_background_transparency_meta',
|
||||
'type' => 'text',
|
||||
'label' => esc_html__( 'Grid Background Transparency', 'calla' ),
|
||||
'description' => esc_html__( 'Set grid background transparency for menu area (0 = fully transparent, 1 = opaque)', 'calla' ),
|
||||
'parent' => $menu_area_in_grid_container,
|
||||
'args' => array(
|
||||
'col_width' => 2
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_menu_area_in_grid_shadow_meta',
|
||||
'type' => 'select',
|
||||
'label' => esc_html__( 'Grid Area Shadow', 'calla' ),
|
||||
'description' => esc_html__( 'Set shadow on grid menu area', 'calla' ),
|
||||
'parent' => $menu_area_in_grid_container,
|
||||
'default_value' => '',
|
||||
'options' => calla_elated_get_yes_no_select_array()
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_menu_area_in_grid_border_meta',
|
||||
'type' => 'select',
|
||||
'label' => esc_html__( 'Grid Area Border', 'calla' ),
|
||||
'description' => esc_html__( 'Set border on grid menu area', 'calla' ),
|
||||
'parent' => $menu_area_in_grid_container,
|
||||
'default_value' => '',
|
||||
'options' => calla_elated_get_yes_no_select_array()
|
||||
)
|
||||
);
|
||||
|
||||
$menu_area_in_grid_border_container = calla_elated_add_admin_container(
|
||||
array(
|
||||
'type' => 'container',
|
||||
'name' => 'menu_area_in_grid_border_container',
|
||||
'parent' => $menu_area_in_grid_container,
|
||||
'dependency' => array(
|
||||
'show' => array(
|
||||
'eltdf_menu_area_in_grid_border_meta' => 'yes'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_menu_area_in_grid_border_color_meta',
|
||||
'type' => 'color',
|
||||
'label' => esc_html__( 'Border Color', 'calla' ),
|
||||
'description' => esc_html__( 'Set border color for grid area', 'calla' ),
|
||||
'parent' => $menu_area_in_grid_border_container
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_menu_area_background_color_meta',
|
||||
'type' => 'color',
|
||||
'label' => esc_html__( 'Background Color', 'calla' ),
|
||||
'description' => esc_html__( 'Choose a background color for menu area', 'calla' ),
|
||||
'parent' => $menu_area_container
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_menu_area_background_transparency_meta',
|
||||
'type' => 'text',
|
||||
'label' => esc_html__( 'Transparency', 'calla' ),
|
||||
'description' => esc_html__( 'Choose a transparency for the menu area background color (0 = fully transparent, 1 = opaque)', 'calla' ),
|
||||
'parent' => $menu_area_container,
|
||||
'args' => array(
|
||||
'col_width' => 2
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_menu_area_shadow_meta',
|
||||
'type' => 'select',
|
||||
'label' => esc_html__( 'Menu Area Shadow', 'calla' ),
|
||||
'description' => esc_html__( 'Set shadow on menu area', 'calla' ),
|
||||
'parent' => $menu_area_container,
|
||||
'default_value' => '',
|
||||
'options' => calla_elated_get_yes_no_select_array()
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_menu_area_border_meta',
|
||||
'type' => 'select',
|
||||
'label' => esc_html__( 'Menu Area Border', 'calla' ),
|
||||
'description' => esc_html__( 'Set border on menu area', 'calla' ),
|
||||
'parent' => $menu_area_container,
|
||||
'default_value' => '',
|
||||
'options' => calla_elated_get_yes_no_select_array()
|
||||
)
|
||||
);
|
||||
|
||||
$menu_area_border_bottom_color_container = calla_elated_add_admin_container(
|
||||
array(
|
||||
'type' => 'container',
|
||||
'name' => 'menu_area_border_bottom_color_container',
|
||||
'parent' => $menu_area_container,
|
||||
'dependency' => array(
|
||||
'show' => array(
|
||||
'eltdf_menu_area_border_meta' => 'yes'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_menu_area_border_color_meta',
|
||||
'type' => 'color',
|
||||
'label' => esc_html__( 'Border Color', 'calla' ),
|
||||
'description' => esc_html__( 'Choose color of header bottom border', 'calla' ),
|
||||
'parent' => $menu_area_border_bottom_color_container
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'type' => 'text',
|
||||
'name' => 'eltdf_menu_area_side_padding_meta',
|
||||
'label' => esc_html__( 'Menu Area Side Padding', 'calla' ),
|
||||
'description' => esc_html__( 'Enter value in px or percentage to define menu area side padding', 'calla' ),
|
||||
'parent' => $menu_area_container,
|
||||
'args' => array(
|
||||
'col_width' => 3,
|
||||
'suffix' => esc_html__( 'px or %', 'calla' )
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'parent' => $menu_area_container,
|
||||
'type' => 'text',
|
||||
'name' => 'eltdf_dropdown_top_position_meta',
|
||||
'label' => esc_html__( 'Dropdown Position', 'calla' ),
|
||||
'description' => esc_html__( 'Enter value in percentage of entire header height', 'calla' ),
|
||||
'args' => array(
|
||||
'col_width' => 3,
|
||||
'suffix' => '%'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
do_action( 'calla_elated_header_menu_area_additional_meta_boxes_map', $menu_area_container );
|
||||
}
|
||||
|
||||
add_action( 'calla_elated_header_menu_area_meta_boxes_map', 'calla_elated_header_menu_area_meta_options_map', 10, 1 );
|
||||
}
|
||||
@@ -0,0 +1,185 @@
|
||||
<?php
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_header_types_options' ) ) {
|
||||
function calla_elated_get_header_types_options() {
|
||||
$header_type_options = apply_filters( 'calla_elated_header_type_global_option', $header_type_options = array() );
|
||||
|
||||
return $header_type_options;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_header_type_default_options' ) ) {
|
||||
function calla_elated_get_header_type_default_options() {
|
||||
$header_type_option = apply_filters( 'calla_elated_default_header_type_global_option', $header_type_option = '' );
|
||||
|
||||
return $header_type_option;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_hide_dep_for_header_behavior_options' ) ) {
|
||||
function calla_elated_get_hide_dep_for_header_behavior_options() {
|
||||
$hide_dep_options = apply_filters( 'calla_elated_header_behavior_hide_global_option', $hide_dep_options = array() );
|
||||
|
||||
return $hide_dep_options;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ( glob( ELATED_FRAMEWORK_HEADER_ROOT_DIR . '/admin/options-map/*/*.php' ) as $options_load ) {
|
||||
include_once $options_load;
|
||||
}
|
||||
|
||||
foreach ( glob( ELATED_FRAMEWORK_HEADER_TYPES_ROOT_DIR . '/*/admin/options-map/*.php' ) as $options_load ) {
|
||||
include_once $options_load;
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_header_options_map' ) ) {
|
||||
function calla_elated_header_options_map() {
|
||||
$header_type_options = calla_elated_get_header_types_options();
|
||||
$header_type_default_option = calla_elated_get_header_type_default_options();
|
||||
$header_behavior_options_hide_dep = calla_elated_get_hide_dep_for_header_behavior_options();
|
||||
|
||||
calla_elated_add_admin_page(
|
||||
array(
|
||||
'slug' => '_header_page',
|
||||
'title' => esc_html__( 'Header', 'calla' ),
|
||||
'icon' => 'fa fa-header'
|
||||
)
|
||||
);
|
||||
|
||||
$panel_header_type = calla_elated_add_admin_panel(
|
||||
array(
|
||||
'page' => '_header_page',
|
||||
'name' => 'panel_header_type',
|
||||
'title' => esc_html__( 'Header Type', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $panel_header_type,
|
||||
'type' => 'radiogroup',
|
||||
'name' => 'header_type',
|
||||
'default_value' => $header_type_default_option,
|
||||
'label' => esc_html__( 'Choose Header Type', 'calla' ),
|
||||
'description' => esc_html__( 'Select the default header you would like to use', 'calla' ),
|
||||
'options' => $header_type_options,
|
||||
'args' => array(
|
||||
'use_images' => true,
|
||||
'hide_labels' => true,
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$panel_header = calla_elated_add_admin_panel(
|
||||
array(
|
||||
'page' => '_header_page',
|
||||
'name' => 'panel_header',
|
||||
'title' => esc_html__( 'Header Options', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $panel_header,
|
||||
'type' => 'select',
|
||||
'name' => 'header_options',
|
||||
'default_value' => $header_type_default_option,
|
||||
'label' => esc_html__( 'Choose Header Type to Customize', 'calla' ),
|
||||
'description' => esc_html__( 'Select the header type you would like to set styling and behavior options for. The header type you choose here will not affect your website\'s default header, which is chosen above, in the header type field.', 'calla' ),
|
||||
'options' => calla_elated_header_types_meta_boxes(),
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $panel_header,
|
||||
'type' => 'select',
|
||||
'name' => 'header_behaviour',
|
||||
'default_value' => 'fixed-on-scroll',
|
||||
'label' => esc_html__( 'Choose Header Behaviour', 'calla' ),
|
||||
'description' => esc_html__( 'Select the behaviour of header when you scroll down to page', 'calla' ),
|
||||
'options' => array(
|
||||
'fixed-on-scroll' => esc_html__( 'Fixed on scroll', 'calla' ),
|
||||
'no-behavior' => esc_html__( 'No Behavior', 'calla' ),
|
||||
'sticky-header-on-scroll-up' => esc_html__( 'Sticky on scroll up', 'calla' ),
|
||||
'sticky-header-on-scroll-down-up' => esc_html__( 'Sticky on scroll up/down', 'calla' )
|
||||
),
|
||||
'dependency' => array(
|
||||
'hide' => array(
|
||||
'header_options' => $header_behavior_options_hide_dep
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
/***************** Header Skin Options -start ********************/
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $panel_header,
|
||||
'type' => 'select',
|
||||
'name' => 'header_style',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Header Skin', 'calla' ),
|
||||
'description' => esc_html__( 'Choose a predefined header style for header elements (logo, main menu, side menu opener...)', 'calla' ),
|
||||
'options' => array(
|
||||
'' => esc_html__( 'Default', 'calla' ),
|
||||
'light-header' => esc_html__( 'Light', 'calla' ),
|
||||
'dark-header' => esc_html__( 'Dark', 'calla' )
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
/***************** Header Skin Options - end ********************/
|
||||
|
||||
/***************** Top Header Layout - start **********************/
|
||||
|
||||
do_action( 'calla_elated_header_top_options_map', $panel_header );
|
||||
|
||||
/***************** Top Header Layout - end **********************/
|
||||
|
||||
/***************** Logo Area Layout - start **********************/
|
||||
|
||||
do_action( 'calla_elated_header_logo_area_options_map', $panel_header );
|
||||
|
||||
/***************** Logo Area Layout - end **********************/
|
||||
|
||||
/***************** Menu Area Layout - start **********************/
|
||||
|
||||
do_action( 'calla_elated_header_menu_area_options_map', $panel_header );
|
||||
|
||||
/***************** Menu Area Layout - end **********************/
|
||||
|
||||
/***************** Additional Header Menu Area Layout - start *****************/
|
||||
|
||||
do_action( 'calla_elated_additional_header_menu_area_options_map', $panel_header );
|
||||
|
||||
/***************** Additional Header Menu Area Layout - end *****************/
|
||||
|
||||
/***************** Sticky Header Layout - start *******************/
|
||||
|
||||
do_action( 'calla_elated_header_sticky_options_map', $panel_header );
|
||||
|
||||
/***************** Sticky Header Layout - end *******************/
|
||||
|
||||
/***************** Fixed Header Layout - start ********************/
|
||||
|
||||
do_action( 'calla_elated_header_fixed_options_map', $panel_header );
|
||||
|
||||
/***************** Fixed Header Layout - end ********************/
|
||||
|
||||
/******************* Main Menu Layout - start *********************/
|
||||
|
||||
do_action( 'calla_elated_header_main_navigation_options_map' );
|
||||
|
||||
/******************* Main Menu Layout - end *********************/
|
||||
|
||||
/***************** Additional Main Menu Area Layout - start *****************/
|
||||
|
||||
do_action( 'calla_elated_additional_header_main_navigation_options_map' );
|
||||
|
||||
/***************** Additional Main Menu Area Layout - end *****************/
|
||||
}
|
||||
|
||||
add_action( 'calla_elated_options_map', 'calla_elated_header_options_map', 3 );
|
||||
}
|
||||
@@ -0,0 +1,190 @@
|
||||
<?php
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_hide_dep_for_header_logo_area_options' ) ) {
|
||||
function calla_elated_get_hide_dep_for_header_logo_area_options() {
|
||||
$hide_dep_options = apply_filters( 'calla_elated_header_logo_area_hide_global_option', $hide_dep_options = array() );
|
||||
|
||||
return $hide_dep_options;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_header_logo_area_options_map' ) ) {
|
||||
function calla_elated_header_logo_area_options_map( $panel_header ) {
|
||||
$hide_dep_options = calla_elated_get_hide_dep_for_header_logo_area_options();
|
||||
|
||||
$logo_area_container = calla_elated_add_admin_container_no_style(
|
||||
array(
|
||||
'parent' => $panel_header,
|
||||
'name' => 'logo_area_container',
|
||||
'dependency' => array(
|
||||
'hide' => array(
|
||||
'header_options' => $hide_dep_options
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_section_title(
|
||||
array(
|
||||
'parent' => $logo_area_container,
|
||||
'name' => 'logo_menu_area_title',
|
||||
'title' => esc_html__( 'Logo Area', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $logo_area_container,
|
||||
'type' => 'yesno',
|
||||
'name' => 'logo_area_in_grid',
|
||||
'default_value' => 'no',
|
||||
'label' => esc_html__( 'Logo Area In Grid', 'calla' ),
|
||||
'description' => esc_html__( 'Set menu area content to be in grid', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
$logo_area_in_grid_container = calla_elated_add_admin_container(
|
||||
array(
|
||||
'parent' => $logo_area_container,
|
||||
'dependency' => array(
|
||||
'hide' => array(
|
||||
'logo_area_in_grid' => 'no'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $logo_area_in_grid_container,
|
||||
'type' => 'color',
|
||||
'name' => 'logo_area_grid_background_color',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Grid Background Color', 'calla' ),
|
||||
'description' => esc_html__( 'Set grid background color for logo area', 'calla' ),
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $logo_area_in_grid_container,
|
||||
'type' => 'text',
|
||||
'name' => 'logo_area_grid_background_transparency',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Grid Background Transparency', 'calla' ),
|
||||
'description' => esc_html__( 'Set grid background transparency', 'calla' ),
|
||||
'args' => array(
|
||||
'col_width' => 3
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $logo_area_in_grid_container,
|
||||
'type' => 'yesno',
|
||||
'name' => 'logo_area_in_grid_border',
|
||||
'default_value' => 'no',
|
||||
'label' => esc_html__( 'Grid Area Border', 'calla' ),
|
||||
'description' => esc_html__( 'Set border on grid area', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
$logo_area_in_grid_border_container = calla_elated_add_admin_container(
|
||||
array(
|
||||
'parent' => $logo_area_in_grid_container,
|
||||
'name' => 'logo_area_in_grid_border_container',
|
||||
'dependency' => array(
|
||||
'hide' => array(
|
||||
'logo_area_in_grid_border' => 'no'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $logo_area_in_grid_border_container,
|
||||
'type' => 'color',
|
||||
'name' => 'logo_area_in_grid_border_color',
|
||||
'label' => esc_html__( 'Border Color', 'calla' ),
|
||||
'description' => esc_html__( 'Set border color for grid area', 'calla' ),
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $logo_area_container,
|
||||
'type' => 'color',
|
||||
'name' => 'logo_area_background_color',
|
||||
'label' => esc_html__( 'Background Color', 'calla' ),
|
||||
'description' => esc_html__( 'Set background color for logo area', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $logo_area_container,
|
||||
'type' => 'text',
|
||||
'name' => 'logo_area_background_transparency',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Background Transparency', 'calla' ),
|
||||
'description' => esc_html__( 'Set background transparency for logo area', 'calla' ),
|
||||
'args' => array(
|
||||
'col_width' => 3
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $logo_area_container,
|
||||
'type' => 'yesno',
|
||||
'name' => 'logo_area_border',
|
||||
'default_value' => 'no',
|
||||
'label' => esc_html__( 'Logo Area Border', 'calla' ),
|
||||
'description' => esc_html__( 'Set border on logo area', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
$logo_area_border_container = calla_elated_add_admin_container(
|
||||
array(
|
||||
'parent' => $logo_area_container,
|
||||
'name' => 'logo_area_border_container',
|
||||
'dependency' => array(
|
||||
'hide' => array(
|
||||
'logo_area_border' => 'no'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'type' => 'color',
|
||||
'name' => 'logo_area_border_color',
|
||||
'label' => esc_html__( 'Border Color', 'calla' ),
|
||||
'description' => esc_html__( 'Set border color for logo area', 'calla' ),
|
||||
'parent' => $logo_area_border_container
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'type' => 'text',
|
||||
'name' => 'logo_area_height',
|
||||
'label' => esc_html__( 'Height', 'calla' ),
|
||||
'description' => esc_html__( 'Enter logo area height (default is 90px)', 'calla' ),
|
||||
'parent' => $logo_area_container,
|
||||
'args' => array(
|
||||
'col_width' => 3,
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
do_action( 'calla_elated_header_logo_area_additional_options', $logo_area_container );
|
||||
}
|
||||
|
||||
add_action( 'calla_elated_header_logo_area_options_map', 'calla_elated_header_logo_area_options_map', 10, 1 );
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
<?php
|
||||
|
||||
if ( ! function_exists( 'calla_elated_logo_options_map' ) ) {
|
||||
function calla_elated_logo_options_map() {
|
||||
|
||||
calla_elated_add_admin_page(
|
||||
array(
|
||||
'slug' => '_logo_page',
|
||||
'title' => esc_html__( 'Logo', 'calla' ),
|
||||
'icon' => 'fa fa-coffee'
|
||||
)
|
||||
);
|
||||
|
||||
$panel_logo = calla_elated_add_admin_panel(
|
||||
array(
|
||||
'page' => '_logo_page',
|
||||
'name' => 'panel_logo',
|
||||
'title' => esc_html__( 'Logo', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $panel_logo,
|
||||
'type' => 'yesno',
|
||||
'name' => 'hide_logo',
|
||||
'default_value' => 'no',
|
||||
'label' => esc_html__( 'Hide Logo', 'calla' ),
|
||||
'description' => esc_html__( 'Enabling this option will hide logo image', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
$hide_logo_container = calla_elated_add_admin_container(
|
||||
array(
|
||||
'parent' => $panel_logo,
|
||||
'name' => 'hide_logo_container',
|
||||
'dependency' => array(
|
||||
'hide' => array(
|
||||
'hide_logo' => 'yes'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'logo_image',
|
||||
'type' => 'image',
|
||||
'default_value' => ELATED_ASSETS_ROOT . "/img/logo.png",
|
||||
'label' => esc_html__( 'Logo Image - Default', 'calla' ),
|
||||
'parent' => $hide_logo_container
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'logo_image_dark',
|
||||
'type' => 'image',
|
||||
'default_value' => ELATED_ASSETS_ROOT . "/img/logo.png",
|
||||
'label' => esc_html__( 'Logo Image - Dark', 'calla' ),
|
||||
'parent' => $hide_logo_container
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'logo_image_light',
|
||||
'type' => 'image',
|
||||
'default_value' => ELATED_ASSETS_ROOT . "/img/logo_white.png",
|
||||
'label' => esc_html__( 'Logo Image - Light', 'calla' ),
|
||||
'parent' => $hide_logo_container
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'logo_image_sticky',
|
||||
'type' => 'image',
|
||||
'default_value' => ELATED_ASSETS_ROOT . "/img/logo.png",
|
||||
'label' => esc_html__( 'Logo Image - Sticky', 'calla' ),
|
||||
'parent' => $hide_logo_container
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'logo_image_mobile',
|
||||
'type' => 'image',
|
||||
'default_value' => ELATED_ASSETS_ROOT . "/img/logo-mobile.png",
|
||||
'label' => esc_html__( 'Logo Image - Mobile', 'calla' ),
|
||||
'parent' => $hide_logo_container
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
add_action( 'calla_elated_options_map', 'calla_elated_logo_options_map', 2 );
|
||||
}
|
||||
@@ -0,0 +1,874 @@
|
||||
<?php
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_hide_dep_for_header_main_menu_options' ) ) {
|
||||
function calla_elated_get_hide_dep_for_header_main_menu_options() {
|
||||
$hide_dep_options = apply_filters( 'calla_elated_header_main_menu_hide_global_option', $hide_dep_options = array() );
|
||||
|
||||
return $hide_dep_options;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_header_main_navigation_options_map' ) ) {
|
||||
function calla_elated_header_main_navigation_options_map() {
|
||||
$hide_dep_options = calla_elated_get_hide_dep_for_header_main_menu_options();
|
||||
|
||||
$panel_main_menu = calla_elated_add_admin_panel(
|
||||
array(
|
||||
'title' => esc_html__( 'Main Menu', 'calla' ),
|
||||
'name' => 'panel_main_menu',
|
||||
'page' => '_header_page',
|
||||
'dependency' => array(
|
||||
'hide' => array(
|
||||
'header_options' => $hide_dep_options
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_section_title(
|
||||
array(
|
||||
'parent' => $panel_main_menu,
|
||||
'name' => 'main_menu_area_title',
|
||||
'title' => esc_html__( 'Main Menu General Settings', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
$drop_down_group = calla_elated_add_admin_group(
|
||||
array(
|
||||
'parent' => $panel_main_menu,
|
||||
'name' => 'drop_down_group',
|
||||
'title' => esc_html__( 'Main Dropdown Menu', 'calla' ),
|
||||
'description' => esc_html__( 'Choose a color and transparency for the main menu background (0 = fully transparent, 1 = opaque)', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
$drop_down_row1 = calla_elated_add_admin_row(
|
||||
array(
|
||||
'parent' => $drop_down_group,
|
||||
'name' => 'drop_down_row1',
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $drop_down_row1,
|
||||
'type' => 'colorsimple',
|
||||
'name' => 'dropdown_background_color',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Background Color', 'calla' ),
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $drop_down_row1,
|
||||
'type' => 'textsimple',
|
||||
'name' => 'dropdown_background_transparency',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Background Transparency', 'calla' ),
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $panel_main_menu,
|
||||
'type' => 'select',
|
||||
'name' => 'menu_dropdown_appearance',
|
||||
'default_value' => 'dropdown-animate-height',
|
||||
'label' => esc_html__( 'Main Dropdown Menu Appearance', 'calla' ),
|
||||
'description' => esc_html__( 'Choose appearance for dropdown menu', 'calla' ),
|
||||
'options' => array(
|
||||
'dropdown-default' => esc_html__( 'Default', 'calla' ),
|
||||
'dropdown-animate-height' => esc_html__( 'Animate Height', 'calla' )
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $panel_main_menu,
|
||||
'type' => 'text',
|
||||
'name' => 'dropdown_top_position',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Dropdown Position', 'calla' ),
|
||||
'description' => esc_html__( 'Enter value in percentage of entire header height', 'calla' ),
|
||||
'args' => array(
|
||||
'col_width' => 3,
|
||||
'suffix' => '%'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$first_level_group = calla_elated_add_admin_group(
|
||||
array(
|
||||
'parent' => $panel_main_menu,
|
||||
'name' => 'first_level_group',
|
||||
'title' => esc_html__( '1st Level Menu', 'calla' ),
|
||||
'description' => esc_html__( 'Define styles for 1st level in Top Navigation Menu', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
$first_level_row1 = calla_elated_add_admin_row(
|
||||
array(
|
||||
'parent' => $first_level_group,
|
||||
'name' => 'first_level_row1'
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $first_level_row1,
|
||||
'type' => 'colorsimple',
|
||||
'name' => 'menu_color',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Text Color', 'calla' ),
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $first_level_row1,
|
||||
'type' => 'colorsimple',
|
||||
'name' => 'menu_hovercolor',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Hover Text Color', 'calla' ),
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $first_level_row1,
|
||||
'type' => 'colorsimple',
|
||||
'name' => 'menu_activecolor',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Active Text Color', 'calla' ),
|
||||
)
|
||||
);
|
||||
|
||||
$first_level_row3 = calla_elated_add_admin_row(
|
||||
array(
|
||||
'parent' => $first_level_group,
|
||||
'name' => 'first_level_row3',
|
||||
'next' => true
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $first_level_row3,
|
||||
'type' => 'colorsimple',
|
||||
'name' => 'menu_light_hovercolor',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Light Menu Hover Text Color', 'calla' ),
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $first_level_row3,
|
||||
'type' => 'colorsimple',
|
||||
'name' => 'menu_light_activecolor',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Light Menu Active Text Color', 'calla' ),
|
||||
)
|
||||
);
|
||||
|
||||
$first_level_row4 = calla_elated_add_admin_row(
|
||||
array(
|
||||
'parent' => $first_level_group,
|
||||
'name' => 'first_level_row4',
|
||||
'next' => true
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $first_level_row4,
|
||||
'type' => 'colorsimple',
|
||||
'name' => 'menu_dark_hovercolor',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Dark Menu Hover Text Color', 'calla' ),
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $first_level_row4,
|
||||
'type' => 'colorsimple',
|
||||
'name' => 'menu_dark_activecolor',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Dark Menu Active Text Color', 'calla' ),
|
||||
)
|
||||
);
|
||||
|
||||
$first_level_row5 = calla_elated_add_admin_row(
|
||||
array(
|
||||
'parent' => $first_level_group,
|
||||
'name' => 'first_level_row5',
|
||||
'next' => true
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $first_level_row5,
|
||||
'type' => 'fontsimple',
|
||||
'name' => 'menu_google_fonts',
|
||||
'default_value' => '-1',
|
||||
'label' => esc_html__( 'Font Family', 'calla' ),
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $first_level_row5,
|
||||
'type' => 'textsimple',
|
||||
'name' => 'menu_font_size',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Font Size', 'calla' ),
|
||||
'args' => array(
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $first_level_row5,
|
||||
'type' => 'textsimple',
|
||||
'name' => 'menu_line_height',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Line Height', 'calla' ),
|
||||
'args' => array(
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$first_level_row6 = calla_elated_add_admin_row(
|
||||
array(
|
||||
'parent' => $first_level_group,
|
||||
'name' => 'first_level_row6',
|
||||
'next' => true
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $first_level_row6,
|
||||
'type' => 'selectblanksimple',
|
||||
'name' => 'menu_font_style',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Font Style', 'calla' ),
|
||||
'options' => calla_elated_get_font_style_array()
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $first_level_row6,
|
||||
'type' => 'selectblanksimple',
|
||||
'name' => 'menu_font_weight',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Font Weight', 'calla' ),
|
||||
'options' => calla_elated_get_font_weight_array()
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $first_level_row6,
|
||||
'type' => 'textsimple',
|
||||
'name' => 'menu_letter_spacing',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Letter Spacing', 'calla' ),
|
||||
'args' => array(
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $first_level_row6,
|
||||
'type' => 'selectblanksimple',
|
||||
'name' => 'menu_text_transform',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Text Transform', 'calla' ),
|
||||
'options' => calla_elated_get_text_transform_array()
|
||||
)
|
||||
);
|
||||
|
||||
$first_level_row7 = calla_elated_add_admin_row(
|
||||
array(
|
||||
'parent' => $first_level_group,
|
||||
'name' => 'first_level_row7',
|
||||
'next' => true
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $first_level_row7,
|
||||
'type' => 'textsimple',
|
||||
'name' => 'menu_padding_left_right',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Padding Left/Right', 'calla' ),
|
||||
'args' => array(
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $first_level_row7,
|
||||
'type' => 'textsimple',
|
||||
'name' => 'menu_margin_left_right',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Margin Left/Right', 'calla' ),
|
||||
'args' => array(
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$second_level_group = calla_elated_add_admin_group(
|
||||
array(
|
||||
'parent' => $panel_main_menu,
|
||||
'name' => 'second_level_group',
|
||||
'title' => esc_html__( '2nd Level Menu', 'calla' ),
|
||||
'description' => esc_html__( 'Define styles for 2nd level in Top Navigation Menu', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
$second_level_row1 = calla_elated_add_admin_row(
|
||||
array(
|
||||
'parent' => $second_level_group,
|
||||
'name' => 'second_level_row1'
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $second_level_row1,
|
||||
'type' => 'colorsimple',
|
||||
'name' => 'dropdown_color',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Text Color', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $second_level_row1,
|
||||
'type' => 'colorsimple',
|
||||
'name' => 'dropdown_hovercolor',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Hover/Active Color', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
$second_level_row2 = calla_elated_add_admin_row(
|
||||
array(
|
||||
'parent' => $second_level_group,
|
||||
'name' => 'second_level_row2',
|
||||
'next' => true
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $second_level_row2,
|
||||
'type' => 'fontsimple',
|
||||
'name' => 'dropdown_google_fonts',
|
||||
'default_value' => '-1',
|
||||
'label' => esc_html__( 'Font Family', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $second_level_row2,
|
||||
'type' => 'textsimple',
|
||||
'name' => 'dropdown_font_size',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Font Size', 'calla' ),
|
||||
'args' => array(
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $second_level_row2,
|
||||
'type' => 'textsimple',
|
||||
'name' => 'dropdown_line_height',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Line Height', 'calla' ),
|
||||
'args' => array(
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$second_level_row3 = calla_elated_add_admin_row(
|
||||
array(
|
||||
'parent' => $second_level_group,
|
||||
'name' => 'second_level_row3',
|
||||
'next' => true
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $second_level_row3,
|
||||
'type' => 'selectblanksimple',
|
||||
'name' => 'dropdown_font_style',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Font Style', 'calla' ),
|
||||
'options' => calla_elated_get_font_style_array()
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $second_level_row3,
|
||||
'type' => 'selectblanksimple',
|
||||
'name' => 'dropdown_font_weight',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Font Weight', 'calla' ),
|
||||
'options' => calla_elated_get_font_weight_array()
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $second_level_row3,
|
||||
'type' => 'textsimple',
|
||||
'name' => 'dropdown_letter_spacing',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Letter Spacing', 'calla' ),
|
||||
'args' => array(
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $second_level_row3,
|
||||
'type' => 'selectblanksimple',
|
||||
'name' => 'dropdown_text_transform',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Text Transform', 'calla' ),
|
||||
'options' => calla_elated_get_text_transform_array()
|
||||
)
|
||||
);
|
||||
|
||||
$second_level_wide_group = calla_elated_add_admin_group(
|
||||
array(
|
||||
'parent' => $panel_main_menu,
|
||||
'name' => 'second_level_wide_group',
|
||||
'title' => esc_html__( '2nd Level Wide Menu', 'calla' ),
|
||||
'description' => esc_html__( 'Define styles for 2nd level in Wide Menu', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
$second_level_wide_row1 = calla_elated_add_admin_row(
|
||||
array(
|
||||
'parent' => $second_level_wide_group,
|
||||
'name' => 'second_level_wide_row1'
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $second_level_wide_row1,
|
||||
'type' => 'colorsimple',
|
||||
'name' => 'dropdown_wide_color',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Text Color', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $second_level_wide_row1,
|
||||
'type' => 'colorsimple',
|
||||
'name' => 'dropdown_wide_hovercolor',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Hover/Active Color', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
$second_level_wide_row2 = calla_elated_add_admin_row(
|
||||
array(
|
||||
'parent' => $second_level_wide_group,
|
||||
'name' => 'second_level_wide_row2',
|
||||
'next' => true
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $second_level_wide_row2,
|
||||
'type' => 'fontsimple',
|
||||
'name' => 'dropdown_wide_google_fonts',
|
||||
'default_value' => '-1',
|
||||
'label' => esc_html__( 'Font Family', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $second_level_wide_row2,
|
||||
'type' => 'textsimple',
|
||||
'name' => 'dropdown_wide_font_size',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Font Size', 'calla' ),
|
||||
'args' => array(
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $second_level_wide_row2,
|
||||
'type' => 'textsimple',
|
||||
'name' => 'dropdown_wide_line_height',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Line Height', 'calla' ),
|
||||
'args' => array(
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$second_level_wide_row3 = calla_elated_add_admin_row(
|
||||
array(
|
||||
'parent' => $second_level_wide_group,
|
||||
'name' => 'second_level_wide_row3',
|
||||
'next' => true
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $second_level_wide_row3,
|
||||
'type' => 'selectblanksimple',
|
||||
'name' => 'dropdown_wide_font_style',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Font Style', 'calla' ),
|
||||
'options' => calla_elated_get_font_style_array()
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $second_level_wide_row3,
|
||||
'type' => 'selectblanksimple',
|
||||
'name' => 'dropdown_wide_font_weight',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Font Weight', 'calla' ),
|
||||
'options' => calla_elated_get_font_weight_array()
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $second_level_wide_row3,
|
||||
'type' => 'textsimple',
|
||||
'name' => 'dropdown_wide_letter_spacing',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Letter Spacing', 'calla' ),
|
||||
'args' => array(
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $second_level_wide_row3,
|
||||
'type' => 'selectblanksimple',
|
||||
'name' => 'dropdown_wide_text_transform',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Text Transform', 'calla' ),
|
||||
'options' => calla_elated_get_text_transform_array()
|
||||
)
|
||||
);
|
||||
|
||||
$third_level_group = calla_elated_add_admin_group(
|
||||
array(
|
||||
'parent' => $panel_main_menu,
|
||||
'name' => 'third_level_group',
|
||||
'title' => esc_html__( '3nd Level Menu', 'calla' ),
|
||||
'description' => esc_html__( 'Define styles for 3nd level in Top Navigation Menu', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
$third_level_row1 = calla_elated_add_admin_row(
|
||||
array(
|
||||
'parent' => $third_level_group,
|
||||
'name' => 'third_level_row1'
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $third_level_row1,
|
||||
'type' => 'colorsimple',
|
||||
'name' => 'dropdown_color_thirdlvl',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Text Color', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $third_level_row1,
|
||||
'type' => 'colorsimple',
|
||||
'name' => 'dropdown_hovercolor_thirdlvl',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Hover/Active Color', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
$third_level_row2 = calla_elated_add_admin_row(
|
||||
array(
|
||||
'parent' => $third_level_group,
|
||||
'name' => 'third_level_row2',
|
||||
'next' => true
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $third_level_row2,
|
||||
'type' => 'fontsimple',
|
||||
'name' => 'dropdown_google_fonts_thirdlvl',
|
||||
'default_value' => '-1',
|
||||
'label' => esc_html__( 'Font Family', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $third_level_row2,
|
||||
'type' => 'textsimple',
|
||||
'name' => 'dropdown_font_size_thirdlvl',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Font Size', 'calla' ),
|
||||
'args' => array(
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $third_level_row2,
|
||||
'type' => 'textsimple',
|
||||
'name' => 'dropdown_line_height_thirdlvl',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Line Height', 'calla' ),
|
||||
'args' => array(
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$third_level_row3 = calla_elated_add_admin_row(
|
||||
array(
|
||||
'parent' => $third_level_group,
|
||||
'name' => 'third_level_row3',
|
||||
'next' => true
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $third_level_row3,
|
||||
'type' => 'selectblanksimple',
|
||||
'name' => 'dropdown_font_style_thirdlvl',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Font Style', 'calla' ),
|
||||
'options' => calla_elated_get_font_style_array()
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $third_level_row3,
|
||||
'type' => 'selectblanksimple',
|
||||
'name' => 'dropdown_font_weight_thirdlvl',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Font Weight', 'calla' ),
|
||||
'options' => calla_elated_get_font_weight_array()
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $third_level_row3,
|
||||
'type' => 'textsimple',
|
||||
'name' => 'dropdown_letter_spacing_thirdlvl',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Letter Spacing', 'calla' ),
|
||||
'args' => array(
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $third_level_row3,
|
||||
'type' => 'selectblanksimple',
|
||||
'name' => 'dropdown_text_transform_thirdlvl',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Text Transform', 'calla' ),
|
||||
'options' => calla_elated_get_text_transform_array()
|
||||
)
|
||||
);
|
||||
|
||||
$third_level_wide_group = calla_elated_add_admin_group(
|
||||
array(
|
||||
'parent' => $panel_main_menu,
|
||||
'name' => 'third_level_wide_group',
|
||||
'title' => esc_html__( '3rd Level Wide Menu', 'calla' ),
|
||||
'description' => esc_html__( 'Define styles for 3rd level in Wide Menu', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
$third_level_wide_row1 = calla_elated_add_admin_row(
|
||||
array(
|
||||
'parent' => $third_level_wide_group,
|
||||
'name' => 'third_level_wide_row1'
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $third_level_wide_row1,
|
||||
'type' => 'colorsimple',
|
||||
'name' => 'dropdown_wide_color_thirdlvl',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Text Color', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $third_level_wide_row1,
|
||||
'type' => 'colorsimple',
|
||||
'name' => 'dropdown_wide_hovercolor_thirdlvl',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Hover/Active Color', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
$third_level_wide_row2 = calla_elated_add_admin_row(
|
||||
array(
|
||||
'parent' => $third_level_wide_group,
|
||||
'name' => 'third_level_wide_row2',
|
||||
'next' => true
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $third_level_wide_row2,
|
||||
'type' => 'fontsimple',
|
||||
'name' => 'dropdown_wide_google_fonts_thirdlvl',
|
||||
'default_value' => '-1',
|
||||
'label' => esc_html__( 'Font Family', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $third_level_wide_row2,
|
||||
'type' => 'textsimple',
|
||||
'name' => 'dropdown_wide_font_size_thirdlvl',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Font Size', 'calla' ),
|
||||
'args' => array(
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $third_level_wide_row2,
|
||||
'type' => 'textsimple',
|
||||
'name' => 'dropdown_wide_line_height_thirdlvl',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Line Height', 'calla' ),
|
||||
'args' => array(
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$third_level_wide_row3 = calla_elated_add_admin_row(
|
||||
array(
|
||||
'parent' => $third_level_wide_group,
|
||||
'name' => 'third_level_wide_row3',
|
||||
'next' => true
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $third_level_wide_row3,
|
||||
'type' => 'selectblanksimple',
|
||||
'name' => 'dropdown_wide_font_style_thirdlvl',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Font Style', 'calla' ),
|
||||
'options' => calla_elated_get_font_style_array()
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $third_level_wide_row3,
|
||||
'type' => 'selectblanksimple',
|
||||
'name' => 'dropdown_wide_font_weight_thirdlvl',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Font Weight', 'calla' ),
|
||||
'options' => calla_elated_get_font_weight_array()
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $third_level_wide_row3,
|
||||
'type' => 'textsimple',
|
||||
'name' => 'dropdown_wide_letter_spacing_thirdlvl',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Letter Spacing', 'calla' ),
|
||||
'args' => array(
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $third_level_wide_row3,
|
||||
'type' => 'selectblanksimple',
|
||||
'name' => 'dropdown_wide_text_transform_thirdlvl',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Text Transform', 'calla' ),
|
||||
'options' => calla_elated_get_text_transform_array()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
add_action( 'calla_elated_header_main_navigation_options_map', 'calla_elated_header_main_navigation_options_map', 10, 1 );
|
||||
}
|
||||
@@ -0,0 +1,228 @@
|
||||
<?php
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_hide_dep_for_header_menu_area_options' ) ) {
|
||||
function calla_elated_get_hide_dep_for_header_menu_area_options() {
|
||||
$hide_dep_options = apply_filters( 'calla_elated_header_menu_area_hide_global_option', $hide_dep_options = array() );
|
||||
|
||||
return $hide_dep_options;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_header_menu_area_options_map' ) ) {
|
||||
function calla_elated_header_menu_area_options_map( $panel_header ) {
|
||||
$hide_dep_options = calla_elated_get_hide_dep_for_header_menu_area_options();
|
||||
|
||||
$menu_area_container = calla_elated_add_admin_container_no_style(
|
||||
array(
|
||||
'parent' => $panel_header,
|
||||
'name' => 'menu_area_container',
|
||||
'dependency' => array(
|
||||
'hide' => array(
|
||||
'header_options' => $hide_dep_options
|
||||
)
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_section_title(
|
||||
array(
|
||||
'parent' => $menu_area_container,
|
||||
'name' => 'menu_area_style',
|
||||
'title' => esc_html__( 'Menu Area Style', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $menu_area_container,
|
||||
'type' => 'yesno',
|
||||
'name' => 'menu_area_in_grid',
|
||||
'default_value' => 'no',
|
||||
'label' => esc_html__( 'Menu Area In Grid', 'calla' ),
|
||||
'description' => esc_html__( 'Set menu area content to be in grid', 'calla' ),
|
||||
)
|
||||
);
|
||||
|
||||
$menu_area_in_grid_container = calla_elated_add_admin_container(
|
||||
array(
|
||||
'parent' => $menu_area_container,
|
||||
'name' => 'menu_area_in_grid_container',
|
||||
'dependency' => array(
|
||||
'hide' => array(
|
||||
'menu_area_in_grid' => 'no'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $menu_area_in_grid_container,
|
||||
'type' => 'color',
|
||||
'name' => 'menu_area_grid_background_color',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Grid Background Color', 'calla' ),
|
||||
'description' => esc_html__( 'Set grid background color for menu area', 'calla' ),
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $menu_area_in_grid_container,
|
||||
'type' => 'text',
|
||||
'name' => 'menu_area_grid_background_transparency',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Grid Background Transparency', 'calla' ),
|
||||
'description' => esc_html__( 'Set grid background transparency for menu area', 'calla' ),
|
||||
'args' => array(
|
||||
'col_width' => 3
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $menu_area_in_grid_container,
|
||||
'type' => 'yesno',
|
||||
'name' => 'menu_area_in_grid_shadow',
|
||||
'default_value' => 'no',
|
||||
'label' => esc_html__( 'Grid Area Shadow', 'calla' ),
|
||||
'description' => esc_html__( 'Set shadow on grid area', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $menu_area_in_grid_container,
|
||||
'type' => 'yesno',
|
||||
'name' => 'menu_area_in_grid_border',
|
||||
'default_value' => 'no',
|
||||
'label' => esc_html__( 'Grid Area Border', 'calla' ),
|
||||
'description' => esc_html__( 'Set border on grid area', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
$menu_area_in_grid_border_container = calla_elated_add_admin_container(
|
||||
array(
|
||||
'parent' => $menu_area_in_grid_container,
|
||||
'name' => 'menu_area_in_grid_border_container',
|
||||
'dependency' => array(
|
||||
'hide' => array(
|
||||
'menu_area_in_grid_border' => 'no'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $menu_area_in_grid_border_container,
|
||||
'type' => 'color',
|
||||
'name' => 'menu_area_in_grid_border_color',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Border Color', 'calla' ),
|
||||
'description' => esc_html__( 'Set border color for menu area', 'calla' ),
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $menu_area_container,
|
||||
'type' => 'color',
|
||||
'name' => 'menu_area_background_color',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Background Color', 'calla' ),
|
||||
'description' => esc_html__( 'Set background color for menu area', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $menu_area_container,
|
||||
'type' => 'text',
|
||||
'name' => 'menu_area_background_transparency',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Background Transparency', 'calla' ),
|
||||
'description' => esc_html__( 'Set background transparency for menu area', 'calla' ),
|
||||
'args' => array(
|
||||
'col_width' => 3
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $menu_area_container,
|
||||
'type' => 'yesno',
|
||||
'name' => 'menu_area_shadow',
|
||||
'default_value' => 'no',
|
||||
'label' => esc_html__( 'Menu Area Area Shadow', 'calla' ),
|
||||
'description' => esc_html__( 'Set shadow on menu area', 'calla' ),
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'type' => 'yesno',
|
||||
'name' => 'menu_area_border',
|
||||
'default_value' => 'no',
|
||||
'label' => esc_html__( 'Menu Area Border', 'calla' ),
|
||||
'description' => esc_html__( 'Set border on menu area', 'calla' ),
|
||||
'parent' => $menu_area_container
|
||||
)
|
||||
);
|
||||
|
||||
$menu_area_border_container = calla_elated_add_admin_container(
|
||||
array(
|
||||
'parent' => $menu_area_container,
|
||||
'name' => 'menu_area_border_container',
|
||||
'dependency' => array(
|
||||
'hide' => array(
|
||||
'menu_area_border' => 'no'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'type' => 'color',
|
||||
'name' => 'menu_area_border_color',
|
||||
'label' => esc_html__( 'Border Color', 'calla' ),
|
||||
'description' => esc_html__( 'Set border color for menu area', 'calla' ),
|
||||
'parent' => $menu_area_border_container
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'type' => 'text',
|
||||
'name' => 'menu_area_height',
|
||||
'label' => esc_html__( 'Height', 'calla' ),
|
||||
'description' => esc_html__( 'Enter header height', 'calla' ),
|
||||
'parent' => $menu_area_container,
|
||||
'args' => array(
|
||||
'col_width' => 3,
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'type' => 'text',
|
||||
'name' => 'menu_area_side_padding',
|
||||
'label' => esc_html__( 'Menu Area Side Padding', 'calla' ),
|
||||
'parent' => $menu_area_container,
|
||||
'args' => array(
|
||||
'col_width' => 2,
|
||||
'suffix' => esc_html__( 'px or %', 'calla' )
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
do_action( 'calla_elated_header_menu_area_additional_options', $panel_header );
|
||||
}
|
||||
|
||||
add_action( 'calla_elated_header_menu_area_options_map', 'calla_elated_header_menu_area_options_map', 10, 1 );
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
/* ==========================================================================
|
||||
Header responsive styles - begin
|
||||
========================================================================== */
|
||||
/* common mixins - start */
|
||||
/* common mixins - end */
|
||||
/* mixins styles - start */
|
||||
/* mixins styles - end */
|
||||
/* ==========================================================================
|
||||
Header responsive style - begin
|
||||
========================================================================== */
|
||||
@media only screen and (max-width: 1200px) {
|
||||
.eltdf-drop-down .wide .second > .inner > ul {
|
||||
width: 950px;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 1024px) {
|
||||
.eltdf-page-header {
|
||||
display: none;
|
||||
}
|
||||
.eltdf-drop-down .wide .second > .inner > ul {
|
||||
width: 768px;
|
||||
}
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Header responsive style - end
|
||||
========================================================================== */
|
||||
/* ==========================================================================
|
||||
Fixed header responsive style - begin
|
||||
========================================================================== */
|
||||
@media only screen and (max-width: 1200px) {
|
||||
.eltdf-boxed .eltdf-page-header .eltdf-fixed-wrapper.fixed {
|
||||
width: 1000px;
|
||||
}
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Fixed header responsive style - end
|
||||
========================================================================== */
|
||||
/* ==========================================================================
|
||||
Mobile header responsive style - begin
|
||||
========================================================================== */
|
||||
@media only screen and (max-width: 1024px) {
|
||||
.eltdf-mobile-header {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Mobile header responsive style - end
|
||||
========================================================================== */
|
||||
/* ==========================================================================
|
||||
Sticky header responsive style - begin
|
||||
========================================================================== */
|
||||
@media only screen and (max-width: 1200px) {
|
||||
.eltdf-boxed .eltdf-page-header .eltdf-sticky-header {
|
||||
width: 1000px;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 1024px) {
|
||||
.eltdf-boxed.eltdf-sticky-up-mobile-header .mobile-header-appear .eltdf-mobile-header-inner {
|
||||
width: 818px;
|
||||
left: auto;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 768px) {
|
||||
.eltdf-boxed.eltdf-sticky-up-mobile-header .mobile-header-appear .eltdf-mobile-header-inner {
|
||||
width: 650px;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 680px) {
|
||||
.eltdf-boxed.eltdf-sticky-up-mobile-header .mobile-header-appear .eltdf-mobile-header-inner {
|
||||
width: 470px;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 480px) {
|
||||
.eltdf-boxed.eltdf-sticky-up-mobile-header .mobile-header-appear .eltdf-mobile-header-inner {
|
||||
width: 350px;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 320px) {
|
||||
.eltdf-boxed.eltdf-sticky-up-mobile-header .mobile-header-appear .eltdf-mobile-header-inner {
|
||||
width: 92%;
|
||||
}
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Sticky header responsive style - end
|
||||
========================================================================== */
|
||||
/* ==========================================================================
|
||||
Top header responsive style - begin
|
||||
========================================================================== */
|
||||
@media only screen and (max-width: 1024px) {
|
||||
.eltdf-top-bar {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Top header responsive style - end
|
||||
========================================================================== */
|
||||
/* ==========================================================================
|
||||
Header responsive styles - end
|
||||
========================================================================== */
|
||||
|
||||
/*# sourceMappingURL=header-map-responsive.css.map */
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"header-map-responsive.css","sources":["header/assets/css/scss/header-map-responsive.scss","../../assets/css/scss/_variables.scss","../../assets/css/scss/_mixins.scss","header/assets/css/scss/responsive/_header-responsive.scss","header/types/fixed-header/assets/css/scss/responsive/_fixed-header-responsive.scss","header/types/mobile-header/assets/css/scss/responsive/_mobile-header-responsive.scss","header/types/sticky-header/assets/css/scss/responsive/_sticky-header-responsive.scss","header/types/top-header/assets/css/scss/responsive/_top-header-responsive.scss"],"names":[],"mappings":"AAAA;;gFAEgF;AEkKhF,2BAA2B;AAqL3B,yBAAyB;AAEzB,2BAA2B;AA+B3B,yBAAyB;AC1XzB;;gFAEgF;AD+Y/E,MAAM,MAAM,MAAM,MAAM,SAAS,EAAE,MAAM;EC3YzC,AAAA,gBAAgB,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,GAAG,EAAE,CAAC;IAC5C,KAAK,EFMuB,KAAK;GELjC;;;AD+YD,MAAM,MAAM,MAAM,MAAM,SAAS,EAAE,MAAM;EC1YtC,AAAA,kBAAkB,CAAC;IACrB,OAAO,EAAE,IAAI;GACb;EAED,AAAA,gBAAgB,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,GAAG,EAAE,CAAC;IAC5C,KAAK,EFJqB,KAAK;GEK/B;;;AAEF;;gFAEgF;ACvBhF;;gFAEgF;AF+Y/E,MAAM,MAAM,MAAM,MAAM,SAAS,EAAE,MAAM;EE3YtC,AAAA,YAAY,CAAC,kBAAkB,CAAC,oBAAoB,AAAA,MAAM,CAAC;IACvD,KAAK,EHcuB,MAAM;GGbrC;;;AAEL;;gFAEgF;ACZhF;;gFAEgF;AHqZ/E,MAAM,MAAM,MAAM,MAAM,SAAS,EAAE,MAAM;EGjZzC,AAAA,oBAAoB,CAAC;IACpB,OAAO,EAAE,KAAK;GACd;;;AAEF;;gFAEgF;ACZhF;;gFAEgF;AJ+Y/E,MAAM,MAAM,MAAM,MAAM,SAAS,EAAE,MAAM;EI7Y1C,AAEC,YAFW,CAEX,kBAAkB,CAAC,oBAAoB,CAAC;IAEtC,KAAK,ELa4B,MAAM;GKXxC;;;AJ6YD,MAAM,MAAM,MAAM,MAAM,SAAS,EAAE,MAAM;EInZ1C,AAQC,YARW,AAQV,8BAA8B,CAAC,qBAAqB,CAAC,0BAA0B,CAAC;IAE/E,KAAK,ELQ0B,KAAK;IKPpC,IAAI,EAAE,IAAI;GAkBX;;;AJ4XD,MAAM,MAAM,MAAM,MAAM,SAAS,EAAE,KAAK;EIzZzC,AAQC,YARW,AAQV,8BAA8B,CAAC,qBAAqB,CAAC,0BAA0B,CAAC;IAO/E,KAAK,ELIyB,KAAK;GKUpC;;;AJkYD,MAAM,MAAM,MAAM,MAAM,SAAS,EAAE,KAAK;EI/ZzC,AAQC,YARW,AAQV,8BAA8B,CAAC,qBAAqB,CAAC,0BAA0B,CAAC;IAW/E,KAAK,ELC2B,KAAK;GKStC;;;AJwYD,MAAM,MAAM,MAAM,MAAM,SAAS,EAAE,KAAK;EIrazC,AAQC,YARW,AAQV,8BAA8B,CAAC,qBAAqB,CAAC,0BAA0B,CAAC;IAe/E,KAAK,ELF0B,KAAK;GKQrC;;;AJ8YD,MAAM,MAAM,MAAM,MAAM,SAAS,EAAE,KAAK;EI3azC,AAQC,YARW,AAQV,8BAA8B,CAAC,qBAAqB,CAAC,0BAA0B,CAAC;IAmB/E,KAAK,ELLkC,GAAG;GKO3C;;;AAEF;;gFAEgF;ACrChF;;gFAEgF;ALqZ/E,MAAM,MAAM,MAAM,MAAM,SAAS,EAAE,MAAM;EKjZzC,AAAA,cAAc,CAAC;IACd,OAAO,EAAE,IAAI;GACb;;;AAEF;;gFAEgF;APAhF;;gFAEgF","sourceRoot":"../../../../../css"}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -0,0 +1,208 @@
|
||||
(function($) {
|
||||
"use strict";
|
||||
|
||||
var header = {};
|
||||
eltdf.modules.header = header;
|
||||
|
||||
header.eltdfSetDropDownMenuPosition = eltdfSetDropDownMenuPosition;
|
||||
header.eltdfSetDropDownWideMenuPosition = eltdfSetDropDownWideMenuPosition;
|
||||
|
||||
header.eltdfOnDocumentReady = eltdfOnDocumentReady;
|
||||
header.eltdfOnWindowLoad = eltdfOnWindowLoad;
|
||||
|
||||
$(document).ready(eltdfOnDocumentReady);
|
||||
$(window).on('load', eltdfOnWindowLoad);
|
||||
|
||||
/*
|
||||
All functions to be called on $(document).ready() should be in this function
|
||||
*/
|
||||
function eltdfOnDocumentReady() {
|
||||
eltdfSetDropDownMenuPosition();
|
||||
eltdfDropDownMenu();
|
||||
}
|
||||
|
||||
/*
|
||||
All functions to be called on $(window).load() should be in this function
|
||||
*/
|
||||
function eltdfOnWindowLoad() {
|
||||
eltdfSetDropDownWideMenuPosition();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set dropdown position
|
||||
*/
|
||||
function eltdfSetDropDownMenuPosition() {
|
||||
var menuItems = $('.eltdf-drop-down > ul > li.narrow.menu-item-has-children');
|
||||
|
||||
if (menuItems.length) {
|
||||
menuItems.each(function (i) {
|
||||
var thisItem = $(this),
|
||||
menuItemPosition = thisItem.offset().left,
|
||||
dropdownHolder = thisItem.find('.second'),
|
||||
dropdownMenuItem = dropdownHolder.find('.inner ul'),
|
||||
dropdownMenuWidth = dropdownMenuItem.outerWidth(),
|
||||
menuItemFromLeft = eltdf.windowWidth - menuItemPosition;
|
||||
|
||||
if (eltdf.body.hasClass('eltdf-boxed')) {
|
||||
menuItemFromLeft = eltdf.boxedLayoutWidth - (menuItemPosition - (eltdf.windowWidth - eltdf.boxedLayoutWidth ) / 2);
|
||||
}
|
||||
|
||||
var dropDownMenuFromLeft; //has to stay undefined because 'dropDownMenuFromLeft < dropdownMenuWidth' conditional will be true
|
||||
|
||||
if (thisItem.find('li.sub').length > 0) {
|
||||
dropDownMenuFromLeft = menuItemFromLeft - dropdownMenuWidth;
|
||||
}
|
||||
|
||||
dropdownHolder.removeClass('right');
|
||||
dropdownMenuItem.removeClass('right');
|
||||
if (menuItemFromLeft < dropdownMenuWidth || dropDownMenuFromLeft < dropdownMenuWidth) {
|
||||
dropdownHolder.addClass('right');
|
||||
dropdownMenuItem.addClass('right');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set dropdown wide position
|
||||
*/
|
||||
function eltdfSetDropDownWideMenuPosition(){
|
||||
var menuItems = $(".eltdf-drop-down > ul > li.wide");
|
||||
|
||||
if(menuItems.length) {
|
||||
menuItems.each( function(i) {
|
||||
var menuItemSubMenu = $(menuItems[i]).find('.second');
|
||||
|
||||
if(menuItemSubMenu.length && !menuItemSubMenu.hasClass('left_position') && !menuItemSubMenu.hasClass('right_position')) {
|
||||
menuItemSubMenu.css('left', 0);
|
||||
|
||||
var left_position = menuItemSubMenu.offset().left;
|
||||
|
||||
if(eltdf.body.hasClass('eltdf-boxed')) {
|
||||
var boxedWidth = $('.eltdf-boxed .eltdf-wrapper .eltdf-wrapper-inner').outerWidth();
|
||||
left_position = left_position - (eltdf.windowWidth - boxedWidth) / 2;
|
||||
|
||||
menuItemSubMenu.css({'left': -left_position, 'width': boxedWidth});
|
||||
} else {
|
||||
menuItemSubMenu.css({'left': -left_position, 'width': eltdf.windowWidth});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function eltdfDropDownMenu() {
|
||||
var menu_items = $('.eltdf-drop-down > ul > li');
|
||||
|
||||
menu_items.each(function(i) {
|
||||
if($(menu_items[i]).find('.second').length > 0) {
|
||||
var thisItem = $(menu_items[i]),
|
||||
dropDownSecondDiv = thisItem.find('.second');
|
||||
|
||||
if(thisItem.hasClass('wide')) {
|
||||
//set columns to be same height - start
|
||||
var tallest = 0,
|
||||
dropDownSecondItem = $(this).find('.second > .inner > ul > li');
|
||||
|
||||
dropDownSecondItem.each(function() {
|
||||
var thisHeight = $(this).height();
|
||||
if(thisHeight > tallest) {
|
||||
tallest = thisHeight;
|
||||
}
|
||||
});
|
||||
|
||||
dropDownSecondItem.css('height', ''); // delete old inline css - via resize
|
||||
dropDownSecondItem.height(tallest);
|
||||
//set columns to be same height - end
|
||||
}
|
||||
|
||||
if(!eltdf.menuDropdownHeightSet) {
|
||||
thisItem.data('original_height', dropDownSecondDiv.height() + 'px');
|
||||
dropDownSecondDiv.height(0);
|
||||
}
|
||||
|
||||
if(navigator.userAgent.match(/(iPod|iPhone|iPad)/)) {
|
||||
thisItem.on("touchstart mouseenter", function() {
|
||||
dropDownSecondDiv.css({
|
||||
'height': thisItem.data('original_height'),
|
||||
'overflow': 'visible',
|
||||
'visibility': 'visible',
|
||||
'opacity': '1'
|
||||
});
|
||||
}).on("mouseleave", function() {
|
||||
dropDownSecondDiv.css({
|
||||
'height': '0px',
|
||||
'overflow': 'hidden',
|
||||
'visibility': 'hidden',
|
||||
'opacity': '0'
|
||||
});
|
||||
});
|
||||
} else {
|
||||
if (eltdf.body.hasClass('eltdf-dropdown-animate-height')) {
|
||||
var animateConfig = {
|
||||
interval: 0,
|
||||
over: function () {
|
||||
setTimeout(function () {
|
||||
dropDownSecondDiv.addClass('eltdf-drop-down-start').css({
|
||||
'visibility': 'visible',
|
||||
'height': '0px',
|
||||
'opacity': '1'
|
||||
});
|
||||
dropDownSecondDiv.stop().animate({
|
||||
'height': thisItem.data('original_height')
|
||||
}, 400, 'easeInOutQuint', function () {
|
||||
dropDownSecondDiv.css('overflow', 'visible');
|
||||
});
|
||||
}, 100);
|
||||
},
|
||||
timeout: 100,
|
||||
out: function () {
|
||||
dropDownSecondDiv.stop().animate({
|
||||
'height': '0px',
|
||||
'opacity': 0
|
||||
}, 100, function () {
|
||||
dropDownSecondDiv.css({
|
||||
'overflow': 'hidden',
|
||||
'visibility': 'hidden'
|
||||
});
|
||||
});
|
||||
|
||||
dropDownSecondDiv.removeClass('eltdf-drop-down-start');
|
||||
}
|
||||
};
|
||||
|
||||
thisItem.hoverIntent(animateConfig);
|
||||
} else {
|
||||
var config = {
|
||||
interval: 0,
|
||||
over: function () {
|
||||
setTimeout(function () {
|
||||
dropDownSecondDiv.addClass('eltdf-drop-down-start').stop().css({'height': thisItem.data('original_height')});
|
||||
}, 150);
|
||||
},
|
||||
timeout: 150,
|
||||
out: function () {
|
||||
dropDownSecondDiv.stop().css({'height': '0px'}).removeClass('eltdf-drop-down-start');
|
||||
}
|
||||
};
|
||||
|
||||
thisItem.hoverIntent(config);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('.eltdf-drop-down ul li.wide ul li a').on('click', function(e) {
|
||||
if (e.which === 1){
|
||||
var $this = $(this);
|
||||
|
||||
setTimeout(function() {
|
||||
$this.mouseleave();
|
||||
}, 500);
|
||||
}
|
||||
});
|
||||
|
||||
eltdf.menuDropdownHeightSet = true;
|
||||
}
|
||||
|
||||
})(jQuery);
|
||||
163
wp-content/themes/calla/framework/modules/header/functions.php
Normal file
163
wp-content/themes/calla/framework/modules/header/functions.php
Normal file
@@ -0,0 +1,163 @@
|
||||
<?php
|
||||
|
||||
if ( ! function_exists( 'calla_elated_include_header_types' ) ) {
|
||||
/**
|
||||
* Load's all header types by going through all folders that are placed directly in header types folder
|
||||
*/
|
||||
function calla_elated_include_header_types() {
|
||||
foreach ( glob( ELATED_FRAMEWORK_HEADER_ROOT_DIR . '/types/*/load.php' ) as $module_load ) {
|
||||
include_once $module_load;
|
||||
}
|
||||
}
|
||||
|
||||
add_action( 'init', 'calla_elated_include_header_types', 0 ); // 0 is set so we can be able to register widgets for header types because of widget_ini action
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_include_header_types_before_load' ) ) {
|
||||
/**
|
||||
* Load's all header types before load files by going through all folders that are placed directly in header types folder.
|
||||
* Functions from this files before-load are used to set all hooks and variables before global options map are init
|
||||
*/
|
||||
function calla_elated_include_header_types_before_load() {
|
||||
foreach ( glob( ELATED_FRAMEWORK_HEADER_ROOT_DIR . '/types/*/before-load.php' ) as $module_load ) {
|
||||
include_once $module_load;
|
||||
}
|
||||
}
|
||||
|
||||
add_action( 'calla_elated_options_map', 'calla_elated_include_header_types_before_load', 1 ); // 1 is set to just be before header option map init
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_include_header_types_after_load' ) ) {
|
||||
/**
|
||||
* Load's all header types after load files by going through all folders that are placed directly in header types folder.
|
||||
* Functions from this files after-load are used to set all hooks that are used for header types options and template files
|
||||
*/
|
||||
function calla_elated_include_header_types_after_load() {
|
||||
foreach ( glob( ELATED_FRAMEWORK_HEADER_ROOT_DIR . '/types/*/after-load.php' ) as $module_load ) {
|
||||
include_once $module_load;
|
||||
}
|
||||
}
|
||||
|
||||
add_action( 'wp', 'calla_elated_include_header_types_after_load', 11 ); // 11 is set to be after wp query loaded to be sure that object id is set
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_include_custom_walker_navigation_for_header_types' ) ) {
|
||||
/**
|
||||
* Load's all custom walkers navigation from header types folder
|
||||
*/
|
||||
function calla_elated_include_custom_walker_navigation_for_header_types() {
|
||||
foreach ( glob( ELATED_FRAMEWORK_HEADER_ROOT_DIR . '/types/*/nav-menu/*.php' ) as $module_load ) {
|
||||
include_once $module_load;
|
||||
}
|
||||
}
|
||||
|
||||
add_action( 'calla_elated_include_custom_walkers_nav', 'calla_elated_include_custom_walker_navigation_for_header_types' );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_header_register_main_navigation' ) ) {
|
||||
/**
|
||||
* Registers main navigation
|
||||
*/
|
||||
function calla_elated_header_register_main_navigation() {
|
||||
$headers_menu_array = apply_filters( 'calla_elated_register_headers_menu', array( 'main-navigation' => esc_html__( 'Main Navigation', 'calla' ) ) );
|
||||
|
||||
register_nav_menus( $headers_menu_array );
|
||||
}
|
||||
|
||||
add_action( 'init', 'calla_elated_header_register_main_navigation' );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_header_widget_areas' ) ) {
|
||||
/**
|
||||
* Registers widget areas for header types
|
||||
*/
|
||||
function calla_elated_header_widget_areas() {
|
||||
register_sidebar(
|
||||
array(
|
||||
'id' => 'eltdf-header-widget-logo-area',
|
||||
'name' => esc_html__( 'Header Widget Logo Area', 'calla' ),
|
||||
'before_widget' => '<div id="%1$s" class="widget %2$s eltdf-header-widget-logo-area">',
|
||||
'after_widget' => '</div>',
|
||||
'description' => esc_html__( 'Widgets added here will appear in the logo area', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
if (calla_elated_core_plugin_installed()) {
|
||||
register_sidebar(
|
||||
array(
|
||||
'id' => 'eltdf-header-widget-menu-area',
|
||||
'name' => esc_html__('Header Widget Menu Area', 'calla'),
|
||||
'before_widget' => '<div id="%1$s" class="widget %2$s eltdf-header-widget-menu-area">',
|
||||
'after_widget' => '</div>',
|
||||
'description' => esc_html__('Widgets added here will appear in the menu area', 'calla')
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
add_action( 'widgets_init', 'calla_elated_header_widget_areas' );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_header_type_meta_values' ) ) {
|
||||
/**
|
||||
* Function which get all meta values from database for header types
|
||||
*/
|
||||
function calla_elated_get_header_type_meta_values() {
|
||||
global $wpdb;
|
||||
global $eltdf_header_types_values;
|
||||
|
||||
if ( calla_elated_is_wpml_installed() ) {
|
||||
$lang = ICL_LANGUAGE_CODE;
|
||||
|
||||
$sql = "SELECT pm.meta_value
|
||||
FROM {$wpdb->prefix}postmeta pm
|
||||
LEFT JOIN {$wpdb->prefix}posts p ON p.ID = pm.post_id
|
||||
LEFT JOIN {$wpdb->prefix}icl_translations icl_t ON icl_t.element_id = p.ID
|
||||
WHERE pm.meta_key = 'eltdf_header_type_meta'
|
||||
AND icl_t.language_code='$lang'";
|
||||
} else {
|
||||
$sql = "SELECT pm.meta_value
|
||||
FROM {$wpdb->prefix}postmeta pm
|
||||
WHERE pm.meta_key = 'eltdf_header_type_meta'";
|
||||
}
|
||||
|
||||
$results = $wpdb->get_results( $sql, ARRAY_A );
|
||||
|
||||
if ( ! ( is_array( $results ) && count( $results ) ) ) {
|
||||
$eltdf_header_types_values = false;
|
||||
} else {
|
||||
$results_array = array();
|
||||
foreach ( $results as $result ) {
|
||||
foreach ( $result as $value ) {
|
||||
$results_array[] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$eltdf_header_types_values = $results_array;
|
||||
}
|
||||
}
|
||||
|
||||
add_action( 'after_setup_theme', 'calla_elated_get_header_type_meta_values', 2 ); // privileges 2 is set because load.php files for modules are init with privileges 1
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_check_is_header_type_enabled' ) ) {
|
||||
/**
|
||||
* This function check is forwarded header type enabled in global option or meta boxes option
|
||||
*/
|
||||
function calla_elated_check_is_header_type_enabled( $header_type = '', $page_id = '' ) {
|
||||
global $eltdf_header_types_values;
|
||||
$per_page_header_types = $eltdf_header_types_values;
|
||||
|
||||
if ( ! empty( $page_id ) ) {
|
||||
$global_header_type = calla_elated_get_meta_field_intersect( 'header_type', $page_id );
|
||||
} else {
|
||||
$global_header_type = calla_elated_options()->getOptionValue( 'header_type' );
|
||||
}
|
||||
|
||||
if ( ! empty( $per_page_header_types ) && empty( $page_id ) ) {
|
||||
return in_array( $header_type, $per_page_header_types ) || $header_type === $global_header_type;
|
||||
} else {
|
||||
return $global_header_type === $header_type;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,321 @@
|
||||
<?php
|
||||
|
||||
if ( ! function_exists( 'calla_elated_header_skin_class' ) ) {
|
||||
/**
|
||||
* Function that adds header style class to body tag
|
||||
*/
|
||||
function calla_elated_header_skin_class( $classes ) {
|
||||
$header_style = calla_elated_get_meta_field_intersect( 'header_style', calla_elated_get_page_id() );
|
||||
$header_style_404 = calla_elated_options()->getOptionValue( '404_header_style' );
|
||||
|
||||
if ( is_404() && ! empty( $header_style_404 ) ) {
|
||||
$classes[] = 'eltdf-' . $header_style_404;
|
||||
} else if ( ! empty( $header_style ) ) {
|
||||
$classes[] = 'eltdf-' . $header_style;
|
||||
}
|
||||
|
||||
return $classes;
|
||||
}
|
||||
|
||||
add_filter( 'body_class', 'calla_elated_header_skin_class' );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_sticky_header_behaviour_class' ) ) {
|
||||
/**
|
||||
* Function that adds header behavior class to body tag
|
||||
*/
|
||||
function calla_elated_sticky_header_behaviour_class( $classes ) {
|
||||
$header_behavior = calla_elated_get_meta_field_intersect( 'header_behaviour', calla_elated_get_page_id() );
|
||||
|
||||
if ( ! empty( $header_behavior ) ) {
|
||||
$classes[] = 'eltdf-' . $header_behavior;
|
||||
}
|
||||
|
||||
return $classes;
|
||||
}
|
||||
|
||||
add_filter( 'body_class', 'calla_elated_sticky_header_behaviour_class' );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_menu_dropdown_appearance' ) ) {
|
||||
/**
|
||||
* Function that adds menu dropdown appearance class to body tag
|
||||
*
|
||||
* @param array array of classes from main filter
|
||||
*
|
||||
* @return array array of classes with added menu dropdown appearance class
|
||||
*/
|
||||
function calla_elated_menu_dropdown_appearance( $classes ) {
|
||||
$dropdown_menu_appearance = calla_elated_options()->getOptionValue( 'menu_dropdown_appearance' );
|
||||
|
||||
if ( $dropdown_menu_appearance !== 'default' ) {
|
||||
$classes[] = 'eltdf-' . $dropdown_menu_appearance;
|
||||
}
|
||||
|
||||
return $classes;
|
||||
}
|
||||
|
||||
add_filter( 'body_class', 'calla_elated_menu_dropdown_appearance' );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_header_class' ) ) {
|
||||
/**
|
||||
* Function that adds class to header based on theme options
|
||||
*
|
||||
* @param array array of classes from main filter
|
||||
*
|
||||
* @return array array of classes with added header class
|
||||
*/
|
||||
function calla_elated_header_class( $classes ) {
|
||||
$id = calla_elated_get_page_id();
|
||||
|
||||
$header_type = calla_elated_get_meta_field_intersect( 'header_type', $id );
|
||||
|
||||
$classes[] = 'eltdf-' . $header_type;
|
||||
|
||||
$disable_menu_area_shadow = calla_elated_get_meta_field_intersect( 'menu_area_shadow', $id ) == 'no';
|
||||
if ( $disable_menu_area_shadow ) {
|
||||
$classes[] = 'eltdf-menu-area-shadow-disable';
|
||||
}
|
||||
|
||||
$disable_menu_area_grid_shadow = calla_elated_get_meta_field_intersect( 'menu_area_in_grid_shadow', $id ) == 'no';
|
||||
if ( $disable_menu_area_grid_shadow ) {
|
||||
$classes[] = 'eltdf-menu-area-in-grid-shadow-disable';
|
||||
}
|
||||
|
||||
$disable_menu_area_border = calla_elated_get_meta_field_intersect( 'menu_area_border', $id ) == 'no';
|
||||
if ( $disable_menu_area_border ) {
|
||||
$classes[] = 'eltdf-menu-area-border-disable';
|
||||
}
|
||||
|
||||
$disable_menu_area_grid_border = calla_elated_get_meta_field_intersect( 'menu_area_in_grid_border', $id ) == 'no';
|
||||
if ( $disable_menu_area_grid_border ) {
|
||||
$classes[] = 'eltdf-menu-area-in-grid-border-disable';
|
||||
}
|
||||
|
||||
if ( calla_elated_get_meta_field_intersect( 'menu_area_in_grid', $id ) == 'yes' &&
|
||||
calla_elated_get_meta_field_intersect( 'menu_area_grid_background_color', $id ) !== '' &&
|
||||
calla_elated_get_meta_field_intersect( 'menu_area_grid_background_transparency', $id ) !== '0'
|
||||
) {
|
||||
$classes[] = 'eltdf-header-menu-area-in-grid-padding';
|
||||
}
|
||||
|
||||
$disable_logo_area_border = calla_elated_get_meta_field_intersect( 'logo_area_border', $id ) == 'no';
|
||||
if ( $disable_logo_area_border ) {
|
||||
$classes[] = 'eltdf-logo-area-border-disable';
|
||||
}
|
||||
|
||||
$disable_logo_area_grid_border = calla_elated_get_meta_field_intersect( 'logo_area_in_grid_border', $id ) == 'no';
|
||||
if ( $disable_logo_area_grid_border ) {
|
||||
$classes[] = 'eltdf-logo-area-in-grid-border-disable';
|
||||
}
|
||||
|
||||
if ( calla_elated_get_meta_field_intersect( 'logo_area_in_grid', $id ) == 'yes' &&
|
||||
calla_elated_get_meta_field_intersect( 'logo_area_grid_background_color', $id ) !== '' &&
|
||||
calla_elated_get_meta_field_intersect( 'logo_area_grid_background_transparency', $id ) !== '0'
|
||||
) {
|
||||
$classes[] = 'eltdf-header-logo-area-in-grid-padding';
|
||||
}
|
||||
|
||||
$disable_shadow_vertical = calla_elated_get_meta_field_intersect( 'vertical_header_shadow', $id ) == 'no';
|
||||
if ( $disable_shadow_vertical ) {
|
||||
$classes[] = 'eltdf-header-vertical-shadow-disable';
|
||||
}
|
||||
|
||||
$disable_border_vertical = calla_elated_get_meta_field_intersect( 'vertical_header_border', $id ) == 'no';
|
||||
if ( $disable_border_vertical ) {
|
||||
$classes[] = 'eltdf-header-vertical-border-disable';
|
||||
}
|
||||
|
||||
return $classes;
|
||||
}
|
||||
|
||||
add_filter( 'body_class', 'calla_elated_header_class' );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_header_area_style' ) ) {
|
||||
/**
|
||||
* Function that return styles for header area
|
||||
*/
|
||||
function calla_elated_header_area_style( $style ) {
|
||||
$page_id = calla_elated_get_page_id();
|
||||
$class_prefix = calla_elated_get_unique_page_class( $page_id, true );
|
||||
|
||||
$current_style = '';
|
||||
|
||||
$menu_area_style = array();
|
||||
$menu_area_grid_style = array();
|
||||
$menu_area_enable_border = get_post_meta( $page_id, 'eltdf_menu_area_border_meta', true ) == 'yes';
|
||||
$menu_area_enable_grid_border = get_post_meta( $page_id, 'eltdf_menu_area_in_grid_border_meta', true ) == 'yes';
|
||||
$menu_area_enable_shadow = get_post_meta( $page_id, 'eltdf_menu_area_shadow_meta', true ) == 'yes';
|
||||
$menu_area_enable_grid_shadow = get_post_meta( $page_id, 'eltdf_menu_area_in_grid_shadow_meta', true ) == 'yes';
|
||||
|
||||
$menu_area_selector = array( $class_prefix . ' .eltdf-page-header .eltdf-menu-area' );
|
||||
$menu_area_grid_selector = array( $class_prefix . ' .eltdf-page-header .eltdf-menu-area .eltdf-grid .eltdf-vertical-align-containers' );
|
||||
|
||||
/* menu area style - start */
|
||||
|
||||
$menu_area_background_color = get_post_meta( $page_id, 'eltdf_menu_area_background_color_meta', true );
|
||||
$menu_area_background_transparency = get_post_meta( $page_id, 'eltdf_menu_area_background_transparency_meta', true );
|
||||
|
||||
if ( $menu_area_background_transparency === '' ) {
|
||||
$menu_area_background_transparency = 1;
|
||||
}
|
||||
|
||||
$menu_area_background_color_rgba = calla_elated_rgba_color( $menu_area_background_color, $menu_area_background_transparency );
|
||||
|
||||
if ( ! empty( $menu_area_background_color_rgba ) ) {
|
||||
$menu_area_style['background-color'] = $menu_area_background_color_rgba;
|
||||
}
|
||||
|
||||
if ( $menu_area_enable_shadow ) {
|
||||
$menu_area_style['box-shadow'] = '0px 1px 3px rgba(0,0,0,0.15)';
|
||||
}
|
||||
|
||||
if ( $menu_area_enable_border ) {
|
||||
$header_border_color = get_post_meta( $page_id, 'eltdf_menu_area_border_color_meta', true );
|
||||
|
||||
if ( $header_border_color !== '' ) {
|
||||
$menu_area_style['border-bottom'] = '1px solid ' . $header_border_color;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$menu_container_selector = $class_prefix . ' .eltdf-page-header .eltdf-vertical-align-containers';
|
||||
$menu_container_styles = array();
|
||||
$container_side_padding = get_post_meta( $page_id, 'eltdf_menu_area_side_padding_meta', true );
|
||||
|
||||
if ( $container_side_padding !== '' ) {
|
||||
if ( calla_elated_string_ends_with( $container_side_padding, 'px' ) || calla_elated_string_ends_with( $container_side_padding, '%' ) ) {
|
||||
$menu_container_styles['padding-left'] = $container_side_padding;
|
||||
$menu_container_styles['padding-right'] = $container_side_padding;
|
||||
} else {
|
||||
$menu_container_styles['padding-left'] = calla_elated_filter_px( $container_side_padding ) . 'px';
|
||||
$menu_container_styles['padding-right'] = calla_elated_filter_px( $container_side_padding ) . 'px';
|
||||
}
|
||||
|
||||
$current_style .= calla_elated_dynamic_css( $menu_container_selector, $menu_container_styles );
|
||||
}
|
||||
|
||||
/* menu area style - end */
|
||||
|
||||
/* menu area in grid style - start */
|
||||
|
||||
if ( $menu_area_enable_grid_shadow ) {
|
||||
$menu_area_grid_style['box-shadow'] = '0 1px 3px rgba(0,0,0,0.15)';
|
||||
}
|
||||
|
||||
if ( $menu_area_enable_grid_border ) {
|
||||
$header_grid_border_color = get_post_meta( $page_id, 'eltdf_menu_area_in_grid_border_color_meta', true );
|
||||
|
||||
if ( $header_grid_border_color !== '' ) {
|
||||
$menu_area_grid_style['border-bottom'] = '1px solid ' . $header_grid_border_color;
|
||||
}
|
||||
}
|
||||
|
||||
$menu_area_grid_background_color = get_post_meta( $page_id, 'eltdf_menu_area_grid_background_color_meta', true );
|
||||
$menu_area_grid_background_transparency = get_post_meta( $page_id, 'eltdf_menu_area_grid_background_transparency_meta', true );
|
||||
|
||||
if ( $menu_area_grid_background_transparency === '' ) {
|
||||
$menu_area_grid_background_transparency = 1;
|
||||
}
|
||||
|
||||
$menu_area_grid_background_color_rgba = calla_elated_rgba_color( $menu_area_grid_background_color, $menu_area_grid_background_transparency );
|
||||
|
||||
if ( ! empty( $menu_area_grid_background_color_rgba ) ) {
|
||||
$menu_area_grid_style['background-color'] = $menu_area_grid_background_color_rgba;
|
||||
}
|
||||
|
||||
$current_style .= calla_elated_dynamic_css( $menu_area_selector, $menu_area_style );
|
||||
$current_style .= calla_elated_dynamic_css( $menu_area_grid_selector, $menu_area_grid_style );
|
||||
|
||||
/* menu area in grid style - end */
|
||||
|
||||
/* main menu dropdown area style - start */
|
||||
|
||||
$dropdown_top_position = get_post_meta( $page_id, 'eltdf_dropdown_top_position_meta', true );
|
||||
|
||||
$dropdown_styles = array();
|
||||
if ( $dropdown_top_position !== '' ) {
|
||||
$dropdown_styles['top'] = calla_elated_filter_suffix( $dropdown_top_position, '%' ) . '%';
|
||||
}
|
||||
|
||||
$dropdown_selector = array( $class_prefix . ' .eltdf-page-header .eltdf-drop-down .second' );
|
||||
|
||||
$current_style .= calla_elated_dynamic_css( $dropdown_selector, $dropdown_styles );
|
||||
|
||||
/* main menu dropdown area style - end */
|
||||
|
||||
/* logo area style - start */
|
||||
|
||||
$logo_area_style = array();
|
||||
$logo_area_grid_style = array();
|
||||
$logo_area_enable_border = get_post_meta( $page_id, 'eltdf_logo_area_border_meta', true ) == 'yes';
|
||||
$logo_area_enable_grid_border = get_post_meta( $page_id, 'eltdf_logo_area_in_grid_border_meta', true ) == 'yes';
|
||||
|
||||
$logo_area_selector = array( $class_prefix . ' .eltdf-page-header .eltdf-logo-area' );
|
||||
$logo_area_grid_selector = array( $class_prefix . ' .eltdf-page-header .eltdf-logo-area .eltdf-grid .eltdf-vertical-align-containers' );
|
||||
|
||||
$logo_area_background_color = get_post_meta( $page_id, 'eltdf_logo_area_background_color_meta', true );
|
||||
$logo_area_background_transparency = get_post_meta( $page_id, 'eltdf_logo_area_background_transparency_meta', true );
|
||||
|
||||
if ( $logo_area_background_transparency === '' ) {
|
||||
$logo_area_background_transparency = 1;
|
||||
}
|
||||
|
||||
$logo_area_background_color_rgba = calla_elated_rgba_color( $logo_area_background_color, $logo_area_background_transparency );
|
||||
|
||||
if ( ! empty( $logo_area_background_color_rgba ) ) {
|
||||
$logo_area_style['background-color'] = $logo_area_background_color_rgba;
|
||||
}
|
||||
|
||||
if ( $logo_area_enable_border ) {
|
||||
$header_border_color = get_post_meta( $page_id, 'eltdf_logo_area_border_color_meta', true );
|
||||
|
||||
if ( $header_border_color !== '' ) {
|
||||
$logo_area_style['border-bottom'] = '1px solid ' . $header_border_color;
|
||||
}
|
||||
}
|
||||
|
||||
/* logo area style - end */
|
||||
|
||||
/* logo area in grid style - start */
|
||||
|
||||
if ( $logo_area_enable_grid_border ) {
|
||||
$header_grid_border_color = get_post_meta( $page_id, 'eltdf_logo_area_in_grid_border_color_meta', true );
|
||||
|
||||
if ( $header_grid_border_color !== '' ) {
|
||||
$logo_area_grid_style['border-bottom'] = '1px solid ' . $header_grid_border_color;
|
||||
}
|
||||
}
|
||||
|
||||
$logo_area_grid_background_color = get_post_meta( $page_id, 'eltdf_logo_area_grid_background_color_meta', true );
|
||||
$logo_area_grid_background_transparency = get_post_meta( $page_id, 'eltdf_logo_area_grid_background_transparency_meta', true );
|
||||
|
||||
if ( $logo_area_grid_background_transparency === '' ) {
|
||||
$logo_area_grid_background_transparency = 1;
|
||||
}
|
||||
|
||||
$logo_area_grid_background_color_rgba = calla_elated_rgba_color( $logo_area_grid_background_color, $logo_area_grid_background_transparency );
|
||||
|
||||
if ( ! empty( $logo_area_grid_background_color_rgba ) ) {
|
||||
$logo_area_grid_style['background-color'] = $logo_area_grid_background_color_rgba;
|
||||
}
|
||||
|
||||
/* logo area in grid style - end */
|
||||
|
||||
if ( ! empty( $logo_area_style ) ) {
|
||||
$current_style .= calla_elated_dynamic_css( $logo_area_selector, $logo_area_style );
|
||||
}
|
||||
|
||||
if ( ! empty( $logo_area_grid_style ) ) {
|
||||
$current_style .= calla_elated_dynamic_css( $logo_area_grid_selector, $logo_area_grid_style );
|
||||
}
|
||||
|
||||
$current_style = apply_filters( 'calla_elated_add_header_page_custom_style', $current_style, $class_prefix, $page_id ) . $style;
|
||||
|
||||
return $current_style;
|
||||
}
|
||||
|
||||
add_filter( 'calla_elated_add_page_custom_style', 'calla_elated_header_area_style' );
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
<?php
|
||||
|
||||
namespace CallaElated\Modules\Header\Lib;
|
||||
|
||||
/**
|
||||
* Class that acts like interface for all header types
|
||||
*
|
||||
* Class HeaderType
|
||||
*/
|
||||
abstract class HeaderType {
|
||||
/**
|
||||
* Value of option in database.
|
||||
* For example, if your header type has value in select field of 'header-type1'
|
||||
* that would be the value of this field
|
||||
*
|
||||
* @var
|
||||
*/
|
||||
protected $slug;
|
||||
/**
|
||||
* Name of module so we don't repeat it where we need it
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $moduleName = 'header';
|
||||
|
||||
/**
|
||||
* Loads template for header type
|
||||
*
|
||||
* @param array $parameters associative array of variables to pass to template
|
||||
*/
|
||||
public abstract function loadTemplate( $parameters = array() );
|
||||
|
||||
/**
|
||||
* Set header height properties
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public abstract function setHeaderHeightProps();
|
||||
|
||||
/**
|
||||
* Returns total height of transparent parts of header
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public abstract function calculateHeightOfTransparency();
|
||||
|
||||
/**
|
||||
* Returns height of header parts that are totaly transparent
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public abstract function calculateHeightOfCompleteTransparency();
|
||||
|
||||
/**
|
||||
* Returns header height
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public abstract function calculateHeaderHeight();
|
||||
|
||||
/**
|
||||
* Returns global variables that are used in JS
|
||||
*
|
||||
* @param $globalVariables
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public abstract function getGlobalJSVariables( $globalVariables );
|
||||
|
||||
/**
|
||||
* Returns per page variables that are used in JS
|
||||
*
|
||||
* @param $perPafeVars
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public abstract function getPerPageJSVariables( $perPafeVars );
|
||||
|
||||
/**
|
||||
* Returns configuration array for connecting header with other modules
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getConnectConfig() {
|
||||
return array(
|
||||
'affect_content' => true,
|
||||
'affect_title' => true,
|
||||
'affect_slider' => true
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for height of transparency property
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getHeightOfTransparency() {
|
||||
if ( isset( $this->heightOfTransparency ) ) {
|
||||
return $this->heightOfTransparency;
|
||||
}
|
||||
|
||||
return $this->calculateHeightOfTransparency();
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for height of complete transparency property
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getHeightOfCompleteTransparency() {
|
||||
if ( isset( $this->heightOfCompleteTransparency ) ) {
|
||||
return $this->heightOfCompleteTransparency;
|
||||
}
|
||||
|
||||
return $this->calculateHeightOfCompleteTransparency();
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for header height property
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getHeaderHeight() {
|
||||
if ( isset( $this->headerHeight ) ) {
|
||||
return $this->headerHeight;
|
||||
}
|
||||
|
||||
return $this->calculateHeaderHeight();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
namespace CallaElated\Modules\Header\Lib;
|
||||
/**
|
||||
* Class CallaElatedHeaderConnector
|
||||
*
|
||||
* Connects header module with other modules
|
||||
*/
|
||||
class CallaElatedHeaderConnector {
|
||||
/**
|
||||
* @param HeaderType $object
|
||||
*/
|
||||
public function __construct( HeaderType $object ) {
|
||||
$this->object = $object;
|
||||
}
|
||||
|
||||
/**
|
||||
* Connects given object with other modules based on pased config
|
||||
*
|
||||
* @param array $config
|
||||
*/
|
||||
public function connect( $config = array() ) {
|
||||
do_action( 'calla_elated_pre_header_connect' );
|
||||
|
||||
$defaultConfig = array(
|
||||
'affect_content' => true,
|
||||
'affect_title' => true,
|
||||
'affect_slider' => true
|
||||
);
|
||||
|
||||
if ( is_array( $config ) && count( $config ) ) {
|
||||
$config = array_merge( $defaultConfig, $config );
|
||||
}
|
||||
|
||||
if ( ! empty( $config['affect_content'] ) ) {
|
||||
add_filter( 'calla_elated_content_elem_style_attr', array( $this, 'contentMarginFilter' ) );
|
||||
}
|
||||
|
||||
if ( ! empty( $config['affect_title'] ) ) {
|
||||
add_filter( 'calla_elated_title_content_padding', array( $this, 'titlePaddingFilter' ) );
|
||||
}
|
||||
|
||||
do_action( 'calla_elated_after_header_connect' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds margin-top property to content element based on height of transparent parts of header
|
||||
*
|
||||
* @param $styles
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function contentMarginFilter( $styles ) {
|
||||
$marginTopValue = $this->object->getHeightOfTransparency();
|
||||
|
||||
if ( ! empty( $marginTopValue ) ) {
|
||||
$styles[] = 'margin-top: -' . $marginTopValue . 'px';
|
||||
}
|
||||
|
||||
return $styles;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns padding value calculated from transparent header parts.
|
||||
*
|
||||
* Hooks to calla_elated_title_content_padding filter
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function titlePaddingFilter() {
|
||||
$heightOfTransparency = $this->object->getHeightOfTransparency();
|
||||
|
||||
return ! empty( $heightOfTransparency ) ? $heightOfTransparency : 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
namespace CallaElated\Modules\Header\Lib;
|
||||
|
||||
/**
|
||||
* Class that builds header object and holds reference to it
|
||||
*
|
||||
* Class HeaderFactory
|
||||
*/
|
||||
class HeaderFactory {
|
||||
/**
|
||||
* Instance of current class
|
||||
*
|
||||
* @var
|
||||
*/
|
||||
private static $instance;
|
||||
/**
|
||||
* Instance of HeaderType
|
||||
*
|
||||
* @var
|
||||
*/
|
||||
private $headerObject;
|
||||
|
||||
/**
|
||||
* Private construct because of singletone
|
||||
*/
|
||||
private function __construct() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns current header object
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getHeaderObject() {
|
||||
return $this->headerObject;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns instance of current class
|
||||
*
|
||||
* @return HeaderFactory
|
||||
*/
|
||||
public static function getInstance() {
|
||||
if(self::$instance == null) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if header object, whether passed as parameter or not, is valid object that extends HeaderType class
|
||||
*
|
||||
* @param null $header_object
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function validHeaderObject($header_object = null) {
|
||||
$header_object = $header_object == null ? $this->headerObject : $header_object;
|
||||
|
||||
return is_subclass_of($header_object, 'CallaElated\Modules\Header\Lib\HeaderType');
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds header object based on option read from database
|
||||
*
|
||||
* @param string $headerType value read from database
|
||||
* @param array $headerTypesOption
|
||||
*
|
||||
* @return bool|HeaderType
|
||||
*/
|
||||
public function build($headerType, $headerTypesOption) {
|
||||
if(!empty($headerType) && !empty($headerTypesOption)) {
|
||||
foreach ($headerTypesOption as $header_type_option_key => $header_type_option_value) {
|
||||
if($headerType === $header_type_option_key) {
|
||||
$this->headerObject = new $header_type_option_value;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->headerObject;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
use CallaElated\Modules\Header\Lib;
|
||||
|
||||
if(!function_exists('calla_elated_get_header_type_options')) {
|
||||
/**
|
||||
* This function collect all header types values and forward them to header factory file for further processing
|
||||
*/
|
||||
function calla_elated_get_header_type_options() {
|
||||
do_action('calla_elated_before_header_function_init');
|
||||
|
||||
$header_types_option = apply_filters('calla_elated_register_header_type_class', $header_types_option = array());
|
||||
|
||||
return $header_types_option;
|
||||
}
|
||||
}
|
||||
|
||||
if(!function_exists('calla_elated_set_default_logo_height_for_header_types')) {
|
||||
/**
|
||||
* This function set default logo area height for header types
|
||||
*/
|
||||
function calla_elated_set_default_logo_height_for_header_types() {
|
||||
$logo_height_meta = calla_elated_filter_px( calla_elated_options()->getOptionValue( 'logo_area_height' ) );
|
||||
$logo_height = !empty($logo_height_meta) ? intval( $logo_height_meta ) : 110;
|
||||
|
||||
return apply_filters('calla_elated_set_default_logo_height_value_for_header_types', $logo_height);
|
||||
}
|
||||
}
|
||||
|
||||
if(!function_exists('calla_elated_set_default_menu_height_for_header_types')) {
|
||||
/**
|
||||
* This function set default menu area height for header types
|
||||
*/
|
||||
function calla_elated_set_default_menu_height_for_header_types() {
|
||||
$menu_height_meta = calla_elated_filter_px( calla_elated_options()->getOptionValue( 'menu_area_height' ) );
|
||||
$menu_height = !empty($menu_height_meta) ? intval( $menu_height_meta ) : 90;
|
||||
|
||||
return apply_filters('calla_elated_set_default_menu_height_value_for_header_types', $menu_height);
|
||||
}
|
||||
}
|
||||
|
||||
if(!function_exists('calla_elated_set_default_mobile_menu_height_for_header_types')) {
|
||||
/**
|
||||
* This function set default mobile menu area height for header types
|
||||
*/
|
||||
function calla_elated_set_default_mobile_menu_height_for_header_types() {
|
||||
$mobile_menu_height_meta = calla_elated_filter_px( calla_elated_options()->getOptionValue( 'mobile_header_height' ) );
|
||||
$mobile_menu_height = !empty($mobile_menu_height_meta) ? intval( $mobile_menu_height_meta ) : 70;
|
||||
|
||||
return apply_filters('calla_elated_set_default_mobile_menu_height_value_for_header_types', $mobile_menu_height);
|
||||
}
|
||||
}
|
||||
|
||||
if(!function_exists('calla_elated_set_header_object')) {
|
||||
/**
|
||||
* This function is used to instance header type object
|
||||
*/
|
||||
function calla_elated_set_header_object() {
|
||||
$header_type = calla_elated_get_meta_field_intersect('header_type', calla_elated_get_page_id());
|
||||
$header_types_option = calla_elated_get_header_type_options();
|
||||
|
||||
$object = Lib\HeaderFactory::getInstance()->build($header_type, $header_types_option);
|
||||
|
||||
if(Lib\HeaderFactory::getInstance()->validHeaderObject()) {
|
||||
$header_connector = new Lib\CallaElatedHeaderConnector($object);
|
||||
$header_connector->connect($object->getConnectConfig());
|
||||
}
|
||||
}
|
||||
|
||||
add_action('wp', 'calla_elated_set_header_object', 1);
|
||||
}
|
||||
21
wp-content/themes/calla/framework/modules/header/load.php
Normal file
21
wp-content/themes/calla/framework/modules/header/load.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
//load lib
|
||||
include_once ELATED_FRAMEWORK_HEADER_ROOT_DIR . '/lib/header-functions.php';
|
||||
include_once ELATED_FRAMEWORK_HEADER_ROOT_DIR . '/lib/header-abstract.php';
|
||||
include_once ELATED_FRAMEWORK_HEADER_ROOT_DIR . '/lib/header-factory.php';
|
||||
include_once ELATED_FRAMEWORK_HEADER_ROOT_DIR . '/lib/header-connector.php';
|
||||
|
||||
//load header functions
|
||||
include_once ELATED_FRAMEWORK_HEADER_ROOT_DIR . '/functions.php';
|
||||
include_once ELATED_FRAMEWORK_HEADER_ROOT_DIR . '/helper-functions.php';
|
||||
include_once ELATED_FRAMEWORK_HEADER_ROOT_DIR . '/template-functions.php';
|
||||
|
||||
//load global header options
|
||||
include_once ELATED_FRAMEWORK_HEADER_ROOT_DIR . '/admin/options-map/header-map.php';
|
||||
|
||||
//load per page header options
|
||||
include_once ELATED_FRAMEWORK_HEADER_ROOT_DIR . '/admin/meta-boxes/header-meta-boxes.php';
|
||||
|
||||
//load global header custom styles
|
||||
include_once ELATED_FRAMEWORK_HEADER_ROOT_DIR . '/admin/custom-styles/header-custom-styles.php';
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
$attachment_meta = calla_elated_get_attachment_meta_from_url($logo_image);
|
||||
$hwstring = !empty($attachment_meta) ? image_hwstring( $attachment_meta['width'], $attachment_meta['height'] ) : '';
|
||||
|
||||
if(!empty($logo_image_dark)) {
|
||||
$attachment_meta_dark = calla_elated_get_attachment_meta_from_url($logo_image_dark);
|
||||
$hwstring_dark = !empty($attachment_meta_dark) ? image_hwstring($attachment_meta_dark['width'], $attachment_meta_dark['height']) : '';
|
||||
}
|
||||
|
||||
if(!empty($logo_image_light)) {
|
||||
$attachment_meta_light = calla_elated_get_attachment_meta_from_url( $logo_image_light );
|
||||
$hwstring_light = !empty($attachment_meta_light) ? image_hwstring($attachment_meta_light['width'], $attachment_meta_light['height']) : '';
|
||||
}
|
||||
?>
|
||||
|
||||
<?php do_action('calla_elated_before_site_logo'); ?>
|
||||
|
||||
<div class="eltdf-logo-wrapper">
|
||||
<a itemprop="url" href="<?php echo esc_url(home_url('/')); ?>">
|
||||
<img itemprop="image" class="eltdf-normal-logo" src="<?php echo esc_url($logo_image); ?>" alt="<?php esc_attr_e('logo','calla'); ?>"/>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<?php do_action('calla_elated_after_site_logo'); ?>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php do_action('calla_elated_before_top_navigation'); ?>
|
||||
|
||||
<nav class="eltdf-main-menu eltdf-drop-down <?php echo esc_attr($additional_class); ?>">
|
||||
<?php wp_nav_menu( array(
|
||||
'theme_location' => 'main-navigation' ,
|
||||
'container' => '',
|
||||
'container_class' => '',
|
||||
'menu_class' => 'clearfix',
|
||||
'menu_id' => '',
|
||||
'fallback_cb' => 'top_navigation_fallback',
|
||||
'link_before' => '<span>',
|
||||
'link_after' => '</span>',
|
||||
'walker' => new CallaElatedTopNavigationWalker()
|
||||
)); ?>
|
||||
</nav>
|
||||
|
||||
<?php do_action('calla_elated_after_top_navigation'); ?>
|
||||
@@ -0,0 +1,124 @@
|
||||
<?php
|
||||
use CallaElated\Modules\Header\Lib\HeaderFactory;
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_header' ) ) {
|
||||
/**
|
||||
* Loads header HTML based on header type option. Sets all necessary parameters for header
|
||||
* and defines calla_elated_header_type_parameters filter
|
||||
*/
|
||||
function calla_elated_get_header() {
|
||||
$id = calla_elated_get_page_id();
|
||||
|
||||
//will be read from options
|
||||
$header_type = calla_elated_get_meta_field_intersect( 'header_type', $id );
|
||||
|
||||
$menu_area_in_grid = calla_elated_get_meta_field_intersect( 'menu_area_in_grid', $id );
|
||||
|
||||
$header_behavior = calla_elated_get_meta_field_intersect( 'header_behaviour', $id );
|
||||
|
||||
if ( HeaderFactory::getInstance()->validHeaderObject() ) {
|
||||
$parameters = array(
|
||||
'hide_logo' => calla_elated_options()->getOptionValue( 'hide_logo' ) == 'yes' ? true : false,
|
||||
'menu_area_in_grid' => $menu_area_in_grid == 'yes' ? true : false,
|
||||
'show_sticky' => in_array( $header_behavior, array(
|
||||
'sticky-header-on-scroll-up',
|
||||
'sticky-header-on-scroll-down-up'
|
||||
) ) ? true : false,
|
||||
'show_fixed_wrapper' => in_array( $header_behavior, array( 'fixed-on-scroll' ) ) ? true : false,
|
||||
);
|
||||
|
||||
$parameters = apply_filters( 'calla_elated_header_type_parameters', $parameters, $header_type );
|
||||
|
||||
HeaderFactory::getInstance()->getHeaderObject()->loadTemplate( $parameters );
|
||||
}
|
||||
}
|
||||
add_action( 'calla_elated_after_wrapper_inner', 'calla_elated_get_header', 10 );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_logo' ) ) {
|
||||
/**
|
||||
* Loads logo HTML
|
||||
*
|
||||
* @param $slug
|
||||
*/
|
||||
function calla_elated_get_logo( $slug = '' ) {
|
||||
$id = calla_elated_get_page_id();
|
||||
|
||||
if ( $slug == 'sticky' ) {
|
||||
$logo_image = calla_elated_get_meta_field_intersect( 'logo_image_sticky', $id );
|
||||
} else {
|
||||
$logo_image = calla_elated_get_meta_field_intersect( 'logo_image', $id );
|
||||
}
|
||||
|
||||
$logo_image_dark = calla_elated_get_meta_field_intersect( 'logo_image_dark', $id );
|
||||
$logo_image_light = calla_elated_get_meta_field_intersect( 'logo_image_light', $id );
|
||||
|
||||
//get logo image dimensions and set style attribute for image link.
|
||||
$logo_dimensions = calla_elated_get_image_dimensions( $logo_image );
|
||||
|
||||
$logo_height = '';
|
||||
$logo_styles = '';
|
||||
if ( is_array( $logo_dimensions ) && array_key_exists( 'height', $logo_dimensions ) ) {
|
||||
$logo_height = $logo_dimensions['height'];
|
||||
$logo_styles = 'height: ' . intval( $logo_height / 2 ) . 'px;'; //divided with 2 because of retina screens
|
||||
}
|
||||
|
||||
$params = array(
|
||||
'logo_image' => $logo_image,
|
||||
'logo_image_dark' => $logo_image_dark,
|
||||
'logo_image_light' => $logo_image_light,
|
||||
'logo_styles' => $logo_styles
|
||||
);
|
||||
|
||||
$params = apply_filters( 'calla_elated_get_logo_html_parameters', $params );
|
||||
|
||||
calla_elated_get_module_template_part( 'parts/logo', 'header', $slug, $params );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_main_menu' ) ) {
|
||||
/**
|
||||
* Loads main menu HTML
|
||||
*
|
||||
* @param string $additional_class addition class to pass to template
|
||||
*/
|
||||
function calla_elated_get_main_menu( $additional_class = 'eltdf-default-nav' ) {
|
||||
calla_elated_get_module_template_part( 'parts/navigation', 'header', '', array( 'additional_class' => $additional_class ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_header_widget_logo_area' ) ) {
|
||||
/**
|
||||
* Loads header widgets area HTML
|
||||
*/
|
||||
function calla_elated_get_header_widget_logo_area() {
|
||||
$page_id = calla_elated_get_page_id();
|
||||
$custom_logo_widget_area = get_post_meta( $page_id, 'eltdf_custom_logo_area_sidebar_meta', true );
|
||||
|
||||
if ( get_post_meta( $page_id, 'eltdf_disable_header_widget_logo_area_meta', 'true' ) !== 'yes' ) {
|
||||
if ( is_active_sidebar( 'eltdf-header-widget-logo-area' ) && empty( $custom_logo_widget_area ) ) {
|
||||
dynamic_sidebar( 'eltdf-header-widget-logo-area' );
|
||||
} else if ( ! empty( $custom_logo_widget_area ) && is_active_sidebar( $custom_logo_widget_area ) ) {
|
||||
dynamic_sidebar( $custom_logo_widget_area );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_header_widget_menu_area' ) ) {
|
||||
/**
|
||||
* Loads header widgets area HTML
|
||||
*/
|
||||
function calla_elated_get_header_widget_menu_area() {
|
||||
$page_id = calla_elated_get_page_id();
|
||||
$custom_menu_widget_area = get_post_meta( $page_id, 'eltdf_custom_menu_area_sidebar_meta', true );
|
||||
|
||||
if ( get_post_meta( $page_id, 'eltdf_disable_header_widget_menu_area_meta', 'true' ) !== 'yes' ) {
|
||||
if ( is_active_sidebar( 'eltdf-header-widget-menu-area' ) && empty( $custom_menu_widget_area ) ) {
|
||||
dynamic_sidebar( 'eltdf-header-widget-menu-area' );
|
||||
} else if ( ! empty( $custom_menu_widget_area ) && is_active_sidebar( $custom_menu_widget_area ) ) {
|
||||
dynamic_sidebar( $custom_menu_widget_area );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
if ( ! function_exists( 'calla_elated_fixed_header_styles' ) ) {
|
||||
/**
|
||||
* Generates styles for fixed haeder
|
||||
*/
|
||||
function calla_elated_fixed_header_styles() {
|
||||
$background_color = calla_elated_options()->getOptionValue( 'fixed_header_background_color' );
|
||||
$background_transparency = calla_elated_options()->getOptionValue( 'fixed_header_transparency' );
|
||||
$border_color = calla_elated_options()->getOptionValue( 'fixed_header_border_bottom_color' );
|
||||
|
||||
$fixed_area_styles = array();
|
||||
if ( ! empty( $background_color ) ) {
|
||||
$fixed_header_background_color = $background_color;
|
||||
$fixed_header_background_color_transparency = 1;
|
||||
|
||||
if ( $background_transparency !== '' ) {
|
||||
$fixed_header_background_color_transparency = $background_transparency;
|
||||
}
|
||||
|
||||
$fixed_area_styles['background-color'] = calla_elated_rgba_color( $fixed_header_background_color, $fixed_header_background_color_transparency ) . '!important';
|
||||
}
|
||||
|
||||
if ( empty( $background_color ) && $background_transparency !== '' ) {
|
||||
$fixed_header_background_color = '#fff';
|
||||
$fixed_header_background_color_transparency = $background_transparency;
|
||||
|
||||
$fixed_area_styles['background-color'] = calla_elated_rgba_color( $fixed_header_background_color, $fixed_header_background_color_transparency ) . '!important';
|
||||
}
|
||||
|
||||
$selector = array(
|
||||
'.eltdf-page-header .eltdf-fixed-wrapper.fixed .eltdf-menu-area'
|
||||
);
|
||||
|
||||
echo calla_elated_dynamic_css( $selector, $fixed_area_styles );
|
||||
|
||||
$fixed_area_holder_styles = array();
|
||||
|
||||
if ( ! empty( $border_color ) ) {
|
||||
$fixed_area_holder_styles['border-bottom-color'] = $border_color;
|
||||
}
|
||||
|
||||
$selector_holder = array(
|
||||
'.eltdf-page-header .eltdf-fixed-wrapper.fixed'
|
||||
);
|
||||
|
||||
echo calla_elated_dynamic_css( $selector_holder, $fixed_area_holder_styles );
|
||||
|
||||
// fixed menu style
|
||||
|
||||
$menu_item_styles = calla_elated_get_typography_styles( 'fixed' );
|
||||
|
||||
$menu_item_selector = array(
|
||||
'.eltdf-fixed-wrapper.fixed .eltdf-main-menu > ul > li > a'
|
||||
);
|
||||
|
||||
echo calla_elated_dynamic_css( $menu_item_selector, $menu_item_styles );
|
||||
|
||||
|
||||
$hover_color = calla_elated_options()->getOptionValue( 'fixed_hovercolor' );
|
||||
|
||||
$menu_item_hover_styles = array();
|
||||
if ( ! empty( $hover_color ) ) {
|
||||
$menu_item_hover_styles['color'] = $hover_color;
|
||||
}
|
||||
|
||||
$menu_item_hover_selector = array(
|
||||
'.eltdf-fixed-wrapper.fixed .eltdf-main-menu > ul > li:hover > a',
|
||||
'.eltdf-fixed-wrapper.fixed .eltdf-main-menu > ul > li.eltdf-active-item > a'
|
||||
);
|
||||
|
||||
echo calla_elated_dynamic_css( $menu_item_hover_selector, $menu_item_hover_styles );
|
||||
}
|
||||
|
||||
add_action( 'calla_elated_style_dynamic', 'calla_elated_fixed_header_styles' );
|
||||
}
|
||||
@@ -0,0 +1,205 @@
|
||||
<?php
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_hide_dep_for_fixed_header_options' ) ) {
|
||||
function calla_elated_get_hide_dep_for_fixed_header_options() {
|
||||
$hide_dep_options = apply_filters( 'calla_elated_fixed_header_hide_global_option', $hide_dep_options = array() );
|
||||
|
||||
return $hide_dep_options;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_additional_hide_dep_for_fixed_header_options' ) ) {
|
||||
function calla_elated_get_additional_hide_dep_for_fixed_header_options() {
|
||||
$additional_hide_dep_options = apply_filters( 'calla_elated_fixed_header_additional_hide_global_option', $additional_hide_dep_options = array() );
|
||||
|
||||
return $additional_hide_dep_options;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_header_fixed_options_map' ) ) {
|
||||
function calla_elated_header_fixed_options_map() {
|
||||
$hide_dep_options = calla_elated_get_hide_dep_for_fixed_header_options();
|
||||
|
||||
$panel_fixed_header = calla_elated_add_admin_panel(
|
||||
array(
|
||||
'title' => esc_html__( 'Fixed Header', 'calla' ),
|
||||
'name' => 'panel_fixed_header',
|
||||
'page' => '_header_page',
|
||||
'dependency' => array(
|
||||
'hide' => array(
|
||||
'header_options' => $hide_dep_options
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'fixed_header_background_color',
|
||||
'type' => 'color',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Background Color', 'calla' ),
|
||||
'description' => esc_html__( 'Choose a background color for header area', 'calla' ),
|
||||
'parent' => $panel_fixed_header
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'fixed_header_transparency',
|
||||
'type' => 'text',
|
||||
'label' => esc_html__( 'Background Transparency', 'calla' ),
|
||||
'description' => esc_html__( 'Choose a transparency for the header background color (0 = fully transparent, 1 = opaque)', 'calla' ),
|
||||
'parent' => $panel_fixed_header,
|
||||
'args' => array(
|
||||
'col_width' => 1
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $panel_fixed_header,
|
||||
'type' => 'color',
|
||||
'name' => 'fixed_header_border_bottom_color',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Border Color', 'calla' ),
|
||||
'description' => esc_html__( 'Set border bottom color for header area', 'calla' ),
|
||||
)
|
||||
);
|
||||
|
||||
$group_fixed_header_menu = calla_elated_add_admin_group(
|
||||
array(
|
||||
'title' => esc_html__( 'Fixed Header Menu', 'calla' ),
|
||||
'name' => 'group_fixed_header_menu',
|
||||
'parent' => $panel_fixed_header,
|
||||
'description' => esc_html__( 'Define styles for fixed menu items', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
$row1_fixed_header_menu = calla_elated_add_admin_row(
|
||||
array(
|
||||
'name' => 'row1',
|
||||
'parent' => $group_fixed_header_menu
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'fixed_color',
|
||||
'type' => 'colorsimple',
|
||||
'label' => esc_html__( 'Text Color', 'calla' ),
|
||||
'description' => '',
|
||||
'parent' => $row1_fixed_header_menu
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'fixed_hovercolor',
|
||||
'type' => 'colorsimple',
|
||||
'label' => esc_html__( esc_html__( 'Hover/Active Color', 'calla' ), 'calla' ),
|
||||
'description' => '',
|
||||
'parent' => $row1_fixed_header_menu
|
||||
)
|
||||
);
|
||||
|
||||
$row2_fixed_header_menu = calla_elated_add_admin_row(
|
||||
array(
|
||||
'name' => 'row2',
|
||||
'parent' => $group_fixed_header_menu
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'fixed_google_fonts',
|
||||
'type' => 'fontsimple',
|
||||
'label' => esc_html__( 'Font Family', 'calla' ),
|
||||
'default_value' => '-1',
|
||||
'parent' => $row2_fixed_header_menu,
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'type' => 'textsimple',
|
||||
'name' => 'fixed_font_size',
|
||||
'label' => esc_html__( 'Font Size', 'calla' ),
|
||||
'default_value' => '',
|
||||
'parent' => $row2_fixed_header_menu,
|
||||
'args' => array(
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'type' => 'textsimple',
|
||||
'name' => 'fixed_line_height',
|
||||
'label' => esc_html__( 'Line Height', 'calla' ),
|
||||
'default_value' => '',
|
||||
'parent' => $row2_fixed_header_menu,
|
||||
'args' => array(
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'type' => 'selectblanksimple',
|
||||
'name' => 'fixed_text_transform',
|
||||
'label' => esc_html__( 'Text Transform', 'calla' ),
|
||||
'default_value' => '',
|
||||
'options' => calla_elated_get_text_transform_array(),
|
||||
'parent' => $row2_fixed_header_menu
|
||||
)
|
||||
);
|
||||
|
||||
$row3_fixed_header_menu = calla_elated_add_admin_row(
|
||||
array(
|
||||
'name' => 'row3',
|
||||
'parent' => $group_fixed_header_menu
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'type' => 'selectblanksimple',
|
||||
'name' => 'fixed_font_style',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Font Style', 'calla' ),
|
||||
'options' => calla_elated_get_font_style_array(),
|
||||
'parent' => $row3_fixed_header_menu
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'type' => 'selectblanksimple',
|
||||
'name' => 'fixed_font_weight',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Font Weight', 'calla' ),
|
||||
'options' => calla_elated_get_font_weight_array(),
|
||||
'parent' => $row3_fixed_header_menu
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'type' => 'textsimple',
|
||||
'name' => 'fixed_letter_spacing',
|
||||
'label' => esc_html__( 'Letter Spacing', 'calla' ),
|
||||
'default_value' => '',
|
||||
'parent' => $row3_fixed_header_menu,
|
||||
'args' => array(
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
add_action( 'calla_elated_header_fixed_options_map', 'calla_elated_header_fixed_options_map', 10, 1 );
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
if ( ! function_exists( 'calla_elated_set_additional_hide_dep_options_for_sticky_header' ) ) {
|
||||
/**
|
||||
* This function is used to set dependency values for sticky header panel in global option if fixed header behavior is set
|
||||
*/
|
||||
function calla_elated_set_additional_hide_dep_options_for_sticky_header( $hide_dep_options ) {
|
||||
$hide_dep_options[] = 'fixed-on-scroll';
|
||||
$hide_dep_options[] = 'no-behavior';
|
||||
|
||||
return $hide_dep_options;
|
||||
}
|
||||
|
||||
add_filter( 'calla_elated_sticky_header_additional_hide_global_option', 'calla_elated_set_additional_hide_dep_options_for_sticky_header' );
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_hide_dep_for_header_centered_meta_boxes' ) ) {
|
||||
function calla_elated_get_hide_dep_for_header_centered_meta_boxes() {
|
||||
$hide_dep_options = apply_filters( 'calla_elated_header_centered_hide_meta_boxes', $hide_dep_options = array() );
|
||||
|
||||
return $hide_dep_options;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_header_centered_logo_meta_map' ) ) {
|
||||
function calla_elated_header_centered_logo_meta_map( $parent ) {
|
||||
$hide_dep_options = calla_elated_get_hide_dep_for_header_centered_meta_boxes();
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'parent' => $parent,
|
||||
'type' => 'text',
|
||||
'name' => 'eltdf_logo_wrapper_padding_header_centered_meta',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Logo Padding', 'calla' ),
|
||||
'description' => esc_html__( 'Insert padding in format: 0px 0px 1px 0px', 'calla' ),
|
||||
'args' => array(
|
||||
'col_width' => 3
|
||||
),
|
||||
'dependency' => array(
|
||||
'hide' => array(
|
||||
'eltdf_header_type_meta' => $hide_dep_options
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
add_action( 'calla_elated_header_logo_area_additional_meta_boxes_map', 'calla_elated_header_centered_logo_meta_map', 10, 1 );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_header_centered_meta_map' ) ) {
|
||||
function calla_elated_header_centered_meta_map( $parent ) {
|
||||
$hide_dep_options = calla_elated_get_hide_dep_for_header_centered_meta_boxes();
|
||||
|
||||
$header_centered_container = calla_elated_add_admin_container_no_style(
|
||||
array(
|
||||
'type' => 'container',
|
||||
'name' => 'header_centered_container',
|
||||
'parent' => $parent,
|
||||
'dependency' => array(
|
||||
'hide' => array(
|
||||
'eltdf_header_type_meta' => $hide_dep_options
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_section_title(
|
||||
array(
|
||||
'parent' => $header_centered_container,
|
||||
'name' => 'header_centered_style',
|
||||
'title' => esc_html__( 'Header Centered', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
$calla_custom_sidebars = calla_elated_get_custom_sidebars();
|
||||
if ( count( $calla_custom_sidebars ) > 0 ) {
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_custom_header_centered_left_widget_meta',
|
||||
'type' => 'selectblank',
|
||||
'label' => esc_html__( 'Choose Custom Widget Area for Header Centered Left Widget Area', 'calla' ),
|
||||
'description' => esc_html__( 'Choose custom widget area to display in header centered on the left side of the menu"', 'calla' ),
|
||||
'parent' => $header_centered_container,
|
||||
'options' => $calla_custom_sidebars
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_custom_header_centered_right_widget_meta',
|
||||
'type' => 'selectblank',
|
||||
'label' => esc_html__( 'Choose Custom Widget Area for Header Centered Right Widget Area', 'calla' ),
|
||||
'description' => esc_html__( 'Choose custom widget area to display in header centered on the right side of the menu"', 'calla' ),
|
||||
'parent' => $header_centered_container,
|
||||
'options' => $calla_custom_sidebars
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
add_action( 'calla_elated_additional_header_area_meta_boxes_map', 'calla_elated_header_centered_meta_map', 10, 1 );
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_hide_dep_for_header_centered_options' ) ) {
|
||||
function calla_elated_get_hide_dep_for_header_centered_options() {
|
||||
$hide_dep_options = apply_filters( 'calla_elated_header_centered_hide_global_option', $hide_dep_options = array() );
|
||||
|
||||
return $hide_dep_options;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_header_centered_map' ) ) {
|
||||
function calla_elated_header_centered_map( $parent ) {
|
||||
$hide_dep_options = calla_elated_get_hide_dep_for_header_centered_options();
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $parent,
|
||||
'type' => 'text',
|
||||
'name' => 'logo_wrapper_padding_header_centered',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Logo Padding', 'calla' ),
|
||||
'description' => esc_html__( 'Insert padding in format: 0px 0px 1px 0px', 'calla' ),
|
||||
'args' => array(
|
||||
'col_width' => 3
|
||||
),
|
||||
'dependency' => array(
|
||||
'hide' => array(
|
||||
'header_options' => $hide_dep_options
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
add_action( 'calla_elated_header_logo_area_additional_options', 'calla_elated_header_centered_map' );
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
if ( ! function_exists( 'calla_elated_set_header_centered_type_global_option' ) ) {
|
||||
/**
|
||||
* This function set header type value for global header option map
|
||||
*/
|
||||
function calla_elated_set_header_centered_type_global_option( $header_types ) {
|
||||
$header_types['header-centered'] = array(
|
||||
'image' => ELATED_FRAMEWORK_HEADER_TYPES_ROOT . '/header-centered/assets/img/header-centered.png',
|
||||
'label' => esc_html__( 'Centered', 'calla' )
|
||||
);
|
||||
|
||||
return $header_types;
|
||||
}
|
||||
|
||||
add_filter( 'calla_elated_header_type_global_option', 'calla_elated_set_header_centered_type_global_option' );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_set_header_centered_type_meta_boxes_option' ) ) {
|
||||
/**
|
||||
* This function set header type value for header meta boxes map
|
||||
*/
|
||||
function calla_elated_set_header_centered_type_meta_boxes_option( $header_type_options ) {
|
||||
$header_type_options['header-centered'] = esc_html__( 'Centered', 'calla' );
|
||||
|
||||
return $header_type_options;
|
||||
}
|
||||
|
||||
add_filter( 'calla_elated_header_type_meta_boxes', 'calla_elated_set_header_centered_type_meta_boxes_option' );
|
||||
}
|
||||
|
||||
if(!function_exists('calla_elated_set_default_menu_height_for_centered_header')) {
|
||||
/**
|
||||
* This function set default menu area height for header types
|
||||
*/
|
||||
function calla_elated_set_default_menu_height_for_centered_header($menu_height) {
|
||||
$menu_height_meta = calla_elated_filter_px( calla_elated_options()->getOptionValue( 'menu_area_height' ) );
|
||||
$id = calla_elated_get_page_id();
|
||||
|
||||
$header_type = calla_elated_get_meta_field_intersect( 'header_type', $id );
|
||||
|
||||
if ($menu_height_meta !== '') {
|
||||
$menu_height = intval( $menu_height_meta );
|
||||
} else if ($header_type == 'header-centered') {
|
||||
$menu_height = 67;
|
||||
} else {
|
||||
$menu_height = 90;
|
||||
}
|
||||
|
||||
return $menu_height;
|
||||
}
|
||||
add_filter('calla_elated_set_default_menu_height_value_for_header_types', 'calla_elated_set_default_menu_height_for_centered_header');
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_set_hide_dep_options_header_centered' ) ) {
|
||||
/**
|
||||
* This function is used to hide all containers/panels for admin options when this header type is selected
|
||||
*/
|
||||
function calla_elated_set_hide_dep_options_header_centered( $hide_dep_options ) {
|
||||
$hide_dep_options[] = 'header-centered';
|
||||
|
||||
return $hide_dep_options;
|
||||
}
|
||||
|
||||
// header types panel options
|
||||
add_filter( 'calla_elated_full_screen_menu_hide_global_option', 'calla_elated_set_hide_dep_options_header_centered' );
|
||||
add_filter( 'calla_elated_header_standard_hide_global_option', 'calla_elated_set_hide_dep_options_header_centered' );
|
||||
add_filter( 'calla_elated_header_vertical_hide_global_option', 'calla_elated_set_hide_dep_options_header_centered' );
|
||||
add_filter( 'calla_elated_header_vertical_menu_hide_global_option', 'calla_elated_set_hide_dep_options_header_centered' );
|
||||
add_filter( 'calla_elated_header_vertical_closed_hide_global_option', 'calla_elated_set_hide_dep_options_header_centered' );
|
||||
add_filter( 'calla_elated_header_vertical_sliding_hide_global_option', 'calla_elated_set_hide_dep_options_header_centered' );
|
||||
|
||||
// header types panel meta boxes
|
||||
add_filter( 'calla_elated_header_standard_hide_meta_boxes', 'calla_elated_set_hide_dep_options_header_centered' );
|
||||
add_filter( 'calla_elated_header_vertical_hide_meta_boxes', 'calla_elated_set_hide_dep_options_header_centered' );
|
||||
|
||||
// header types panel - widgets area meta boxes
|
||||
add_filter( 'calla_elated_header_menu_area_widgets_hide_meta_boxes', 'calla_elated_set_hide_dep_options_header_centered' );
|
||||
add_filter( 'calla_elated_header_logo_area_widgets_hide_meta_boxes', 'calla_elated_set_hide_dep_options_header_centered' );
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
|
||||
if ( ! function_exists( 'calla_elated_register_header_centered_type' ) ) {
|
||||
/**
|
||||
* This function is used to register header type class for header factory file
|
||||
*/
|
||||
function calla_elated_register_header_centered_type( $header_types ) {
|
||||
$header_type = array(
|
||||
'header-centered' => 'CallaElated\Modules\Header\Types\HeaderCentered'
|
||||
);
|
||||
|
||||
$header_types = array_merge( $header_types, $header_type );
|
||||
|
||||
return $header_types;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_init_register_header_centered_type' ) ) {
|
||||
/**
|
||||
* This function is used to wait header-function.php file to init header object and then to init hook registration function above
|
||||
*/
|
||||
function calla_elated_init_register_header_centered_type() {
|
||||
add_filter( 'calla_elated_register_header_type_class', 'calla_elated_register_header_centered_type' );
|
||||
}
|
||||
|
||||
add_action( 'calla_elated_before_header_function_init', 'calla_elated_init_register_header_centered_type' );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_header_centered_per_page_custom_styles' ) ) {
|
||||
/**
|
||||
* Return header per page styles
|
||||
*/
|
||||
function calla_elated_header_centered_per_page_custom_styles( $style, $class_prefix, $page_id ) {
|
||||
$header_area_style = array();
|
||||
$header_area_selector = array( $class_prefix . '.eltdf-header-centered .eltdf-logo-area .eltdf-logo-wrapper' );
|
||||
|
||||
$logo_area_logo_padding = get_post_meta( $page_id, 'eltdf_logo_wrapper_padding_header_centered_meta', true );
|
||||
|
||||
if ( $logo_area_logo_padding !== '' ) {
|
||||
$header_area_style['padding'] = $logo_area_logo_padding;
|
||||
}
|
||||
|
||||
$current_style = '';
|
||||
|
||||
if ( ! empty( $header_area_style ) ) {
|
||||
$current_style .= calla_elated_dynamic_css( $header_area_selector, $header_area_style );
|
||||
}
|
||||
|
||||
$current_style = $current_style . $style;
|
||||
|
||||
return $current_style;
|
||||
}
|
||||
|
||||
add_filter( 'calla_elated_add_header_page_custom_style', 'calla_elated_header_centered_per_page_custom_styles', 10, 3 );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_register_header_centered_widget_areas' ) ) {
|
||||
/**
|
||||
* Registers additional widget areas for this header type
|
||||
*/
|
||||
function calla_elated_register_header_centered_widget_areas() {
|
||||
register_sidebar(
|
||||
array(
|
||||
'id' => 'eltdf-header-centered-left',
|
||||
'name' => esc_html__( 'Header Centered Left Widget Area', 'calla' ),
|
||||
'description' => esc_html__( 'Widgets added here will appear on the left of header centered', 'calla' ),
|
||||
'before_widget' => '<div id="%1$s" class="widget %2$s eltdf-header-centered-left-widget">',
|
||||
'after_widget' => '</div>',
|
||||
'before_title' => '<h5 class="eltdf-widget-title">',
|
||||
'after_title' => '</h5>'
|
||||
)
|
||||
);
|
||||
|
||||
register_sidebar(
|
||||
array(
|
||||
'id' => 'eltdf-header-centered-right',
|
||||
'name' => esc_html__( 'Header Centered Right Widget Area', 'calla' ),
|
||||
'description' => esc_html__( 'Widgets added here will appear on the right of header centered', 'calla' ),
|
||||
'before_widget' => '<div id="%1$s" class="widget %2$s eltdf-header-centered-right-widget">',
|
||||
'after_widget' => '</div>',
|
||||
'before_title' => '<h5 class="eltdf-widget-title">',
|
||||
'after_title' => '</h5>'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if ( calla_elated_check_is_header_type_enabled( 'header-centered' ) ) {
|
||||
add_action( 'widgets_init', 'calla_elated_register_header_centered_widget_areas' );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_header_centered_left_widget_areas' ) ) {
|
||||
/**
|
||||
* Loads header widgets area HTML
|
||||
*/
|
||||
function calla_elated_get_header_centered_left_widget_areas() {
|
||||
$page_id = calla_elated_get_page_id();
|
||||
$custom_header_centered_left_widget_area = get_post_meta( $page_id, 'eltdf_custom_header_centered_left_widget_meta', true );
|
||||
|
||||
if ( is_active_sidebar( 'eltdf-header-centered-left' ) && empty( $custom_header_centered_left_widget_area ) ) {
|
||||
dynamic_sidebar( 'eltdf-header-centered-left' );
|
||||
} else if ( ! empty( $custom_header_centered_left_widget_area ) && is_active_sidebar( $custom_header_centered_left_widget_area ) ) {
|
||||
dynamic_sidebar( $custom_header_centered_left_widget_area );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_header_centered_right_widget_areas' ) ) {
|
||||
/**
|
||||
* Loads header widgets area HTML
|
||||
*/
|
||||
function calla_elated_get_header_centered_right_widget_areas() {
|
||||
$page_id = calla_elated_get_page_id();
|
||||
$custom_header_centered_right_widget_area = get_post_meta( $page_id, 'eltdf_custom_header_centered_right_widget_meta', true );
|
||||
|
||||
if ( is_active_sidebar( 'eltdf-header-centered-right' ) && empty( $custom_header_centered_right_widget_area ) ) {
|
||||
dynamic_sidebar( 'eltdf-header-centered-right' );
|
||||
} else if ( ! empty( $custom_header_centered_right_widget_area ) && is_active_sidebar( $custom_header_centered_right_widget_area ) ) {
|
||||
dynamic_sidebar( $custom_header_centered_right_widget_area );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,236 @@
|
||||
<?php
|
||||
namespace CallaElated\Modules\Header\Types;
|
||||
|
||||
use CallaElated\Modules\Header\Lib\HeaderType;
|
||||
|
||||
/**
|
||||
* Class that represents Header Centered layout and option
|
||||
*
|
||||
* Class HeaderCentered
|
||||
*/
|
||||
class HeaderCentered extends HeaderType {
|
||||
protected $heightOfTransparency;
|
||||
protected $heightOfCompleteTransparency;
|
||||
protected $headerHeight;
|
||||
protected $mobileHeaderHeight;
|
||||
|
||||
/**
|
||||
* Sets slug property which is the same as value of option in DB
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->slug = 'header-centered';
|
||||
|
||||
if ( ! is_admin() ) {
|
||||
$this->logoAreaHeight = calla_elated_set_default_logo_height_for_header_types();
|
||||
$this->menuAreaHeight = calla_elated_set_default_menu_height_for_header_types();
|
||||
$this->mobileHeaderHeight = calla_elated_set_default_mobile_menu_height_for_header_types();
|
||||
|
||||
add_action( 'wp', array( $this, 'setHeaderHeightProps' ) );
|
||||
|
||||
add_filter( 'calla_elated_js_global_variables', array( $this, 'getGlobalJSVariables' ) );
|
||||
add_filter( 'calla_elated_per_page_js_vars', array( $this, 'getPerPageJSVariables' ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads template file for this header type
|
||||
*
|
||||
* @param array $parameters associative array of variables that needs to passed to template
|
||||
*/
|
||||
public function loadTemplate( $parameters = array() ) {
|
||||
$id = calla_elated_get_page_id();
|
||||
|
||||
$parameters['logo_area_in_grid'] = calla_elated_get_meta_field_intersect( 'logo_area_in_grid', $id ) == 'yes' ? true : false;
|
||||
$parameters['menu_area_in_grid'] = calla_elated_get_meta_field_intersect( 'menu_area_in_grid', $id ) == 'yes' ? true : false;
|
||||
|
||||
$parameters = apply_filters( 'calla_elated_header_centered_parameters', $parameters );
|
||||
|
||||
calla_elated_get_module_template_part( 'templates/' . $this->slug, $this->moduleName . '/types/' . $this->slug, '', $parameters );
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets header height properties after WP object is set up
|
||||
*/
|
||||
public function setHeaderHeightProps() {
|
||||
$this->heightOfTransparency = $this->calculateHeightOfTransparency();
|
||||
$this->heightOfCompleteTransparency = $this->calculateHeightOfCompleteTransparency();
|
||||
$this->headerHeight = $this->calculateHeaderHeight();
|
||||
$this->mobileHeaderHeight = $this->calculateMobileHeaderHeight();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns total height of transparent parts of header
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function calculateHeightOfTransparency() {
|
||||
$id = calla_elated_get_page_id();
|
||||
$transparencyHeight = 0;
|
||||
|
||||
$logo_background_color = calla_elated_get_meta_field_intersect( 'logo_area_background_color', $id );
|
||||
$logo_background_transparency = calla_elated_get_meta_field_intersect( 'logo_area_background_transparency', $id );
|
||||
$logo_grid_background_color = calla_elated_options()->getOptionValue( 'logo_area_grid_background_color' );
|
||||
$logo_grid_background_transparency = calla_elated_options()->getOptionValue( 'logo_area_grid_background_transparency' );
|
||||
|
||||
if ( empty( $logo_background_color ) ) {
|
||||
$logoAreaTransparent = ! empty( $logo_grid_background_color ) && $logo_grid_background_transparency !== '1' && $logo_grid_background_transparency !== '';
|
||||
} else {
|
||||
$logoAreaTransparent = ! empty( $logo_background_color ) && $logo_background_transparency !== '1' && $logo_background_transparency !== '';
|
||||
}
|
||||
|
||||
$menu_background_color = calla_elated_get_meta_field_intersect( 'menu_area_background_color', $id );
|
||||
$menu_background_transparency = calla_elated_get_meta_field_intersect( 'menu_area_background_transparency', $id );
|
||||
$menu_grid_background_color = calla_elated_options()->getOptionValue( 'menu_area_grid_background_color' );
|
||||
$menu_grid_background_transparency = calla_elated_options()->getOptionValue( 'menu_area_grid_background_transparency' );
|
||||
|
||||
if ( empty( $menu_background_color ) ) {
|
||||
$menuAreaTransparent = ! empty( $menu_grid_background_color ) && $menu_grid_background_transparency !== '1' && $menu_grid_background_transparency !== '';
|
||||
} else {
|
||||
$menuAreaTransparent = ! empty( $menu_background_color ) && $menu_background_transparency !== '1' && $menu_background_transparency !== '';
|
||||
}
|
||||
|
||||
$sliderExists = get_post_meta( $id, 'eltdf_page_slider_meta', true ) !== '';
|
||||
$contentBehindHeader = get_post_meta( $id, 'eltdf_page_content_behind_header_meta', true ) === 'yes';
|
||||
|
||||
if ( $sliderExists || $contentBehindHeader || is_404() ) {
|
||||
$menuAreaTransparent = true;
|
||||
$logoAreaTransparent = true;
|
||||
}
|
||||
|
||||
if ( $logoAreaTransparent || $menuAreaTransparent ) {
|
||||
if ( $logoAreaTransparent ) {
|
||||
$transparencyHeight = $this->logoAreaHeight + $this->menuAreaHeight;
|
||||
|
||||
if ( ( $sliderExists && calla_elated_is_top_bar_enabled() )
|
||||
|| calla_elated_is_top_bar_enabled() && calla_elated_is_top_bar_transparent()
|
||||
) {
|
||||
$transparencyHeight += calla_elated_get_top_bar_height();
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $logoAreaTransparent && $menuAreaTransparent ) {
|
||||
$transparencyHeight = $this->menuAreaHeight;
|
||||
}
|
||||
}
|
||||
|
||||
return $transparencyHeight;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns height of completely transparent header parts
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function calculateHeightOfCompleteTransparency() {
|
||||
$id = calla_elated_get_page_id();
|
||||
$transparencyHeight = 0;
|
||||
|
||||
$logo_background_color_meta = get_post_meta( $id, 'eltdf_logo_area_background_color_meta', true );
|
||||
$logo_background_transparency_meta = get_post_meta( $id, 'eltdf_logo_area_background_transparency_meta', true );
|
||||
$logo_background_color = calla_elated_options()->getOptionValue( 'logo_area_background_color' );
|
||||
$logo_background_transparency = calla_elated_options()->getOptionValue( 'logo_area_background_transparency' );
|
||||
$logo_grid_background_color = calla_elated_options()->getOptionValue( 'logo_area_grid_background_color' );
|
||||
$logo_grid_background_transparency = calla_elated_options()->getOptionValue( 'logo_area_grid_background_transparency' );
|
||||
|
||||
if ( ! empty( $logo_background_color_meta ) ) {
|
||||
$logoAreaTransparent = ! empty( $logo_background_color_meta ) && $logo_background_transparency_meta === '0';
|
||||
} elseif ( empty( $logo_background_color ) ) {
|
||||
$logoAreaTransparent = ! empty( $logo_grid_background_color ) && $logo_grid_background_transparency === '0';
|
||||
} else {
|
||||
$logoAreaTransparent = ! empty( $logo_background_color ) && $logo_background_transparency === '0';
|
||||
}
|
||||
|
||||
$menu_background_color_meta = get_post_meta( $id, 'eltdf_menu_area_background_color_meta', true );
|
||||
$menu_background_transparency_meta = get_post_meta( $id, 'eltdf_menu_area_background_transparency_meta', true );
|
||||
$menu_background_color = calla_elated_options()->getOptionValue( 'menu_area_background_color' );
|
||||
$menu_background_transparency = calla_elated_options()->getOptionValue( 'menu_area_background_transparency' );
|
||||
$menu_grid_background_color = calla_elated_options()->getOptionValue( 'menu_area_grid_background_color' );
|
||||
$menu_grid_background_transparency = calla_elated_options()->getOptionValue( 'menu_area_grid_background_transparency' );
|
||||
|
||||
if ( ! empty( $menu_background_color_meta ) ) {
|
||||
$menuAreaTransparent = ! empty( $menu_background_color_meta ) && $menu_background_transparency_meta === '0';
|
||||
} elseif ( empty( $menu_background_color ) ) {
|
||||
$menuAreaTransparent = ! empty( $menu_grid_background_color ) && $menu_grid_background_transparency === '0';
|
||||
} else {
|
||||
$menuAreaTransparent = ! empty( $menu_background_color ) && $menu_background_transparency === '0';
|
||||
}
|
||||
|
||||
if ( $logoAreaTransparent || $menuAreaTransparent ) {
|
||||
if ( $logoAreaTransparent ) {
|
||||
$transparencyHeight = $this->logoAreaHeight + $this->menuAreaHeight;
|
||||
|
||||
if ( calla_elated_is_top_bar_enabled() && calla_elated_is_top_bar_completely_transparent() ) {
|
||||
$transparencyHeight += calla_elated_get_top_bar_height();
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $logoAreaTransparent && $menuAreaTransparent ) {
|
||||
$transparencyHeight = $this->menuAreaHeight;
|
||||
}
|
||||
}
|
||||
|
||||
return $transparencyHeight;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns total height of header
|
||||
*
|
||||
* @return int|string
|
||||
*/
|
||||
public function calculateHeaderHeight() {
|
||||
$headerHeight = $this->logoAreaHeight + $this->menuAreaHeight;
|
||||
if ( calla_elated_is_top_bar_enabled() ) {
|
||||
$headerHeight += calla_elated_get_top_bar_height();
|
||||
}
|
||||
|
||||
return $headerHeight;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns total height of mobile header
|
||||
*
|
||||
* @return int|string
|
||||
*/
|
||||
public function calculateMobileHeaderHeight() {
|
||||
$mobileHeaderHeight = $this->mobileHeaderHeight;
|
||||
|
||||
return $mobileHeaderHeight;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns global js variables of header
|
||||
*
|
||||
* @param $globalVariables
|
||||
*
|
||||
* @return int|string
|
||||
*/
|
||||
public function getGlobalJSVariables( $globalVariables ) {
|
||||
$globalVariables['eltdfLogoAreaHeight'] = $this->logoAreaHeight;
|
||||
$globalVariables['eltdfMenuAreaHeight'] = $this->menuAreaHeight;
|
||||
$globalVariables['eltdfMobileHeaderHeight'] = $this->mobileHeaderHeight;
|
||||
|
||||
return $globalVariables;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns per page js variables of header
|
||||
*
|
||||
* @param $perPageVars
|
||||
*
|
||||
* @return int|string
|
||||
*/
|
||||
public function getPerPageJSVariables( $perPageVars ) {
|
||||
//calculate transparency height only if header has no sticky behaviour
|
||||
$header_behavior = calla_elated_get_meta_field_intersect( 'header_behaviour' );
|
||||
if ( ! in_array( $header_behavior, array( 'sticky-header-on-scroll-up', 'sticky-header-on-scroll-down-up' ) ) ) {
|
||||
$perPageVars['eltdfHeaderTransparencyHeight'] = $this->headerHeight - ( calla_elated_get_top_bar_height() + $this->heightOfCompleteTransparency );
|
||||
} else {
|
||||
$perPageVars['eltdfHeaderTransparencyHeight'] = 0;
|
||||
}
|
||||
$perPageVars['eltdfHeaderVerticalWidth'] = 0;
|
||||
|
||||
return $perPageVars;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
|
||||
include_once ELATED_FRAMEWORK_HEADER_ROOT_DIR . '/types/header-centered/functions.php';
|
||||
include_once ELATED_FRAMEWORK_HEADER_ROOT_DIR . '/types/header-centered/header-centered.php';
|
||||
@@ -0,0 +1,73 @@
|
||||
<?php do_action('calla_elated_before_page_header'); ?>
|
||||
|
||||
<header class="eltdf-page-header">
|
||||
<?php do_action('calla_elated_after_page_header_html_open'); ?>
|
||||
|
||||
<div class="eltdf-logo-area">
|
||||
<?php do_action( 'calla_elated_after_header_logo_area_html_open' ); ?>
|
||||
|
||||
<?php if($logo_area_in_grid) : ?>
|
||||
<div class="eltdf-grid">
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="eltdf-vertical-align-containers">
|
||||
<div class="eltdf-position-center"><!--
|
||||
--><div class="eltdf-position-center-inner">
|
||||
<?php if(!$hide_logo) {
|
||||
calla_elated_get_logo();
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if($logo_area_in_grid) : ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php if($show_fixed_wrapper) : ?>
|
||||
<div class="eltdf-fixed-wrapper">
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="eltdf-menu-area">
|
||||
<?php do_action( 'calla_elated_after_header_menu_area_html_open' ); ?>
|
||||
|
||||
<?php if($menu_area_in_grid) : ?>
|
||||
<div class="eltdf-grid">
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="eltdf-vertical-align-containers">
|
||||
<div class="eltdf-position-left"><!--
|
||||
--><div class="eltdf-position-left-inner">
|
||||
<?php calla_elated_get_header_centered_left_widget_areas(); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="eltdf-position-center"><!--
|
||||
--><div class="eltdf-position-center-inner">
|
||||
<?php calla_elated_get_main_menu(); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="eltdf-position-right"><!--
|
||||
--><div class="eltdf-position-right-inner">
|
||||
<?php calla_elated_get_header_centered_right_widget_areas(); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if($menu_area_in_grid) : ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php if($show_fixed_wrapper) { ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if($show_sticky) {
|
||||
calla_elated_get_sticky_header('centered', 'header/types/header-centered');
|
||||
} ?>
|
||||
|
||||
<?php do_action('calla_elated_before_page_header_html_close'); ?>
|
||||
</header>
|
||||
|
||||
<?php do_action('calla_elated_after_page_header'); ?>
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php do_action('calla_elated_after_sticky_header'); ?>
|
||||
|
||||
<div class="eltdf-sticky-header">
|
||||
<?php do_action('calla_elated_after_sticky_menu_html_open'); ?>
|
||||
<div class="eltdf-sticky-holder">
|
||||
<?php if ($sticky_header_in_grid) : ?>
|
||||
<div class="eltdf-grid">
|
||||
<?php endif; ?>
|
||||
<div class=" eltdf-vertical-align-containers">
|
||||
<div class="eltdf-position-left"><!--
|
||||
--><div class="eltdf-position-left-inner">
|
||||
<?php if (!$hide_logo) {
|
||||
calla_elated_get_logo('sticky');
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="eltdf-position-right"><!--
|
||||
--><div class="eltdf-position-right-inner">
|
||||
<?php calla_elated_get_sticky_menu('eltdf-sticky-nav'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($sticky_header_in_grid) : ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php do_action('calla_elated_after_sticky_header'); ?>
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_hide_dep_for_header_standard_meta_boxes' ) ) {
|
||||
function calla_elated_get_hide_dep_for_header_standard_meta_boxes() {
|
||||
$hide_dep_options = apply_filters( 'calla_elated_header_standard_hide_meta_boxes', $hide_dep_options = array() );
|
||||
|
||||
return $hide_dep_options;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_header_standard_meta_map' ) ) {
|
||||
function calla_elated_header_standard_meta_map( $parent ) {
|
||||
$hide_dep_options = calla_elated_get_hide_dep_for_header_standard_meta_boxes();
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'parent' => $parent,
|
||||
'type' => 'select',
|
||||
'name' => 'eltdf_set_menu_area_position_meta',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Choose Menu Area Position', 'calla' ),
|
||||
'description' => esc_html__( 'Select menu area position in your header', 'calla' ),
|
||||
'options' => array(
|
||||
'' => esc_html__( 'Default', 'calla' ),
|
||||
'left' => esc_html__( 'Left', 'calla' ),
|
||||
'right' => esc_html__( 'Right', 'calla' ),
|
||||
'center' => esc_html__( 'Center', 'calla' )
|
||||
),
|
||||
'dependency' => array(
|
||||
'hide' => array(
|
||||
'eltdf_header_type_meta' => $hide_dep_options
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
add_action( 'calla_elated_additional_header_area_meta_boxes_map', 'calla_elated_header_standard_meta_map' );
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_hide_dep_for_header_standard_options' ) ) {
|
||||
function calla_elated_get_hide_dep_for_header_standard_options() {
|
||||
$hide_dep_options = apply_filters( 'calla_elated_header_standard_hide_global_option', $hide_dep_options = array() );
|
||||
|
||||
return $hide_dep_options;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_header_standard_map' ) ) {
|
||||
function calla_elated_header_standard_map( $parent ) {
|
||||
$hide_dep_options = calla_elated_get_hide_dep_for_header_standard_options();
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $parent,
|
||||
'type' => 'select',
|
||||
'name' => 'set_menu_area_position',
|
||||
'default_value' => 'right',
|
||||
'label' => esc_html__( 'Choose Menu Area Position', 'calla' ),
|
||||
'description' => esc_html__( 'Select menu area position in your header', 'calla' ),
|
||||
'options' => array(
|
||||
'right' => esc_html__( 'Right', 'calla' ),
|
||||
'left' => esc_html__( 'Left', 'calla' ),
|
||||
'center' => esc_html__( 'Center', 'calla' )
|
||||
),
|
||||
'dependency' => array(
|
||||
'hide' => array(
|
||||
'header_options' => $hide_dep_options
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
add_action( 'calla_elated_additional_header_menu_area_options_map', 'calla_elated_header_standard_map' );
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
if ( ! function_exists( 'calla_elated_set_header_standard_type_global_option' ) ) {
|
||||
/**
|
||||
* This function set header type value for global header option map
|
||||
*/
|
||||
function calla_elated_set_header_standard_type_global_option( $header_types ) {
|
||||
$header_types['header-standard'] = array(
|
||||
'image' => ELATED_FRAMEWORK_HEADER_TYPES_ROOT . '/header-standard/assets/img/header-standard.png',
|
||||
'label' => esc_html__( 'Standard', 'calla' )
|
||||
);
|
||||
|
||||
return $header_types;
|
||||
}
|
||||
|
||||
add_filter( 'calla_elated_header_type_global_option', 'calla_elated_set_header_standard_type_global_option' );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_set_header_standard_type_as_global_option' ) ) {
|
||||
/**
|
||||
* This function set default header type value for global header option map
|
||||
*/
|
||||
function calla_elated_set_header_standard_type_as_global_option( $header_type ) {
|
||||
$header_type = 'header-standard';
|
||||
|
||||
return $header_type;
|
||||
}
|
||||
|
||||
add_filter( 'calla_elated_default_header_type_global_option', 'calla_elated_set_header_standard_type_as_global_option' );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_set_header_standard_type_meta_boxes_option' ) ) {
|
||||
/**
|
||||
* This function set header type value for header meta boxes map
|
||||
*/
|
||||
function calla_elated_set_header_standard_type_meta_boxes_option( $header_type_options ) {
|
||||
$header_type_options['header-standard'] = esc_html__( 'Standard', 'calla' );
|
||||
|
||||
return $header_type_options;
|
||||
}
|
||||
|
||||
add_filter( 'calla_elated_header_type_meta_boxes', 'calla_elated_set_header_standard_type_meta_boxes_option' );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_set_hide_dep_options_header_standard' ) ) {
|
||||
/**
|
||||
* This function is used to hide all containers/panels for admin options when this header type is selected
|
||||
*/
|
||||
function calla_elated_set_hide_dep_options_header_standard( $hide_dep_options ) {
|
||||
$hide_dep_options[] = 'header-standard';
|
||||
|
||||
return $hide_dep_options;
|
||||
}
|
||||
|
||||
// header global panel options
|
||||
add_filter( 'calla_elated_header_logo_area_hide_global_option', 'calla_elated_set_hide_dep_options_header_standard' );
|
||||
|
||||
// header global panel meta boxes
|
||||
add_filter( 'calla_elated_header_logo_area_hide_meta_boxes', 'calla_elated_set_hide_dep_options_header_standard' );
|
||||
|
||||
// header types panel options
|
||||
add_filter( 'calla_elated_header_centered_hide_global_option', 'calla_elated_set_hide_dep_options_header_standard' );
|
||||
add_filter( 'calla_elated_full_screen_menu_hide_global_option', 'calla_elated_set_hide_dep_options_header_standard' );
|
||||
add_filter( 'calla_elated_header_vertical_hide_global_option', 'calla_elated_set_hide_dep_options_header_standard' );
|
||||
add_filter( 'calla_elated_header_vertical_menu_hide_global_option', 'calla_elated_set_hide_dep_options_header_standard' );
|
||||
add_filter( 'calla_elated_header_vertical_closed_hide_global_option', 'calla_elated_set_hide_dep_options_header_standard' );
|
||||
add_filter( 'calla_elated_header_vertical_sliding_hide_global_option', 'calla_elated_set_hide_dep_options_header_standard' );
|
||||
|
||||
// header types panel meta boxes
|
||||
add_filter( 'calla_elated_header_centered_hide_meta_boxes', 'calla_elated_set_hide_dep_options_header_standard' );
|
||||
add_filter( 'calla_elated_header_vertical_hide_meta_boxes', 'calla_elated_set_hide_dep_options_header_standard' );
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
if ( ! function_exists( 'calla_elated_register_header_standard_type' ) ) {
|
||||
/**
|
||||
* This function is used to register header type class for header factory file
|
||||
*/
|
||||
function calla_elated_register_header_standard_type( $header_types ) {
|
||||
$header_type = array(
|
||||
'header-standard' => 'CallaElated\Modules\Header\Types\HeaderStandard'
|
||||
);
|
||||
|
||||
$header_types = array_merge( $header_types, $header_type );
|
||||
|
||||
return $header_types;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_init_register_header_standard_type' ) ) {
|
||||
/**
|
||||
* This function is used to wait header-function.php file to init header object and then to init hook registration function above
|
||||
*/
|
||||
function calla_elated_init_register_header_standard_type() {
|
||||
add_filter( 'calla_elated_register_header_type_class', 'calla_elated_register_header_standard_type' );
|
||||
}
|
||||
|
||||
add_action( 'calla_elated_before_header_function_init', 'calla_elated_init_register_header_standard_type' );
|
||||
}
|
||||
@@ -0,0 +1,190 @@
|
||||
<?php
|
||||
namespace CallaElated\Modules\Header\Types;
|
||||
|
||||
use CallaElated\Modules\Header\Lib\HeaderType;
|
||||
|
||||
/**
|
||||
* Class that represents Header Standard layout and option
|
||||
*
|
||||
* Class HeaderStandard
|
||||
*/
|
||||
class HeaderStandard extends HeaderType {
|
||||
protected $heightOfTransparency;
|
||||
protected $heightOfCompleteTransparency;
|
||||
protected $headerHeight;
|
||||
protected $mobileHeaderHeight;
|
||||
|
||||
/**
|
||||
* Sets slug property which is the same as value of option in DB
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->slug = 'header-standard';
|
||||
|
||||
if ( ! is_admin() ) {
|
||||
$this->menuAreaHeight = calla_elated_set_default_menu_height_for_header_types();
|
||||
$this->mobileHeaderHeight = calla_elated_set_default_mobile_menu_height_for_header_types();
|
||||
|
||||
add_action( 'wp', array( $this, 'setHeaderHeightProps' ) );
|
||||
|
||||
add_filter( 'calla_elated_js_global_variables', array( $this, 'getGlobalJSVariables' ) );
|
||||
add_filter( 'calla_elated_per_page_js_vars', array( $this, 'getPerPageJSVariables' ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads template file for this header type
|
||||
*
|
||||
* @param array $parameters associative array of variables that needs to passed to template
|
||||
*/
|
||||
public function loadTemplate( $parameters = array() ) {
|
||||
$page_id = calla_elated_get_page_id();
|
||||
$menu_area_position = calla_elated_get_meta_field_intersect( 'set_menu_area_position', $page_id );
|
||||
$parameters['menu_area_position'] = ! empty( $menu_area_position ) ? $menu_area_position : 'right';
|
||||
$parameters['menu_area_position_class'] = ! empty( $menu_area_position ) ? 'eltdf-menu-' . $menu_area_position : 'eltdf-menu-right';
|
||||
|
||||
$parameters = apply_filters( 'calla_elated_header_standard_parameters', $parameters );
|
||||
|
||||
calla_elated_get_module_template_part( 'templates/' . $this->slug, $this->moduleName . '/types/' . $this->slug, '', $parameters );
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets header height properties after WP object is set up
|
||||
*/
|
||||
public function setHeaderHeightProps() {
|
||||
$this->heightOfTransparency = $this->calculateHeightOfTransparency();
|
||||
$this->heightOfCompleteTransparency = $this->calculateHeightOfCompleteTransparency();
|
||||
$this->headerHeight = $this->calculateHeaderHeight();
|
||||
$this->mobileHeaderHeight = $this->calculateMobileHeaderHeight();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns total height of transparent parts of header
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function calculateHeightOfTransparency() {
|
||||
$id = calla_elated_get_page_id();
|
||||
$transparencyHeight = 0;
|
||||
|
||||
$menu_background_color = calla_elated_get_meta_field_intersect( 'menu_area_background_color', $id );
|
||||
$menu_background_transparency = calla_elated_get_meta_field_intersect( 'menu_area_background_transparency', $id );
|
||||
$menu_grid_background_color = calla_elated_options()->getOptionValue( 'menu_area_grid_background_color' );
|
||||
$menu_grid_background_transparency = calla_elated_options()->getOptionValue( 'menu_area_grid_background_transparency' );
|
||||
|
||||
if ( empty( $menu_background_color ) ) {
|
||||
$menuAreaTransparent = ! empty( $menu_grid_background_color ) && $menu_grid_background_transparency !== '1' && $menu_grid_background_transparency !== '';
|
||||
} else {
|
||||
$menuAreaTransparent = ! empty( $menu_background_color ) && $menu_background_transparency !== '1' && $menu_background_transparency !== '';
|
||||
}
|
||||
|
||||
$sliderExists = get_post_meta( $id, 'eltdf_page_slider_meta', true ) !== '';
|
||||
$contentBehindHeader = get_post_meta( $id, 'eltdf_page_content_behind_header_meta', true ) === 'yes';
|
||||
|
||||
if ( $sliderExists || $contentBehindHeader || is_404() ) {
|
||||
$menuAreaTransparent = true;
|
||||
}
|
||||
|
||||
if ( $menuAreaTransparent ) {
|
||||
$transparencyHeight = $this->menuAreaHeight;
|
||||
|
||||
if ( ( $sliderExists && calla_elated_is_top_bar_enabled() )
|
||||
|| calla_elated_is_top_bar_enabled() && calla_elated_is_top_bar_transparent()
|
||||
) {
|
||||
$transparencyHeight += calla_elated_get_top_bar_height();
|
||||
}
|
||||
}
|
||||
|
||||
return $transparencyHeight;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns height of completely transparent header parts
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function calculateHeightOfCompleteTransparency() {
|
||||
$id = calla_elated_get_page_id();
|
||||
$transparencyHeight = 0;
|
||||
|
||||
$menu_background_color_meta = get_post_meta( $id, 'eltdf_menu_area_background_color_meta', true );
|
||||
$menu_background_transparency_meta = get_post_meta( $id, 'eltdf_menu_area_background_transparency_meta', true );
|
||||
$menu_background_color = calla_elated_options()->getOptionValue( 'menu_area_background_color' );
|
||||
$menu_background_transparency = calla_elated_options()->getOptionValue( 'menu_area_background_transparency' );
|
||||
$menu_grid_background_color = calla_elated_options()->getOptionValue( 'menu_area_grid_background_color' );
|
||||
$menu_grid_background_transparency = calla_elated_options()->getOptionValue( 'menu_area_grid_background_transparency' );
|
||||
|
||||
if ( ! empty( $menu_background_color_meta ) ) {
|
||||
$menuAreaTransparent = ! empty( $menu_background_color_meta ) && $menu_background_transparency_meta === '0';
|
||||
} elseif ( empty( $menu_background_color ) ) {
|
||||
$menuAreaTransparent = ! empty( $menu_grid_background_color ) && $menu_grid_background_transparency === '0';
|
||||
} else {
|
||||
$menuAreaTransparent = ! empty( $menu_background_color ) && $menu_background_transparency === '0';
|
||||
}
|
||||
|
||||
if ( $menuAreaTransparent ) {
|
||||
$transparencyHeight = $this->menuAreaHeight;
|
||||
}
|
||||
|
||||
return $transparencyHeight;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns total height of header
|
||||
*
|
||||
* @return int|string
|
||||
*/
|
||||
public function calculateHeaderHeight() {
|
||||
$headerHeight = $this->menuAreaHeight;
|
||||
if ( calla_elated_is_top_bar_enabled() ) {
|
||||
$headerHeight += calla_elated_get_top_bar_height();
|
||||
}
|
||||
|
||||
return $headerHeight;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns total height of mobile header
|
||||
*
|
||||
* @return int|string
|
||||
*/
|
||||
public function calculateMobileHeaderHeight() {
|
||||
$mobileHeaderHeight = $this->mobileHeaderHeight;
|
||||
|
||||
return $mobileHeaderHeight;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns global js variables of header
|
||||
*
|
||||
* @param $globalVariables
|
||||
*
|
||||
* @return int|string
|
||||
*/
|
||||
public function getGlobalJSVariables( $globalVariables ) {
|
||||
$globalVariables['eltdfLogoAreaHeight'] = 0;
|
||||
$globalVariables['eltdfMenuAreaHeight'] = $this->headerHeight;
|
||||
$globalVariables['eltdfMobileHeaderHeight'] = $this->mobileHeaderHeight;
|
||||
|
||||
return $globalVariables;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns per page js variables of header
|
||||
*
|
||||
* @param $perPageVars
|
||||
*
|
||||
* @return int|string
|
||||
*/
|
||||
public function getPerPageJSVariables( $perPageVars ) {
|
||||
//calculate transparency height only if header has no sticky behaviour
|
||||
$header_behavior = calla_elated_get_meta_field_intersect( 'header_behaviour' );
|
||||
if ( ! in_array( $header_behavior, array( 'sticky-header-on-scroll-up', 'sticky-header-on-scroll-down-up' ) ) ) {
|
||||
$perPageVars['eltdfHeaderTransparencyHeight'] = $this->headerHeight - ( calla_elated_get_top_bar_height() + $this->heightOfCompleteTransparency );
|
||||
} else {
|
||||
$perPageVars['eltdfHeaderTransparencyHeight'] = 0;
|
||||
}
|
||||
$perPageVars['eltdfHeaderVerticalWidth'] = 0;
|
||||
|
||||
return $perPageVars;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
|
||||
include_once ELATED_FRAMEWORK_HEADER_ROOT_DIR . '/types/header-standard/functions.php';
|
||||
include_once ELATED_FRAMEWORK_HEADER_ROOT_DIR . '/types/header-standard/header-standard.php';
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php do_action('calla_elated_before_page_header'); ?>
|
||||
|
||||
<header class="eltdf-page-header">
|
||||
<?php do_action('calla_elated_after_page_header_html_open'); ?>
|
||||
|
||||
<?php if($show_fixed_wrapper) : ?>
|
||||
<div class="eltdf-fixed-wrapper">
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="eltdf-menu-area <?php echo esc_attr($menu_area_position_class); ?>">
|
||||
<?php do_action('calla_elated_after_header_menu_area_html_open') ?>
|
||||
|
||||
<?php if($menu_area_in_grid) : ?>
|
||||
<div class="eltdf-grid">
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="eltdf-vertical-align-containers">
|
||||
<div class="eltdf-position-left"><!--
|
||||
--><div class="eltdf-position-left-inner">
|
||||
<?php if(!$hide_logo) {
|
||||
calla_elated_get_logo();
|
||||
} ?>
|
||||
<?php if($menu_area_position === 'left') : ?>
|
||||
<?php calla_elated_get_main_menu(); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if($menu_area_position === 'center') : ?>
|
||||
<div class="eltdf-position-center"><!--
|
||||
--><div class="eltdf-position-center-inner">
|
||||
<?php calla_elated_get_main_menu(); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="eltdf-position-right"><!--
|
||||
--><div class="eltdf-position-right-inner">
|
||||
<?php if($menu_area_position === 'right') : ?>
|
||||
<?php calla_elated_get_main_menu(); ?>
|
||||
<?php endif; ?>
|
||||
<?php calla_elated_get_header_widget_menu_area(); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if($menu_area_in_grid) : ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php if($show_fixed_wrapper) { ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if($show_sticky) {
|
||||
calla_elated_get_sticky_header();
|
||||
} ?>
|
||||
|
||||
<?php do_action('calla_elated_before_page_header_html_close'); ?>
|
||||
</header>
|
||||
|
||||
<?php do_action('calla_elated_after_page_header'); ?>
|
||||
@@ -0,0 +1,179 @@
|
||||
<?php
|
||||
|
||||
if ( ! function_exists( 'calla_elated_mobile_header_general_styles' ) ) {
|
||||
/**
|
||||
* Generates general custom styles for mobile header
|
||||
*/
|
||||
function calla_elated_mobile_header_general_styles() {
|
||||
$item_styles = array();
|
||||
$height = calla_elated_options()->getOptionValue( 'mobile_header_height' );
|
||||
$background_color = calla_elated_options()->getOptionValue( 'mobile_header_background_color' );
|
||||
$border_color = calla_elated_options()->getOptionValue( 'mobile_header_border_bottom_color' );
|
||||
|
||||
if ( ! empty( $height ) ) {
|
||||
$item_styles['height'] = calla_elated_filter_px( $height ) . 'px';
|
||||
}
|
||||
|
||||
if ( ! empty( $background_color ) ) {
|
||||
$item_styles['background-color'] = $background_color;
|
||||
}
|
||||
|
||||
if ( ! empty( $border_color ) ) {
|
||||
$item_styles['border-color'] = $border_color;
|
||||
}
|
||||
|
||||
echo calla_elated_dynamic_css( '.eltdf-mobile-header .eltdf-mobile-header-inner', $item_styles );
|
||||
}
|
||||
|
||||
add_action( 'calla_elated_style_dynamic', 'calla_elated_mobile_header_general_styles' );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_mobile_navigation_styles' ) ) {
|
||||
/**
|
||||
* Generates styles for mobile navigation
|
||||
*/
|
||||
function calla_elated_mobile_navigation_styles() {
|
||||
$mobile_nav_styles = array();
|
||||
$background_color = calla_elated_options()->getOptionValue( 'mobile_menu_background_color' );
|
||||
$border_color = calla_elated_options()->getOptionValue( 'mobile_menu_border_bottom_color' );
|
||||
|
||||
if ( ! empty( $background_color ) ) {
|
||||
$mobile_nav_styles['background-color'] = $background_color;
|
||||
}
|
||||
|
||||
if ( ! empty( $border_color ) ) {
|
||||
$mobile_nav_styles['border-color'] = $border_color;
|
||||
}
|
||||
|
||||
echo calla_elated_dynamic_css( '.eltdf-mobile-header .eltdf-mobile-nav', $mobile_nav_styles );
|
||||
|
||||
$nav_item_styles = array();
|
||||
$nav_border_color = calla_elated_options()->getOptionValue( 'mobile_menu_separator_color' );
|
||||
$mobile_nav_item_selector = array(
|
||||
'.eltdf-mobile-header .eltdf-mobile-nav ul li a',
|
||||
'.eltdf-mobile-header .eltdf-mobile-nav ul li h6'
|
||||
);
|
||||
|
||||
if ( ! empty( $nav_border_color ) ) {
|
||||
$nav_item_styles['border-bottom-color'] = $nav_border_color;
|
||||
}
|
||||
|
||||
echo calla_elated_dynamic_css( $mobile_nav_item_selector, $nav_item_styles );
|
||||
|
||||
|
||||
// mobile dropdown 1st level menu style
|
||||
|
||||
$mobile_menu_style = calla_elated_get_typography_styles( 'mobile_text' );
|
||||
|
||||
$mobile_menu_selector = array(
|
||||
'.eltdf-mobile-header .eltdf-mobile-nav .eltdf-grid > ul > li > a',
|
||||
'.eltdf-mobile-header .eltdf-mobile-nav .eltdf-grid > ul > li > h6'
|
||||
);
|
||||
|
||||
echo calla_elated_dynamic_css( $mobile_menu_selector, $mobile_menu_style );
|
||||
|
||||
|
||||
$mobile_nav_item_hover_styles = array();
|
||||
$mobile_text_hover_color = calla_elated_options()->getOptionValue( 'mobile_text_hover_color' );
|
||||
|
||||
if ( ! empty( $mobile_text_hover_color ) ) {
|
||||
$mobile_nav_item_hover_styles['color'] = $mobile_text_hover_color;
|
||||
}
|
||||
|
||||
$mobile_nav_item_selector_hover = array(
|
||||
'.eltdf-mobile-header .eltdf-mobile-nav .eltdf-grid > ul > li.eltdf-active-item > a',
|
||||
'.eltdf-mobile-header .eltdf-mobile-nav .eltdf-grid > ul > li.eltdf-active-item > h6',
|
||||
'.eltdf-mobile-header .eltdf-mobile-nav .eltdf-grid > ul > li > a:hover',
|
||||
'.eltdf-mobile-header .eltdf-mobile-nav .eltdf-grid > ul > li > h6:hover'
|
||||
);
|
||||
|
||||
echo calla_elated_dynamic_css( $mobile_nav_item_selector_hover, $mobile_nav_item_hover_styles );
|
||||
|
||||
// mobile dropdown deeper levels menu style
|
||||
|
||||
$mobile_dropdown_style = calla_elated_get_typography_styles( 'mobile_dropdown_text' );
|
||||
|
||||
$mobile_dropdown_selector = array(
|
||||
'.eltdf-mobile-header .eltdf-mobile-nav ul ul li a',
|
||||
'.eltdf-mobile-header .eltdf-mobile-nav ul ul li h6'
|
||||
);
|
||||
|
||||
echo calla_elated_dynamic_css( $mobile_dropdown_selector, $mobile_dropdown_style );
|
||||
|
||||
|
||||
$mobile_nav_dropdown_item_hover_styles = array();
|
||||
$mobile_nav_dropdown_hover_color = calla_elated_options()->getOptionValue( 'mobile_dropdown_text_hover_color' );
|
||||
|
||||
if ( ! empty( $mobile_nav_dropdown_hover_color ) ) {
|
||||
$mobile_nav_dropdown_item_hover_styles['color'] = $mobile_nav_dropdown_hover_color;
|
||||
}
|
||||
|
||||
$mobile_nav_dropdown_item_selector_hover = array(
|
||||
'.eltdf-mobile-header .eltdf-mobile-nav ul ul li.current-menu-ancestor > a',
|
||||
'.eltdf-mobile-header .eltdf-mobile-nav ul ul li.current-menu-item > a',
|
||||
'.eltdf-mobile-header .eltdf-mobile-nav ul ul li.current-menu-ancestor > h6',
|
||||
'.eltdf-mobile-header .eltdf-mobile-nav ul ul li.current-menu-item > h6',
|
||||
'.eltdf-mobile-header .eltdf-mobile-nav ul ul li a:hover',
|
||||
'.eltdf-mobile-header .eltdf-mobile-nav ul ul li h6:hover'
|
||||
);
|
||||
|
||||
echo calla_elated_dynamic_css( $mobile_nav_dropdown_item_selector_hover, $mobile_nav_dropdown_item_hover_styles );
|
||||
}
|
||||
|
||||
add_action( 'calla_elated_style_dynamic', 'calla_elated_mobile_navigation_styles' );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_mobile_logo_styles' ) ) {
|
||||
/**
|
||||
* Generates styles for mobile logo
|
||||
*/
|
||||
function calla_elated_mobile_logo_styles() {
|
||||
$logo_height = calla_elated_options()->getOptionValue( 'mobile_logo_height' );
|
||||
$mobile_logo_height = calla_elated_options()->getOptionValue( 'mobile_logo_height_phones' );
|
||||
$mobile_header_height = calla_elated_options()->getOptionValue( 'mobile_header_height' );
|
||||
|
||||
if ( ! empty( $logo_height ) ) { ?>
|
||||
@media only screen and (max-width: 1024px) {
|
||||
<?php echo calla_elated_dynamic_css(
|
||||
'.eltdf-mobile-header .eltdf-mobile-logo-wrapper a',
|
||||
array( 'height' => calla_elated_filter_px( $logo_height ) . 'px !important' )
|
||||
); ?>
|
||||
}
|
||||
<?php }
|
||||
|
||||
if ( ! empty( $mobile_logo_height ) ) { ?>
|
||||
@media only screen and (max-width: 480px) {
|
||||
<?php echo calla_elated_dynamic_css(
|
||||
'.eltdf-mobile-header .eltdf-mobile-logo-wrapper a',
|
||||
array( 'height' => calla_elated_filter_px( $mobile_logo_height ) . 'px !important' )
|
||||
); ?>
|
||||
}
|
||||
<?php }
|
||||
|
||||
if ( ! empty( $mobile_header_height ) ) {
|
||||
echo calla_elated_dynamic_css( '.eltdf-mobile-header .eltdf-mobile-logo-wrapper a', array( 'max-height' => calla_elated_filter_px( $mobile_header_height ) . 'px' ) );
|
||||
}
|
||||
}
|
||||
|
||||
add_action( 'calla_elated_style_dynamic', 'calla_elated_mobile_logo_styles' );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_mobile_icon_styles' ) ) {
|
||||
/**
|
||||
* Generates styles for mobile icon opener
|
||||
*/
|
||||
function calla_elated_mobile_icon_styles() {
|
||||
$icon_color = calla_elated_options()->getOptionValue( 'mobile_icon_color' );
|
||||
$icon_hover_color = calla_elated_options()->getOptionValue( 'mobile_icon_hover_color' );
|
||||
|
||||
if ( ! empty( $icon_color ) ) {
|
||||
echo calla_elated_dynamic_css( '.eltdf-mobile-header .eltdf-mobile-menu-opener a', array( 'color' => $icon_color ) );
|
||||
}
|
||||
|
||||
if ( ! empty( $icon_hover_color ) ) {
|
||||
echo calla_elated_dynamic_css( '.eltdf-mobile-header .eltdf-mobile-menu-opener a:hover, .eltdf-mobile-header .eltdf-mobile-menu-opener.eltdf-mobile-menu-opened a', array( 'color' => $icon_hover_color ) );
|
||||
}
|
||||
}
|
||||
|
||||
add_action( 'calla_elated_style_dynamic', 'calla_elated_mobile_icon_styles' );
|
||||
}
|
||||
@@ -0,0 +1,489 @@
|
||||
<?php
|
||||
|
||||
if ( ! function_exists( 'calla_elated_mobile_header_options_map' ) ) {
|
||||
function calla_elated_mobile_header_options_map() {
|
||||
|
||||
$panel_mobile_header = calla_elated_add_admin_panel(
|
||||
array(
|
||||
'title' => esc_html__( 'Mobile Header', 'calla' ),
|
||||
'name' => 'panel_mobile_header',
|
||||
'page' => '_header_page'
|
||||
)
|
||||
);
|
||||
|
||||
$mobile_header_group = calla_elated_add_admin_group(
|
||||
array(
|
||||
'parent' => $panel_mobile_header,
|
||||
'name' => 'mobile_header_group',
|
||||
'title' => esc_html__( 'Mobile Header Styles', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
$mobile_header_row1 = calla_elated_add_admin_row(
|
||||
array(
|
||||
'parent' => $mobile_header_group,
|
||||
'name' => 'mobile_header_row1'
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'mobile_header_height',
|
||||
'type' => 'textsimple',
|
||||
'label' => esc_html__( 'Height', 'calla' ),
|
||||
'parent' => $mobile_header_row1,
|
||||
'args' => array(
|
||||
'col_width' => 3,
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'mobile_header_background_color',
|
||||
'type' => 'colorsimple',
|
||||
'label' => esc_html__( 'Background Color', 'calla' ),
|
||||
'parent' => $mobile_header_row1
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'mobile_header_border_bottom_color',
|
||||
'type' => 'colorsimple',
|
||||
'label' => esc_html__( 'Border Bottom Color', 'calla' ),
|
||||
'parent' => $mobile_header_row1
|
||||
)
|
||||
);
|
||||
|
||||
$mobile_menu_group = calla_elated_add_admin_group(
|
||||
array(
|
||||
'parent' => $panel_mobile_header,
|
||||
'name' => 'mobile_menu_group',
|
||||
'title' => esc_html__( 'Mobile Menu Styles', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
$mobile_menu_row1 = calla_elated_add_admin_row(
|
||||
array(
|
||||
'parent' => $mobile_menu_group,
|
||||
'name' => 'mobile_menu_row1'
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'mobile_menu_background_color',
|
||||
'type' => 'colorsimple',
|
||||
'label' => esc_html__( 'Background Color', 'calla' ),
|
||||
'parent' => $mobile_menu_row1
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'mobile_menu_border_bottom_color',
|
||||
'type' => 'colorsimple',
|
||||
'label' => esc_html__( 'Border Bottom Color', 'calla' ),
|
||||
'parent' => $mobile_menu_row1
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'mobile_menu_separator_color',
|
||||
'type' => 'colorsimple',
|
||||
'label' => esc_html__( 'Menu Item Separator Color', 'calla' ),
|
||||
'parent' => $mobile_menu_row1
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'mobile_logo_height',
|
||||
'type' => 'text',
|
||||
'label' => esc_html__( 'Logo Height For Mobile Header', 'calla' ),
|
||||
'description' => esc_html__( 'Define logo height for screen size smaller than 1024px', 'calla' ),
|
||||
'parent' => $panel_mobile_header,
|
||||
'args' => array(
|
||||
'col_width' => 3,
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'mobile_logo_height_phones',
|
||||
'type' => 'text',
|
||||
'label' => esc_html__( 'Logo Height For Mobile Devices', 'calla' ),
|
||||
'description' => esc_html__( 'Define logo height for screen size smaller than 480px', 'calla' ),
|
||||
'parent' => $panel_mobile_header,
|
||||
'args' => array(
|
||||
'col_width' => 3,
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_section_title(
|
||||
array(
|
||||
'parent' => $panel_mobile_header,
|
||||
'name' => 'mobile_header_fonts_title',
|
||||
'title' => esc_html__( 'Typography', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
$first_level_group = calla_elated_add_admin_group(
|
||||
array(
|
||||
'parent' => $panel_mobile_header,
|
||||
'name' => 'first_level_group',
|
||||
'title' => esc_html__( '1st Level Menu', 'calla' ),
|
||||
'description' => esc_html__( 'Define styles for 1st level in Mobile Menu Navigation', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
$first_level_row1 = calla_elated_add_admin_row(
|
||||
array(
|
||||
'parent' => $first_level_group,
|
||||
'name' => 'first_level_row1'
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'mobile_text_color',
|
||||
'type' => 'colorsimple',
|
||||
'label' => esc_html__( 'Text Color', 'calla' ),
|
||||
'parent' => $first_level_row1
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'mobile_text_hover_color',
|
||||
'type' => 'colorsimple',
|
||||
'label' => esc_html__( 'Hover/Active Text Color', 'calla' ),
|
||||
'parent' => $first_level_row1
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'mobile_text_google_fonts',
|
||||
'type' => 'fontsimple',
|
||||
'label' => esc_html__( 'Font Family', 'calla' ),
|
||||
'parent' => $first_level_row1
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'mobile_text_font_size',
|
||||
'type' => 'textsimple',
|
||||
'label' => esc_html__( 'Font Size', 'calla' ),
|
||||
'parent' => $first_level_row1,
|
||||
'args' => array(
|
||||
'col_width' => 3,
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$first_level_row2 = calla_elated_add_admin_row(
|
||||
array(
|
||||
'parent' => $first_level_group,
|
||||
'name' => 'first_level_row2'
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'mobile_text_line_height',
|
||||
'type' => 'textsimple',
|
||||
'label' => esc_html__( 'Line Height', 'calla' ),
|
||||
'parent' => $first_level_row2,
|
||||
'args' => array(
|
||||
'col_width' => 3,
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'mobile_text_text_transform',
|
||||
'type' => 'selectsimple',
|
||||
'label' => esc_html__( 'Text Transform', 'calla' ),
|
||||
'parent' => $first_level_row2,
|
||||
'options' => calla_elated_get_text_transform_array()
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'mobile_text_font_style',
|
||||
'type' => 'selectsimple',
|
||||
'label' => esc_html__( 'Font Style', 'calla' ),
|
||||
'parent' => $first_level_row2,
|
||||
'options' => calla_elated_get_font_style_array()
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'mobile_text_font_weight',
|
||||
'type' => 'selectsimple',
|
||||
'label' => esc_html__( 'Font Weight', 'calla' ),
|
||||
'parent' => $first_level_row2,
|
||||
'options' => calla_elated_get_font_weight_array()
|
||||
)
|
||||
);
|
||||
|
||||
$first_level_row3 = calla_elated_add_admin_row(
|
||||
array(
|
||||
'parent' => $first_level_group,
|
||||
'name' => 'first_level_row3'
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'type' => 'textsimple',
|
||||
'name' => 'mobile_text_letter_spacing',
|
||||
'label' => esc_html__( 'Letter Spacing', 'calla' ),
|
||||
'default_value' => '',
|
||||
'parent' => $first_level_row3,
|
||||
'args' => array(
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$second_level_group = calla_elated_add_admin_group(
|
||||
array(
|
||||
'parent' => $panel_mobile_header,
|
||||
'name' => 'second_level_group',
|
||||
'title' => esc_html__( 'Dropdown Menu', 'calla' ),
|
||||
'description' => esc_html__( 'Define styles for drop down menu items in Mobile Menu Navigation', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
$second_level_row1 = calla_elated_add_admin_row(
|
||||
array(
|
||||
'parent' => $second_level_group,
|
||||
'name' => 'second_level_row1'
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'mobile_dropdown_text_color',
|
||||
'type' => 'colorsimple',
|
||||
'label' => esc_html__( 'Text Color', 'calla' ),
|
||||
'parent' => $second_level_row1
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'mobile_dropdown_text_hover_color',
|
||||
'type' => 'colorsimple',
|
||||
'label' => esc_html__( 'Hover/Active Text Color', 'calla' ),
|
||||
'parent' => $second_level_row1
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'mobile_dropdown_text_google_fonts',
|
||||
'type' => 'fontsimple',
|
||||
'label' => esc_html__( 'Font Family', 'calla' ),
|
||||
'parent' => $second_level_row1
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'mobile_dropdown_text_font_size',
|
||||
'type' => 'textsimple',
|
||||
'label' => esc_html__( 'Font Size', 'calla' ),
|
||||
'parent' => $second_level_row1,
|
||||
'args' => array(
|
||||
'col_width' => 3,
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$second_level_row2 = calla_elated_add_admin_row(
|
||||
array(
|
||||
'parent' => $second_level_group,
|
||||
'name' => 'second_level_row2'
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'mobile_dropdown_text_line_height',
|
||||
'type' => 'textsimple',
|
||||
'label' => esc_html__( 'Line Height', 'calla' ),
|
||||
'parent' => $second_level_row2,
|
||||
'args' => array(
|
||||
'col_width' => 3,
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'mobile_dropdown_text_text_transform',
|
||||
'type' => 'selectsimple',
|
||||
'label' => esc_html__( 'Text Transform', 'calla' ),
|
||||
'parent' => $second_level_row2,
|
||||
'options' => calla_elated_get_text_transform_array()
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'mobile_dropdown_text_font_style',
|
||||
'type' => 'selectsimple',
|
||||
'label' => esc_html__( 'Font Style', 'calla' ),
|
||||
'parent' => $second_level_row2,
|
||||
'options' => calla_elated_get_font_style_array()
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'mobile_dropdown_text_font_weight',
|
||||
'type' => 'selectsimple',
|
||||
'label' => esc_html__( 'Font Weight', 'calla' ),
|
||||
'parent' => $second_level_row2,
|
||||
'options' => calla_elated_get_font_weight_array()
|
||||
)
|
||||
);
|
||||
|
||||
$second_level_row3 = calla_elated_add_admin_row(
|
||||
array(
|
||||
'parent' => $second_level_group,
|
||||
'name' => 'second_level_row3'
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'type' => 'textsimple',
|
||||
'name' => 'mobile_dropdown_text_letter_spacing',
|
||||
'label' => esc_html__( 'Letter Spacing', 'calla' ),
|
||||
'default_value' => '',
|
||||
'parent' => $second_level_row3,
|
||||
'args' => array(
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_section_title(
|
||||
array(
|
||||
'name' => 'mobile_opener_panel',
|
||||
'parent' => $panel_mobile_header,
|
||||
'title' => esc_html__( 'Mobile Menu Opener', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'mobile_menu_title',
|
||||
'type' => 'text',
|
||||
'label' => esc_html__( 'Mobile Navigation Title', 'calla' ),
|
||||
'description' => esc_html__( 'Enter title for mobile menu navigation', 'calla' ),
|
||||
'parent' => $panel_mobile_header,
|
||||
'args' => array(
|
||||
'col_width' => 3
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $panel_mobile_header,
|
||||
'type' => 'select',
|
||||
'name' => 'mobile_icon_icon_source',
|
||||
'default_value' => 'icon_pack',
|
||||
'label' => esc_html__( 'Select Mobile Navigation Icon Source', 'calla' ),
|
||||
'description' => esc_html__( 'Choose whether you would like to use icons from an icon pack or SVG icons', 'calla' ),
|
||||
'options' => calla_elated_get_icon_sources_array()
|
||||
)
|
||||
);
|
||||
|
||||
$mobile_icon_pack_container = calla_elated_add_admin_container(
|
||||
array(
|
||||
'parent' => $panel_mobile_header,
|
||||
'name' => 'mobile_icon_pack_container',
|
||||
'dependency' => array(
|
||||
'show' => array(
|
||||
'mobile_icon_icon_source' => 'icon_pack'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $mobile_icon_pack_container,
|
||||
'type' => 'select',
|
||||
'name' => 'mobile_icon_icon_pack',
|
||||
'default_value' => 'font_elegant',
|
||||
'label' => esc_html__( 'Mobile Navigation Icon Pack', 'calla' ),
|
||||
'description' => esc_html__( 'Choose icon pack for mobile navigation icon', 'calla' ),
|
||||
'options' => calla_elated_icon_collections()->getIconCollectionsExclude( array( 'linea_icons', 'dripicons', 'simple_line_icons' ) )
|
||||
)
|
||||
);
|
||||
|
||||
$mobile_icon_svg_path_container = calla_elated_add_admin_container(
|
||||
array(
|
||||
'parent' => $panel_mobile_header,
|
||||
'name' => 'mobile_icon_svg_path_container',
|
||||
'dependency' => array(
|
||||
'show' => array(
|
||||
'mobile_icon_icon_source' => 'svg_path'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'parent' => $mobile_icon_svg_path_container,
|
||||
'type' => 'textarea',
|
||||
'name' => 'mobile_icon_svg_path',
|
||||
'label' => esc_html__( 'Mobile Navigation Icon SVG Path', 'calla' ),
|
||||
'description' => esc_html__( 'Enter your mobile navigation icon SVG path here. Please remove version and id attributes from your SVG path because of HTML validation', 'calla' ),
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'mobile_icon_color',
|
||||
'type' => 'color',
|
||||
'label' => esc_html__( 'Mobile Navigation Icon Color', 'calla' ),
|
||||
'parent' => $panel_mobile_header
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'mobile_icon_hover_color',
|
||||
'type' => 'color',
|
||||
'label' => esc_html__( 'Mobile Navigation Icon Hover Color', 'calla' ),
|
||||
'parent' => $panel_mobile_header
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
add_action( 'calla_elated_options_map', 'calla_elated_mobile_header_options_map', 5 );
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
var mobileHeader = {};
|
||||
eltdf.modules.mobileHeader = mobileHeader;
|
||||
|
||||
mobileHeader.eltdfOnDocumentReady = eltdfOnDocumentReady;
|
||||
mobileHeader.eltdfOnWindowResize = eltdfOnWindowResize;
|
||||
|
||||
$(document).ready(eltdfOnDocumentReady);
|
||||
$(window).resize(eltdfOnWindowResize);
|
||||
|
||||
/*
|
||||
All functions to be called on $(document).ready() should be in this function
|
||||
*/
|
||||
function eltdfOnDocumentReady() {
|
||||
eltdfInitMobileNavigation();
|
||||
eltdfInitMobileNavigationScroll();
|
||||
eltdfMobileHeaderBehavior();
|
||||
}
|
||||
|
||||
/*
|
||||
All functions to be called on $(window).resize() should be in this function
|
||||
*/
|
||||
function eltdfOnWindowResize() {
|
||||
eltdfInitMobileNavigationScroll();
|
||||
}
|
||||
|
||||
function eltdfInitMobileNavigation() {
|
||||
var navigationOpener = $('.eltdf-mobile-header .eltdf-mobile-menu-opener'),
|
||||
navigationHolder = $('.eltdf-mobile-header .eltdf-mobile-nav'),
|
||||
dropdownOpener = $('.eltdf-mobile-nav .mobile_arrow, .eltdf-mobile-nav h6, .eltdf-mobile-nav a.eltdf-mobile-no-link');
|
||||
|
||||
//whole mobile menu opening / closing
|
||||
if (navigationOpener.length && navigationHolder.length) {
|
||||
navigationOpener.on('tap click', function (e) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
|
||||
if (navigationHolder.is(':visible')) {
|
||||
navigationHolder.slideUp(450, 'easeInOutQuint');
|
||||
navigationOpener.removeClass('eltdf-mobile-menu-opened');
|
||||
} else {
|
||||
navigationHolder.slideDown(450, 'easeInOutQuint');
|
||||
navigationOpener.addClass('eltdf-mobile-menu-opened');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//dropdown opening / closing
|
||||
if (dropdownOpener.length) {
|
||||
dropdownOpener.each(function () {
|
||||
var thisItem = $(this),
|
||||
initialNavHeight = navigationHolder.outerHeight();
|
||||
|
||||
thisItem.on('tap click', function (e) {
|
||||
var thisItemParent = thisItem.parent('li'),
|
||||
thisItemParentSiblingsWithDrop = thisItemParent.siblings('.menu-item-has-children');
|
||||
|
||||
if (thisItemParent.hasClass('has_sub')) {
|
||||
var submenu = thisItemParent.find('> ul.sub_menu');
|
||||
|
||||
if (submenu.is(':visible')) {
|
||||
submenu.slideUp(450, 'easeInOutQuint');
|
||||
thisItemParent.removeClass('eltdf-opened');
|
||||
navigationHolder.stop().animate({'height': initialNavHeight}, 300);
|
||||
} else {
|
||||
thisItemParent.addClass('eltdf-opened');
|
||||
|
||||
if (thisItemParentSiblingsWithDrop.length === 0) {
|
||||
thisItemParent.find('.sub_menu').slideUp(400, 'easeInOutQuint', function () {
|
||||
submenu.slideDown(400, 'easeInOutQuint');
|
||||
navigationHolder.stop().animate({'height': initialNavHeight + 50}, 300);
|
||||
});
|
||||
} else {
|
||||
thisItemParent.siblings().removeClass('eltdf-opened').find('.sub_menu').slideUp(400, 'easeInOutQuint', function () {
|
||||
submenu.slideDown(400, 'easeInOutQuint');
|
||||
navigationHolder.stop().animate({'height': initialNavHeight + 50}, 300);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$('.eltdf-mobile-nav a, .eltdf-mobile-logo-wrapper a').on('click tap', function (e) {
|
||||
if ($(this).attr('href') !== 'http://#' && $(this).attr('href') !== '#') {
|
||||
navigationHolder.slideUp(450, 'easeInOutQuint');
|
||||
navigationOpener.removeClass("eltdf-mobile-menu-opened");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function eltdfInitMobileNavigationScroll() {
|
||||
if (eltdf.windowWidth <= 1024) {
|
||||
var mobileHeader = $('.eltdf-mobile-header'),
|
||||
mobileHeaderHeight = mobileHeader.length ? mobileHeader.height() : 0,
|
||||
navigationHolder = mobileHeader.find('.eltdf-mobile-nav'),
|
||||
navigationHeight = navigationHolder.outerHeight(),
|
||||
windowHeight = eltdf.windowHeight - 100;
|
||||
|
||||
//init scrollable menu
|
||||
var scrollHeight = mobileHeaderHeight + navigationHeight > windowHeight ? windowHeight - mobileHeaderHeight : navigationHeight;
|
||||
|
||||
navigationHolder.height(scrollHeight).perfectScrollbar({
|
||||
wheelSpeed: 0.6,
|
||||
suppressScrollX: true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function eltdfMobileHeaderBehavior() {
|
||||
var mobileHeader = $('.eltdf-mobile-header'),
|
||||
mobileMenuOpener = mobileHeader.find('.eltdf-mobile-menu-opener'),
|
||||
mobileHeaderHeight = mobileHeader.length ? mobileHeader.outerHeight() : 0;
|
||||
|
||||
if (eltdf.body.hasClass('eltdf-content-is-behind-header') && mobileHeaderHeight > 0 && eltdf.windowWidth <= 1024) {
|
||||
$('.eltdf-content').css('marginTop', -mobileHeaderHeight);
|
||||
}
|
||||
|
||||
if (eltdf.body.hasClass('eltdf-sticky-up-mobile-header')) {
|
||||
var stickyAppearAmount,
|
||||
adminBar = $('#wpadminbar');
|
||||
|
||||
var docYScroll1 = $(document).scrollTop();
|
||||
stickyAppearAmount = mobileHeaderHeight + eltdfGlobalVars.vars.eltdfAddForAdminBar;
|
||||
|
||||
$(window).scroll(function () {
|
||||
var docYScroll2 = $(document).scrollTop();
|
||||
|
||||
if (docYScroll2 > stickyAppearAmount) {
|
||||
mobileHeader.addClass('eltdf-animate-mobile-header');
|
||||
} else {
|
||||
mobileHeader.removeClass('eltdf-animate-mobile-header');
|
||||
}
|
||||
|
||||
if ((docYScroll2 > docYScroll1 && docYScroll2 > stickyAppearAmount && !mobileMenuOpener.hasClass('eltdf-mobile-menu-opened')) || (docYScroll2 < stickyAppearAmount)) {
|
||||
mobileHeader.removeClass('mobile-header-appear');
|
||||
mobileHeader.css('margin-bottom', 0);
|
||||
|
||||
if (adminBar.length) {
|
||||
mobileHeader.find('.eltdf-mobile-header-inner').css('top', 0);
|
||||
}
|
||||
} else {
|
||||
mobileHeader.addClass('mobile-header-appear');
|
||||
mobileHeader.css('margin-bottom', stickyAppearAmount);
|
||||
}
|
||||
|
||||
docYScroll1 = $(document).scrollTop();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,165 @@
|
||||
<?php
|
||||
|
||||
if ( ! function_exists( 'calla_elated_include_mobile_header_menu' ) ) {
|
||||
function calla_elated_include_mobile_header_menu( $menus ) {
|
||||
$menus['mobile-navigation'] = esc_html__( 'Mobile Navigation', 'calla' );
|
||||
|
||||
return $menus;
|
||||
}
|
||||
|
||||
add_filter( 'calla_elated_register_headers_menu', 'calla_elated_include_mobile_header_menu' );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_register_mobile_header_areas' ) ) {
|
||||
/**
|
||||
* Registers widget areas for mobile header
|
||||
*/
|
||||
function calla_elated_register_mobile_header_areas() {
|
||||
if ( calla_elated_is_responsive_on() && calla_elated_core_plugin_installed() ) {
|
||||
register_sidebar(
|
||||
array(
|
||||
'id' => 'eltdf-right-from-mobile-logo',
|
||||
'name' => esc_html__( 'Mobile Header Widget Area', 'calla' ),
|
||||
'description' => esc_html__( 'Widgets added here will appear on the right hand side from the mobile logo on mobile header', 'calla' ),
|
||||
'before_widget' => '<div id="%1$s" class="widget %2$s eltdf-right-from-mobile-logo">',
|
||||
'after_widget' => '</div>'
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
add_action( 'widgets_init', 'calla_elated_register_mobile_header_areas' );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_mobile_header_class' ) ) {
|
||||
function calla_elated_mobile_header_class( $classes ) {
|
||||
$classes[] = 'eltdf-default-mobile-header';
|
||||
|
||||
$classes[] = 'eltdf-sticky-up-mobile-header';
|
||||
|
||||
return $classes;
|
||||
}
|
||||
|
||||
add_filter( 'body_class', 'calla_elated_mobile_header_class' );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_mobile_header' ) ) {
|
||||
/**
|
||||
* Loads mobile header HTML only if responsiveness is enabled
|
||||
*/
|
||||
function calla_elated_get_mobile_header( $slug = '', $module = '' ) {
|
||||
if ( calla_elated_is_responsive_on() ) {
|
||||
$mobile_menu_title = calla_elated_options()->getOptionValue( 'mobile_menu_title' );
|
||||
$has_navigation = has_nav_menu( 'main-navigation' ) || has_nav_menu( 'mobile-navigation' ) ? true : false;
|
||||
|
||||
$parameters = array(
|
||||
'show_navigation_opener' => $has_navigation,
|
||||
'mobile_menu_title' => $mobile_menu_title,
|
||||
'mobile_icon_class' => calla_elated_get_mobile_navigation_icon_class()
|
||||
);
|
||||
|
||||
$module = apply_filters('calla_elated_mobile_menu_module', 'header/types/mobile-header');
|
||||
$slug = apply_filters('calla_elated_mobile_menu_slug', '');
|
||||
$parameters = apply_filters('calla_elated_mobile_menu_parameters', $parameters);
|
||||
|
||||
calla_elated_get_module_template_part( 'templates/mobile-header', $module, $slug, $parameters );
|
||||
}
|
||||
}
|
||||
|
||||
add_action( 'calla_elated_after_wrapper_inner', 'calla_elated_get_mobile_header', 20 );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_mobile_logo' ) ) {
|
||||
/**
|
||||
* Loads mobile logo HTML. It checks if mobile logo image is set and uses that, else takes normal logo image
|
||||
*/
|
||||
function calla_elated_get_mobile_logo() {
|
||||
$show_logo_image = calla_elated_options()->getOptionValue( 'hide_logo' ) === 'yes' ? false : true;
|
||||
|
||||
if ( $show_logo_image ) {
|
||||
$mobile_logo_image = calla_elated_get_meta_field_intersect( 'logo_image_mobile', calla_elated_get_page_id() );
|
||||
|
||||
//check if mobile logo has been set and use that, else use normal logo
|
||||
$logo_image = ! empty( $mobile_logo_image ) ? $mobile_logo_image : calla_elated_get_meta_field_intersect( 'logo_image', calla_elated_get_page_id() );
|
||||
|
||||
//get logo image dimensions and set style attribute for image link.
|
||||
$logo_dimensions = calla_elated_get_image_dimensions( $logo_image );
|
||||
|
||||
$logo_height = '';
|
||||
$logo_styles = '';
|
||||
if ( is_array( $logo_dimensions ) && array_key_exists( 'height', $logo_dimensions ) ) {
|
||||
$logo_height = $logo_dimensions['height'];
|
||||
$logo_styles = 'height: ' . intval( $logo_height / 2 ) . 'px'; //divided with 2 because of retina screens
|
||||
}
|
||||
|
||||
//set parameters for logo
|
||||
$parameters = array(
|
||||
'logo_image' => $logo_image,
|
||||
'logo_dimensions' => $logo_dimensions,
|
||||
'logo_height' => $logo_height,
|
||||
'logo_styles' => $logo_styles
|
||||
);
|
||||
|
||||
calla_elated_get_module_template_part( 'templates/mobile-logo', 'header/types/mobile-header', '', $parameters );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_mobile_nav' ) ) {
|
||||
/**
|
||||
* Loads mobile navigation HTML
|
||||
*/
|
||||
function calla_elated_get_mobile_nav() {
|
||||
calla_elated_get_module_template_part( 'templates/mobile-navigation', 'header/types/mobile-header' );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_mobile_header_per_page_js_var' ) ) {
|
||||
function calla_elated_mobile_header_per_page_js_var( $perPageVars ) {
|
||||
$perPageVars['eltdfMobileHeaderHeight'] = calla_elated_set_default_mobile_menu_height_for_header_types();
|
||||
|
||||
return $perPageVars;
|
||||
}
|
||||
|
||||
add_filter( 'calla_elated_per_page_js_vars', 'calla_elated_mobile_header_per_page_js_var' );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_mobile_navigation_icon_class' ) ) {
|
||||
/**
|
||||
* Loads mobile navigation icon class
|
||||
*/
|
||||
function calla_elated_get_mobile_navigation_icon_class() {
|
||||
|
||||
$mobile_icon_icon_source = calla_elated_options()->getOptionValue( 'mobile_icon_icon_source' );
|
||||
|
||||
$mobile_icon_class_array = array(
|
||||
'eltdf-mobile-menu-opener'
|
||||
);
|
||||
|
||||
$mobile_icon_class_array[] = $mobile_icon_icon_source == 'icon_pack' ? 'eltdf-mobile-menu-opener-icon-pack' : 'eltdf-mobile-menu-opener-svg-path';
|
||||
|
||||
return $mobile_icon_class_array;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_mobile_navigation_icon_html' ) ) {
|
||||
/**
|
||||
* Loads mobile navigation icon HTML
|
||||
*/
|
||||
function calla_elated_get_mobile_navigation_icon_html() {
|
||||
|
||||
$mobile_icon_icon_source = calla_elated_options()->getOptionValue( 'mobile_icon_icon_source' );
|
||||
$mobile_icon_icon_pack = calla_elated_options()->getOptionValue( 'mobile_icon_icon_pack' );
|
||||
$mobile_icon_svg_path = calla_elated_options()->getOptionValue( 'mobile_icon_svg_path' );
|
||||
|
||||
$mobile_navigation_icon_html = '';
|
||||
|
||||
if ( ( $mobile_icon_icon_source == 'icon_pack' ) && ( isset( $mobile_icon_icon_pack ) ) ) {
|
||||
$mobile_navigation_icon_html .= calla_elated_icon_collections()->getMobileMenuIcon($mobile_icon_icon_pack);
|
||||
} else if ( isset( $mobile_icon_svg_path ) ) {
|
||||
$mobile_navigation_icon_html .= $mobile_icon_svg_path;
|
||||
}
|
||||
|
||||
return $mobile_navigation_icon_html;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
include_once ELATED_FRAMEWORK_HEADER_ROOT_DIR . '/types/mobile-header/functions.php';
|
||||
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
|
||||
if (!class_exists('CallaElatedMobileNavigationWalker')) {
|
||||
class CallaElatedMobileNavigationWalker extends Walker_Nav_Menu {
|
||||
|
||||
// add classes to ul sub-menus
|
||||
function display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output ) {
|
||||
$id_field = $this->db_fields['id'];
|
||||
if ( is_object( $args[0] ) ) {
|
||||
$args[0]->has_children = ! empty( $children_elements[$element->$id_field] );
|
||||
}
|
||||
return parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );
|
||||
}
|
||||
|
||||
function start_lvl( &$output, $depth = 0, $args = array() ) {
|
||||
|
||||
$indent = str_repeat("\t", $depth);
|
||||
|
||||
// build html
|
||||
$output .= "\n" . $indent .'<ul class="sub_menu">' . "\n";
|
||||
}
|
||||
function end_lvl( &$output, $depth = 0, $args = array() ) {
|
||||
$indent = str_repeat("\t", $depth);
|
||||
|
||||
$output .= "$indent</ul>" ."\n";
|
||||
}
|
||||
|
||||
// add main/sub classes to li's and links
|
||||
function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
|
||||
|
||||
$sub = "";
|
||||
$indent = ( $depth > 0 ? str_repeat( "\t", $depth ) : '' ); // code indent
|
||||
if($depth >=0 && $args->has_children) :
|
||||
$sub = ' has_sub';
|
||||
endif;
|
||||
|
||||
// passed classes
|
||||
$classes = empty( $item->classes ) ? array() : (array) $item->classes;
|
||||
|
||||
$class_names = esc_attr( implode( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) ) );
|
||||
|
||||
$anchor = '';
|
||||
if($item->anchor != ""){
|
||||
$anchor = '#'.esc_attr($item->anchor);
|
||||
}
|
||||
|
||||
$active = "";
|
||||
// depth dependent classes
|
||||
if ($item->anchor == "" && (($item->current && $depth == 0) || ($item->current_item_ancestor && $depth == 0))):
|
||||
$active = 'eltdf-active-item';
|
||||
endif;
|
||||
|
||||
// build html
|
||||
$output .= $indent . '<li id="mobile-menu-item-'. $item->ID . '" class="' . $class_names . ' ' . $active . $sub .'">';
|
||||
|
||||
$current_a = "";
|
||||
// link attributes
|
||||
$attributes = ! empty( $item->attr_title ) ? ' title="' . esc_attr( $item->attr_title ) .'"' : '';
|
||||
$attributes .= ! empty( $item->target ) ? ' target="' . esc_attr( $item->target ) .'"' : '';
|
||||
$attributes .= ! empty( $item->xfn ) ? ' rel="' . esc_attr( $item->xfn ) .'"' : '';
|
||||
$attributes .= ' href="' . esc_url( $item->url ) .$anchor.'"';
|
||||
if (($item->current && $depth == 0) || ($item->current_item_ancestor && $depth == 0) ):
|
||||
$current_a .= ' current ';
|
||||
endif;
|
||||
if(esc_attr( $item->url ) === '#') {
|
||||
$current_a .= ' eltdf-mobile-no-link';
|
||||
}
|
||||
|
||||
$attributes .= ' class="'. $current_a . '"';
|
||||
$item_output = $args->before;
|
||||
if($item->hide == ""){
|
||||
if($item->nolink == ""){
|
||||
$item_output .= '<a'. $attributes .'>';
|
||||
}else{
|
||||
$item_output .= '<h6>';
|
||||
}
|
||||
$item_output .= $args->link_before .apply_filters( 'the_title', $item->title, $item->ID );
|
||||
$item_output .= $args->link_after;
|
||||
if($item->nolink == ""){
|
||||
$item_output .= '</a>';
|
||||
} else {
|
||||
$item_output .= '</h6>';
|
||||
}
|
||||
|
||||
if($args->has_children) {
|
||||
$item_output .= '<span class="mobile_arrow"><i class="eltdf-sub-arrow fa fa-angle-right"></i><i class="fa fa-angle-down"></i></span>';
|
||||
}
|
||||
}
|
||||
$item_output .= $args->after;
|
||||
|
||||
// build html
|
||||
$output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php do_action('calla_elated_before_mobile_header'); ?>
|
||||
|
||||
<header class="eltdf-mobile-header">
|
||||
<?php do_action('calla_elated_after_mobile_header_html_open'); ?>
|
||||
|
||||
<div class="eltdf-mobile-header-inner">
|
||||
<div class="eltdf-mobile-header-holder">
|
||||
<div class="eltdf-grid">
|
||||
<div class="eltdf-vertical-align-containers">
|
||||
<div class="eltdf-vertical-align-containers">
|
||||
<?php if($show_navigation_opener) : ?>
|
||||
<div <?php calla_elated_class_attribute( $mobile_icon_class ); ?>>
|
||||
<a href="javascript:void(0)">
|
||||
<span class="eltdf-mobile-menu-icon">
|
||||
<?php echo calla_elated_get_mobile_navigation_icon_html(); ?>
|
||||
</span>
|
||||
<?php if(!empty($mobile_menu_title)) { ?>
|
||||
<h5 class="eltdf-mobile-menu-text"><?php echo esc_attr($mobile_menu_title); ?></h5>
|
||||
<?php } ?>
|
||||
</a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="eltdf-position-center"><!--
|
||||
--><div class="eltdf-position-center-inner">
|
||||
<?php calla_elated_get_mobile_logo(); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="eltdf-position-right">
|
||||
<div class="eltdf-position-right-inner">
|
||||
<a class="eltdf-search-opener eltdf-icon-has-hover eltdf-search-opener-icon-pack" href="javascript:void(0)">
|
||||
<span class="eltdf-search-opener-wrapper">
|
||||
<span aria-hidden="true" class="eltdf-icon-font-elegant icon_search "></span>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php calla_elated_get_mobile_nav(); ?>
|
||||
</div>
|
||||
|
||||
<?php do_action('calla_elated_before_mobile_header_html_close'); ?>
|
||||
</header>
|
||||
|
||||
<?php do_action('calla_elated_after_mobile_header'); ?>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
$attachment_meta = calla_elated_get_attachment_meta_from_url($logo_image);
|
||||
$hwstring = !empty($attachment_meta) ? image_hwstring( $attachment_meta['width'], $attachment_meta['height'] ) : '';
|
||||
?>
|
||||
|
||||
<?php do_action('calla_elated_before_mobile_logo'); ?>
|
||||
|
||||
<div class="eltdf-mobile-logo-wrapper">
|
||||
<a itemprop="url" href="<?php echo esc_url(home_url('/')); ?>" <?php calla_elated_inline_style($logo_styles); ?>>
|
||||
<img itemprop="image" src="<?php echo esc_url($logo_image); ?>" <?php echo wp_kses($hwstring, array('width' => true, 'height' => true)); ?> alt="<?php esc_attr_e('Mobile Logo','calla'); ?>"/>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<?php do_action('calla_elated_after_mobile_logo'); ?>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php do_action('calla_elated_before_mobile_navigation'); ?>
|
||||
|
||||
<?php if ( has_nav_menu( 'mobile-navigation' ) || has_nav_menu( 'main-navigation' ) ) { ?>
|
||||
<nav class="eltdf-mobile-nav" role="navigation" aria-label="<?php esc_attr_e( 'Mobile Menu', 'calla' ); ?>">
|
||||
<div class="eltdf-grid">
|
||||
|
||||
<?php
|
||||
// Set main navigation menu as mobile if mobile navigation is not set
|
||||
$theme_location = has_nav_menu( 'mobile-navigation' ) ? 'mobile-navigation' : 'main-navigation';
|
||||
|
||||
wp_nav_menu(array(
|
||||
'theme_location' => $theme_location,
|
||||
'container' => '',
|
||||
'container_class' => '',
|
||||
'menu_class' => '',
|
||||
'menu_id' => '',
|
||||
'fallback_cb' => 'top_navigation_fallback',
|
||||
'link_before' => '<span>',
|
||||
'link_after' => '</span>',
|
||||
'walker' => new CallaElatedMobileNavigationWalker()
|
||||
)); ?>
|
||||
</div>
|
||||
</nav>
|
||||
<?php } ?>
|
||||
|
||||
<?php do_action('calla_elated_after_mobile_navigation'); ?>
|
||||
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
|
||||
if ( ! function_exists( 'calla_elated_sticky_header_styles' ) ) {
|
||||
/**
|
||||
* Generates styles for sticky haeder
|
||||
*/
|
||||
function calla_elated_sticky_header_styles() {
|
||||
$background_color = calla_elated_options()->getOptionValue( 'sticky_header_background_color' );
|
||||
$background_transparency = calla_elated_options()->getOptionValue( 'sticky_header_transparency' );
|
||||
$border_color = calla_elated_options()->getOptionValue( 'sticky_header_border_color' );
|
||||
$header_height = calla_elated_options()->getOptionValue( 'sticky_header_height' );
|
||||
|
||||
if ( ! empty( $background_color ) ) {
|
||||
$header_background_color = $background_color;
|
||||
$header_background_color_transparency = 1;
|
||||
|
||||
if ( $background_transparency !== '' ) {
|
||||
$header_background_color_transparency = $background_transparency;
|
||||
}
|
||||
|
||||
echo calla_elated_dynamic_css( '.eltdf-page-header .eltdf-sticky-header .eltdf-sticky-holder', array( 'background-color' => calla_elated_rgba_color( $header_background_color, $header_background_color_transparency ) ) );
|
||||
}
|
||||
|
||||
if ( ! empty( $border_color ) ) {
|
||||
echo calla_elated_dynamic_css( '.eltdf-page-header .eltdf-sticky-header .eltdf-sticky-holder', array( 'border-color' => $border_color ) );
|
||||
}
|
||||
|
||||
if ( ! empty( $header_height ) ) {
|
||||
$height = calla_elated_filter_px( $header_height ) . 'px';
|
||||
|
||||
echo calla_elated_dynamic_css( '.eltdf-page-header .eltdf-sticky-header', array( 'height' => $height ) );
|
||||
echo calla_elated_dynamic_css( '.eltdf-page-header .eltdf-sticky-header .eltdf-logo-wrapper a', array( 'max-height' => $height ) );
|
||||
}
|
||||
|
||||
$sticky_container_selector = '.eltdf-sticky-header .eltdf-sticky-holder .eltdf-vertical-align-containers';
|
||||
$sticky_container_styles = array();
|
||||
$container_side_padding = calla_elated_options()->getOptionValue( 'sticky_header_side_padding' );
|
||||
|
||||
if ( $container_side_padding !== '' ) {
|
||||
if ( calla_elated_string_ends_with( $container_side_padding, 'px' ) || calla_elated_string_ends_with( $container_side_padding, '%' ) ) {
|
||||
$sticky_container_styles['padding-left'] = $container_side_padding;
|
||||
$sticky_container_styles['padding-right'] = $container_side_padding;
|
||||
} else {
|
||||
$sticky_container_styles['padding-left'] = calla_elated_filter_px( $container_side_padding ) . 'px';
|
||||
$sticky_container_styles['padding-right'] = calla_elated_filter_px( $container_side_padding ) . 'px';
|
||||
}
|
||||
|
||||
echo calla_elated_dynamic_css( $sticky_container_selector, $sticky_container_styles );
|
||||
}
|
||||
|
||||
// sticky menu style
|
||||
|
||||
$menu_item_styles = calla_elated_get_typography_styles( 'sticky' );
|
||||
|
||||
$menu_item_selector = array(
|
||||
'.eltdf-main-menu.eltdf-sticky-nav > ul > li > a'
|
||||
);
|
||||
|
||||
echo calla_elated_dynamic_css( $menu_item_selector, $menu_item_styles );
|
||||
|
||||
|
||||
$hover_color = calla_elated_options()->getOptionValue( 'sticky_hovercolor' );
|
||||
|
||||
$menu_item_hover_styles = array();
|
||||
if ( ! empty( $hover_color ) ) {
|
||||
$menu_item_hover_styles['color'] = $hover_color;
|
||||
}
|
||||
|
||||
$menu_item_hover_selector = array(
|
||||
'.eltdf-main-menu.eltdf-sticky-nav > ul > li:hover > a',
|
||||
'.eltdf-main-menu.eltdf-sticky-nav > ul > li.eltdf-active-item > a'
|
||||
);
|
||||
|
||||
echo calla_elated_dynamic_css( $menu_item_hover_selector, $menu_item_hover_styles );
|
||||
}
|
||||
|
||||
add_action( 'calla_elated_style_dynamic', 'calla_elated_sticky_header_styles' );
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
if ( ! function_exists( 'calla_elated_sticky_header_meta_boxes_options_map' ) ) {
|
||||
function calla_elated_sticky_header_meta_boxes_options_map( $header_meta_box ) {
|
||||
|
||||
$sticky_amount_container = calla_elated_add_admin_container(
|
||||
array(
|
||||
'parent' => $header_meta_box,
|
||||
'name' => 'sticky_amount_container_meta_container',
|
||||
'dependency' => array(
|
||||
'hide' => array(
|
||||
'eltdf_header_behaviour_meta' => array( '', 'no-behavior','fixed-on-scroll','sticky-header-on-scroll-up' )
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_scroll_amount_for_sticky_meta',
|
||||
'type' => 'text',
|
||||
'label' => esc_html__( 'Scroll Amount for Sticky Header Appearance', 'calla' ),
|
||||
'description' => esc_html__( 'Define scroll amount for sticky header appearance', 'calla' ),
|
||||
'parent' => $sticky_amount_container,
|
||||
'args' => array(
|
||||
'col_width' => 2,
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$calla_custom_sidebars = calla_elated_get_custom_sidebars();
|
||||
if ( count( $calla_custom_sidebars ) > 0 ) {
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_custom_sticky_menu_area_sidebar_meta',
|
||||
'type' => 'selectblank',
|
||||
'label' => esc_html__( 'Choose Custom Widget Area In Sticky Header Menu Area', 'calla' ),
|
||||
'description' => esc_html__( 'Choose custom widget area to display in sticky header menu area"', 'calla' ),
|
||||
'parent' => $header_meta_box,
|
||||
'options' => $calla_custom_sidebars,
|
||||
'dependency' => array(
|
||||
'show' => array(
|
||||
'eltdf_header_behaviour_meta' => array( 'sticky-header-on-scroll-up', 'sticky-header-on-scroll-down-up' )
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
add_action( 'calla_elated_additional_header_area_meta_boxes_map', 'calla_elated_sticky_header_meta_boxes_options_map', 8, 1 );
|
||||
}
|
||||
@@ -0,0 +1,255 @@
|
||||
<?php
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_hide_dep_for_sticky_header_options' ) ) {
|
||||
function calla_elated_get_hide_dep_for_sticky_header_options() {
|
||||
$hide_dep_options = apply_filters( 'calla_elated_sticky_header_hide_global_option', $hide_dep_options = array() );
|
||||
|
||||
return $hide_dep_options;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_additional_hide_dep_for_sticky_header_options' ) ) {
|
||||
function calla_elated_get_additional_hide_dep_for_sticky_header_options() {
|
||||
$additional_hide_dep_options = apply_filters( 'calla_elated_sticky_header_additional_hide_global_option', $additional_hide_dep_options = array() );
|
||||
|
||||
return $additional_hide_dep_options;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_header_sticky_options_map' ) ) {
|
||||
function calla_elated_header_sticky_options_map() {
|
||||
$hide_dep_options = calla_elated_get_hide_dep_for_sticky_header_options();
|
||||
|
||||
$panel_sticky_header = calla_elated_add_admin_panel(
|
||||
array(
|
||||
'title' => esc_html__( 'Sticky Header', 'calla' ),
|
||||
'name' => 'panel_sticky_header',
|
||||
'page' => '_header_page',
|
||||
'dependency' => array(
|
||||
'hide' => array(
|
||||
'header_options' => $hide_dep_options
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'scroll_amount_for_sticky',
|
||||
'type' => 'text',
|
||||
'label' => esc_html__( 'Scroll Amount for Sticky', 'calla' ),
|
||||
'description' => esc_html__( 'Enter scroll amount for Sticky Menu to appear (deafult is header height). This value can be overriden on a page level basis', 'calla' ),
|
||||
'parent' => $panel_sticky_header,
|
||||
'args' => array(
|
||||
'col_width' => 2,
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'sticky_header_in_grid',
|
||||
'type' => 'yesno',
|
||||
'default_value' => 'no',
|
||||
'label' => esc_html__( 'Sticky Header in Grid', 'calla' ),
|
||||
'description' => esc_html__( 'Enabling this option will put sticky header in grid', 'calla' ),
|
||||
'parent' => $panel_sticky_header,
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'sticky_header_background_color',
|
||||
'type' => 'color',
|
||||
'label' => esc_html__( 'Background Color', 'calla' ),
|
||||
'description' => esc_html__( 'Choose a background color for header area', 'calla' ),
|
||||
'parent' => $panel_sticky_header
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'sticky_header_transparency',
|
||||
'type' => 'text',
|
||||
'label' => esc_html__( 'Background Transparency', 'calla' ),
|
||||
'description' => esc_html__( 'Choose a transparency for the header background color (0 = fully transparent, 1 = opaque)', 'calla' ),
|
||||
'parent' => $panel_sticky_header,
|
||||
'args' => array(
|
||||
'col_width' => 1
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'sticky_header_border_color',
|
||||
'type' => 'color',
|
||||
'label' => esc_html__( 'Border Color', 'calla' ),
|
||||
'description' => esc_html__( 'Set border bottom color for header area', 'calla' ),
|
||||
'parent' => $panel_sticky_header
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'sticky_header_height',
|
||||
'type' => 'text',
|
||||
'label' => esc_html__( 'Sticky Header Height', 'calla' ),
|
||||
'description' => esc_html__( 'Enter height for sticky header (default is 60px)', 'calla' ),
|
||||
'parent' => $panel_sticky_header,
|
||||
'args' => array(
|
||||
'col_width' => 2,
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'sticky_header_side_padding',
|
||||
'type' => 'text',
|
||||
'label' => esc_html__( 'Sticky Header Side Padding', 'calla' ),
|
||||
'parent' => $panel_sticky_header,
|
||||
'args' => array(
|
||||
'col_width' => 2,
|
||||
'suffix' => esc_html__( 'px or %', 'calla' )
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$group_sticky_header_menu = calla_elated_add_admin_group(
|
||||
array(
|
||||
'title' => esc_html__( 'Sticky Header Menu', 'calla' ),
|
||||
'name' => 'group_sticky_header_menu',
|
||||
'parent' => $panel_sticky_header,
|
||||
'description' => esc_html__( 'Define styles for sticky menu items', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
$row1_sticky_header_menu = calla_elated_add_admin_row(
|
||||
array(
|
||||
'name' => 'row1',
|
||||
'parent' => $group_sticky_header_menu
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'sticky_color',
|
||||
'type' => 'colorsimple',
|
||||
'label' => esc_html__( 'Text Color', 'calla' ),
|
||||
'description' => '',
|
||||
'parent' => $row1_sticky_header_menu
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'sticky_hovercolor',
|
||||
'type' => 'colorsimple',
|
||||
'label' => esc_html__( esc_html__( 'Hover/Active Color', 'calla' ), 'calla' ),
|
||||
'description' => '',
|
||||
'parent' => $row1_sticky_header_menu
|
||||
)
|
||||
);
|
||||
|
||||
$row2_sticky_header_menu = calla_elated_add_admin_row(
|
||||
array(
|
||||
'name' => 'row2',
|
||||
'parent' => $group_sticky_header_menu
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'sticky_google_fonts',
|
||||
'type' => 'fontsimple',
|
||||
'label' => esc_html__( 'Font Family', 'calla' ),
|
||||
'default_value' => '-1',
|
||||
'parent' => $row2_sticky_header_menu,
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'type' => 'textsimple',
|
||||
'name' => 'sticky_font_size',
|
||||
'label' => esc_html__( 'Font Size', 'calla' ),
|
||||
'default_value' => '',
|
||||
'parent' => $row2_sticky_header_menu,
|
||||
'args' => array(
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'type' => 'textsimple',
|
||||
'name' => 'sticky_line_height',
|
||||
'label' => esc_html__( 'Line Height', 'calla' ),
|
||||
'default_value' => '',
|
||||
'parent' => $row2_sticky_header_menu,
|
||||
'args' => array(
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'type' => 'selectblanksimple',
|
||||
'name' => 'sticky_text_transform',
|
||||
'label' => esc_html__( 'Text Transform', 'calla' ),
|
||||
'default_value' => '',
|
||||
'options' => calla_elated_get_text_transform_array(),
|
||||
'parent' => $row2_sticky_header_menu
|
||||
)
|
||||
);
|
||||
|
||||
$row3_sticky_header_menu = calla_elated_add_admin_row(
|
||||
array(
|
||||
'name' => 'row3',
|
||||
'parent' => $group_sticky_header_menu
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'type' => 'selectblanksimple',
|
||||
'name' => 'sticky_font_style',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Font Style', 'calla' ),
|
||||
'options' => calla_elated_get_font_style_array(),
|
||||
'parent' => $row3_sticky_header_menu
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'type' => 'selectblanksimple',
|
||||
'name' => 'sticky_font_weight',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Font Weight', 'calla' ),
|
||||
'options' => calla_elated_get_font_weight_array(),
|
||||
'parent' => $row3_sticky_header_menu
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'type' => 'textsimple',
|
||||
'name' => 'sticky_letter_spacing',
|
||||
'label' => esc_html__( 'Letter Spacing', 'calla' ),
|
||||
'default_value' => '',
|
||||
'parent' => $row3_sticky_header_menu,
|
||||
'args' => array(
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
add_action( 'calla_elated_header_sticky_options_map', 'calla_elated_header_sticky_options_map', 10, 1 );
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
(function($) {
|
||||
"use strict";
|
||||
|
||||
var stickyHeader = {};
|
||||
eltdf.modules.stickyHeader = stickyHeader;
|
||||
|
||||
stickyHeader.isStickyVisible = false;
|
||||
stickyHeader.stickyAppearAmount = 0;
|
||||
stickyHeader.behaviour = '';
|
||||
|
||||
stickyHeader.eltdfOnDocumentReady = eltdfOnDocumentReady;
|
||||
|
||||
$(document).ready(eltdfOnDocumentReady);
|
||||
|
||||
/*
|
||||
All functions to be called on $(document).ready() should be in this function
|
||||
*/
|
||||
function eltdfOnDocumentReady() {
|
||||
if(eltdf.windowWidth > 1024) {
|
||||
eltdfHeaderBehaviour();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** Show/Hide sticky header on window scroll
|
||||
*/
|
||||
function eltdfHeaderBehaviour() {
|
||||
var header = $('.eltdf-page-header'),
|
||||
stickyHeader = $('.eltdf-sticky-header'),
|
||||
fixedHeaderWrapper = $('.eltdf-fixed-wrapper'),
|
||||
fixedMenuArea = fixedHeaderWrapper.children('.eltdf-menu-area'),
|
||||
fixedMenuAreaHeight = fixedMenuArea.outerHeight(),
|
||||
sliderHolder = $('.eltdf-slider'),
|
||||
revSliderHeight = sliderHolder.length ? sliderHolder.outerHeight() : 0,
|
||||
stickyAppearAmount,
|
||||
headerAppear;
|
||||
|
||||
var headerMenuAreaOffset = fixedHeaderWrapper.length ? fixedHeaderWrapper.offset().top - eltdfGlobalVars.vars.eltdfAddForAdminBar : 0;
|
||||
|
||||
switch(true) {
|
||||
// sticky header that will be shown when user scrolls up
|
||||
case eltdf.body.hasClass('eltdf-sticky-header-on-scroll-up'):
|
||||
eltdf.modules.stickyHeader.behaviour = 'eltdf-sticky-header-on-scroll-up';
|
||||
var docYScroll1 = $(document).scrollTop();
|
||||
stickyAppearAmount = parseInt(eltdfGlobalVars.vars.eltdfTopBarHeight) + parseInt(eltdfGlobalVars.vars.eltdfLogoAreaHeight) + parseInt(eltdfGlobalVars.vars.eltdfMenuAreaHeight) + parseInt(eltdfGlobalVars.vars.eltdfStickyHeaderHeight);
|
||||
|
||||
headerAppear = function(){
|
||||
var docYScroll2 = $(document).scrollTop();
|
||||
|
||||
if((docYScroll2 > docYScroll1 && docYScroll2 > stickyAppearAmount) || (docYScroll2 < stickyAppearAmount)) {
|
||||
eltdf.modules.stickyHeader.isStickyVisible = false;
|
||||
stickyHeader.removeClass('header-appear').find('.eltdf-main-menu .second').removeClass('eltdf-drop-down-start');
|
||||
eltdf.body.removeClass('eltdf-sticky-header-appear');
|
||||
} else {
|
||||
eltdf.modules.stickyHeader.isStickyVisible = true;
|
||||
stickyHeader.addClass('header-appear');
|
||||
eltdf.body.addClass('eltdf-sticky-header-appear');
|
||||
}
|
||||
|
||||
docYScroll1 = $(document).scrollTop();
|
||||
};
|
||||
headerAppear();
|
||||
|
||||
$(window).scroll(function() {
|
||||
headerAppear();
|
||||
});
|
||||
|
||||
break;
|
||||
|
||||
// sticky header that will be shown when user scrolls both up and down
|
||||
case eltdf.body.hasClass('eltdf-sticky-header-on-scroll-down-up'):
|
||||
eltdf.modules.stickyHeader.behaviour = 'eltdf-sticky-header-on-scroll-down-up';
|
||||
|
||||
if(eltdfPerPageVars.vars.eltdfStickyScrollAmount !== 0){
|
||||
eltdf.modules.stickyHeader.stickyAppearAmount = parseInt(eltdfPerPageVars.vars.eltdfStickyScrollAmount);
|
||||
} else {
|
||||
eltdf.modules.stickyHeader.stickyAppearAmount = parseInt(eltdfGlobalVars.vars.eltdfTopBarHeight) + parseInt(eltdfGlobalVars.vars.eltdfLogoAreaHeight) + parseInt(eltdfGlobalVars.vars.eltdfMenuAreaHeight) + parseInt(revSliderHeight);
|
||||
}
|
||||
|
||||
headerAppear = function(){
|
||||
if(eltdf.scroll < eltdf.modules.stickyHeader.stickyAppearAmount) {
|
||||
eltdf.modules.stickyHeader.isStickyVisible = false;
|
||||
stickyHeader.removeClass('header-appear').find('.eltdf-main-menu .second').removeClass('eltdf-drop-down-start');
|
||||
eltdf.body.removeClass('eltdf-sticky-header-appear');
|
||||
}else{
|
||||
eltdf.modules.stickyHeader.isStickyVisible = true;
|
||||
stickyHeader.addClass('header-appear');
|
||||
eltdf.body.addClass('eltdf-sticky-header-appear');
|
||||
}
|
||||
};
|
||||
|
||||
headerAppear();
|
||||
|
||||
$(window).scroll(function() {
|
||||
headerAppear();
|
||||
});
|
||||
|
||||
break;
|
||||
|
||||
// on scroll down, part of header will be sticky
|
||||
case eltdf.body.hasClass('eltdf-fixed-on-scroll'):
|
||||
eltdf.modules.stickyHeader.behaviour = 'eltdf-fixed-on-scroll';
|
||||
var headerFixed = function(){
|
||||
|
||||
if(eltdf.scroll <= headerMenuAreaOffset) {
|
||||
fixedHeaderWrapper.removeClass('fixed');
|
||||
eltdf.body.removeClass('eltdf-fixed-header-appear');
|
||||
header.css('margin-bottom', '0');
|
||||
} else {
|
||||
fixedHeaderWrapper.addClass('fixed');
|
||||
eltdf.body.addClass('eltdf-fixed-header-appear');
|
||||
header.css('margin-bottom', fixedMenuAreaHeight + 'px');
|
||||
}
|
||||
};
|
||||
|
||||
headerFixed();
|
||||
|
||||
$(window).scroll(function() {
|
||||
headerFixed();
|
||||
});
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
if ( ! function_exists( 'calla_elated_set_additional_hide_dep_options_for_fixed_header' ) ) {
|
||||
/**
|
||||
* This function is used to set dependency values for fixed header panel in global option if sticky header behavior is set
|
||||
*/
|
||||
function calla_elated_set_additional_hide_dep_options_for_fixed_header( $hide_dep_options ) {
|
||||
$hide_dep_options[] = 'sticky-header-on-scroll-up';
|
||||
$hide_dep_options[] = 'sticky-header-on-scroll-down-up';
|
||||
|
||||
return $hide_dep_options;
|
||||
}
|
||||
|
||||
add_filter( 'calla_elated_fixed_header_additional_hide_global_option', 'calla_elated_set_additional_hide_dep_options_for_fixed_header' );
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
<?php
|
||||
|
||||
if ( ! function_exists( 'calla_elated_sticky_header_global_js_var' ) ) {
|
||||
function calla_elated_sticky_header_global_js_var( $global_variables ) {
|
||||
$global_variables['eltdfStickyHeaderHeight'] = calla_elated_get_sticky_header_height();
|
||||
$global_variables['eltdfStickyHeaderTransparencyHeight'] = calla_elated_get_sticky_header_height_of_complete_transparency();
|
||||
|
||||
return $global_variables;
|
||||
}
|
||||
|
||||
add_filter( 'calla_elated_js_global_variables', 'calla_elated_sticky_header_global_js_var' );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_sticky_header_per_page_js_var' ) ) {
|
||||
function calla_elated_sticky_header_per_page_js_var( $perPageVars ) {
|
||||
$perPageVars['eltdfStickyScrollAmount'] = calla_elated_get_sticky_scroll_amount();
|
||||
|
||||
return $perPageVars;
|
||||
}
|
||||
|
||||
add_filter( 'calla_elated_per_page_js_vars', 'calla_elated_sticky_header_per_page_js_var' );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_register_sticky_header_areas' ) ) {
|
||||
/**
|
||||
* Registers widget area for sticky header
|
||||
*/
|
||||
function calla_elated_register_sticky_header_areas() {
|
||||
register_sidebar(
|
||||
array(
|
||||
'id' => 'eltdf-sticky-right',
|
||||
'name' => esc_html__( 'Sticky Header Widget Area', 'calla' ),
|
||||
'description' => esc_html__( 'Widgets added here will appear on the right hand side from the sticky menu', 'calla' ),
|
||||
'before_widget' => '<div id="%1$s" class="widget %2$s eltdf-sticky-right">',
|
||||
'after_widget' => '</div>'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
add_action( 'widgets_init', 'calla_elated_register_sticky_header_areas' );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_sticky_menu' ) ) {
|
||||
/**
|
||||
* Loads sticky menu HTML
|
||||
*
|
||||
* @param string $additional_class addition class to pass to template
|
||||
*/
|
||||
function calla_elated_get_sticky_menu( $additional_class = 'eltdf-default-nav' ) {
|
||||
calla_elated_get_module_template_part( 'templates/sticky-navigation', 'header/types/sticky-header', '', array( 'additional_class' => $additional_class ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_sticky_header' ) ) {
|
||||
/**
|
||||
* Loads sticky header behavior HTML
|
||||
*/
|
||||
function calla_elated_get_sticky_header( $slug = '', $module = '' ) {
|
||||
$page_id = calla_elated_get_page_id();
|
||||
$sticky_in_grid = calla_elated_options()->getOptionValue( 'sticky_header_in_grid' ) == 'yes' ? true : false;
|
||||
$header_in_grid_meta = get_post_meta( $page_id, 'eltdf_menu_area_in_grid_meta', true);
|
||||
$menu_area_position = calla_elated_get_meta_field_intersect( 'set_menu_area_position', $page_id );
|
||||
|
||||
if ( $header_in_grid_meta === 'yes' && ! $sticky_in_grid ) {
|
||||
$sticky_in_grid = true;
|
||||
} else if ( $header_in_grid_meta === 'no' && $sticky_in_grid ) {
|
||||
$sticky_in_grid = false;
|
||||
}
|
||||
|
||||
$parameters = array(
|
||||
'hide_logo' => calla_elated_options()->getOptionValue( 'hide_logo' ) == 'yes' ? true : false,
|
||||
'sticky_header_in_grid' => $sticky_in_grid,
|
||||
'menu_area_position' => $menu_area_position,
|
||||
'menu_area_class' => ! empty( $menu_area_position ) ? 'eltdf-menu-' . $menu_area_position : ''
|
||||
);
|
||||
|
||||
$parameters = apply_filters('calla_elated_sticky_header_parameters',$parameters);
|
||||
|
||||
$module = ! empty( $module ) ? $module : 'header/types/sticky-header';
|
||||
|
||||
calla_elated_get_module_template_part( 'templates/sticky-header', $module, $slug, $parameters );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_sticky_header_widget_menu_area' ) ) {
|
||||
/**
|
||||
* Loads sticky header widgets area HTML
|
||||
*/
|
||||
function calla_elated_get_sticky_header_widget_menu_area() {
|
||||
$page_id = calla_elated_get_page_id();
|
||||
$custom_menu_widget_area = get_post_meta( $page_id, 'eltdf_custom_sticky_menu_area_sidebar_meta', true );
|
||||
|
||||
if ( is_active_sidebar( 'eltdf-sticky-right' ) && empty( $custom_menu_widget_area ) ) {
|
||||
dynamic_sidebar( 'eltdf-sticky-right' );
|
||||
} else if ( ! empty( $custom_menu_widget_area ) && is_active_sidebar( $custom_menu_widget_area ) ) {
|
||||
dynamic_sidebar( $custom_menu_widget_area );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_sticky_header_height' ) ) {
|
||||
/**
|
||||
* Returns top sticky header height
|
||||
*
|
||||
* @return bool|int|void
|
||||
*/
|
||||
function calla_elated_get_sticky_header_height() {
|
||||
$allow_sticky_behavior = true;
|
||||
$allow_sticky_behavior = apply_filters( 'calla_elated_allow_sticky_header_behavior', $allow_sticky_behavior );
|
||||
$header_behaviour = calla_elated_get_meta_field_intersect( 'header_behaviour' );
|
||||
|
||||
//sticky menu height, needed only for sticky header on scroll up
|
||||
if ( $allow_sticky_behavior && in_array( $header_behaviour, array( 'sticky-header-on-scroll-up' ) ) ) {
|
||||
$sticky_header_height = calla_elated_filter_px( calla_elated_options()->getOptionValue( 'sticky_header_height' ) );
|
||||
|
||||
return $sticky_header_height !== '' ? intval( $sticky_header_height ) : 70;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_sticky_header_height_of_complete_transparency' ) ) {
|
||||
/**
|
||||
* Returns top sticky header height it is fully transparent. used in anchor logic
|
||||
*
|
||||
* @return bool|int|void
|
||||
*/
|
||||
function calla_elated_get_sticky_header_height_of_complete_transparency() {
|
||||
$allow_sticky_behavior = true;
|
||||
$allow_sticky_behavior = apply_filters( 'calla_elated_allow_sticky_header_behavior', $allow_sticky_behavior );
|
||||
|
||||
if ( $allow_sticky_behavior ) {
|
||||
$stickyHeaderTransparent = calla_elated_options()->getOptionValue( 'sticky_header_background_color' ) !== '' && calla_elated_options()->getOptionValue( 'sticky_header_transparency' ) === '0';
|
||||
|
||||
if ( $stickyHeaderTransparent ) {
|
||||
return 0;
|
||||
} else {
|
||||
$sticky_header_height = calla_elated_filter_px( calla_elated_options()->getOptionValue( 'sticky_header_height' ) );
|
||||
|
||||
return $sticky_header_height !== '' ? intval( $sticky_header_height ) : 70;
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_sticky_scroll_amount' ) ) {
|
||||
/**
|
||||
* Returns top sticky scroll amount
|
||||
*
|
||||
* @return bool|int|void
|
||||
*/
|
||||
function calla_elated_get_sticky_scroll_amount() {
|
||||
$allow_sticky_behavior = true;
|
||||
$allow_sticky_behavior = apply_filters( 'calla_elated_allow_sticky_header_behavior', $allow_sticky_behavior );
|
||||
$header_behaviour = calla_elated_get_meta_field_intersect( 'header_behaviour' );
|
||||
|
||||
//sticky menu scroll amount
|
||||
if ( $allow_sticky_behavior && in_array( $header_behaviour, array( 'sticky-header-on-scroll-up', 'sticky-header-on-scroll-down-up' ) ) ) {
|
||||
$sticky_scroll_amount = calla_elated_filter_px( calla_elated_get_meta_field_intersect( 'scroll_amount_for_sticky' ) );
|
||||
|
||||
return $sticky_scroll_amount !== '' ? intval( $sticky_scroll_amount ) : 0;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
include_once ELATED_FRAMEWORK_HEADER_ROOT_DIR . '/types/sticky-header/functions.php';
|
||||
@@ -0,0 +1,172 @@
|
||||
<?php
|
||||
|
||||
if (!class_exists('CallaElatedStickyNavigationWalker')) {
|
||||
class CallaElatedStickyNavigationWalker extends Walker_Nav_Menu {
|
||||
|
||||
// add classes to ul sub-menus
|
||||
function display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output ) {
|
||||
$id_field = $this->db_fields['id'];
|
||||
if ( is_object( $args[0] ) ) {
|
||||
$args[0]->has_children = ! empty( $children_elements[$element->$id_field] );
|
||||
}
|
||||
return parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );
|
||||
}
|
||||
|
||||
function start_lvl( &$output, $depth = 0, $args = array() ) {
|
||||
|
||||
$indent = str_repeat("\t", $depth);
|
||||
if($depth == 0){
|
||||
$out_div = '<div class="second"><div class="inner">';
|
||||
}else{
|
||||
$out_div = '';
|
||||
}
|
||||
|
||||
// build html
|
||||
$output .= "\n" . $indent . $out_div .'<ul>' . "\n";
|
||||
}
|
||||
function end_lvl( &$output, $depth = 0, $args = array() ) {
|
||||
$indent = str_repeat("\t", $depth);
|
||||
|
||||
if($depth == 0){
|
||||
$out_div_close = '</div></div>';
|
||||
}else{
|
||||
$out_div_close = '';
|
||||
}
|
||||
|
||||
$output .= "$indent</ul>". $out_div_close ."\n";
|
||||
}
|
||||
|
||||
// add main/sub classes to li's and links
|
||||
function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
|
||||
|
||||
$sub = "";
|
||||
$indent = ( $depth > 0 ? str_repeat( "\t", $depth ) : '' ); // code indent
|
||||
if($depth==0 && $args->has_children) :
|
||||
$sub = ' has_sub';
|
||||
endif;
|
||||
if( ( $depth==1 or $depth == 2 ) && $args->has_children) :
|
||||
$sub = 'sub';
|
||||
endif;
|
||||
|
||||
// passed classes
|
||||
$classes = empty( $item->classes ) ? array() : (array) $item->classes;
|
||||
|
||||
$class_names = esc_attr( implode( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) ) );
|
||||
|
||||
//menu type class
|
||||
$menu_type = "";
|
||||
if($depth==0){
|
||||
if($item->type_menu == "wide") {
|
||||
$menu_type = " wide";
|
||||
} else {
|
||||
$menu_type = " narrow";
|
||||
}
|
||||
}
|
||||
|
||||
//wide menu position class
|
||||
$wide_menu_position = "";
|
||||
if($depth==0){
|
||||
if($item->wide_position == "right"){
|
||||
$wide_menu_position = " right_position";
|
||||
}elseif($item->wide_position == "left"){
|
||||
$wide_menu_position = " left_position";
|
||||
}else{
|
||||
$wide_menu_position = "";
|
||||
}
|
||||
}
|
||||
|
||||
$anchor = '';
|
||||
if($item->anchor != ""){
|
||||
$anchor = '#'.esc_attr($item->anchor);
|
||||
$class_names .= ' anchor-item';
|
||||
}
|
||||
|
||||
$active = "";
|
||||
// depth dependent classes
|
||||
if ($item->anchor == "" && (($item->current && $depth == 0) || ($item->current_item_ancestor && $depth == 0))):
|
||||
$active = 'eltdf-active-item';
|
||||
endif;
|
||||
|
||||
// build html
|
||||
$output .= $indent . '<li id="sticky-nav-menu-item-'. $item->ID . '" class="' . $class_names . ' '. $active . $sub . $menu_type . $wide_menu_position .'">';
|
||||
|
||||
$current_a = "";
|
||||
// link attributes
|
||||
$attributes = ! empty( $item->attr_title ) ? ' title="' . esc_attr( $item->attr_title ) .'"' : '';
|
||||
$attributes .= ! empty( $item->target ) ? ' target="' . esc_attr( $item->target ) .'"' : '';
|
||||
$attributes .= ! empty( $item->xfn ) ? ' rel="' . esc_attr( $item->xfn ) .'"' : '';
|
||||
$attributes .= ' href="' . esc_url( $item->url ) .$anchor.'"';
|
||||
if (($item->current && $depth == 0) || ($item->current_item_ancestor && $depth == 0) ):
|
||||
$current_a .= ' current ';
|
||||
endif;
|
||||
|
||||
$no_link_class = '';
|
||||
if($item->nolink != '') {
|
||||
$no_link_class = ' no_link';
|
||||
}
|
||||
|
||||
$attributes .= ' class="'.$current_a.$no_link_class.'"';
|
||||
$item_output = $args->before;
|
||||
if($item->hide == ""){
|
||||
if($item->nolink == ""){
|
||||
$item_output .= '<a'. $attributes .'><span class="item_outer">';
|
||||
} else{
|
||||
$item_output .= '<a'. $attributes .' onclick="JavaScript: return false;"><span class="item_outer">';
|
||||
}
|
||||
|
||||
$icon = '';
|
||||
if($item->icon !== "" && $item->icon !== 'null') {
|
||||
$icon = $item->icon;
|
||||
}
|
||||
|
||||
$icon_pack = 'font_awesome';
|
||||
|
||||
if(empty($this->icon_pack)) {
|
||||
$item->icon_pack = $icon_pack;
|
||||
}
|
||||
|
||||
if($icon !== '') {
|
||||
if($item->icon_pack == 'font_awesome') {
|
||||
$icon .= ' fa';
|
||||
}
|
||||
|
||||
$item_output .= '<span class="menu_icon_wrapper"><i class="menu_icon '.$icon.'"></i></span>';
|
||||
}
|
||||
|
||||
$item_output .= '<span class="item_text">';
|
||||
$item_output .= apply_filters('the_title', $item->title, $item->ID);
|
||||
|
||||
$featured_icon = '';
|
||||
if($item->featured_icon !== ""){
|
||||
$featured_icon .= '<i class="eltdf-menu-featured-icon fa '.$item->featured_icon .'"></i>';
|
||||
}
|
||||
|
||||
$item_output .= $featured_icon;
|
||||
|
||||
$item_output .= '</span>'; //close span.item_text
|
||||
$item_output .= '<span class="plus"></span>';
|
||||
|
||||
//append arrow for dropdown
|
||||
|
||||
if($args->has_children && $depth == 0) {
|
||||
$item_output .= '<i class="eltdf-menu-arrow fa fa-angle-down"></i>';
|
||||
}
|
||||
|
||||
$item_output .= '</span></a>';
|
||||
}
|
||||
|
||||
if($item->sidebar != "" && $depth > 0){
|
||||
ob_start();
|
||||
dynamic_sidebar($item->sidebar);
|
||||
$sidebar_content = ob_get_contents();
|
||||
ob_end_clean();
|
||||
$item_output .= $sidebar_content;
|
||||
}
|
||||
|
||||
$item_output .= $args->after;
|
||||
|
||||
// build html
|
||||
$output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php do_action('calla_elated_before_sticky_header'); ?>
|
||||
|
||||
<div class="eltdf-sticky-header">
|
||||
<?php do_action( 'calla_elated_after_sticky_menu_html_open' ); ?>
|
||||
<div class="eltdf-sticky-holder <?php echo esc_attr($menu_area_class); ?>">
|
||||
<?php if($sticky_header_in_grid) : ?>
|
||||
<div class="eltdf-grid">
|
||||
<?php endif; ?>
|
||||
<div class="eltdf-vertical-align-containers">
|
||||
<div class="eltdf-position-left"><!--
|
||||
--><div class="eltdf-position-left-inner">
|
||||
<?php if(!$hide_logo) {
|
||||
calla_elated_get_logo('sticky');
|
||||
} ?>
|
||||
<?php if($menu_area_position === 'left') : ?>
|
||||
<?php calla_elated_get_sticky_menu('eltdf-sticky-nav'); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if($menu_area_position === 'center') : ?>
|
||||
<div class="eltdf-position-center"><!--
|
||||
--><div class="eltdf-position-center-inner">
|
||||
<?php calla_elated_get_sticky_menu('eltdf-sticky-nav'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="eltdf-position-right"><!--
|
||||
--><div class="eltdf-position-right-inner">
|
||||
<?php if($menu_area_position === 'right') : ?>
|
||||
<?php calla_elated_get_sticky_menu('eltdf-sticky-nav'); ?>
|
||||
<?php endif; ?>
|
||||
<?php calla_elated_get_sticky_header_widget_menu_area(); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php if($sticky_header_in_grid) : ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php do_action( 'calla_elated_before_sticky_menu_html_close' ); ?>
|
||||
</div>
|
||||
|
||||
<?php do_action('calla_elated_after_sticky_header'); ?>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php do_action('calla_elated_before_top_navigation'); ?>
|
||||
|
||||
<nav class="eltdf-main-menu eltdf-drop-down <?php echo esc_attr($additional_class); ?>">
|
||||
<?php
|
||||
wp_nav_menu( array(
|
||||
'theme_location' => 'main-navigation' ,
|
||||
'container' => '',
|
||||
'container_class' => '',
|
||||
'menu_class' => 'clearfix',
|
||||
'menu_id' => '',
|
||||
'fallback_cb' => 'top_navigation_fallback',
|
||||
'link_before' => '<span>',
|
||||
'link_after' => '</span>',
|
||||
'walker' => new CallaElatedStickyNavigationWalker()
|
||||
));
|
||||
?>
|
||||
</nav>
|
||||
|
||||
<?php do_action('calla_elated_after_top_navigation'); ?>
|
||||
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
|
||||
if ( ! function_exists( 'calla_elated_header_top_bar_styles' ) ) {
|
||||
/**
|
||||
* Generates styles for header top bar
|
||||
*/
|
||||
function calla_elated_header_top_bar_styles() {
|
||||
$top_header_height = calla_elated_options()->getOptionValue( 'top_bar_height' );
|
||||
|
||||
if ( ! empty( $top_header_height ) ) {
|
||||
echo calla_elated_dynamic_css( '.eltdf-top-bar', array( 'height' => calla_elated_filter_px( $top_header_height ) . 'px' ) );
|
||||
echo calla_elated_dynamic_css( '.eltdf-top-bar .eltdf-logo-wrapper a', array( 'max-height' => calla_elated_filter_px( $top_header_height ) . 'px' ) );
|
||||
}
|
||||
|
||||
echo calla_elated_dynamic_css( '.eltdf-header-box .eltdf-top-bar-background', array( 'height' => calla_elated_get_top_bar_background_height() . 'px' ) );
|
||||
|
||||
$top_bar_container_selector = '.eltdf-top-bar > .eltdf-vertical-align-containers';
|
||||
$top_bar_container_styles = array();
|
||||
$container_side_padding = calla_elated_options()->getOptionValue( 'top_bar_side_padding' );
|
||||
|
||||
if ( $container_side_padding !== '' ) {
|
||||
if ( calla_elated_string_ends_with( $container_side_padding, 'px' ) || calla_elated_string_ends_with( $container_side_padding, '%' ) ) {
|
||||
$top_bar_container_styles['padding-left'] = $container_side_padding;
|
||||
$top_bar_container_styles['padding-right'] = $container_side_padding;
|
||||
} else {
|
||||
$top_bar_container_styles['padding-left'] = calla_elated_filter_px( $container_side_padding ) . 'px';
|
||||
$top_bar_container_styles['padding-right'] = calla_elated_filter_px( $container_side_padding ) . 'px';
|
||||
}
|
||||
|
||||
echo calla_elated_dynamic_css( $top_bar_container_selector, $top_bar_container_styles );
|
||||
}
|
||||
|
||||
if ( calla_elated_options()->getOptionValue( 'top_bar_in_grid' ) == 'yes' ) {
|
||||
$top_bar_grid_selector = '.eltdf-top-bar .eltdf-grid .eltdf-vertical-align-containers';
|
||||
$top_bar_grid_styles = array();
|
||||
$top_bar_grid_background_color = calla_elated_options()->getOptionValue( 'top_bar_grid_background_color' );
|
||||
$top_bar_grid_background_transparency = calla_elated_options()->getOptionValue( 'top_bar_grid_background_transparency' );
|
||||
|
||||
if ( !empty($top_bar_grid_background_color) ) {
|
||||
$grid_background_color = $top_bar_grid_background_color;
|
||||
$grid_background_transparency = 1;
|
||||
|
||||
if ( $top_bar_grid_background_transparency !== '' ) {
|
||||
$grid_background_transparency = $top_bar_grid_background_transparency;
|
||||
}
|
||||
|
||||
$grid_background_color = calla_elated_rgba_color( $grid_background_color, $grid_background_transparency );
|
||||
$top_bar_grid_styles['background-color'] = $grid_background_color;
|
||||
}
|
||||
|
||||
echo calla_elated_dynamic_css( $top_bar_grid_selector, $top_bar_grid_styles );
|
||||
}
|
||||
|
||||
$top_bar_styles = array();
|
||||
$background_color = calla_elated_options()->getOptionValue( 'top_bar_background_color' );
|
||||
$background_image = calla_elated_options()->getOptionValue( 'top_bar_background_image' );
|
||||
$border_color = calla_elated_options()->getOptionValue( 'top_bar_border_color' );
|
||||
|
||||
$top_bar_background_selector = array(
|
||||
'.eltdf-header-box .eltdf-top-bar-background'
|
||||
);
|
||||
$top_bar_background_style = array();
|
||||
|
||||
|
||||
if ( $background_color !== '' ) {
|
||||
$background_transparency = 1;
|
||||
if ( calla_elated_options()->getOptionValue( 'top_bar_background_transparency' ) !== '' ) {
|
||||
$background_transparency = calla_elated_options()->getOptionValue( 'top_bar_background_transparency' );
|
||||
}
|
||||
|
||||
$background_color = calla_elated_rgba_color( $background_color, $background_transparency );
|
||||
$top_bar_styles['background-color'] = $background_color;
|
||||
$top_bar_background_style['background-color'] = $background_color;
|
||||
}
|
||||
|
||||
if($background_image !== '' ){
|
||||
$top_bar_styles['background-image'] = 'url('.$background_image.')';
|
||||
$top_bar_background_style['background-image'] = 'url('.$background_image.')';
|
||||
}
|
||||
|
||||
echo calla_elated_dynamic_css( $top_bar_background_selector, $top_bar_background_style );
|
||||
|
||||
if ( calla_elated_options()->getOptionValue( 'top_bar_border' ) == 'yes' && $border_color != '' ) {
|
||||
$top_bar_styles['border-bottom'] = '1px solid ' . $border_color;
|
||||
}
|
||||
|
||||
echo calla_elated_dynamic_css( '.eltdf-top-bar', $top_bar_styles );
|
||||
}
|
||||
|
||||
add_action( 'calla_elated_style_dynamic', 'calla_elated_header_top_bar_styles' );
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
<?php
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_hide_dep_for_top_header_area_meta_boxes' ) ) {
|
||||
function calla_elated_get_hide_dep_for_top_header_area_meta_boxes() {
|
||||
$hide_dep_options = apply_filters( 'calla_elated_top_header_hide_meta_boxes', $hide_dep_options = array() );
|
||||
|
||||
return $hide_dep_options;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_header_top_area_meta_options_map' ) ) {
|
||||
function calla_elated_header_top_area_meta_options_map( $header_meta_box ) {
|
||||
$hide_dep_options = calla_elated_get_hide_dep_for_top_header_area_meta_boxes();
|
||||
|
||||
$top_header_container = calla_elated_add_admin_container_no_style(
|
||||
array(
|
||||
'type' => 'container',
|
||||
'name' => 'top_header_container',
|
||||
'parent' => $header_meta_box,
|
||||
'dependency' => array(
|
||||
'hide' => array(
|
||||
'eltdf_header_type_meta' => $hide_dep_options
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_section_title(
|
||||
array(
|
||||
'parent' => $top_header_container,
|
||||
'name' => 'top_area_style',
|
||||
'title' => esc_html__( 'Top Area', 'calla' )
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_top_bar_meta',
|
||||
'type' => 'select',
|
||||
'default_value' => '',
|
||||
'label' => esc_html__( 'Header Top Bar', 'calla' ),
|
||||
'description' => esc_html__( 'Enabling this option will show header top bar area', 'calla' ),
|
||||
'parent' => $top_header_container,
|
||||
'options' => calla_elated_get_yes_no_select_array(),
|
||||
)
|
||||
);
|
||||
|
||||
$top_bar_container = calla_elated_add_admin_container_no_style(
|
||||
array(
|
||||
'name' => 'top_bar_container_no_style',
|
||||
'parent' => $top_header_container,
|
||||
'dependency' => array(
|
||||
'show' => array(
|
||||
'eltdf_top_bar_meta' => 'yes'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_top_bar_in_grid_meta',
|
||||
'type' => 'select',
|
||||
'label' => esc_html__( 'Top Bar In Grid', 'calla' ),
|
||||
'description' => esc_html__( 'Set top bar content to be in grid', 'calla' ),
|
||||
'parent' => $top_bar_container,
|
||||
'default_value' => '',
|
||||
'options' => calla_elated_get_yes_no_select_array()
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_top_bar_background_color_meta',
|
||||
'type' => 'color',
|
||||
'label' => esc_html__( 'Top Bar Background Color', 'calla' ),
|
||||
'parent' => $top_bar_container
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_top_bar_background_transparency_meta',
|
||||
'type' => 'text',
|
||||
'label' => esc_html__( 'Top Bar Background Color Transparency', 'calla' ),
|
||||
'description' => esc_html__( 'Set top bar background color transparenct. Value should be between 0 and 1', 'calla' ),
|
||||
'parent' => $top_bar_container,
|
||||
'args' => array(
|
||||
'col_width' => 3
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_top_bar_background_image_meta',
|
||||
'type' => 'image',
|
||||
'label' => esc_html__( 'Top Bar Background Image', 'calla' ),
|
||||
'description' => esc_html__( 'Set background image for top bar', 'calla' ),
|
||||
'parent' => $top_bar_container,
|
||||
'default_value' => ''
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_top_bar_border_meta',
|
||||
'type' => 'select',
|
||||
'label' => esc_html__( 'Top Bar Border', 'calla' ),
|
||||
'description' => esc_html__( 'Set border on top bar', 'calla' ),
|
||||
'parent' => $top_bar_container,
|
||||
'default_value' => '',
|
||||
'options' => calla_elated_get_yes_no_select_array()
|
||||
)
|
||||
);
|
||||
|
||||
$top_bar_border_container = calla_elated_add_admin_container(
|
||||
array(
|
||||
'type' => 'container',
|
||||
'name' => 'top_bar_border_container',
|
||||
'parent' => $top_bar_container,
|
||||
'dependency' => array(
|
||||
'show' => array(
|
||||
'eltdf_top_bar_border_meta' => 'yes'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_create_meta_box_field(
|
||||
array(
|
||||
'name' => 'eltdf_top_bar_border_color_meta',
|
||||
'type' => 'color',
|
||||
'label' => esc_html__( 'Border Color', 'calla' ),
|
||||
'description' => esc_html__( 'Choose color for top bar border', 'calla' ),
|
||||
'parent' => $top_bar_border_container
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
add_action( 'calla_elated_additional_header_area_meta_boxes_map', 'calla_elated_header_top_area_meta_options_map', 10, 1 );
|
||||
}
|
||||
@@ -0,0 +1,188 @@
|
||||
<?php
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_hide_dep_for_top_header_options' ) ) {
|
||||
function calla_elated_get_hide_dep_for_top_header_options() {
|
||||
$hide_dep_options = apply_filters( 'calla_elated_top_header_hide_global_option', $hide_dep_options = array() );
|
||||
|
||||
return $hide_dep_options;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_header_top_options_map' ) ) {
|
||||
function calla_elated_header_top_options_map( $panel_header ) {
|
||||
$hide_dep_options = calla_elated_get_hide_dep_for_top_header_options();
|
||||
|
||||
$top_header_container = calla_elated_add_admin_container_no_style(
|
||||
array(
|
||||
'type' => 'container',
|
||||
'name' => 'top_header_container',
|
||||
'parent' => $panel_header,
|
||||
'dependency' => array(
|
||||
'hide' => array(
|
||||
'header_options' => $hide_dep_options
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'top_bar',
|
||||
'type' => 'yesno',
|
||||
'default_value' => 'no',
|
||||
'label' => esc_html__( 'Top Bar', 'calla' ),
|
||||
'description' => esc_html__( 'Enabling this option will show top bar area', 'calla' ),
|
||||
'parent' => $top_header_container,
|
||||
)
|
||||
);
|
||||
|
||||
$top_bar_container = calla_elated_add_admin_container(
|
||||
array(
|
||||
'name' => 'top_bar_container',
|
||||
'parent' => $top_header_container,
|
||||
'dependency' => array(
|
||||
'hide' => array(
|
||||
'top_bar' => 'no'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'top_bar_in_grid',
|
||||
'type' => 'yesno',
|
||||
'default_value' => 'yes',
|
||||
'label' => esc_html__( 'Top Bar in Grid', 'calla' ),
|
||||
'description' => esc_html__( 'Set top bar content to be in grid', 'calla' ),
|
||||
'parent' => $top_bar_container
|
||||
)
|
||||
);
|
||||
|
||||
$top_bar_in_grid_container = calla_elated_add_admin_container(
|
||||
array(
|
||||
'name' => 'top_bar_in_grid_container',
|
||||
'parent' => $top_bar_container,
|
||||
'dependency' => array(
|
||||
'hide' => array(
|
||||
'top_bar_in_grid' => 'no'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'top_bar_grid_background_color',
|
||||
'type' => 'color',
|
||||
'label' => esc_html__( 'Grid Background Color', 'calla' ),
|
||||
'description' => esc_html__( 'Set grid background color for top bar', 'calla' ),
|
||||
'parent' => $top_bar_in_grid_container
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'top_bar_grid_background_transparency',
|
||||
'type' => 'text',
|
||||
'label' => esc_html__( 'Grid Background Transparency', 'calla' ),
|
||||
'description' => esc_html__( 'Set grid background transparency for top bar', 'calla' ),
|
||||
'parent' => $top_bar_in_grid_container,
|
||||
'args' => array( 'col_width' => 3 )
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'top_bar_background_color',
|
||||
'type' => 'color',
|
||||
'label' => esc_html__( 'Background Color', 'calla' ),
|
||||
'description' => esc_html__( 'Set background color for top bar', 'calla' ),
|
||||
'parent' => $top_bar_container
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'top_bar_background_transparency',
|
||||
'type' => 'text',
|
||||
'label' => esc_html__( 'Background Transparency', 'calla' ),
|
||||
'description' => esc_html__( 'Set background transparency for top bar', 'calla' ),
|
||||
'parent' => $top_bar_container,
|
||||
'args' => array( 'col_width' => 3 )
|
||||
)
|
||||
);
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'top_bar_background_image',
|
||||
'type' => 'image',
|
||||
'label' => esc_html__( 'Background Image', 'calla' ),
|
||||
'description' => esc_html__( 'Set background image for top bar', 'calla' ),
|
||||
'parent' => $top_bar_container
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'top_bar_border',
|
||||
'type' => 'yesno',
|
||||
'default_value' => 'yes',
|
||||
'label' => esc_html__( 'Top Bar Border', 'calla' ),
|
||||
'description' => esc_html__( 'Set top bar border', 'calla' ),
|
||||
'parent' => $top_bar_container
|
||||
)
|
||||
);
|
||||
|
||||
$top_bar_border_container = calla_elated_add_admin_container(
|
||||
array(
|
||||
'name' => 'top_bar_border_container',
|
||||
'parent' => $top_bar_container,
|
||||
'dependency' => array(
|
||||
'hide' => array(
|
||||
'top_bar_border' => 'no'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'top_bar_border_color',
|
||||
'type' => 'color',
|
||||
'label' => esc_html__( 'Top Bar Border Color', 'calla' ),
|
||||
'description' => esc_html__( 'Set border color for top bar', 'calla' ),
|
||||
'parent' => $top_bar_border_container
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'top_bar_height',
|
||||
'type' => 'text',
|
||||
'label' => esc_html__( 'Top Bar Height', 'calla' ),
|
||||
'description' => esc_html__( 'Enter top bar height (Default is 46px)', 'calla' ),
|
||||
'parent' => $top_bar_container,
|
||||
'args' => array(
|
||||
'col_width' => 2,
|
||||
'suffix' => 'px'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
calla_elated_add_admin_field(
|
||||
array(
|
||||
'name' => 'top_bar_side_padding',
|
||||
'type' => 'text',
|
||||
'label' => esc_html__( 'Top Bar Side Padding', 'calla' ),
|
||||
'parent' => $top_bar_container,
|
||||
'args' => array(
|
||||
'col_width' => 2,
|
||||
'suffix' => esc_html__( 'px or %', 'calla' )
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
add_action( 'calla_elated_header_top_options_map', 'calla_elated_header_top_options_map', 10, 1 );
|
||||
}
|
||||
@@ -0,0 +1,246 @@
|
||||
<?php
|
||||
|
||||
if ( ! function_exists( 'calla_elated_set_header_top_enabled_class' ) ) {
|
||||
function calla_elated_set_header_top_enabled_class( $classes ) {
|
||||
|
||||
if ( calla_elated_is_top_bar_enabled() ) {
|
||||
$classes[] = 'eltdf-header-top-enabled';
|
||||
}
|
||||
|
||||
return $classes;
|
||||
}
|
||||
|
||||
add_filter( 'body_class', 'calla_elated_set_header_top_enabled_class' );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_top_header_global_js_var' ) ) {
|
||||
function calla_elated_top_header_global_js_var( $global_variables ) {
|
||||
$global_variables['eltdfTopBarHeight'] = calla_elated_get_top_bar_height();
|
||||
|
||||
return $global_variables;
|
||||
}
|
||||
|
||||
add_filter( 'calla_elated_js_global_variables', 'calla_elated_top_header_global_js_var' );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_header_top' ) ) {
|
||||
/**
|
||||
* Loads header top HTML and sets parameters for it
|
||||
*/
|
||||
function calla_elated_get_header_top() {
|
||||
$params = array(
|
||||
'show_header_top' => calla_elated_is_top_bar_enabled(),
|
||||
'show_header_top_background_div' => calla_elated_get_meta_field_intersect( 'header_type' ) == 'header-box' ? true : false,
|
||||
'top_bar_in_grid' => calla_elated_get_meta_field_intersect( 'top_bar_in_grid' ) == 'yes' ? true : false,
|
||||
);
|
||||
|
||||
$params = apply_filters( 'calla_elated_header_top_params', $params );
|
||||
|
||||
calla_elated_get_module_template_part( 'templates/top-header', 'header/types/top-header', '', $params );
|
||||
}
|
||||
|
||||
add_action( 'calla_elated_before_page_header', 'calla_elated_get_header_top' );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_is_top_bar_enabled' ) ) {
|
||||
/**
|
||||
* Returns is top header area enabled
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function calla_elated_is_top_bar_enabled() {
|
||||
$top_bar_enabled = calla_elated_get_meta_field_intersect( 'top_bar' ) === 'yes' ? true : false;
|
||||
|
||||
if ( is_404() ) {
|
||||
$top_bar_enabled = false;
|
||||
}
|
||||
|
||||
return apply_filters( 'calla_elated_enabled_top_bar', $top_bar_enabled );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_top_bar_height' ) ) {
|
||||
/**
|
||||
* Returns top header area height
|
||||
*
|
||||
* @return bool|int|void
|
||||
*/
|
||||
function calla_elated_get_top_bar_height() {
|
||||
if ( calla_elated_is_top_bar_enabled() ) {
|
||||
$top_bar_height_meta = calla_elated_filter_px( calla_elated_options()->getOptionValue( 'top_bar_height' ) );
|
||||
$top_bar_height = ! empty( $top_bar_height_meta ) ? $top_bar_height_meta : 46;
|
||||
|
||||
return $top_bar_height;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_top_bar_background_height' ) ) {
|
||||
/**
|
||||
* Returns top header area background height
|
||||
*
|
||||
* @return bool|int|void
|
||||
*/
|
||||
function calla_elated_get_top_bar_background_height() {
|
||||
$top_bar_height_meta = calla_elated_filter_px( calla_elated_options()->getOptionValue( 'top_bar_height' ) );
|
||||
$header_height_meta = calla_elated_filter_px( calla_elated_options()->getOptionValue( 'menu_area_height' ) );
|
||||
|
||||
$top_bar_height = ! empty( $top_bar_height_meta ) ? $top_bar_height_meta : 46;
|
||||
$header_height = ! empty( $header_height_meta ) ? $header_height_meta : 90;
|
||||
|
||||
$top_bar_background_height = round( $top_bar_height ) + round( $header_height / 2 );
|
||||
|
||||
return $top_bar_background_height;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_is_top_bar_transparent' ) ) {
|
||||
/**
|
||||
* Checks if top header area is transparent or not
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function calla_elated_is_top_bar_transparent() {
|
||||
$top_bar_enabled = calla_elated_is_top_bar_enabled();
|
||||
$top_bar_bg_color = calla_elated_options()->getOptionValue( 'top_bar_background_color' );
|
||||
$top_bar_transparency = calla_elated_options()->getOptionValue( 'top_bar_background_transparency' );
|
||||
|
||||
if ( $top_bar_enabled && $top_bar_bg_color !== '' && $top_bar_transparency !== '' ) {
|
||||
return $top_bar_transparency >= 0 && $top_bar_transparency < 1;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_is_top_bar_completely_transparent' ) ) {
|
||||
/**
|
||||
* Checks is top header area completely transparent
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function calla_elated_is_top_bar_completely_transparent() {
|
||||
$top_bar_enabled = calla_elated_is_top_bar_enabled();
|
||||
$top_bar_bg_color = calla_elated_options()->getOptionValue( 'top_bar_background_color' );
|
||||
$top_bar_transparency = calla_elated_options()->getOptionValue( 'top_bar_background_transparency' );
|
||||
|
||||
if ( $top_bar_enabled && $top_bar_bg_color !== '' && $top_bar_transparency !== '' ) {
|
||||
return $top_bar_transparency === '0';
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_register_top_header_areas' ) ) {
|
||||
/**
|
||||
* Registers widget areas for top header bar when it is enabled
|
||||
*/
|
||||
function calla_elated_register_top_header_areas() {
|
||||
register_sidebar(
|
||||
array(
|
||||
'id' => 'eltdf-top-bar-left',
|
||||
'name' => esc_html__( 'Header Top Bar Left Column', 'calla' ),
|
||||
'description' => esc_html__( 'Widgets added here will appear on the left side in top bar header', 'calla' ),
|
||||
'before_widget' => '<div id="%1$s" class="widget %2$s eltdf-top-bar-widget">',
|
||||
'after_widget' => '</div>'
|
||||
)
|
||||
);
|
||||
|
||||
register_sidebar(
|
||||
array(
|
||||
'id' => 'eltdf-top-bar-right',
|
||||
'name' => esc_html__( 'Header Top Bar Right Column', 'calla' ),
|
||||
'description' => esc_html__( 'Widgets added here will appear on the right side in top bar header', 'calla' ),
|
||||
'before_widget' => '<div id="%1$s" class="widget %2$s eltdf-top-bar-widget">',
|
||||
'after_widget' => '</div>'
|
||||
)
|
||||
);
|
||||
|
||||
register_sidebar(
|
||||
array(
|
||||
'id' => 'eltdf-top-bar-center',
|
||||
'name' => esc_html__( 'Header Top Bar Center Column', 'calla' ),
|
||||
'description' => esc_html__( 'Widgets added here will appear on the center in top bar header', 'calla' ),
|
||||
'before_widget' => '<div id="%1$s" class="widget %2$s eltdf-top-bar-widget">',
|
||||
'after_widget' => '</div>'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
add_action( 'widgets_init', 'calla_elated_register_top_header_areas' );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_top_bar_grid_class' ) ) {
|
||||
/**
|
||||
* @param $classes
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function calla_elated_top_bar_grid_class( $classes ) {
|
||||
if ( calla_elated_get_meta_field_intersect( 'top_bar_in_grid', calla_elated_get_page_id() ) == 'yes' &&
|
||||
calla_elated_options()->getOptionValue( 'top_bar_grid_background_color' ) !== '' &&
|
||||
calla_elated_options()->getOptionValue( 'top_bar_grid_background_transparency' ) !== '0'
|
||||
) {
|
||||
$classes[] = 'eltdf-top-bar-in-grid-padding';
|
||||
}
|
||||
|
||||
return $classes;
|
||||
}
|
||||
|
||||
add_filter( 'body_class', 'calla_elated_top_bar_grid_class' );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'calla_elated_get_top_bar_styles' ) ) {
|
||||
/**
|
||||
* Sets per page styles for header top bar
|
||||
*
|
||||
* @param $styles
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function calla_elated_get_top_bar_styles( $styles ) {
|
||||
$page_id = calla_elated_get_page_id();
|
||||
$class_prefix = calla_elated_get_unique_page_class( $page_id, true );
|
||||
|
||||
$top_bar_style = array();
|
||||
|
||||
$top_bar_bg_color = get_post_meta( $page_id, 'eltdf_top_bar_background_color_meta', true );
|
||||
$top_bar_bg_image = get_post_meta( $page_id, 'eltdf_top_bar_background_image_meta', true );
|
||||
$top_bar_border = get_post_meta( $page_id, 'eltdf_top_bar_border_meta', true );
|
||||
$top_bar_border_color = get_post_meta( $page_id, 'eltdf_top_bar_border_color_meta', true );
|
||||
|
||||
$current_style = '';
|
||||
|
||||
$top_bar_selector = array(
|
||||
$class_prefix . ' .eltdf-top-bar'
|
||||
);
|
||||
|
||||
if ( $top_bar_bg_color !== '' ) {
|
||||
$top_bar_transparency = get_post_meta( $page_id, 'eltdf_top_bar_background_transparency_meta', true );
|
||||
if ( $top_bar_transparency === '' ) {
|
||||
$top_bar_transparency = 1;
|
||||
}
|
||||
$top_bar_style['background-color'] = calla_elated_rgba_color( $top_bar_bg_color, $top_bar_transparency );
|
||||
}
|
||||
if ( $top_bar_bg_image !== '' ) {
|
||||
$top_bar_image = get_post_meta( $page_id, 'eltdf_top_bar_background_image_meta', true );
|
||||
$top_bar_style['background-image'] = 'url('.$top_bar_image.')';
|
||||
}
|
||||
if ( $top_bar_border == 'yes' ) {
|
||||
$top_bar_style['border-bottom'] = '1px solid ' . $top_bar_border_color;
|
||||
} elseif ( $top_bar_border == 'no' ) {
|
||||
$top_bar_style['border-bottom'] = '0';
|
||||
}
|
||||
|
||||
$current_style .= calla_elated_dynamic_css( $top_bar_selector, $top_bar_style );
|
||||
|
||||
$current_style = $current_style . $styles;
|
||||
|
||||
return $current_style;
|
||||
}
|
||||
|
||||
add_filter( 'calla_elated_add_page_custom_style', 'calla_elated_get_top_bar_styles' );
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
include_once ELATED_FRAMEWORK_HEADER_ROOT_DIR . '/types/top-header/functions.php';
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
if($show_header_top) {
|
||||
do_action('calla_elated_before_header_top');
|
||||
?>
|
||||
|
||||
<?php if($show_header_top_background_div){ ?>
|
||||
<div class="eltdf-top-bar-background"></div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="eltdf-top-bar">
|
||||
<?php do_action( 'calla_elated_after_header_top_html_open' ); ?>
|
||||
|
||||
<?php if($top_bar_in_grid) : ?>
|
||||
<div class="eltdf-grid">
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="eltdf-vertical-align-containers">
|
||||
<div class="eltdf-position-left"><!--
|
||||
--><div class="eltdf-position-left-inner">
|
||||
<?php if(is_active_sidebar('eltdf-top-bar-left')) : ?>
|
||||
<?php dynamic_sidebar('eltdf-top-bar-left'); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="eltdf-position-center"><!--
|
||||
--><div class="eltdf-position-center-inner">
|
||||
<?php if(is_active_sidebar('eltdf-top-bar-center')) : ?>
|
||||
<?php dynamic_sidebar('eltdf-top-bar-center'); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="eltdf-position-right"><!--
|
||||
--><div class="eltdf-position-right-inner">
|
||||
<?php if(is_active_sidebar('eltdf-top-bar-right')) : ?>
|
||||
<?php dynamic_sidebar('eltdf-top-bar-right'); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if($top_bar_in_grid) : ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'calla_elated_before_header_top_html_close' ); ?>
|
||||
</div>
|
||||
|
||||
<?php do_action('calla_elated_after_header_top');
|
||||
}
|
||||
Reference in New Issue
Block a user