Exemplo n.º 1
0
Claroline::getDisplay()->body->appendContent(claro_html_tool_title(array('supraTitle' => get_lang("Groups"), 'mainTitle' => claro_get_current_group_data('name') . ' <img src="' . get_icon_url('group') . '" alt="" />')));
$groupSpaceTemplate = new CoreTemplate('group_space.tpl.php');
$groupSpaceTemplate->assign('dialogBox', $dialogBox);
$groupSpaceTemplate->assign('displayRegistrationLink', $is_allowedToSelfRegInGroup && !array_key_exists('registration', $_REQUEST));
$groupSpaceTemplate->assign('displayUnregistrationLink', $is_allowedToSelfUnregInGroup && !array_key_exists('unregistration', $_REQUEST));
$groupSpaceTemplate->assign('displayTutorRegistrationLink', $isTutorRegAllowed && !array_key_exists('tutorRegistration', $_REQUEST));
$groupSpaceTemplate->assign('displayTutorUnregistrationLink', $isTutorUnregAllowed && !array_key_exists('tutorUnregistration', $_REQUEST));
$groupSpaceTemplate->assign('toolLinkList', $toolLinkList);
/*----------------------------------------------------------------------------
DISPLAY GROUP DESCRIPTION
----------------------------------------------------------------------------*/
if (strlen(claro_get_current_group_data('description')) > 0) {
    $groupSpaceTemplate->assign('groupDescription', claro_get_current_group_data('description'));
} else {
    $groupSpaceTemplate->assign('groupDescription', get_lang("(none)"));
}
/*----------------------------------------------------------------------------
DISPLAY GROUP TUTOR INFORMATION
----------------------------------------------------------------------------*/
$groupSpaceTemplate->assign('tutorDataList', $tutorDataList);
/*----------------------------------------------------------------------------
DISPLAY GROUP MEMBER LIST
----------------------------------------------------------------------------*/
$context = Claro_Context::getCurrentContext();
$context[CLARO_CONTEXT_GROUP] = null;
$urlContext = Claro_Context::getUrlContext($context);
$groupSpaceTemplate->assign('urlContext', $urlContext);
$groupSpaceTemplate->assign('groupMemberList', $groupMemberList);
Claroline::getDisplay()->body->appendContent($groupSpaceTemplate->render());
echo Claroline::getDisplay()->render();
Exemplo n.º 2
0
/**
 * Route the script to an auhtentication form if user id is missing.
 * Once authenticated, the system get back to the source where the form
 * was trigged
 *
 * @param boolean $cidRequired - if the course id is required to leave the form
 * @author Christophe gesche <*****@*****.**>
 * @copyright   (c) 2001-2011, Universite catholique de Louvain (UCL)
 */
