<?php
/**
 * Active callback functions.
 *
 * @package Magazine Bell
 */

function magazine_bell_header_background_active( $control ) {
    if( $control->manager->get_setting( 'theme_options[disable_header_background_section]' )->value() == true ) {
        return true;
    }else{
        return false;
    }
}

function magazine_bell_ads_active( $control ) {
    if( $control->manager->get_setting( 'theme_options[disable_ads_section]' )->value() == true ) {
        return true;
    }else{
        return false;
    }
}
function magazine_bell_adssec_active( $control ) {
    if( $control->manager->get_setting( 'theme_options[disable_adssec_section]' )->value() == true ) {
        return true;
    }else{
        return false;
    }
}
function magazine_bell_pricing_active( $control ) {
    if( $control->manager->get_setting( 'theme_options[disable_pricing_section]' )->value() == true ) {
        return true;
    }else{
        return false;
    }
}
function magazine_bell_about_active( $control ) {
    if( $control->manager->get_setting( 'theme_options[disable_about_section]' )->value() == true ) {
        return true;
    }else{
        return false;
    }
}

function magazine_bell_about_custom( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[about_content_type]' )->value();
    return ( magazine_bell_about_active( $control ) && ( 'about_custom' == $content_type ) );
} 

function magazine_bell_about_page( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[about_content_type]' )->value();
    return ( magazine_bell_about_active( $control ) && ( 'about_page' == $content_type ) );
}

function magazine_bell_about_post( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[about_content_type]' )->value();
    return ( magazine_bell_about_active( $control ) && ( 'about_post' == $content_type ) );
}

function magazine_bell_about_category( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[about_content_type]' )->value();
    return ( magazine_bell_about_active( $control ) && ( 'about_category' == $content_type ) );
}


//========================Slider Section=====================//

function magazine_bell_slider_active( $control ) {
    if( $control->manager->get_setting( 'theme_options[disable_featured-slider_section]' )->value() == true ) {
        return true;
    }else{
        return false;
    }
}

function magazine_bell_slider_page( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[sr_content_type]' )->value();
    return ( magazine_bell_slider_active( $control ) && ( 'sr_page' == $content_type ) );
}

function magazine_bell_slider_post( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[sr_content_type]' )->value();
    return ( magazine_bell_slider_active( $control ) && ( 'sr_post' == $content_type ) );
}

function magazine_bell_slider_seperator( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[sr_content_type]' )->value();
    return  magazine_bell_slider_seperator( $control ) && ( in_array( $content_type, array( 'sr_page', 'sr_post', 'sr_custom' ) ) ) ;
}

function magazine_bell_slider_custom( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[sr_content_type]' )->value();
    return ( magazine_bell_slider_active( $control ) && ( 'sr_custom' == $content_type ) );
}

function magazine_bell_slider_category( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[sr_content_type]' )->value();
    return ( magazine_bell_slider_active( $control ) && ( 'sr_category' == $content_type ) );
}


//========================Trending Section=====================//
function magazine_bell_trending_active( $control ) {
    if( $control->manager->get_setting( 'theme_options[disable_trending_section]' )->value() == true ) {
        return true;
    }else{
        return false;
    }
}

function magazine_bell_trending_custom( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[trending_content_type]' )->value();
    return ( magazine_bell_trending_active( $control ) && ( 'trending_custom' == $content_type ) );
} 

function magazine_bell_trending_page( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[trending_content_type]' )->value();
    return ( magazine_bell_trending_active( $control ) && ( 'trending_page' == $content_type ) );
}

function magazine_bell_trending_post( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[trending_content_type]' )->value();
    return ( magazine_bell_trending_active( $control ) && ( 'trending_post' == $content_type ) );
}

function magazine_bell_trending_category( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[trending_content_type]' )->value();
    return ( magazine_bell_trending_active( $control ) && ( 'trending_category' == $content_type ) );
}
//===================End Trending Section==============//

//========================Subscription Section=====================//
function magazine_bell_subscription_active( $control ) {
    if( $control->manager->get_setting( 'theme_options[disable_subscription_section]' )->value() == true ) {
        return true;
    }else{
        return false;
    }
}

