Example #1
0
                $cmdList[] = array('name' => get_lang('Full review'), 'url' => claro_htmlspecialchars(Url::Contextualize($viewallUrl)));
            }
        }
    }
    $out .= $postLister->disp_pager_tool_bar($pagerUrl);
    try {
        $display = new ModuleTemplate('CLFRM', 'forum_viewtopic.tpl.php');
        $display->assign('forum_id', $forumId);
        $display->assign('topic_id', $topicId);
        $display->assign('topic_subject', $topicSettingList['topic_title']);
        $display->assign('postList', $postList);
        $display->assign('is_allowedToEdit', $is_allowedToEdit);
        $display->assign('anonymity', $anonymityStatus);
        $display->assign('claro_notifier', $claro_notifier);
        $display->assign('is_post_allowed', $is_postAllowed);
        $out .= $display->render();
    } catch (Exception $ex) {
        $dialogBox->error($ex);
    }
    if ($is_postAllowed) {
        $replyUrl = Url::Contextualize($_SERVER['PHP_SELF'] . '?topic=' . $topicId . '&cmd=rqPost' . '&mode=reply');
        $toolBar[] = claro_html_cmd_link(claro_htmlspecialchars($replyUrl), '<img src="' . get_icon_url('reply') . '" alt="" />' . ' ' . get_lang('Reply'));
        $out .= '<p>' . claro_html_menu_horizontal($toolBar) . '</p>';
    }
    $out .= $postLister->disp_pager_tool_bar($pagerUrl);
}
// Page title
$out = claro_html_tool_title($nameTools, $is_allowedToEdit ? get_help_page_url('blockForumsHelp', 'CLFRM') : false, $cmdList) . $out;
ClaroBreadCrumbs::getInstance()->setCurrent(get_lang('Forums'), 'index.php');
$claroline->display->body->appendContent($out);
echo $claroline->display->render();
Example #2
0
 * @package CLCHT
 *
 * @author Claro Team <*****@*****.**>
 * @author Christophe Gesché <*****@*****.**>
 * @copyright   (c) 2001-2011, Universite catholique de Louvain (UCL)
 *
 */
require '../inc/claro_init_global.inc.php';
$is_allowedToManage = claro_is_course_manager() || claro_is_in_a_group() && claro_is_group_tutor();
// header
$htmlHeadXtra[] = '
<script type="text/javascript">
function prepare_message()
{
    document.chatForm.chatLine.value=document.chatForm.msg.value;
    document.chatForm.msg.value = "";
    document.chatForm.msg.focus();
    return true;
}
</script>';
$cmdMenu = array();
if ($is_allowedToManage) {
    $cmdMenu[] = claro_html_cmd_link('messageList.php?cmd=reset' . claro_url_relay_context('&amp;'), get_lang('Reset'), array('target' => "messageList"));
    $cmdMenu[] = claro_html_cmd_link('messageList.php?cmd=store' . claro_url_relay_context('&amp;'), get_lang('Store Chat'), array('target' => "messageList"));
}
$hide_banner = TRUE;
// Turn off session lost
$warnSessionLost = false;
include get_path('incRepositorySys') . '/claro_init_header.inc.php';
echo '<form name="chatForm" action="messageList.php#final" method="post" target="messageList" onsubmit="return prepare_message();">' . "\n" . claro_form_relay_context() . '<input type="text"    name="msg" size="80" />' . "\n" . '<input type="hidden"  name="chatLine" />' . "\n" . '<input type="submit" value=" >> " />' . "\n" . '<br />' . "\n" . '' . "\n" . claro_html_menu_horizontal($cmdMenu) . '</form>';
include get_path('incRepositorySys') . '/claro_init_footer.inc.php';
Example #3
0
if (is_array($this->toolLinkList)) {
    echo claro_html_list($this->toolLinkList, array('id' => 'groupToolList'));
}
?>
    
    <br />

    <?php 
if (claro_is_allowed_to_edit()) {
    echo claro_html_cmd_link(claro_htmlspecialchars(Url::Contextualize('group_edit.php')), '<img src="' . get_icon_url('edit') . '"' . ' alt="' . get_lang("Edit this group") . '" />' . get_lang("Edit this group"));
}
?>
    
    <?php 
if (current_user_is_allowed_to_send_message_to_current_group()) {
    echo '<br />' . claro_html_cmd_link(claro_htmlspecialchars(Url::Contextualize('../messaging/sendmessage.php?cmd=rqMessageToGroup&amp;')), '<img src="' . get_icon_url('mail_send') . '" alt="" />' . get_lang("Send a message to group"));
}
?>
</div>
<div id="rightContent" class="groupSpaceContents">
    <fieldset>
        <dl>
            <dt><?php 
