示例#1
0
/**
 * @param int $gid 
 * @param string $courseId 
 * @param boolean $active if set to true, only actvated tool will be considered for display
 */
function get_group_tool_menu($gid = null, $courseId = null, $active = true)
{
    $toolList = array();
    if (is_null($gid)) {
        $gid = claro_get_current_group_id();
    }
    if (is_null($courseId)) {
        $courseId = claro_get_current_course_id();
    }
    require_once dirname(__FILE__) . '/../group.lib.inc.php';
    $groupToolList = get_group_tool_list($courseId, $active);
    // group space links
    /* $toolList[] =
       claro_html_cmd_link(
           claro_htmlspecialchars(Url::Contextualize( get_module_url('CLGRP').'/group_space.php' ))
           , '<img src="' . get_icon_url('group') . '" alt="" />&nbsp;'
           . get_lang('Group area')
       ); */
    $courseGroupData = claro_get_main_group_properties($courseId);
    foreach ($groupToolList as $groupTool) {
        if (is_tool_activated_in_groups($courseId, $groupTool['label']) && (isset($courseGroupData['tools'][$groupTool['label']]) && $courseGroupData['tools'][$groupTool['label']])) {
            $toolList[] = claro_html_cmd_link(claro_htmlspecialchars(Url::Contextualize(get_module_url($groupTool['label']) . '/' . $groupTool['url'])), '<img src="' . get_module_url($groupTool['label']) . '/' . $groupTool['icon'] . '" alt="" />' . '&nbsp;' . claro_get_tool_name($groupTool['label']), array('class' => $groupTool['visibility'] ? 'visible' : 'invisible'));
        }
    }
    if (count($toolList)) {
        return claro_html_menu_horizontal($toolList);
    } else {
        return '';
    }
}
示例#2
0
 * GROUP INFORMATIONS RETRIVIAL
 ********************************/
/*----------------------------------------------------------------------------
GET GROUP MEMBER LIST
----------------------------------------------------------------------------*/
$groupMemberList = get_group_user_list(claro_get_current_group_id(), claro_get_current_course_id());
/*----------------------------------------------------------------------------
GET TUTOR(S) DATA
----------------------------------------------------------------------------*/
$sql = "SELECT user_id AS id, nom AS lastName, prenom AS firstName, email\n        FROM `" . $tbl_user . "` user\n        WHERE user.user_id='" . claro_get_current_group_data('tutorId') . "'";
$tutorDataList = claro_sql_query_fetch_all($sql);
/*----------------------------------------------------------------------------
GET FORUM POINTER
----------------------------------------------------------------------------*/
$forumId = claro_get_current_group_data('forumId');
$toolList = get_group_tool_list();
if (claro_is_in_a_course()) {
    $date = $claro_notifier->get_notification_date(claro_get_current_user_id());
    $modified_tools = $claro_notifier->get_notified_tools(claro_get_current_course_id(), $date, claro_get_current_user_id(), claro_get_current_group_id());
} else {
    $modified_tools = array();
}
$toolLinkList = array();
foreach ($toolList as $thisTool) {
    if (!array_key_exists($thisTool['label'], $_groupProperties['tools'])) {
        continue;
    }
    // special case when display mode is student and tool invisible doesn't display it
    if (!claro_is_allowed_to_edit()) {
        if (!$_groupProperties['tools'][$thisTool['label']]) {
            continue;
示例#3
0
 * @package     CLGRP
 * @author      Claro Team <*****@*****.**>
 */
$tlabelReq = 'CLGRP';
require '../inc/claro_init_global.inc.php';
// $_groupProperties = claro_get_main_group_properties(claro_get_current_course_id());
include_once get_path('incRepositorySys') . '/lib/group.lib.inc.php';
// display login form
if (!claro_is_in_a_course() || !claro_is_course_allowed()) {
    claro_disp_auth_form(true);
}
// check user right
if (!claro_is_allowed_to_edit()) {
    claro_die(get_lang("Not allowed"));
}
$nameTools = get_lang("Groups settings");
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Groups'), Url::Contextualize('group.php'));
$_groupProperties = claro_get_main_group_properties(claro_get_current_course_id());
// session_register('_groupProperties');
$_SESSION['_groupProperties'] =& $_groupProperties;
$claroline->display->body->appendContent(claro_html_tool_title(array('supraTitle' => get_lang("Groups"), 'mainTitle' => $nameTools)));
$tpl = new CoreTemplate('group_properties.tpl.php');
$tpl->assign('groupToolList', get_group_tool_list());
$tpl->assign('nbGroupPerUser', $_groupProperties['nbGroupPerUser']);
$tpl->assign('registrationAllowedInGroup', $_groupProperties['registrationAllowed']);
$tpl->assign('unregistrationAllowedInGroup', isset($_groupProperties['unregistrationAllowed']) ? $_groupProperties['unregistrationAllowed'] : false);
$tpl->assign('tutorRegistrationAllowedInGroup', isset($_groupProperties['tutorRegistrationAllowed']) ? $_groupProperties['tutorRegistrationAllowed'] : false);
$tpl->assign('groupPrivate', $_groupProperties['private']);
$tpl->assign('tools', $_groupProperties['tools']);
$claroline->display->body->appendContent($tpl->render());
echo $claroline->display->render();