//========================Hero Section=====================//
function magazine_bell_hero_active( $control ) {
    if( $control->manager->get_setting( 'theme_options[disable_hero_section]' )->value() == true ) {
        return true;
    }else{
        return false;
    }
}

function magazine_bell_hero_custom( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[hero_content_type]' )->value();
    return ( magazine_bell_hero_active( $control ) && ( 'hero_custom' == $content_type ) );
} 

function magazine_bell_hero_page( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[hero_content_type]' )->value();
    return ( magazine_bell_hero_active( $control ) && ( 'hero_page' == $content_type ) );
}

function magazine_bell_hero_post( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[hero_content_type]' )->value();
    return ( magazine_bell_hero_active( $control ) && ( 'hero_post' == $content_type ) );
}

function magazine_bell_hero_category( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[hero_content_type]' )->value();
    return ( magazine_bell_hero_active( $control ) && ( 'hero_category' == $content_type ) );
} 

function magazine_bell_hero_right_page( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[hero_right_content_type]' )->value();
    return ( magazine_bell_hero_active( $control ) && ( 'hero_right_page' == $content_type ) );
}

function magazine_bell_hero_right_post( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[hero_right_content_type]' )->value();
    return ( magazine_bell_hero_active( $control ) && ( 'hero_right_post' == $content_type ) );
}

function magazine_bell_hero_right_category( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[hero_right_content_type]' )->value();
    return ( magazine_bell_hero_active( $control ) && ( 'hero_right_category' == $content_type ) );
}
//===================End Hero Section==============//

//========================Headlines Section=====================//
function magazine_bell_headlines_active( $control ) {
    if( $control->manager->get_setting( 'theme_options[disable_headlines_section]' )->value() == true ) {
        return true;
    }else{
        return false;
    }
}
function magazine_bell_headlines_page( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[headlines_content_type]' )->value();
    return ( magazine_bell_headlines_active( $control ) && ( 'headlines_page' == $content_type ) );
}

function magazine_bell_headlines_post( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[headlines_content_type]' )->value();
    return ( magazine_bell_headlines_active( $control ) && ( 'headlines_post' == $content_type ) );
}

function magazine_bell_headlines_category( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[headlines_content_type]' )->value();
    return ( magazine_bell_headlines_active( $control ) && ( 'headlines_category' == $content_type ) );
}
//===================End Headlines Section==============//

//========================CategryNews Section=====================//
function magazine_bell_categorynews_active( $control ) {
    if( $control->manager->get_setting( 'theme_options[disable_categorynews_section]' )->value() == true ) {
        return true;
    }else{
        return false;
    }
}

//========================Features Section=====================//

function magazine_bell_features_active( $control ) {
    if( $control->manager->get_setting( 'theme_options[disable_features_section]' )->value() == true ) {
        return true;
    }else{
        return false;
    }
}

function magazine_bell_features_custom( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[features_content_type]' )->value();
    return ( magazine_bell_features_active( $control ) && ( 'features_custom' == $content_type ) );
} 

function magazine_bell_features_page( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[features_content_type]' )->value();
    return ( magazine_bell_features_active( $control ) && ( 'features_page' == $content_type ) );
}

function magazine_bell_features_post( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[features_content_type]' )->value();
    return ( magazine_bell_features_active( $control ) && ( 'features_post' == $content_type ) );
}

function magazine_bell_features_category( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[features_content_type]' )->value();
    return ( magazine_bell_features_active( $control ) && ( 'features_category' == $content_type ) );
}

//========================Must Read Section=====================//


function magazine_bell_mustread_active( $control ) {
    if( $control->manager->get_setting( 'theme_options[disable_mustread_section]' )->value() == true ) {
        return true;
    }else{
        return false;
    }
}

function magazine_bell_mustread_page( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[mustread_content_type]' )->value();
    return ( magazine_bell_mustread_active( $control ) && ( 'mustread_page' == $content_type ) );
}

function magazine_bell_mustread_post( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[mustread_content_type]' )->value();
    return ( magazine_bell_mustread_active( $control ) && ( 'mustread_post' == $content_type ) );
}

function magazine_bell_mustread_category( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[mustread_content_type]' )->value();
    return ( magazine_bell_mustread_active( $control ) && ( 'mustread_category' == $content_type ) );
}


//========================Popular Section=====================//


