<?php
/**
 * Active callback functions.
 *
 * @package DarkMag
 */

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

function darkmag_breaking_news_post( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[breaking_news_content_type]' )->value();
    return ( darkmag_breaking_news_active( $control ) && ( 'breaking_news_post' == $content_type ) );
}

function darkmag_breaking_news_category( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[breaking_news_content_type]' )->value();
    return ( darkmag_breaking_news_active( $control ) && ( 'breaking_news_category' == $content_type ) );
}

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

function darkmag_highlighted_posts_post( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[highlighted_posts_content_type]' )->value();
    return ( darkmag_highlighted_posts_active( $control ) && ( 'highlighted_posts_post' == $content_type ) );
}

function darkmag_highlighted_posts_category( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[highlighted_posts_content_type]' )->value();
    return ( darkmag_highlighted_posts_active( $control ) && ( 'highlighted_posts_category' == $content_type ) );
}

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

function darkmag_featured_posts_post( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[featured_posts_content_type]' )->value();
    return ( darkmag_featured_posts_active( $control ) && ( 'featured_posts_post' == $content_type ) );
}

function darkmag_featured_posts_category( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[featured_posts_content_type]' )->value();
    return ( darkmag_featured_posts_active( $control ) && ( 'featured_posts_category' == $content_type ) );
}

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

function darkmag_recent_posts_post( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[recent_posts_content_type]' )->value();
    return ( darkmag_recent_posts_active( $control ) && ( 'recent_posts_post' == $content_type ) );
}

function darkmag_recent_posts_category( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[recent_posts_content_type]' )->value();
    return ( darkmag_recent_posts_active( $control ) && ( 'recent_posts_category' == $content_type ) );
}

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

function darkmag_popular_posts_post( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[popular_posts_content_type]' )->value();
    return ( darkmag_popular_posts_active( $control ) && ( 'popular_posts_post' == $content_type ) );
}

function darkmag_popular_posts_category( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[popular_posts_content_type]' )->value();
    return ( darkmag_popular_posts_active( $control ) && ( 'popular_posts_category' == $content_type ) );
}

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

function darkmag_trending_posts_post( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[trending_posts_content_type]' )->value();
    return ( darkmag_trending_posts_active( $control ) && ( 'trending_posts_post' == $content_type ) );
}

function darkmag_trending_posts_category( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[trending_posts_content_type]' )->value();
    return ( darkmag_trending_posts_active( $control ) && ( 'trending_posts_category' == $content_type ) );
}

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

function darkmag_most_viewed_posts_post( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[most_viewed_posts_content_type]' )->value();
    return ( darkmag_most_viewed_posts_active( $control ) && ( 'most_viewed_posts_post' == $content_type ) );
}

function darkmag_most_viewed_posts_category( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[most_viewed_posts_content_type]' )->value();
    return ( darkmag_most_viewed_posts_active( $control ) && ( 'most_viewed_posts_category' == $content_type ) );
}

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

function darkmag_recommended_posts_post( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[recommended_posts_content_type]' )->value();
    return ( darkmag_recommended_posts_active( $control ) && ( 'recommended_posts_post' == $content_type ) );
}

function darkmag_recommended_posts_category( $control ) {
    $content_type = $control->manager->get_setting( 'theme_options[recommended_posts_content_type]' )->value();
    return ( darkmag_recommended_posts_active( $control ) && ( 'recommended_posts_category' == $content_type ) );
}

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