<?php
/**
 * Active Callbacks
 *
 * @package Corporaze
 */

// Theme Options.
function corporaze_is_pagination_enabled( $control ) {
	return ( $control->manager->get_setting( 'corporaze_enable_pagination' )->value() );
}
function corporaze_is_breadcrumb_enabled( $control ) {
	return ( $control->manager->get_setting( 'corporaze_enable_breadcrumb' )->value() );
}

function corporaze_is_topbar_enabled( $control ) {
	return ( $control->manager->get_Setting( 'corporaze_enable_topbar_section' )->value() );
}

// Banner section.
function corporaze_is_banner_section_enabled( $control ) {
	return ( $control->manager->get_setting( 'corporaze_enable_banner_section' )->value() );
}
function corporaze_is_banner_section_and_content_type_post_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'corporaze_banner_content' )->value();
	return ( corporaze_is_banner_section_enabled( $control ) && ( 'post' === $content_type ) );
}
function corporaze_is_banner_section_and_content_type_page_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'corporaze_banner_content' )->value();
	return ( corporaze_is_banner_section_enabled( $control ) && ( 'page' === $content_type ) );
}

// Counter section.
function corporaze_is_counter_section_enabled( $control ) {
	return ( $control->manager->get_setting( 'corporaze_enable_counter_section' )->value() );
}

// Service section.
function corporaze_is_service_section_enabled( $control ) {
	return ( $control->manager->get_setting( 'corporaze_enable_service_section' )->value() );
}
function corporaze_is_service_section_and_content_type_post_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'corporaze_service_content_type' )->value();
	return ( corporaze_is_service_section_enabled( $control ) && ( 'post' === $content_type ) );
}
function corporaze_is_service_section_and_content_type_page_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'corporaze_service_content_type' )->value();
	return ( corporaze_is_service_section_enabled( $control ) && ( 'page' === $content_type ) );
}

// About section.
function corporaze_is_about_section_enabled( $control ) {
	return ( $control->manager->get_setting( 'corporaze_enable_about_section' )->value() );
}
function corporaze_is_about_section_and_content_type_post_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'corporaze_about_content_type' )->value();
	return ( corporaze_is_about_section_enabled( $control ) && ( 'post' === $content_type ) );
}
function corporaze_is_about_section_and_content_type_page_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'corporaze_about_content_type' )->value();
	return ( corporaze_is_about_section_enabled( $control ) && ( 'page' === $content_type ) );
}

// Team section.
function corporaze_is_team_section_enabled( $control ) {
	return ( $control->manager->get_setting( 'corporaze_enable_team_section' )->value() );
}
function corporaze_is_team_section_and_content_type_post_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'corporaze_team_content_type' )->value();
	return ( corporaze_is_team_section_enabled( $control ) && ( 'post' === $content_type ) );
}
function corporaze_is_team_section_and_content_type_page_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'corporaze_team_content_type' )->value();
	return ( corporaze_is_team_section_enabled( $control ) && ( 'page' === $content_type ) );
}

// Mission section.
function corporaze_is_mission_section_enabled( $control ) {
	return ( $control->manager->get_setting( 'corporaze_enable_mission_section' )->value() );
}
function corporaze_is_mission_section_and_content_type_post_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'corporaze_mission_content_type' )->value();
	return ( corporaze_is_mission_section_enabled( $control ) && ( 'post' === $content_type ) );
}
function corporaze_is_mission_section_and_content_type_page_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'corporaze_mission_content_type' )->value();
	return ( corporaze_is_mission_section_enabled( $control ) && ( 'page' === $content_type ) );
}

// Blog section.
function corporaze_is_blog_section_enabled( $control ) {
	return ( $control->manager->get_setting( 'corporaze_enable_blog_section' )->value() );
}
function corporaze_is_blog_section_and_content_type_post_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'corporaze_blog_content_type' )->value();
	return ( corporaze_is_blog_section_enabled( $control ) && ( 'post' === $content_type ) );
}
function corporaze_is_blog_section_and_content_type_page_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'corporaze_blog_content_type' )->value();
	return ( corporaze_is_blog_section_enabled( $control ) && ( 'page' === $content_type ) );
}
function corporaze_is_blog_section_and_content_type_category_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'corporaze_blog_content_type' )->value();
	return ( corporaze_is_blog_section_enabled( $control ) && ( 'category' === $content_type ) );
}

// CTA section.
function corporaze_is_cta_section_enabled( $control ) {
	return ( $control->manager->get_setting( 'corporaze_enable_cta_section' )->value() );
}

// Check if static home page is enabled.
function corporaze_is_static_homepage_enabled( $control ) {
	return ( 'page' === $control->manager->get_setting( 'show_on_front' )->value() );
}