function magazine_bell_popular_active( $control ) {
    if( $control->manager->get_setting( 'theme_options[disable_popular_section]' )->value() == true ) {
        return true;
    }else{
        return false;
    }
}

function magazine_bell_popular_page( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[popular_content_type]' )->value();
    return ( magazine_bell_popular_active( $control ) && ( 'popular_page' == $content_type ) );
}

function magazine_bell_popular_post( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[popular_content_type]' )->value();
    return ( magazine_bell_popular_active( $control ) && ( 'popular_post' == $content_type ) );
}

function magazine_bell_popular_category( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[popular_content_type]' )->value();
    return ( magazine_bell_popular_active( $control ) && ( 'popular_category' == $content_type ) );
}

//========================Recent Section=====================//


function magazine_bell_recent_active( $control ) {
    if( $control->manager->get_setting( 'theme_options[disable_recent_section]' )->value() == true ) {
        return true;
    }else{
        return false;
    }
}

function magazine_bell_recent_page( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[recent_content_type]' )->value();
    return ( magazine_bell_recent_active( $control ) && ( 'recent_page' == $content_type ) );
}

function magazine_bell_recent_post( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[recent_content_type]' )->value();
    return ( magazine_bell_recent_active( $control ) && ( 'recent_post' == $content_type ) );
}

function magazine_bell_recent_category( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[recent_content_type]' )->value();
    return ( magazine_bell_recent_active( $control ) && ( 'recent_category' == $content_type ) );
}

//========================Flash Section=====================//


function magazine_bell_flash_active( $control ) {
    if( $control->manager->get_setting( 'theme_options[disable_flash_section]' )->value() == true ) {
        return true;
    }else{
        return false;
    }
}

function magazine_bell_flash_page( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[flash_content_type]' )->value();
    return ( magazine_bell_flash_active( $control ) && ( 'flash_page' == $content_type ) );
}

function magazine_bell_flash_post( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[flash_content_type]' )->value();
    return ( magazine_bell_flash_active( $control ) && ( 'flash_post' == $content_type ) );
}

function magazine_bell_flash_category( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[flash_content_type]' )->value();
    return ( magazine_bell_flash_active( $control ) && ( 'flash_category' == $content_type ) );
}

//========================Highlights Section=====================//


function magazine_bell_highlights_active( $control ) {
    if( $control->manager->get_setting( 'theme_options[disable_highlights_section]' )->value() == true ) {
        return true;
    }else{
        return false;
    }
}

function magazine_bell_highlights_page( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[highlights_content_type]' )->value();
    return ( magazine_bell_highlights_active( $control ) && ( 'highlights_page' == $content_type ) );
}

function magazine_bell_highlights_post( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[highlights_content_type]' )->value();
    return ( magazine_bell_highlights_active( $control ) && ( 'highlights_post' == $content_type ) );
}

function magazine_bell_highlights_category( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[highlights_content_type]' )->value();
    return ( magazine_bell_highlights_active( $control ) && ( 'highlights_category' == $content_type ) );
}

//========================Featuredpost Section=====================//
function magazine_bell_featuredpost_active( $control ) {
    if( $control->manager->get_setting( 'theme_options[disable_featuredpost_section]' )->value() == true ) {
        return true;
    }else{
        return false;
    }
}
function magazine_bell_featuredpost_page( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[featuredpost_content_type]' )->value();
    return ( magazine_bell_featuredpost_active( $control ) && ( 'featuredpost_page' == $content_type ) );
}

function magazine_bell_featuredpost_post( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[featuredpost_content_type]' )->value();
    return ( magazine_bell_featuredpost_active( $control ) && ( 'featuredpost_post' == $content_type ) );
}

function magazine_bell_featuredpost_category( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[featuredpost_content_type]' )->value();
    return ( magazine_bell_featuredpost_active( $control ) && ( 'featuredpost_category' == $content_type ) );
}

//========================Blog Section=====================//

function magazine_bell_blog_active( $control ) {
    if( $control->manager->get_setting( 'theme_options[disable_blog_section]' )->value() == true ) {
        return true;
    }else{
        return false;
    }
}

function magazine_bell_blog_page( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[blog_content_type]' )->value();
    return ( magazine_bell_blog_active( $control ) && ( 'blog_page' == $content_type ) );
}

