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

// Theme Options.
function construktly_is_pagination_enabled( $control ) {
	return ( $control->manager->get_setting( 'construktly_enable_pagination' )->value() );
}
function construktly_is_breadcrumb_enabled( $control ) {
	return ( $control->manager->get_setting( 'construktly_enable_breadcrumb' )->value() );
}

function construktly_is_topbar_enabled( $control ) {
	return ( $control->manager->get_Setting( 'construktly_enable_topbar_section' )->value() );
}

// Banner section.
function construktly_is_banner_section_enabled( $control ) {
	return ( $control->manager->get_setting( 'construktly_enable_banner_section' )->value() );
}
function construktly_is_banner_section_and_content_type_post_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'construktly_banner_content' )->value();
	return ( construktly_is_banner_section_enabled( $control ) && ( 'post' === $content_type ) );
}
function construktly_is_banner_section_and_content_type_page_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'construktly_banner_content' )->value();
	return ( construktly_is_banner_section_enabled( $control ) && ( 'page' === $content_type ) );
}

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

// Service section.
function construktly_is_service_section_enabled( $control ) {
	return ( $control->manager->get_setting( 'construktly_enable_service_section' )->value() );
}
function construktly_is_service_section_and_content_type_post_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'construktly_service_content_type' )->value();
	return ( construktly_is_service_section_enabled( $control ) && ( 'post' === $content_type ) );
}
function construktly_is_service_section_and_content_type_page_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'construktly_service_content_type' )->value();
	return ( construktly_is_service_section_enabled( $control ) && ( 'page' === $content_type ) );
}

// About section.
function construktly_is_about_section_enabled( $control ) {
	return ( $control->manager->get_setting( 'construktly_enable_about_section' )->value() );
}
function construktly_is_about_section_and_content_type_post_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'construktly_about_content_type' )->value();
	return ( construktly_is_about_section_enabled( $control ) && ( 'post' === $content_type ) );
}
function construktly_is_about_section_and_content_type_page_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'construktly_about_content_type' )->value();
	return ( construktly_is_about_section_enabled( $control ) && ( 'page' === $content_type ) );
}

// Associate section.
function construktly_is_associate_section_enabled( $control ) {
	return ( $control->manager->get_setting( 'construktly_enable_associate_section' )->value() );
}

// Projects section.
function construktly_is_projects_section_enabled( $control ) {
	return ( $control->manager->get_setting( 'construktly_enable_projects_section' )->value() );
}
function construktly_is_projects_section_and_content_type_post_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'construktly_projects_content_type' )->value();
	return ( construktly_is_projects_section_enabled( $control ) && ( 'post' === $content_type ) );
}
function construktly_is_projects_section_and_content_type_page_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'construktly_projects_content_type' )->value();
	return ( construktly_is_projects_section_enabled( $control ) && ( 'page' === $content_type ) );
}

// Testimonial section.
function construktly_is_testimonial_section_enabled( $control ) {
	return ( $control->manager->get_setting( 'construktly_enable_testimonial_section' )->value() );
}
function construktly_is_testimonial_section_and_content_type_post_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'construktly_testimonial_content_type' )->value();
	return ( construktly_is_testimonial_section_enabled( $control ) && ( 'post' === $content_type ) );
}
function construktly_is_testimonial_section_and_content_type_page_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'construktly_testimonial_content_type' )->value();
	return ( construktly_is_testimonial_section_enabled( $control ) && ( 'page' === $content_type ) );
}

// Blog section.
function construktly_is_blog_section_enabled( $control ) {
	return ( $control->manager->get_setting( 'construktly_enable_blog_section' )->value() );
}
function construktly_is_blog_section_and_content_type_post_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'construktly_blog_content_type' )->value();
	return ( construktly_is_blog_section_enabled( $control ) && ( 'post' === $content_type ) );
}
function construktly_is_blog_section_and_content_type_page_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'construktly_blog_content_type' )->value();
	return ( construktly_is_blog_section_enabled( $control ) && ( 'page' === $content_type ) );
}
function construktly_is_blog_section_and_content_type_category_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'construktly_blog_content_type' )->value();
	return ( construktly_is_blog_section_enabled( $control ) && ( 'category' === $content_type ) );
}

// Contact section.
function construktly_is_contact_section_enabled( $control ) {
	return ( $control->manager->get_setting( 'construktly_enable_contact_section' )->value() );
}

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