function claro_disp_auth_form($cidRequired = false)
{
    if (isset($_SESSION['login_already_claimed']) && $_SESSION['login_already_claimed'] === true) {
        $_SESSION['login_already_claimed'] = false;
        return;
    }
    $_SESSION['login_already_claimed'] = true;
    // TODO check if it does not break the CAS mechanism
    if (get_conf('claro_secureLogin', false)) {
        $sourceUrl = base64_encode(rtrim(get_path('rootWeb'), '/') . $_SERVER['REQUEST_URI']);
    } else {
        $sourceUrl = base64_encode($_SERVER['REQUEST_URI']);
    }
    if (!headers_sent()) {
        $urlCmd = $cidRequired && !claro_is_in_a_course() ? '&cidRequired=true' : '';
        header('Location:' . get_path('url') . '/claroline/auth/login.php?sourceUrl=' . urlencode($sourceUrl) . $urlCmd);
    } else {
        Claroline::getDisplay()->body->appendContent('<p align="center">' . 'WARNING ! Login Required <br />' . 'Click ' . '<a href="' . get_path('url') . '/claroline/auth/login.php' . '?sourceUrl=' . urlencode($sourceUrl) . '">' . 'here' . '</a>' . '</p>');
        Claroline::getDisplay()->render();
    }
    die;
    // necessary to prevent any continuation of the application
}
Exemplo n.º 3
0
                $dialogBox->error(get_lang('This introduction\'s visibility can\'t be modified'));
            }
        }
    }
}
// Display
$cmdList = array();
if (claro_is_allowed_to_edit()) {
    $cmdList[] = array('img' => 'headline_new', 'name' => get_lang('New headline'), 'url' => claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=rqAdd')));
}
$cmdList[] = array('img' => 'coursehome', 'name' => get_lang('Back to course homepage'), 'url' => claro_htmlspecialchars(Url::Contextualize(get_path('rootWeb') . 'claroline/course/index.php?cid=' . claro_get_current_course_id())));
$toolIntroIterator = new ToolIntroductionIterator(claro_get_current_course_id());
$toolIntroductionList = '';
if (count($toolIntroIterator) > 0) {
    foreach ($toolIntroIterator as $toolIntro) {
        $toolIntroductionList .= $toolIntro->render();
    }
} else {
    // If there's no item, display the form to add one
    $toolIntro = new ToolIntro();
    $dialogBox->info(get_lang('There\'s no headline for this course right now.  Use the form below to add a new one.'));
    $toolIntroForm = empty($toolIntroForm) ? $toolIntro->renderForm() : $toolIntroForm;
}
Claroline::getDisplay()->body->appendContent(claro_html_tool_title(get_lang('Headlines'), null, $cmdList));
Claroline::getDisplay()->body->appendContent($dialogBox->render());
$output = '';
$output .= $toolIntroForm . $toolIntroductionList;
// Append output
Claroline::getDisplay()->body->appendContent($output);
// Render output
echo $claroline->display->render();
Exemplo n.º 4
0
        Claroline::getDisplay()->body->appendContent($template->render());
    }
}
// end if is_allowedToEdit
/******************************************************************************
DESCRIPTION LIST DISPLAY
******************************************************************************/
if (claro_is_user_authenticated()) {
    $date = $claro_notifier->get_notification_date(claro_get_current_user_id());
}
$preparedDescList = array();
foreach ($descList as $description) {
    if (claro_is_user_authenticated() && $claro_notifier->is_a_notified_ressource(claro_get_current_course_id(), $date, claro_get_current_user_id(), claro_get_current_group_id(), claro_get_current_tool_id(), $description['id'])) {
        $description['hot'] = true;
    } else {
        $description['hot'] = false;
    }
    // Remove invisible items
    if ($description['visibility'] == 'VISIBLE' || $description['visibility'] == 'INVISIBLE' && $is_allowedToEdit) {
        if ($description['visibility'] == 'VISIBLE') {
            $description['visible'] = 1;
        } else {
            $description['visible'] = 0;
        }
        $preparedDescList[] = $description;
    }
}
$template = new ModuleTemplate($tlabelReq, 'list.tpl.php');
$template->assign('descriptionList', $preparedDescList);
Claroline::getDisplay()->body->appendContent($template->render());
echo Claroline::getInstance()->display->render();
Exemplo n.º 5
0
} elseif (isset($_REQUEST['uInfo']) && is_numeric($_REQUEST['uInfo'])) {
    $userId = (int) $_REQUEST['uInfo'];
} else {
    $userId = null;
}
if (isset($_REQUEST['courseId']) && !empty($_REQUEST['courseId'])) {
    $courseId = $_REQUEST['courseId'];
} else {
    if (claro_is_in_a_course()) {
        $courseId = claro_get_current_course_id();
    } else {
        $courseId = null;
    }
}
if (claro_is_in_a_course()) {
    Claroline::getDisplay()->body->hideCourseTitleAndTools();
}
$selfStatistics = $userId == claro_get_current_user_id() ? true : false;
/*
 * Permissions
 */
if (claro_is_platform_admin()) {
    // if I am platform admin I can always see tracking for all courses of user
    $is_allowedToTrack = true;
    $canSwitchCourses = true;
} elseif (!is_null($userId) && claro_is_user_authenticated() && $userId == claro_get_current_user_id()) {
    // if these are my tracking I can view tracking of my other courses
    $is_allowedToTrack = true;
    $canSwitchCourses = true;
} elseif (claro_is_course_manager()) {
    // if I am course manager I will only be able to see tracking of my course