function magazine_bell_blog_post( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[blog_content_type]' )->value();
    return ( magazine_bell_blog_active( $control ) && ( 'blog_post' == $content_type ) );
}

function magazine_bell_blog_category( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[blog_content_type]' )->value();
    return ( magazine_bell_blog_active( $control ) && ( 'blog_category' == $content_type ) );
}

//========================Layout=====================//

function topbar_contact_info_option( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[topbar_layout_option]' )->value();
    return ( ( 'contact-info-option' == $content_type ) );
}
function topbar_current_date_option( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[topbar_layout_option]' )->value();
    return ( ( 'current-date-option' == $content_type ) );
}
function magazine_bell_header_three( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[header_layout_options]' )->value();
    return ( ( 'header-three' == $content_type ) );
}
function magazine_bell_header_five( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[header_layout_options]' )->value();
    return ( ( 'header-five' == $content_type ) );
}
function magazine_bell_header_nine( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[header_layout_options]' )->value();
    return ( ( 'header-nine' == $content_type ) );
}
function magazine_bell_kids_menu( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[header_layout_options]' )->value();
    return ( ( 'kids-menu' == $content_type ) );
}
function magazine_bell_medical_layout( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[homepage_design_layout_options]' )->value();
    return ( ( 'home-medical' == $content_type ) );
}
function magazine_bell_education_layout( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[homepage_design_layout_options]' )->value();
    return ( ( 'home-education' == $content_type ) );
}

function magazine_bell_header_background_image( $control ) {
    $home_layout = $control->manager->get_setting( 'theme_options[header_layout_options]' )->value();
    return in_array($home_layout,array('header-two','header-three'));
}


function magazine_bell_slider_design_enable( $control ) {
    $home_layout = $control->manager->get_setting( 'theme_options[homepage_design_layout_options]' )->value();
    return in_array($home_layout,array('home-blog','home-normal-blog','home-classic-blog','home-normal-magazine','home-business', 'home-corporate','home-nature', 'home-medical','home-education','home-fitness'));
}

function magazine_bell_services_design_enable( $control ) {
    $home_layout = $control->manager->get_setting( 'theme_options[homepage_design_layout_options]' )->value();
    return in_array($home_layout,array('home-business', 'home-corporate', 'home-medical','home-education','home-fitness'));
}

function magazine_bell_information_design_enable( $control ) {
    $home_layout = $control->manager->get_setting( 'theme_options[homepage_design_layout_options]' )->value();
    return in_array($home_layout,array('home-business', 'home-corporate', 'home-medical','home-education','home-fitness'));
}

function magazine_bell_team_design_enable( $control ) {
    $home_layout = $control->manager->get_setting( 'theme_options[homepage_design_layout_options]' )->value();
    return in_array($home_layout,array('home-business', 'home-corporate', 'home-medical','home-education','home-fitness'));
}

function magazine_bell_testimonial_design_enable( $control ) {
    $home_layout = $control->manager->get_setting( 'theme_options[homepage_design_layout_options]' )->value();
    return in_array($home_layout,array('home-business', 'home-corporate', 'home-medical','home-education','home-fitness'));
}

function magazine_bell_pricing_design_enable( $control ) {
    $home_layout = $control->manager->get_setting( 'theme_options[homepage_design_layout_options]' )->value();
    return in_array($home_layout,array('home-business', 'home-corporate', 'home-medical','home-education','home-fitness'));
}

function magazine_bell_cta_design_enable( $control ) {
    $home_layout = $control->manager->get_setting( 'theme_options[homepage_design_layout_options]' )->value();
    return in_array($home_layout,array('home-business', 'home-corporate', 'home-medical','home-education','home-fitness'));
}

function magazine_bell_client_design_enable( $control ) {
    $home_layout = $control->manager->get_setting( 'theme_options[homepage_design_layout_options]' )->value();
    return in_array($home_layout,array('home-business', 'home-corporate', 'home-medical','home-education','home-fitness'));
}


