first commit

This commit is contained in:
2023-11-23 22:14:40 +01:00
commit 6c5e83d1b2
2779 changed files with 640726 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
<?php
if ( ! function_exists( 'calla_elated_admin_map_init' ) ) {
function calla_elated_admin_map_init() {
do_action( 'calla_elated_before_options_map' );
require_once ELATED_FRAMEWORK_ROOT_DIR . '/admin/options/fonts/map.php';
require_once ELATED_FRAMEWORK_ROOT_DIR . '/admin/options/general/map.php';
require_once ELATED_FRAMEWORK_ROOT_DIR . '/admin/options/page/map.php';
require_once ELATED_FRAMEWORK_ROOT_DIR . '/admin/options/social/map.php';
require_once ELATED_FRAMEWORK_ROOT_DIR . '/admin/options/reset/map.php';
do_action( 'calla_elated_options_map' );
do_action( 'calla_elated_after_options_map' );
}
add_action( 'after_setup_theme', 'calla_elated_admin_map_init', 1 );
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,728 @@
<?php
if ( ! function_exists( 'calla_elated_general_options_map' ) ) {
/**
* General options page
*/
function calla_elated_general_options_map() {
calla_elated_add_admin_page(
array(
'slug' => '',
'title' => esc_html__( 'General', 'calla' ),
'icon' => 'fa fa-institution'
)
);
$panel_design_style = calla_elated_add_admin_panel(
array(
'page' => '',
'name' => 'panel_design_style',
'title' => esc_html__( 'Design Style', 'calla' )
)
);
calla_elated_add_admin_field(
array(
'name' => 'google_fonts',
'type' => 'font',
'default_value' => '-1',
'label' => esc_html__( 'Google Font Family', 'calla' ),
'description' => esc_html__( 'Choose a default Google font for your site', 'calla' ),
'parent' => $panel_design_style
)
);
calla_elated_add_admin_field(
array(
'name' => 'additional_google_fonts',
'type' => 'yesno',
'default_value' => 'no',
'label' => esc_html__( 'Additional Google Fonts', 'calla' ),
'parent' => $panel_design_style
)
);
$additional_google_fonts_container = calla_elated_add_admin_container(
array(
'parent' => $panel_design_style,
'name' => 'additional_google_fonts_container',
'dependency' => array(
'show' => array(
'additional_google_fonts' => 'yes'
)
)
)
);
calla_elated_add_admin_field(
array(
'name' => 'additional_google_font1',
'type' => 'font',
'default_value' => '-1',
'label' => esc_html__( 'Font Family', 'calla' ),
'description' => esc_html__( 'Choose additional Google font for your site', 'calla' ),
'parent' => $additional_google_fonts_container
)
);
calla_elated_add_admin_field(
array(
'name' => 'additional_google_font2',
'type' => 'font',
'default_value' => '-1',
'label' => esc_html__( 'Font Family', 'calla' ),
'description' => esc_html__( 'Choose additional Google font for your site', 'calla' ),
'parent' => $additional_google_fonts_container
)
);
calla_elated_add_admin_field(
array(
'name' => 'additional_google_font3',
'type' => 'font',
'default_value' => '-1',
'label' => esc_html__( 'Font Family', 'calla' ),
'description' => esc_html__( 'Choose additional Google font for your site', 'calla' ),
'parent' => $additional_google_fonts_container
)
);
calla_elated_add_admin_field(
array(
'name' => 'additional_google_font4',
'type' => 'font',
'default_value' => '-1',
'label' => esc_html__( 'Font Family', 'calla' ),
'description' => esc_html__( 'Choose additional Google font for your site', 'calla' ),
'parent' => $additional_google_fonts_container
)
);
calla_elated_add_admin_field(
array(
'name' => 'additional_google_font5',
'type' => 'font',
'default_value' => '-1',
'label' => esc_html__( 'Font Family', 'calla' ),
'description' => esc_html__( 'Choose additional Google font for your site', 'calla' ),
'parent' => $additional_google_fonts_container
)
);
calla_elated_add_admin_field(
array(
'name' => 'google_font_weight',
'type' => 'checkboxgroup',
'default_value' => '',
'label' => esc_html__( 'Google Fonts Style & Weight', 'calla' ),
'description' => esc_html__( 'Choose a default Google font weights for your site. Impact on page load time', 'calla' ),
'parent' => $panel_design_style,
'options' => array(
'100' => esc_html__( '100 Thin', 'calla' ),
'100i' => esc_html__( '100 Thin Italic', 'calla' ),
'200' => esc_html__( '200 Extra-Light', 'calla' ),
'200i' => esc_html__( '200 Extra-Light Italic', 'calla' ),
'300' => esc_html__( '300 Light', 'calla' ),
'300i' => esc_html__( '300 Light Italic', 'calla' ),
'400' => esc_html__( '400 Regular', 'calla' ),
'400i' => esc_html__( '400 Regular Italic', 'calla' ),
'500' => esc_html__( '500 Medium', 'calla' ),
'500i' => esc_html__( '500 Medium Italic', 'calla' ),
'600' => esc_html__( '600 Semi-Bold', 'calla' ),
'600i' => esc_html__( '600 Semi-Bold Italic', 'calla' ),
'700' => esc_html__( '700 Bold', 'calla' ),
'700i' => esc_html__( '700 Bold Italic', 'calla' ),
'800' => esc_html__( '800 Extra-Bold', 'calla' ),
'800i' => esc_html__( '800 Extra-Bold Italic', 'calla' ),
'900' => esc_html__( '900 Ultra-Bold', 'calla' ),
'900i' => esc_html__( '900 Ultra-Bold Italic', 'calla' )
)
)
);
calla_elated_add_admin_field(
array(
'name' => 'google_font_subset',
'type' => 'checkboxgroup',
'default_value' => '',
'label' => esc_html__( 'Google Fonts Subset', 'calla' ),
'description' => esc_html__( 'Choose a default Google font subsets for your site', 'calla' ),
'parent' => $panel_design_style,
'options' => array(
'latin' => esc_html__( 'Latin', 'calla' ),
'latin-ext' => esc_html__( 'Latin Extended', 'calla' ),
'cyrillic' => esc_html__( 'Cyrillic', 'calla' ),
'cyrillic-ext' => esc_html__( 'Cyrillic Extended', 'calla' ),
'greek' => esc_html__( 'Greek', 'calla' ),
'greek-ext' => esc_html__( 'Greek Extended', 'calla' ),
'vietnamese' => esc_html__( 'Vietnamese', 'calla' )
)
)
);
calla_elated_add_admin_field(
array(
'name' => 'first_color',
'type' => 'color',
'label' => esc_html__( 'First Main Color', 'calla' ),
'description' => esc_html__( 'Choose the most dominant theme color. Default color is #00bbb3', 'calla' ),
'parent' => $panel_design_style
)
);
calla_elated_add_admin_field(
array(
'name' => 'page_background_color',
'type' => 'color',
'label' => esc_html__( 'Page Background Color', 'calla' ),
'description' => esc_html__( 'Choose the background color for page content. Default color is #ffffff', 'calla' ),
'parent' => $panel_design_style
)
);
calla_elated_add_admin_field(
array(
'name' => 'selection_color',
'type' => 'color',
'label' => esc_html__( 'Text Selection Color', 'calla' ),
'description' => esc_html__( 'Choose the color users see when selecting text', 'calla' ),
'parent' => $panel_design_style
)
);
/***************** Boxed Layout - begin **********************/
calla_elated_add_admin_field(
array(
'name' => 'boxed',
'type' => 'yesno',
'default_value' => 'no',
'label' => esc_html__( 'Boxed Layout', 'calla' ),
'parent' => $panel_design_style
)
);
$boxed_container = calla_elated_add_admin_container(
array(
'parent' => $panel_design_style,
'name' => 'boxed_container',
'dependency' => array(
'show' => array(
'boxed' => 'yes'
)
)
)
);
calla_elated_add_admin_field(
array(
'name' => 'page_background_color_in_box',
'type' => 'color',
'label' => esc_html__( 'Page Background Color', 'calla' ),
'description' => esc_html__( 'Choose the page background color outside box', 'calla' ),
'parent' => $boxed_container
)
);
calla_elated_add_admin_field(
array(
'name' => 'boxed_background_image',
'type' => 'image',
'label' => esc_html__( 'Background Image', 'calla' ),
'description' => esc_html__( 'Choose an image to be displayed in background', 'calla' ),
'parent' => $boxed_container
)
);
calla_elated_add_admin_field(
array(
'name' => 'boxed_pattern_background_image',
'type' => 'image',
'label' => esc_html__( 'Background Pattern', 'calla' ),
'description' => esc_html__( 'Choose an image to be used as background pattern', 'calla' ),
'parent' => $boxed_container
)
);
calla_elated_add_admin_field(
array(
'name' => 'boxed_background_image_attachment',
'type' => 'select',
'default_value' => '',
'label' => esc_html__( 'Background Image Attachment', 'calla' ),
'description' => esc_html__( 'Choose background image attachment', 'calla' ),
'parent' => $boxed_container,
'options' => array(
'' => esc_html__( 'Default', 'calla' ),
'fixed' => esc_html__( 'Fixed', 'calla' ),
'scroll' => esc_html__( 'Scroll', 'calla' )
)
)
);
/***************** Boxed Layout - end **********************/
/***************** Passepartout Layout - begin **********************/
calla_elated_add_admin_field(
array(
'name' => 'paspartu',
'type' => 'yesno',
'default_value' => 'no',
'label' => esc_html__( 'Passepartout', 'calla' ),
'description' => esc_html__( 'Enabling this option will display passepartout around site content', 'calla' ),
'parent' => $panel_design_style
)
);
$paspartu_container = calla_elated_add_admin_container(
array(
'parent' => $panel_design_style,
'name' => 'paspartu_container',
'dependency' => array(
'show' => array(
'paspartu' => 'yes'
)
)
)
);
calla_elated_add_admin_field(
array(
'name' => 'paspartu_color',
'type' => 'color',
'label' => esc_html__( 'Passepartout Color', 'calla' ),
'description' => esc_html__( 'Choose passepartout color, default value is #ffffff', 'calla' ),
'parent' => $paspartu_container
)
);
calla_elated_add_admin_field(
array(
'name' => 'paspartu_width',
'type' => 'text',
'label' => esc_html__( 'Passepartout Size', 'calla' ),
'description' => esc_html__( 'Enter size amount for passepartout', 'calla' ),
'parent' => $paspartu_container,
'args' => array(
'col_width' => 2,
'suffix' => 'px or %'
)
)
);
calla_elated_add_admin_field(
array(
'name' => 'paspartu_responsive_width',
'type' => 'text',
'label' => esc_html__( 'Responsive Passepartout Size', 'calla' ),
'description' => esc_html__( 'Enter size amount for passepartout for smaller screens (tablets and mobiles view)', 'calla' ),
'parent' => $paspartu_container,
'args' => array(
'col_width' => 2,
'suffix' => 'px or %'
)
)
);
calla_elated_add_admin_field(
array(
'parent' => $paspartu_container,
'type' => 'yesno',
'default_value' => 'no',
'name' => 'disable_top_paspartu',
'label' => esc_html__( 'Disable Top Passepartout', 'calla' )
)
);
calla_elated_add_admin_field(
array(
'parent' => $paspartu_container,
'type' => 'yesno',
'default_value' => 'no',
'name' => 'enable_fixed_paspartu',
'label' => esc_html__( 'Enable Fixed Passepartout', 'calla' ),
'description' => esc_html__( 'Enabling this option will set fixed passepartout for your screens', 'calla' )
)
);
/***************** Passepartout Layout - end **********************/
/***************** Content Layout - begin **********************/
calla_elated_add_admin_field(
array(
'name' => 'initial_content_width',
'type' => 'select',
'default_value' => '',
'label' => esc_html__( 'Initial Width of Content', 'calla' ),
'description' => esc_html__( 'Choose the initial width of content which is in grid (Applies to pages set to "Default Template" and rows set to "In Grid")', 'calla' ),
'parent' => $panel_design_style,
'options' => array(
'eltdf-grid-1100' => esc_html__( '1100px - default', 'calla' ),
'eltdf-grid-1300' => esc_html__( '1300px', 'calla' ),
'eltdf-grid-1200' => esc_html__( '1200px', 'calla' ),
'eltdf-grid-1000' => esc_html__( '1000px', 'calla' ),
'eltdf-grid-800' => esc_html__( '800px', 'calla' )
)
)
);
calla_elated_add_admin_field(
array(
'name' => 'preload_pattern_image',
'type' => 'image',
'label' => esc_html__( 'Preload Pattern Image', 'calla' ),
'description' => esc_html__( 'Choose preload pattern image to be displayed until images are loaded', 'calla' ),
'parent' => $panel_design_style
)
);
/***************** Content Layout - end **********************/
$panel_settings = calla_elated_add_admin_panel(
array(
'page' => '',
'name' => 'panel_settings',
'title' => esc_html__( 'Settings', 'calla' )
)
);
/***************** Smooth Scroll Layout - begin **********************/
calla_elated_add_admin_field(
array(
'name' => 'page_smooth_scroll',
'type' => 'yesno',
'default_value' => 'no',
'label' => esc_html__( 'Smooth Scroll', 'calla' ),
'description' => esc_html__( 'Enabling this option will perform a smooth scrolling effect on every page (except on Mac and touch devices)', 'calla' ),
'parent' => $panel_settings
)
);
/***************** Smooth Scroll Layout - end **********************/
/***************** Smooth Page Transitions Layout - begin **********************/
calla_elated_add_admin_field(
array(
'name' => 'smooth_page_transitions',
'type' => 'yesno',
'default_value' => 'no',
'label' => esc_html__( 'Smooth Page Transitions', 'calla' ),
'description' => esc_html__( 'Enabling this option will perform a smooth transition between pages when clicking on links', 'calla' ),
'parent' => $panel_settings
)
);
$page_transitions_container = calla_elated_add_admin_container(
array(
'parent' => $panel_settings,
'name' => 'page_transitions_container',
'dependency' => array(
'show' => array(
'smooth_page_transitions' => 'yes'
)
)
)
);
calla_elated_add_admin_field(
array(
'name' => 'page_transition_preloader',
'type' => 'yesno',
'default_value' => 'no',
'label' => esc_html__( 'Enable Preloading Animation', 'calla' ),
'description' => esc_html__( 'Enabling this option will display an animated preloader while the page content is loading', 'calla' ),
'parent' => $page_transitions_container
)
);
$page_transition_preloader_container = calla_elated_add_admin_container(
array(
'parent' => $page_transitions_container,
'name' => 'page_transition_preloader_container',
'dependency' => array(
'show' => array(
'page_transition_preloader' => 'yes'
)
)
)
);
calla_elated_add_admin_field(
array(
'name' => 'smooth_pt_bgnd_color',
'type' => 'color',
'label' => esc_html__( 'Page Loader Background Color', 'calla' ),
'parent' => $page_transition_preloader_container
)
);
$group_pt_spinner_animation = calla_elated_add_admin_group(
array(
'name' => 'group_pt_spinner_animation',
'title' => esc_html__( 'Loader Style', 'calla' ),
'description' => esc_html__( 'Define styles for loader spinner animation', 'calla' ),
'parent' => $page_transition_preloader_container
)
);
$row_pt_spinner_animation = calla_elated_add_admin_row(
array(
'name' => 'row_pt_spinner_animation',
'parent' => $group_pt_spinner_animation
)
);
calla_elated_add_admin_field(
array(
'type' => 'selectsimple',
'name' => 'smooth_pt_spinner_type',
'default_value' => '',
'label' => esc_html__( 'Spinner Type', 'calla' ),
'parent' => $row_pt_spinner_animation,
'options' => array(
'calla' => esc_html__( 'Calla', 'calla' ),
'rotate_circles' => esc_html__( 'Rotate Circles', 'calla' ),
'pulse' => esc_html__( 'Pulse', 'calla' ),
'double_pulse' => esc_html__( 'Double Pulse', 'calla' ),
'cube' => esc_html__( 'Cube', 'calla' ),
'rotating_cubes' => esc_html__( 'Rotating Cubes', 'calla' ),
'stripes' => esc_html__( 'Stripes', 'calla' ),
'wave' => esc_html__( 'Wave', 'calla' ),
'two_rotating_circles' => esc_html__( '2 Rotating Circles', 'calla' ),
'five_rotating_circles' => esc_html__( '5 Rotating Circles', 'calla' ),
'atom' => esc_html__( 'Atom', 'calla' ),
'clock' => esc_html__( 'Clock', 'calla' ),
'mitosis' => esc_html__( 'Mitosis', 'calla' ),
'lines' => esc_html__( 'Lines', 'calla' ),
'fussion' => esc_html__( 'Fussion', 'calla' ),
'wave_circles' => esc_html__( 'Wave Circles', 'calla' ),
'pulse_circles' => esc_html__( 'Pulse Circles', 'calla' )
)
)
);
calla_elated_add_admin_field(
array(
'type' => 'colorsimple',
'name' => 'smooth_pt_spinner_color',
'default_value' => '',
'label' => esc_html__( 'Spinner Color', 'calla' ),
'parent' => $row_pt_spinner_animation
)
);
calla_elated_add_admin_field(
array(
'name' => 'page_transition_fadeout',
'type' => 'yesno',
'default_value' => 'no',
'label' => esc_html__( 'Enable Fade Out Animation', 'calla' ),
'description' => esc_html__( 'Enabling this option will turn on fade out animation when leaving page', 'calla' ),
'parent' => $page_transitions_container
)
);
/***************** Smooth Page Transitions Layout - end **********************/
calla_elated_add_admin_field(
array(
'name' => 'show_back_button',
'type' => 'yesno',
'default_value' => 'yes',
'label' => esc_html__( 'Show "Back To Top Button"', 'calla' ),
'description' => esc_html__( 'Enabling this option will display a Back to Top button on every page', 'calla' ),
'parent' => $panel_settings
)
);
calla_elated_add_admin_field(
array(
'name' => 'responsiveness',
'type' => 'yesno',
'default_value' => 'yes',
'label' => esc_html__( 'Responsiveness', 'calla' ),
'description' => esc_html__( 'Enabling this option will make all pages responsive', 'calla' ),
'parent' => $panel_settings
)
);
$panel_custom_code = calla_elated_add_admin_panel(
array(
'page' => '',
'name' => 'panel_custom_code',
'title' => esc_html__( 'Custom Code', 'calla' )
)
);
calla_elated_add_admin_field(
array(
'name' => 'custom_js',
'type' => 'textarea',
'label' => esc_html__( 'Custom JS', 'calla' ),
'description' => esc_html__( 'Enter your custom Javascript here', 'calla' ),
'parent' => $panel_custom_code
)
);
$panel_google_api = calla_elated_add_admin_panel(
array(
'page' => '',
'name' => 'panel_google_api',
'title' => esc_html__( 'Google API', 'calla' )
)
);
calla_elated_add_admin_field(
array(
'name' => 'google_maps_api_key',
'type' => 'text',
'label' => esc_html__( 'Google Maps Api Key', 'calla' ),
'description' => esc_html__( 'Insert your Google Maps API key here. For instructions on how to create a Google Maps API key, please refer to our to our documentation.', 'calla' ),
'parent' => $panel_google_api
)
);
}
add_action( 'calla_elated_options_map', 'calla_elated_general_options_map', 1 );
}
if ( ! function_exists( 'calla_elated_page_general_style' ) ) {
/**
* Function that prints page general inline styles
*/
function calla_elated_page_general_style( $style ) {
$current_style = '';
$page_id = calla_elated_get_page_id();
$class_prefix = calla_elated_get_unique_page_class( $page_id );
$boxed_background_style = array();
$boxed_page_background_color = calla_elated_get_meta_field_intersect( 'page_background_color_in_box', $page_id );
if ( ! empty( $boxed_page_background_color ) ) {
$boxed_background_style['background-color'] = $boxed_page_background_color;
}
$boxed_page_background_image = calla_elated_get_meta_field_intersect( 'boxed_background_image', $page_id );
if ( ! empty( $boxed_page_background_image ) ) {
$boxed_background_style['background-image'] = 'url(' . esc_url( $boxed_page_background_image ) . ')';
$boxed_background_style['background-position'] = 'center 0px';
$boxed_background_style['background-repeat'] = 'no-repeat';
}
$boxed_page_background_pattern_image = calla_elated_get_meta_field_intersect( 'boxed_pattern_background_image', $page_id );
if ( ! empty( $boxed_page_background_pattern_image ) ) {
$boxed_background_style['background-image'] = 'url(' . esc_url( $boxed_page_background_pattern_image ) . ')';
$boxed_background_style['background-position'] = '0px 0px';
$boxed_background_style['background-repeat'] = 'repeat';
}
$boxed_page_background_attachment = calla_elated_get_meta_field_intersect( 'boxed_background_image_attachment', $page_id );
if ( ! empty( $boxed_page_background_attachment ) ) {
$boxed_background_style['background-attachment'] = $boxed_page_background_attachment;
}
$boxed_background_selector = $class_prefix . '.eltdf-boxed .eltdf-wrapper';
if ( ! empty( $boxed_background_style ) ) {
$current_style .= calla_elated_dynamic_css( $boxed_background_selector, $boxed_background_style );
}
$paspartu_style = array();
$paspartu_res_style = array();
$paspartu_res_start = '@media only screen and (max-width: 1024px) {';
$paspartu_res_end = '}';
$paspartu_header_selector = array(
'.eltdf-paspartu-enabled .eltdf-page-header .eltdf-fixed-wrapper.fixed',
'.eltdf-paspartu-enabled .eltdf-sticky-header',
'.eltdf-paspartu-enabled .eltdf-mobile-header.mobile-header-appear .eltdf-mobile-header-inner'
);
$paspartu_header_appear_selector = array(
'.eltdf-paspartu-enabled.eltdf-fixed-paspartu-enabled .eltdf-page-header .eltdf-fixed-wrapper.fixed',
'.eltdf-paspartu-enabled.eltdf-fixed-paspartu-enabled .eltdf-sticky-header.header-appear',
'.eltdf-paspartu-enabled.eltdf-fixed-paspartu-enabled .eltdf-mobile-header.mobile-header-appear .eltdf-mobile-header-inner'
);
$paspartu_header_style = array();
$paspartu_header_appear_style = array();
$paspartu_header_responsive_style = array();
$paspartu_header_appear_responsive_style = array();
$paspartu_color = calla_elated_get_meta_field_intersect( 'paspartu_color', $page_id );
if ( ! empty( $paspartu_color ) ) {
$paspartu_style['background-color'] = $paspartu_color;
}
$paspartu_width = calla_elated_get_meta_field_intersect( 'paspartu_width', $page_id );
if ( $paspartu_width !== '' ) {
if ( calla_elated_string_ends_with( $paspartu_width, '%' ) || calla_elated_string_ends_with( $paspartu_width, 'px' ) ) {
$paspartu_style['padding'] = $paspartu_width;
$paspartu_clean_width = calla_elated_string_ends_with( $paspartu_width, '%' ) ? calla_elated_filter_suffix( $paspartu_width, '%' ) : calla_elated_filter_suffix( $paspartu_width, 'px' );
$paspartu_clean_width_mark = calla_elated_string_ends_with( $paspartu_width, '%' ) ? '%' : 'px';
$paspartu_header_style['left'] = $paspartu_width;
$paspartu_header_style['width'] = 'calc(100% - ' . ( 2 * $paspartu_clean_width ) . $paspartu_clean_width_mark . ')';
$paspartu_header_appear_style['margin-top'] = $paspartu_width;
} else {
$paspartu_style['padding'] = $paspartu_width . 'px';
$paspartu_header_style['left'] = $paspartu_width . 'px';
$paspartu_header_style['width'] = 'calc(100% - ' . ( 2 * $paspartu_width ) . 'px)';
$paspartu_header_appear_style['margin-top'] = $paspartu_width . 'px';
}
}
$paspartu_selector = $class_prefix . '.eltdf-paspartu-enabled .eltdf-wrapper';
if ( ! empty( $paspartu_style ) ) {
$current_style .= calla_elated_dynamic_css( $paspartu_selector, $paspartu_style );
}
if ( ! empty( $paspartu_header_style ) ) {
$current_style .= calla_elated_dynamic_css( $paspartu_header_selector, $paspartu_header_style );
$current_style .= calla_elated_dynamic_css( $paspartu_header_appear_selector, $paspartu_header_appear_style );
}
$paspartu_responsive_width = calla_elated_get_meta_field_intersect( 'paspartu_responsive_width', $page_id );
if ( $paspartu_responsive_width !== '' ) {
if ( calla_elated_string_ends_with( $paspartu_responsive_width, '%' ) || calla_elated_string_ends_with( $paspartu_responsive_width, 'px' ) ) {
$paspartu_res_style['padding'] = $paspartu_responsive_width;
$paspartu_clean_width = calla_elated_string_ends_with( $paspartu_responsive_width, '%' ) ? calla_elated_filter_suffix( $paspartu_responsive_width, '%' ) : calla_elated_filter_suffix( $paspartu_responsive_width, 'px' );
$paspartu_clean_width_mark = calla_elated_string_ends_with( $paspartu_responsive_width, '%' ) ? '%' : 'px';
$paspartu_header_responsive_style['left'] = $paspartu_width;
$paspartu_header_responsive_style['width'] = 'calc(100% - ' . ( 2 * $paspartu_clean_width ) . $paspartu_clean_width_mark . ')';
$paspartu_header_appear_responsive_style['margin-top'] = $paspartu_width;
} else {
$paspartu_res_style['padding'] = $paspartu_responsive_width . 'px';
$paspartu_header_responsive_style['left'] = $paspartu_width . 'px';
$paspartu_header_responsive_style['width'] = 'calc(100% - ' . ( 2 * $paspartu_width ) . 'px)';
$paspartu_header_appear_responsive_style['margin-top'] = $paspartu_width . 'px';
}
}
if ( ! empty( $paspartu_res_style ) ) {
$current_style .= $paspartu_res_start . calla_elated_dynamic_css( $paspartu_selector, $paspartu_res_style ) . $paspartu_res_end;
}
if ( ! empty( $paspartu_header_responsive_style ) ) {
$current_style .= $paspartu_res_start . calla_elated_dynamic_css( $paspartu_header_selector, $paspartu_header_responsive_style ) . $paspartu_res_end;
$current_style .= $paspartu_res_start . calla_elated_dynamic_css( $paspartu_header_appear_selector, $paspartu_header_appear_responsive_style ) . $paspartu_res_end;
}
$current_style = $current_style . $style;
return $current_style;
}
add_filter( 'calla_elated_add_page_custom_style', 'calla_elated_page_general_style' );
}

View File

@@ -0,0 +1,102 @@
<?php
if ( ! function_exists( 'calla_elated_page_options_map' ) ) {
function calla_elated_page_options_map() {
calla_elated_add_admin_page(
array(
'slug' => '_page_page',
'title' => esc_html__( 'Page', 'calla' ),
'icon' => 'fa fa-file-text-o'
)
);
/***************** Page Layout - begin **********************/
$panel_sidebar = calla_elated_add_admin_panel(
array(
'page' => '_page_page',
'name' => 'panel_sidebar',
'title' => esc_html__( 'Page Style', 'calla' )
)
);
calla_elated_add_admin_field(
array(
'name' => 'page_show_comments',
'type' => 'yesno',
'label' => esc_html__( 'Show Comments', 'calla' ),
'description' => esc_html__( 'Enabling this option will show comments on your page', 'calla' ),
'default_value' => 'yes',
'parent' => $panel_sidebar
)
);
/***************** Page Layout - end **********************/
/***************** Content Layout - begin **********************/
$panel_content = calla_elated_add_admin_panel(
array(
'page' => '_page_page',
'name' => 'panel_content',
'title' => esc_html__( 'Content Style', 'calla' )
)
);
calla_elated_add_admin_field(
array(
'type' => 'text',
'name' => 'content_top_padding',
'default_value' => '',
'label' => esc_html__( 'Content Top Padding for Template in Full Width', 'calla' ),
'description' => esc_html__( 'Enter top padding for content area for templates in full width. If you set this value then it\'s important to set also Content top padding for mobile header value', 'calla' ),
'args' => array(
'suffix' => 'px',
'col_width' => 3
),
'parent' => $panel_content
)
);
calla_elated_add_admin_field(
array(
'type' => 'text',
'name' => 'content_top_padding_in_grid',
'default_value' => '',
'label' => esc_html__( 'Content Top Padding for Templates in Grid', 'calla' ),
'description' => esc_html__( 'Enter top padding for content area for Templates in grid. If you set this value then it\'s important to set also Content top padding for mobile header value', 'calla' ),
'args' => array(
'suffix' => 'px',
'col_width' => 3
),
'parent' => $panel_content
)
);
calla_elated_add_admin_field(
array(
'type' => 'text',
'name' => 'content_top_padding_mobile',
'default_value' => '',
'label' => esc_html__( 'Content Top Padding for Mobile Header', 'calla' ),
'description' => esc_html__( 'Enter top padding for content area for Mobile Header', 'calla' ),
'args' => array(
'suffix' => 'px',
'col_width' => 3
),
'parent' => $panel_content
)
);
/***************** Content Layout - end **********************/
/***************** Additional Page Layout - start *****************/
do_action( 'calla_elated_additional_page_options_map' );
/***************** Additional Page Layout - end *****************/
}
add_action( 'calla_elated_options_map', 'calla_elated_page_options_map', 5 );
}

View File

@@ -0,0 +1,38 @@
<?php
if ( ! function_exists( 'calla_elated_reset_options_map' ) ) {
/**
* Reset options panel
*/
function calla_elated_reset_options_map() {
calla_elated_add_admin_page(
array(
'slug' => '_reset_page',
'title' => esc_html__( 'Reset', 'calla' ),
'icon' => 'fa fa-retweet'
)
);
$panel_reset = calla_elated_add_admin_panel(
array(
'page' => '_reset_page',
'name' => 'panel_reset',
'title' => esc_html__( 'Reset', 'calla' )
)
);
calla_elated_add_admin_field(
array(
'type' => 'yesno',
'name' => 'reset_to_defaults',
'default_value' => 'no',
'label' => esc_html__( 'Reset to Defaults', 'calla' ),
'description' => esc_html__( 'This option will reset all Select Options values to defaults', 'calla' ),
'parent' => $panel_reset
)
);
}
add_action( 'calla_elated_options_map', 'calla_elated_reset_options_map', 100 );
}

View File

@@ -0,0 +1,454 @@
<?php
if ( ! function_exists( 'calla_elated_social_options_map' ) ) {
function calla_elated_social_options_map() {
$page = '_social_page';
calla_elated_add_admin_page(
array(
'slug' => '_social_page',
'title' => esc_html__( 'Social Networks', 'calla' ),
'icon' => 'fa fa-share-alt'
)
);
/**
* Enable Social Share
*/
$panel_social_share = calla_elated_add_admin_panel(
array(
'page' => '_social_page',
'name' => 'panel_social_share',
'title' => esc_html__( 'Enable Social Share', 'calla' )
)
);
calla_elated_add_admin_field(
array(
'type' => 'yesno',
'name' => 'enable_social_share',
'default_value' => 'no',
'label' => esc_html__( 'Enable Social Share', 'calla' ),
'description' => esc_html__( 'Enabling this option will allow social share on networks of your choice', 'calla' ),
'parent' => $panel_social_share
)
);
$panel_show_social_share_on = calla_elated_add_admin_panel(
array(
'page' => '_social_page',
'name' => 'panel_show_social_share_on',
'title' => esc_html__( 'Show Social Share On', 'calla' ),
'dependency' => array(
'show' => array(
'enable_social_share' => 'yes'
)
)
)
);
calla_elated_add_admin_field(
array(
'type' => 'yesno',
'name' => 'enable_social_share_on_post',
'default_value' => 'no',
'label' => esc_html__( 'Posts', 'calla' ),
'description' => esc_html__( 'Show Social Share on Blog Posts', 'calla' ),
'parent' => $panel_show_social_share_on
)
);
calla_elated_add_admin_field(
array(
'type' => 'yesno',
'name' => 'enable_social_share_on_page',
'default_value' => 'no',
'label' => esc_html__( 'Pages', 'calla' ),
'description' => esc_html__( 'Show Social Share on Pages', 'calla' ),
'parent' => $panel_show_social_share_on
)
);
/**
* Action for embedding social share option for custom post types
*/
do_action('calla_elated_post_types_social_share', $panel_show_social_share_on);
/**
* Social Share Networks
*/
$panel_social_networks = calla_elated_add_admin_panel(
array(
'page' => '_social_page',
'name' => 'panel_social_networks',
'title' => esc_html__( 'Social Networks', 'calla' ),
'dependency' => array(
'hide' => array(
'enable_social_share' => 'no'
)
)
)
);
/**
* Facebook
*/
calla_elated_add_admin_section_title(
array(
'parent' => $panel_social_networks,
'name' => 'facebook_title',
'title' => esc_html__( 'Share on Facebook', 'calla' )
)
);
calla_elated_add_admin_field(
array(
'type' => 'yesno',
'name' => 'enable_facebook_share',
'default_value' => 'no',
'label' => esc_html__( 'Enable Share', 'calla' ),
'description' => esc_html__( 'Enabling this option will allow sharing via Facebook', 'calla' ),
'parent' => $panel_social_networks
)
);
$enable_facebook_share_container = calla_elated_add_admin_container(
array(
'name' => 'enable_facebook_share_container',
'parent' => $panel_social_networks,
'dependency' => array(
'show' => array(
'enable_facebook_share' => 'yes'
)
)
)
);
calla_elated_add_admin_field(
array(
'type' => 'image',
'name' => 'facebook_icon',
'default_value' => '',
'label' => esc_html__( 'Upload Icon', 'calla' ),
'parent' => $enable_facebook_share_container
)
);
/**
* Twitter
*/
calla_elated_add_admin_section_title(
array(
'parent' => $panel_social_networks,
'name' => 'twitter_title',
'title' => esc_html__( 'Share on Twitter', 'calla' )
)
);
calla_elated_add_admin_field(
array(
'type' => 'yesno',
'name' => 'enable_twitter_share',
'default_value' => 'no',
'label' => esc_html__( 'Enable Share', 'calla' ),
'description' => esc_html__( 'Enabling this option will allow sharing via Twitter', 'calla' ),
'parent' => $panel_social_networks
)
);
$enable_twitter_share_container = calla_elated_add_admin_container(
array(
'name' => 'enable_twitter_share_container',
'parent' => $panel_social_networks,
'dependency' => array(
'show' => array(
'enable_twitter_share' => 'yes'
)
)
)
);
calla_elated_add_admin_field(
array(
'type' => 'image',
'name' => 'twitter_icon',
'default_value' => '',
'label' => esc_html__( 'Upload Icon', 'calla' ),
'parent' => $enable_twitter_share_container
)
);
calla_elated_add_admin_field(
array(
'type' => 'text',
'name' => 'twitter_via',
'default_value' => '',
'label' => esc_html__( 'Via', 'calla' ),
'parent' => $enable_twitter_share_container
)
);
/**
* Linked In
*/
calla_elated_add_admin_section_title(
array(
'parent' => $panel_social_networks,
'name' => 'linkedin_title',
'title' => esc_html__( 'Share on LinkedIn', 'calla' )
)
);
calla_elated_add_admin_field(
array(
'type' => 'yesno',
'name' => 'enable_linkedin_share',
'default_value' => 'no',
'label' => esc_html__( 'Enable Share', 'calla' ),
'description' => esc_html__( 'Enabling this option will allow sharing via LinkedIn', 'calla' ),
'parent' => $panel_social_networks
)
);
$enable_linkedin_container = calla_elated_add_admin_container(
array(
'name' => 'enable_linkedin_container',
'parent' => $panel_social_networks,
'dependency' => array(
'show' => array(
'enable_linkedin_share' => 'yes'
)
)
)
);
calla_elated_add_admin_field(
array(
'type' => 'image',
'name' => 'linkedin_icon',
'default_value' => '',
'label' => esc_html__( 'Upload Icon', 'calla' ),
'parent' => $enable_linkedin_container
)
);
/**
* Tumblr
*/
calla_elated_add_admin_section_title(
array(
'parent' => $panel_social_networks,
'name' => 'tumblr_title',
'title' => esc_html__( 'Share on Tumblr', 'calla' )
)
);
calla_elated_add_admin_field(
array(
'type' => 'yesno',
'name' => 'enable_tumblr_share',
'default_value' => 'no',
'label' => esc_html__( 'Enable Share', 'calla' ),
'description' => esc_html__( 'Enabling this option will allow sharing via Tumblr', 'calla' ),
'parent' => $panel_social_networks
)
);
$enable_tumblr_container = calla_elated_add_admin_container(
array(
'name' => 'enable_tumblr_container',
'parent' => $panel_social_networks,
'dependency' => array(
'show' => array(
'enable_tumblr_share' => 'yes'
)
)
)
);
calla_elated_add_admin_field(
array(
'type' => 'image',
'name' => 'tumblr_icon',
'default_value' => '',
'label' => esc_html__( 'Upload Icon', 'calla' ),
'parent' => $enable_tumblr_container
)
);
/**
* Pinterest
*/
calla_elated_add_admin_section_title(
array(
'parent' => $panel_social_networks,
'name' => 'pinterest_title',
'title' => esc_html__( 'Share on Pinterest', 'calla' )
)
);
calla_elated_add_admin_field(
array(
'type' => 'yesno',
'name' => 'enable_pinterest_share',
'default_value' => 'no',
'label' => esc_html__( 'Enable Share', 'calla' ),
'description' => esc_html__( 'Enabling this option will allow sharing via Pinterest', 'calla' ),
'parent' => $panel_social_networks
)
);
$enable_pinterest_container = calla_elated_add_admin_container(
array(
'name' => 'enable_pinterest_container',
'parent' => $panel_social_networks,
'dependency' => array(
'show' => array(
'enable_pinterest_share' => 'yes'
)
)
)
);
calla_elated_add_admin_field(
array(
'type' => 'image',
'name' => 'pinterest_icon',
'default_value' => '',
'label' => esc_html__( 'Upload Icon', 'calla' ),
'parent' => $enable_pinterest_container
)
);
/**
* VK
*/
calla_elated_add_admin_section_title(
array(
'parent' => $panel_social_networks,
'name' => 'vk_title',
'title' => esc_html__( 'Share on VK', 'calla' )
)
);
calla_elated_add_admin_field(
array(
'type' => 'yesno',
'name' => 'enable_vk_share',
'default_value' => 'no',
'label' => esc_html__( 'Enable Share', 'calla' ),
'description' => esc_html__( 'Enabling this option will allow sharing via VK', 'calla' ),
'parent' => $panel_social_networks
)
);
$enable_vk_container = calla_elated_add_admin_container(
array(
'name' => 'enable_vk_container',
'parent' => $panel_social_networks,
'dependency' => array(
'show' => array(
'enable_vk_share' => 'yes'
)
)
)
);
calla_elated_add_admin_field(
array(
'type' => 'image',
'name' => 'vk_icon',
'default_value' => '',
'label' => esc_html__( 'Upload Icon', 'calla' ),
'parent' => $enable_vk_container
)
);
if ( defined( 'CALLA_TWITTER_FEED_VERSION' ) ) {
$twitter_panel = calla_elated_add_admin_panel(
array(
'title' => esc_html__( 'Twitter', 'calla' ),
'name' => 'panel_twitter',
'page' => '_social_page'
)
);
calla_elated_add_admin_twitter_button(
array(
'name' => 'twitter_button',
'parent' => $twitter_panel
)
);
}
if ( defined( 'CALLA_INSTAGRAM_FEED_VERSION' ) ) {
$instagram_panel = calla_elated_add_admin_panel(
array(
'title' => esc_html__( 'Instagram', 'calla' ),
'name' => 'panel_instagram',
'page' => '_social_page'
)
);
calla_elated_add_admin_instagram_button(
array(
'name' => 'instagram_button',
'parent' => $instagram_panel
)
);
}
/**
* Open Graph
*/
$panel_open_graph = calla_elated_add_admin_panel(
array(
'page' => '_social_page',
'name' => 'panel_open_graph',
'title' => esc_html__( 'Open Graph', 'calla' ),
)
);
calla_elated_add_admin_field(
array(
'type' => 'yesno',
'name' => 'enable_open_graph',
'default_value' => 'no',
'label' => esc_html__( 'Enable Open Graph', 'calla' ),
'description' => esc_html__( 'Enabling this option will allow usage of Open Graph protocol on your site', 'calla' ),
'parent' => $panel_open_graph
)
);
$enable_open_graph_container = calla_elated_add_admin_container(
array(
'name' => 'enable_open_graph_container',
'parent' => $panel_open_graph,
'dependency' => array(
'show' => array(
'enable_open_graph' => 'yes'
)
)
)
);
calla_elated_add_admin_field(
array(
'type' => 'image',
'name' => 'open_graph_image',
'default_value' => ELATED_ASSETS_ROOT . '/img/open_graph.jpg',
'label' => esc_html__( 'Default Share Image', 'calla' ),
'parent' => $enable_open_graph_container,
'description' => esc_html__( 'Used when featured image is not set. Make sure that image is at least 1200 x 630 pixels, up to 8MB in size', 'calla' ),
)
);
/**
* Action for embedding social share option for custom post types
*/
do_action('calla_elated_social_options', $page);
}
add_action( 'calla_elated_options_map', 'calla_elated_social_options_map', 18 );
}