function task_breaker_bp_projects_content()
{
    echo '<div id="task_breaker-intranet-projects">';
    $user_groups = task_breaker_get_displayed_user_groups();
    $current_user_groups = task_breaker_get_current_user_groups();
    $groups_collection = array();
    if (!empty($user_groups)) {
        foreach ($user_groups as $key => $group) {
            $groups_collection[] = $group['group_id'];
        }
    }
    // If there are no groups found assign negative value
    // so that WP_Query will return empty result
    if (empty($groups_collection)) {
        $groups_collection = array(-1);
    }
    $args = array('meta_query' => array(array('key' => 'task_breaker_project_group_id', 'value' => $groups_collection, 'compare' => 'IN')));
    task_breaker_project_loop($args);
    echo '</div>';
    return;
}
    /**
     * Displays the Projects under 'Projects' tab under group.
     * @param int $group_id The Group ID.
     * @return void
     */
    function display($group_id = null)
    {
        do_action('task_breaker_before_projects_archive');
        $group_id = bp_get_group_id();
        ?>

			<h3>
				<?php 
        esc_html_e('Projects', 'task_breaker');
        ?>
			</h3>

			<div id="task_breaker-intranet-projects">

				<?php 
        task_breaker_new_project_modal($group_id);
        ?>

				<?php 
        $args = array('meta_key' => 'task_breaker_project_group_id', 'meta_value' => absint($group_id));
        ?>

				<?php 
        task_breaker_project_loop($args);
        ?>

			</div>

		<?php 
        do_action('task_breaker_after_projects_archive');
        return;
    }
Example #3
0
?>

<div id="buddypress">

	<div id="task_breaker-intranet-projects">

		<?php 
if (bp_is_active('groups')) {
    ?>

			<?php 
    task_breaker_new_project_modal();
    ?>

			<?php 
    task_breaker_project_loop($config = array());
    ?>

		<?php 
} else {
    ?>

			<p id="message" class="info">
	        	<?php 
    _e('Please enable BuddyPress Groups Components to access the Projects.', 'task-breaker');
    ?>
	    	</p>

		<?php 
}
?>