function magazine_bell_mustread_design_enable( $control ) {
    $home_layout = $control->manager->get_setting( 'theme_options[homepage_design_layout_options]' )->value();
    return in_array($home_layout,array('home-magazine','home-blog','home-normal-magazine','home-normal-blog', 'home-business', 'home-corporate', 'home-medical','home-education','home-fitness','home-minimal-blog','home-classic-blog'));
}
function magazine_bell_project_design_enable( $control ) {
    $home_layout = $control->manager->get_setting( 'theme_options[homepage_design_layout_options]' )->value();
    return in_array($home_layout,array('home-education','home-corporate'));
}

function magazine_bell_admissionprocess_design_enable( $control ) {
    $home_layout = $control->manager->get_setting( 'theme_options[homepage_design_layout_options]' )->value();
    return in_array($home_layout,array('home-education','home-blog','home-normal-magazine','home-normal-blog'));
}

function magazine_bell_message_design_enable( $control ) {
    $home_layout = $control->manager->get_setting( 'theme_options[homepage_design_layout_options]' )->value();
    return in_array($home_layout,array('home-normal-blog','home-business', 'home-corporate', 'home-medical','home-education','home-fitness','home-minimal-blog','home-classic-blog')); 
}

function magazine_bell_topbar_current_date_design_enable( $control ) {
    $home_layout = $control->manager->get_setting( 'theme_options[homepage_design_layout_options]' )->value();
    return in_array($home_layout,array('home-normal-magazine','home-magazine', 'home-corporate','home-education','home-fitness'));
}

function magazine_bell_topbar_contact_info_design_enable( $control ) {
    $home_layout = $control->manager->get_setting( 'theme_options[homepage_design_layout_options]' )->value();
    return in_array($home_layout,array('home-blog','home-normal-blog', 'home-business', 'home-corporate'));
}
function magazine_bell_home_magazine_enable( $control ) {
    $home_layout = $control->manager->get_setting( 'theme_options[homepage_design_layout_options]' )->value();
    return in_array($home_layout,array('home-magazine'));
}
function magazine_bell_gallery_design_enable( $control ) {
    $home_layout = $control->manager->get_setting( 'theme_options[homepage_design_layout_options]' )->value();
    return in_array($home_layout,array('home-corporate'));
}
function magazine_bell_gallerypost_design_enable( $control ) {
    $home_layout = $control->manager->get_setting( 'theme_options[homepage_design_layout_options]' )->value();
    return in_array($home_layout,array('home-education','home-classic-blog'));
}
function magazine_bell_event_design_enable( $control ) {
    $home_layout = $control->manager->get_setting( 'theme_options[homepage_design_layout_options]' )->value();
    return in_array($home_layout,array('home-education','home-fitness'));
}
function magazine_bell_counter_design_enable( $control ) {
    $home_layout = $control->manager->get_setting( 'theme_options[homepage_design_layout_options]' )->value();
    return in_array($home_layout,array('home-education','home-fitness'));
}
function magazine_bell_fitnesscat_design_enable( $control ) {
    $home_layout = $control->manager->get_setting( 'theme_options[homepage_design_layout_options]' )->value();
    return in_array($home_layout,array('home-fitness','home-minimal-blog','home-classic-blog'));
}
function magazine_bell_shopproduct_design_enable( $control ) {
    $home_layout = $control->manager->get_setting( 'theme_options[homepage_design_layout_options]' )->value();
    return in_array($home_layout,array('home-fitness','home-education'));
}

function magazine_bell_blog_four_design_enable( $control ) {
    $blog_layout = $control->manager->get_setting( 'theme_options[blog_layout_content_type]' )->value();
    return in_array($blog_layout,array('blog-four'));
}

/**
 * Active Callback for top bar section
 */
function magazine_bell_contact_info_ac( $control ) {

    $show_contact_info = $control->manager->get_setting( 'theme_options[show_header_contact_info]')->value();
    $control_id        = $control->id;
         
    if ( $control_id == 'theme_options[header_location]' && $show_contact_info ) return true;
    if ( $control_id == 'theme_options[header_email]' && $show_contact_info ) return true;
    if ( $control_id == 'theme_options[header_phone]' && $show_contact_info ) return true;

    return false;
}

function magazine_bell_social_links_active( $control ) {
    if( $control->manager->get_setting( 'theme_options[show_header_social_links]' )->value() == true ) {
        return true;
    }else{
        return false;
    }
}

