/**
 * BuddyPress - Group Header
 *
 * @package BuddyPress
 * @subpackage Boss
 */
?>

<?php 
do_action('bp_before_group_header');
?>

<?php 
//output cover photo.
if (boss_get_option('boss_layout_style') != 'boxed' && boss_get_option('boss_cover_group')) {
    echo buddyboss_cover_photo("group", bp_get_group_id());
}
?>

<div id="item-header-cover" class="table">

	<div class="table-cell">
        <span class="bp-group-hierarchy-breadcrumbs"><?php 
bp_group_hierarchy_breadcrumbs();
?>
</span>
		<div id="group-name">
			<h1 class="main-title"><?php 
$group_name = bp_get_group_name();
if (!empty($group_name)) {
    //Get truncated string with long width group title
if (bp_is_group()) {
    //single group
    $class[] = "group-single";
}
$class = implode(" ", $class);
?>

<?php 
if (bp_is_group() && !bp_is_current_action('create')) {
    // Boxed layout cover
    if (boss_get_option('boss_layout_style') == 'boxed') {
        $id = bp_get_current_group_id();
        if ($id != 0 && $id != false) {
            echo buddyboss_cover_photo("group", $id);
        }
    }
    do_action('boss_get_group_template');
    //get_template_part( 'buddypress', 'group-single' );
} else {
    if (is_post_type_archive('bp_doc') || is_single() && get_post_type() == 'bp_doc') {
        $id = boss_get_docs_group_id();
        if ($id != 0 && $id != false) {
            echo buddyboss_cover_photo("group", $id);
        }
    }
    get_template_part('buddypress', 'sidewide');
}
?>

<?php 
get_footer();
if (function_exists('bp_docs_is_doc_edit')) {
    //fix boss code with rw_bp_doc_single_group_id()
    $is_group_single_doc = (bp_docs_is_doc_edit() || bp_docs_is_doc_read() || bp_docs_is_doc_create() || bp_docs_is_doc_history()) && rw_bp_doc_single_group_id(false);
}
if ($is_group_single_doc) {
    $class .= ' group-single';
}
?>

<?php 
// Boxed layout cover
if (boss_get_option('boss_cover_profile')) {
    if (boss_get_option('boss_layout_style') == 'boxed' && (!bp_is_current_component('events') || bp_is_current_component('events') && 'profile' == bp_current_action())) {
        // show here for boxed and if not Events Manager page or if it is My Profile of Events
        if (bp_is_user()) {
            echo buddyboss_cover_photo("user", bp_displayed_user_id());
        }
    }
}
?>

<?php 
if (bp_is_current_component('groups') && !bp_is_group() && !bp_is_user()) {
    ?>
<div class="dir-page-entry">
    <div class="inner-padding">
        <header class="group-header page-header">
            <div id="item-statistics" class="follows">
                <h1 class="main-title"><?php 
    buddyboss_page_title();
    ?>