echo get_lang("Description");
?>
</dt>
            <dd><?php 
echo claro_htmlspecialchars($this->groupDescription);
?>
</dd>
            <dt><?php 
Example #4
0
$is_allowedToEdit = claro_is_allowed_to_edit();
if (!isset($_SESSION['chat_connectionTime'])) {
    // to avoid displaying message that were sent before arrival on the chat
    $_SESSION['chat_connectionTime'] = time();
    // should not be reset
}
if (!isset($_SESSION['chat_lastReceivedMsg'])) {
    // to add a visual effect when lines are added
    // (this var is reset each time new messages are received)
    $_SESSION['chat_lastReceivedMsg'] = time();
}
$cmdMenu = array();
if ($is_allowedToEdit) {
    $cmdMenu[] = claro_html_cmd_link('#', get_lang('Show/hide logs'), array('id' => 'clchat_cmd_logs'));
    $cmdMenu[] = claro_html_cmd_link('#', get_lang('Store Chat'), array('id' => 'clchat_cmd_archive'));
    $cmdMenu[] = claro_html_cmd_link('#', get_lang('Reset'), array('id' => 'clchat_cmd_flush'));
}
/*
 * Output
 */
$cssLoader = CssLoader::getInstance();
$cssLoader->load('clchat', 'screen');
//-- Content
$out = '';
$nameTools = get_lang('Chat');
$out .= claro_html_tool_title($nameTools);
if (claro_is_javascript_enabled() && $_uid) {
    $jsloader = JavascriptLoader::getInstance();
    $jsloader->load('jquery');
    $jsloader->load('clchat');
    // init var with values from get_conf before including tool library
Example #5
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 '';
    }
}
Example #6
0
        case 'adminTool':
            $_SESSION['CSV_CancelButton'] = '../admin/';
            break;
        case 'adminClassTool':
            $_SESSION['CSV_CancelButton'] = '../admin/admin_class_user.php?class_id=' . $class_id;
            break;
        default:
            $_SESSION['CSV_CancelButton'] = '../index.php';
    }
} else {
    if (empty($_SESSION['CSV_CancelButton'])) {
        $_SESSION['CSV_CancelButton'] = '../index.php';
    }
}
$backButtonUrl = Url::Contextualize($_SESSION['CSV_CancelButton']);
$content_default = get_lang('You must specify the CSV format used in your file') . ':' . "\n" . '<br /><br />' . "\n" . '<form method="post" action="' . claro_htmlspecialchars($_SERVER['PHP_SELF']) . '" enctype="multipart/form-data"  >' . "\n" . '<input type="hidden" name="step" value="1" />' . "\n" . '<input type="hidden" name="class_id" value="' . $class_id . '" />' . "\n" . claro_form_relay_context() . '<input type="radio" name="firstLineFormat" value="YES" id="firstLineFormat_YES" /> ' . '<label for="firstLineFormat_YES">' . get_lang('Use format defined in first line of file') . '</label>' . "\n" . '<br /><br />' . "\n" . '<input type="radio" name="firstLineFormat" value="NO" checked="checked" id="firstLineFormat_NO" />' . "\n" . '<label for="firstLineFormat_NO">' . get_lang('Use the following format') . ' : ' . '</label>' . "\n" . '<br /><br />' . "\n" . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . '<span style="font-weight: bold;">' . $usedFormat . '</span><br /><br />' . "\n" . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . "\n" . claro_html_cmd_link(claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?display=default' . '&cmd=rqLoadDefaultFormat' . '&addType=' . $addType)), get_lang('Load default format')) . "\n" . ' | ' . claro_html_cmd_link(claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?display=default' . '&cmd=rqChangeFormat' . '&addType=' . $addType)), get_lang('Edit format to use')) . "\n" . '<br /><br />' . "\n" . get_lang('CSV file with the user list :') . "\n" . '<input type="file" name="CSVfile" />' . "\n" . '<br /><br />' . "\n" . "\n";
$content_default .= '<h3>' . get_lang('Options') . '</h3>';
$content_default .= '<input type="checkbox" name="sendEmailToUserCreated" value="1" id="sendEmailToUserCreated" />' . "\n" . '<label for="sendEmailToUserCreated">' . get_lang('Send email to new users') . ' ' . '</label>' . "\n" . '<br /><br />' . "\n";
if (get_conf('update_user_properties')) {
    $content_default .= '<input type="checkbox" name="updateUserProperties" value="1" id="updateUserProperties" />' . "\n" . '<label for="updateUserProperties">' . get_lang('Update user\'properties ') . ' ' . '</label>' . "\n" . '<br /><br />' . "\n";
}
$content_default .= '<input type="submit" name="submitCSV" value="' . get_lang('Add user list') . '" />' . "\n" . claro_html_button(claro_htmlspecialchars($backButtonUrl), get_lang('Cancel')) . "\n" . '</form>' . "\n";
$csvImport = new CsvImport();
$csvImport->heading = $firstLineFormat;
if (!$firstLineFormat) {
    // $csvImport->titles = explode( ',' , $usedFormat);
    $csvImport->fields = explode(',', $usedFormat);
}
switch ($step) {
    case 1:
        if (!isset($_FILES['CSVfile']) || empty($_FILES['CSVfile']['name']) || $_FILES['CSVfile']['size'] == 0) {
Example #7
0
 // get params from the form
 $userData = user_initialise();
 $userData['language'] = null;
 // validate forum params
 $messageList = user_validate_form_registration($userData);
 if (count($messageList) == 0) {
     // register the new user in the claroline platform
     $userId = user_create($userData);
     if (false === $userId) {
         $dialogBox->error(claro_failure::get_last_failure());
     } else {
         $dialogBox->success(get_lang('The new user has been sucessfully created'));
         $newUserMenu[] = claro_html_cmd_link('../auth/courses.php?cmd=rqReg&amp;uidToEdit=' . $userId . '&amp;category=&amp;fromAdmin=settings', get_lang('Register this user to a course'));
         $newUserMenu[] = claro_html_cmd_link('admin_profile.php?uidToEdit=' . $userId . '&amp;category=', get_lang('User settings'));
         $newUserMenu[] = claro_html_cmd_link('adminaddnewuser.php', get_lang('Create another new user'));
         $newUserMenu[] = claro_html_cmd_link('index.php', get_lang('Back to administration page'));
         $display = DISP_REGISTRATION_SUCCEED;
         // Send a mail to the user
         if (false !== user_send_registration_mail($userId, $userData)) {
             $dialogBox->success(get_lang('Mail sent to user'));
         } else {
             $dialogBox->warning(get_lang('No mail sent to user'));
             // TODO  display in a popup "To Print" with  content to give to user.
         }
     }
 } else {
     // User validate form return error messages
     if (is_array($messageList) && !empty($messageList)) {
         foreach ($messageList as $message) {
             $dialogBox->error($message);
         }
Example #8
0
    case 'exSearch':
        $toolTitle['subTitle'] = get_lang("Search in pages");
        break;
    default:
        break;
}
// Command list
$cmdList = array();
// Check javascript
$javascriptEnabled = claro_is_javascript_enabled();
// Wiki navigation bar
$cmdWikiNavigationBar[] = claro_html_cmd_link(claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?wikiId=' . $wiki->getWikiId() . '&action=show' . '&title=__MainPage__')), '<img src="' . get_icon_url('wiki') . '" alt="edit" />&nbsp;' . get_lang("Main page"));
$cmdWikiNavigationBar[] = claro_html_cmd_link(claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?wikiId=' . $wiki->getWikiId() . '&action=recent')), '<img src="' . get_icon_url('history') . '" ' . ' alt="recent changes" />&nbsp;' . get_lang("Recent changes"));
$cmdWikiNavigationBar[] = claro_html_cmd_link(claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?wikiId=' . $wiki->getWikiId() . '&action=all')), '<img src="' . get_icon_url('allpages') . '" ' . ' alt="all pages" />&nbsp;' . get_lang("All pages"));
$cmdWikiNavigationBar[] = claro_html_cmd_link(claro_htmlspecialchars(Url::Contextualize('wiki.php')), '<img src="' . get_icon_url('list') . '" ' . ' alt="all pages" />' . '&nbsp;' . get_lang("List of Wiki"));
$cmdWikiNavigationBar[] = claro_html_cmd_link(claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?wikiId=' . $wiki->getWikiId() . '&action=rqSearch')), '<img src="' . get_icon_url('search') . '" ' . ' alt="all pages" />&nbsp;' . get_lang("Search"));
$out .= '<p>' . claro_html_menu_horizontal($cmdWikiNavigationBar) . '</p>';
if ('recent' != $action && 'all' != $action && 'rqSearch' != $action && 'exSearch' != $action) {
    if ('show' == $action || 'edit' == $action || 'history' == $action) {
        $cmdList[] = array('img' => 'back', 'name' => get_lang("Back to page"), 'url' => claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?wikiId=' . $wiki->getWikiId() . '&action=show' . '&title=' . rawurlencode($title))));
    }
    if ($is_allowedToEdit || $is_allowedToCreate) {
        // Show context
        if ('show' == $action || 'edit' == $action || 'diff' == $action) {
            $cmdList[] = array('img' => 'edit', 'name' => get_lang("Edit this page"), 'url' => claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?wikiId=' . $wiki->getWikiId() . '&action=edit' . '&title=' . rawurlencode($title) . '&versionId=' . $versionId)));
        }
    }
    if ('show' == $action || 'edit' == $action || 'history' == $action || 'diff' == $action) {
        // active
        $cmdList[] = array('img' => 'versions', 'name' => get_lang("Page history"), 'url' => claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?wikiId=' . $wiki->getWikiId() . '&action=history' . '&title=' . rawurlencode($title))));
    }
Example #9
0
    ClaroBreadCrumbs::getInstance()->prepend(get_lang('Administration'), get_path('rootAdminWeb'));
    $backUrl = get_path('rootAdminWeb');
} else {
    if ($course->courseId) {
        $backUrl = get_path('url') . '/claroline/course/index.php?cid=' . $course->courseId;
    } else {
        $backUrl = get_path('url') . '/index.php';
    }
}
if (!get_conf('courseCreationAllowed', true)) {
    $dialogBox->warning(get_lang('Course creation is disabled on the platform'));
}
//=================================
// Display section
//=================================
$out = '';
$out .= claro_html_tool_title(get_lang('Create a course website'));
$out .= $dialogBox->render();
if (claro_is_platform_admin() || get_conf('courseCreationAllowed', true)) {
    if ($display == DISP_COURSE_CREATION_FORM || $display == DISP_COURSE_CREATION_FAILED) {
        // display form
        $out .= $course->displayForm($backUrl);
    } elseif ($display == DISP_COURSE_CREATION_PROGRESS) {
        // do nothing except displaying dialogBox content
    } elseif ($display == DISP_COURSE_CREATION_SUCCEED) {
        // display back link
        $out .= '<p>' . claro_html_cmd_link(claro_htmlspecialchars($backUrl), get_lang('Continue')) . '</p>' . "\n";
    }
}
$claroline->display->body->appendContent($out);
echo $claroline->display->render();
Example #10
0
/**
 * Display a pager tool bar
 *
 * @author Mathieu Laurent <*****@*****.**>
 * @return void
 */
function disp_forum_toolbar($pagetype, $forum_id, $cat_id = 0, $topic_id = 0)
{
    global $forum_name, $topic_title;
    $toolList = array();
    $html = '';
    switch ($pagetype) {
        // 'index' is covered by default
        case 'newtopic':
            break;
        case 'reply':
            break;
        case 'viewforum':
            $toolList[] = claro_html_cmd_link(claro_htmlspecialchars(Url::Contextualize(get_module_url('CLFRM') . '/viewtopic.php?forum=' . $forum_id . '&amp;cmd=rqPost&amp;mode=add')), '<img src="' . get_icon_url('topic') . '" alt="" /> ' . get_lang('New topic'));
            break;
        case 'viewtopic':
            $toolList[] = claro_html_cmd_link(claro_htmlspecialchars(Url::Contextualize(get_module_url('CLFRM') . '/viewtopic.php?topic=' . $topic_id . '&amp;cmd=rqPost&amp;mode=reply')), '<img src="' . get_icon_url('reply') . '" alt="' . get_lang('Reply') . '" /> ' . get_lang('Reply'));
            break;
            // 'Register' is covered by default
        // 'Register' is covered by default
        case 'index':
            if (claro_is_allowed_to_edit()) {
                $toolList[] = claro_html_cmd_link(claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=rqMkCat')), get_lang('Create category'));
                $toolList[] = claro_html_cmd_link(claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=rqMkForum')), '<img src="' . get_icon_url('forum') . '" alt="" /> ' . get_lang('Create forum'));
            }
            break;
    }
    if (!in_array($pagetype, array('add', 'reply', 'edit', 'quote'))) {
        $toolList[] = claro_html_cmd_link(claro_htmlspecialchars(Url::Contextualize(get_module_url('CLFRM') . '/index.php?cmd=rqSearch')), '<img src="' . get_icon_url('search') . '" alt="" />' . get_lang('Search'));
    }
    return $toolList;
}
Example #11
0
/**
 * This function is used to display comments of module or learning path with admin links if needed.
 * Admin links are 'edit' and 'delete' links.
 *
 * @param string $type MODULE_ , LEARNINGPATH_ , LEARNINGPATHMODULE_
 * @param string $mode DISPLAY_ , UPDATE_ , DELETE_
 *
 * @author Piraux S�bastien <*****@*****.**>
 * @author Lederer Guillaume <*****@*****.**>
 */
function commentBox($type, $mode)
{
    $tbl_cdb_names = claro_sql_get_course_tbl();
    $tbl_lp_learnPath = $tbl_cdb_names['lp_learnPath'];
    $tbl_lp_rel_learnPath_module = $tbl_cdb_names['lp_rel_learnPath_module'];
    $tbl_lp_module = $tbl_cdb_names['lp_module'];
    $out = '';
    // globals
    global $is_allowedToEdit;
    // will be set 'true' if the comment has to be displayed
    $dsp = false;
    // those vars will be used to build sql queries according to the comment type
    switch ($type) {
        case MODULE_:
            $defaultTxt = get_lang('blockDefaultModuleComment');
            $col_name = 'comment';
            $tbl_name = $tbl_lp_module;
            if (isset($_REQUEST['module_id'])) {
                $module_id = $_REQUEST['module_id'];
            } else {
                $module_id = $_SESSION['module_id'];
            }
            $where_cond = "`module_id` = " . (int) $module_id;
            // use backticks ( ` ) for col names and simple quote ( ' ) for string
            break;
        case LEARNINGPATH_:
            $defaultTxt = get_lang('blockDefaultLearningPathComment');
            $col_name = 'comment';
            $tbl_name = $tbl_lp_learnPath;
            $where_cond = '`learnPath_id` = ' . (int) $_SESSION['path_id'];
            // use backticks ( ` ) for col names and simple quote ( ' ) for string
            break;
        case LEARNINGPATHMODULE_:
            $defaultTxt = get_lang('blockDefaultModuleAddedComment');
            $col_name = 'specificComment';
            $tbl_name = $tbl_lp_rel_learnPath_module;
            $where_cond = "`learnPath_id` = " . (int) $_SESSION['path_id'] . "\n                                        AND `module_id` = " . (int) $_SESSION['module_id'];
            // use backticks ( ` ) for col names and simple quote ( ' ) for string
            break;
    }
    // update mode
    // allow to chose between
    // - update and show the comment and the pencil and the delete cross (UPDATE_)
    // - update and nothing displayed after form sent (UPDATENOTSHOWN_)
    if (($mode == UPDATE_ || $mode == UPDATENOTSHOWN_) && $is_allowedToEdit) {
        if (isset($_POST['insertCommentBox'])) {
            $sql = "UPDATE `" . $tbl_name . "`\n                    SET `" . $col_name . "` = \"" . claro_sql_escape($_POST['insertCommentBox']) . "\"\n                    WHERE " . $where_cond;
            claro_sql_query($sql);
            if ($mode == UPDATE_) {
                $dsp = true;
            } elseif ($mode == UPDATENOTSHOWN_) {
                $dsp = false;
            }
        } else {
            // get info to fill the form in
            $sql = "SELECT `" . $col_name . "`\n                       FROM `" . $tbl_name . "`\n                      WHERE " . $where_cond;
            $oldComment = claro_sql_query_get_single_value($sql);
            $out .= '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">' . "\n" . claro_html_textarea_editor('insertCommentBox', $oldComment, 15, 55) . '<br />' . "\n" . '<input type="hidden" name="cmd" value="update' . $col_name . '" />' . '<input type="submit" value="' . get_lang('Ok') . '" />' . "\n" . '<br />' . "\n" . '</form>' . "\n";
        }
    }
    // delete mode
    if ($mode == DELETE_ && $is_allowedToEdit) {
        $sql = "UPDATE `" . $tbl_name . "`\n                 SET `" . $col_name . "` = ''\n                 WHERE " . $where_cond;
        claro_sql_query($sql);
        $dsp = TRUE;
    }
    // display mode only or display was asked by delete mode or update mode
    if ($mode == DISPLAY_ || $dsp == TRUE) {
        $sql = "SELECT `" . $col_name . "`\n                FROM `" . $tbl_name . "`\n                WHERE " . $where_cond;
        $currentComment = claro_sql_query_get_single_value($sql);
        // display nothing if this is default comment and not an admin
        if ($currentComment == $defaultTxt && !$is_allowedToEdit) {
            return '';
        }
        if (empty($currentComment)) {
            // if no comment and user is admin : display link to add a comment
            if ($is_allowedToEdit) {
                $textLink = '';
                if ($type == MODULE_) {
                    $textLink = get_lang('Add a comment to this module');
                } elseif ($type == LEARNINGPATHMODULE_) {
                    $textLink = get_lang('Add a specific comment to this module');
                } else {
                    $textLink = get_lang('Add a comment');
                }
                $out .= '<p>' . "\n" . claro_html_cmd_link($_SERVER['PHP_SELF'] . '?cmd=update' . $col_name . claro_url_relay_context('&amp;'), $textLink) . '</p>' . "\n";
            }
        } else {
            // display comment
            $out .= "<p>" . claro_parse_user_text($currentComment) . "</p>";
            // display edit and delete links if user as the right to see it
            if ($is_allowedToEdit) {
                $out .= '<p>' . "\n" . '<small>' . "\n" . '<a href="' . $_SERVER['PHP_SELF'] . '?cmd=update' . $col_name . '">' . "\n" . '<img src="' . get_icon_url('edit') . '" alt="' . get_lang('Modify') . '" />' . "\n" . '</a>' . "\n" . '<a href="' . $_SERVER['PHP_SELF'] . '?cmd=del' . $col_name . '" ' . ' onclick="javascript:if(!confirm(\'' . clean_str_for_javascript(get_lang('Please confirm your choice')) . '\')) return false;">' . "\n" . '<img src="' . get_icon_url('delete') . '" alt="' . get_lang('Delete') . '" />' . "\n" . '</a>' . "\n" . '</small>' . "\n" . '</p>' . "\n";
            }
        }
    }
    return $out;
}
Example #12
0
        $offset = '0';
    } else {
        $offset = $_REQUEST['offset'];
    }
    $myPager = new claro_sql_pager($sql, $offset, get_conf('userPerPage', 20));
    $resultList = $myPager->get_result_list();
}
// PREPARE DISPLAY
// Deal with interbredcrumps
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Classes'), get_path('rootAdminWeb') . 'admin_class.php');
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Administration'), get_path('rootAdminWeb'));
$nameTools = get_lang('Class members');
$cmdList[] = '<a class="claroCmd" href="' . get_path('clarolineRepositoryWeb') . 'admin/admin_class_register.php' . '?class_id=' . $classinfo['id'] . '">' . '<img src="' . get_icon_url('enroll') . '" /> ' . get_lang('Register a user for this class') . '</a>';
$cmdList[] = '<a class="claroCmd" href="' . get_path('clarolineRepositoryWeb') . 'auth/courses.php' . '?cmd=rqReg&amp;fromAdmin=class&amp;class_id=' . $class_id . '">' . '<img src="' . get_icon_url('enroll') . '" /> ' . get_lang('Register class for course') . '</a>';
if (claro_is_platform_admin()) {
    $cmdList[] = claro_html_cmd_link(claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=export&amp;class_id=' . $class_id)), '<img src="' . get_icon_url('export') . '" alt="" />' . get_lang('Export user list'));
}
$cmdList[] = '<a class="claroCmd" href="' . get_path('clarolineRepositoryWeb') . 'user/addcsvusers.php' . '?AddType=adminClassTool&amp;class_id=' . $class_id . '">' . '<img src="' . get_icon_url('import_list') . '" /> ' . get_lang('Add a user list in class') . '</a>';
if (!empty($resultList)) {
    $cmdList[] = '<a class="claroCmd" href="' . $_SERVER['PHP_SELF'] . '?cmd=unsubscribe_all&amp;class_id=' . $class_id . '"' . ' onclick="if (confirm(\'' . clean_str_for_javascript(get_lang('Unregister all users ?')) . '\')){return true;}else{return false;}">' . '<img src="' . get_icon_url('deluser') . '" /> ' . get_lang('Unregister all users') . '</a>';
} else {
    $cmdList[] = '<span class="claroCmdDisabled" >' . '<img src="' . get_icon_url('deluser') . '" alt="" />' . get_lang('Unregister all users') . '</span>';
}
//------------------------------------
// Display section
//------------------------------------
$out = '';
if (!empty($class_id)) {
    $out .= claro_html_tool_title($nameTools . ' : ' . $classinfo['name']);
    $out .= $dialogBox->render();
    // Display menu