Example #1
0
$out = '';
// Set display right
$profileRightHtml = new RightProfileToolRightHtml();
$profileRightHtml->addUrlParam('display_profile', $display_profile_url_param);
$profileFoundCount = 0;
foreach ($display_profile_list as $profileId) {
    $profile = new RightProfile();
    if ($profile->load($profileId)) {
        $profileRight = new RightCourseProfileToolRight();
        $profileRight->setCourseId(claro_get_current_course_id());
        $profileRight->load($profile);
        $profileRightHtml->addRightProfileToolRight($profileRight);
        $profileFoundCount++;
    }
}
if ($profileFoundCount == 0) {
    $dialogBox->error(get_lang('Profile not found'));
    $out .= $dialogBox->render();
} else {
    if ($profileFoundCount == 1) {
        // display tool title
        $out .= claro_html_tool_title(array('mainTitle' => get_lang('Manage Right'), 'subTitle' => $profile->getName()));
        $out .= '<p>' . $profile->getDescription() . '</p>';
    } else {
        // display tool title
        $out .= claro_html_tool_title(array('mainTitle' => get_lang('Manage Right'), 'subTitle' => get_lang('All profiles')));
    }
    $out .= $profileRightHtml->displayProfileToolRightList();
}
$claroline->display->body->appendContent($out);
echo $claroline->display->render();
Example #2
0
    $profileRightHtml = new RightProfileToolRightHtml();
    $profileRightHtml->addUrlParam('section', claro_htmlspecialchars($currentSection));
    $profileRightHtml->setCourseToolInfo($displayToolList);
    $profileLegend = array();
    foreach ($display_profile_list as $profileId) {
        $profile = new RightProfile();
        if ($profile->load($profileId)) {
            $profileRight = new RightCourseProfileToolRight();
            $profileRight->setCourseId(claro_get_current_course_id());
            $profileRight->load($profile);
            $profileRightHtml->addRightProfileToolRight($profileRight);
            $profileLegend[] = get_lang($profileNameList[$profileId]['name']) . ' : <em>' . get_lang($profileNameList[$profileId]['description']) . '</em>';
        }
    }
    $out .= '<p><small><span style="text-decoration: underline">' . get_lang('Profile list') . '</span> : ' . implode($profileLegend, ' - ') . '.</small></p>';
    $out .= '<blockquote>' . "\n" . $profileRightHtml->displayProfileToolRightList() . '</blockquote>' . "\n";
} elseif ($currentSection == 'extLinks') {
    // Display external link list
    $out .= '<p>' . get_lang('Add external links to your course') . '</p>' . "\n";
    $out .= '<blockquote>' . "\n" . '<p>' . "\n" . '<a class="claroCmd" href="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=rqAdd&section=' . claro_htmlspecialchars($currentSection))) . '">' . '<img src="' . get_icon_url('link') . '" alt="" />' . get_lang('Add external link') . '</a>' . "\n" . '</p>' . "\n" . '<table class="claroTable" >' . "\n\n" . '<thead>' . "\n" . '<tr>' . "\n" . '<th>' . get_lang('Tools') . '</th>' . "\n" . '<th>' . get_lang('Visibility') . '</th>' . "\n" . '<th>' . get_lang('Edit') . '</th>' . "\n" . '<th>' . get_lang('Delete') . '</th>' . "\n" . '</tr>' . "\n" . '</thead>' . "\n\n" . '<tbody>' . "\n";
    if (!empty($courseExtLinkList)) {
        foreach ($courseExtLinkList as $linkId => $link) {
            $out .= '<tr>' . "\n";
            $out .= '<td ' . ($link['visibility'] ? '' : 'class="invisible"') . '>' . '<img src="' . get_icon_url('link') . '" alt="" />' . $link['name'] . '</td>';
            $out .= '<td align="center">';
            if ($link['visibility'] == true) {
                $out .= '<a href="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=exInvisible&amp;tool_id=' . $linkId . '&amp;section=' . claro_htmlspecialchars($currentSection))) . '" >' . '<img src="' . get_icon_url('visible') . '" alt="' . get_lang('Visible') . '" />' . '</a>';
            } else {
                $out .= '<a href="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=exVisible&amp;tool_id=' . $linkId . '&amp;section=' . claro_htmlspecialchars($currentSection))) . '" >' . '<img src="' . get_icon_url('invisible') . '" alt="' . get_lang('Invisible') . '" />' . '</a>';
            }
            $out .= '</td>' . "\n";