Example #1
0
 public function renderContent()
 {
     global $platformLanguage;
     $out = '';
     // Last user action
     $lastUserAction = isset($_SESSION['last_action']) && $_SESSION['last_action'] != '1970-01-01 00:00:00' ? $_SESSION['last_action'] : date('Y-m-d H:i:s');
     $userCommands = array();
     // User commands
     // 'Create Course Site' command. Only available for teacher.
     if (claro_is_allowed_to_create_course()) {
         $userCommands[] = '<a href="' . claro_htmlspecialchars(Url::Contextualize(get_path('clarolineRepositoryWeb') . 'course/create.php')) . '" class="userCommandsItem">' . '<img src="' . get_icon_url('courseadd') . '" alt="" /> ' . get_lang('Create a course site') . '</a>' . "\n";
     } elseif ($GLOBALS['currentUser']->isCourseCreator) {
         $userCommands[] = '<span class="userCommandsItemDisabled">' . '<img src="' . get_icon_url('courseadd') . '" alt="" /> ' . get_lang('Create a course site') . '</span>' . "\n";
     }
     if (get_conf('allowToSelfEnroll', true)) {
         $userCommands[] = '<a href="' . claro_htmlspecialchars(Url::Contextualize(get_path('clarolineRepositoryWeb') . 'auth/courses.php?cmd=rqReg&amp;categoryId=0')) . '" class="userCommandsItem">' . '<img src="' . get_icon_url('enroll') . '" alt="" /> ' . get_lang('Enrol on a new course') . '</a>' . "\n";
         $userCommands[] = '<a href="' . claro_htmlspecialchars(Url::Contextualize(get_path('clarolineRepositoryWeb') . 'auth/courses.php?cmd=rqUnreg')) . '" class="userCommandsItem">' . '<img src="' . get_icon_url('unenroll') . '" alt="" /> ' . get_lang('Remove course enrolment') . '</a>' . "\n";
     }
     $userCommands[] = '<a href="' . claro_htmlspecialchars(Url::Contextualize(get_path('clarolineRepositoryWeb') . 'course/platform_courses.php')) . '" class="userCommandsItem">' . '<img src="' . get_icon_url('course') . '" alt="" /> ' . get_lang('All platform courses') . '</a>' . "\n";
     $userCommands[] = '<a href="' . claro_htmlspecialchars(Url::Contextualize(get_path('clarolineRepositoryWeb') . 'notification_date.php')) . '" class="userCommandsItem">' . '<img class="iconDefinitionList" src="' . get_icon_url('hot') . '" alt="' . get_lang('New items') . '" />' . ' ' . get_lang('New items') . ' ' . get_lang('to another date') . (substr($lastUserAction, strlen($lastUserAction) - 8) == '00:00:00' ? ' [' . claro_html_localised_date(get_locale('dateFormatNumeric'), strtotime($lastUserAction)) . ']' : '') . '</a>' . "\n";
     $userCourseList = render_user_course_list();
     $userCourseListDesactivated = render_user_course_list_desactivated();
     $out .= '<div class="userCommands">' . '<h2>' . get_lang('Manage my courses') . '</h2>' . claro_html_list($userCommands) . '</div>' . '<div class="userCourseList">' . '<h2>' . get_lang('My course list') . '</h2>' . $userCourseList;
     if (!empty($userCourseListDesactivated)) {
         $out .= '<h4>' . get_lang('Deactivated course list') . '</h4>' . $userCourseListDesactivated;
     }
     $out .= '</div>';
     /*'</td>'
       . '</tr>'
       . '</tbody>'
       . '</table>'*/
     $this->content = $out;
     return $this->content;
 }
Example #2
0
/**
 * CLAROLINE
 *
 * @version     $Revision: 14314 $
 * @copyright   (c) 2001-2011, Universite catholique de Louvain (UCL)
 * @license     http://www.gnu.org/copyleft/gpl.html (GPL) GENERAL PUBLIC LICENSE
 * @author      Piraux Sebastien <*****@*****.**>
 * @author      Lederer Guillaume <*****@*****.**>
 * @package     CLLNP
 * @since       1.8
 */
function lp_display_scorm($TABLELEARNPATHMODULE)
{
    $out = '';
    // change raw if value is a number between 0 and 100
    if (isset($_POST['newRaw']) && is_num($_POST['newRaw']) && $_POST['newRaw'] <= 100 && $_POST['newRaw'] >= 0) {
        $sql = "UPDATE `" . $TABLELEARNPATHMODULE . "`\n                SET `raw_to_pass` = " . (int) $_POST['newRaw'] . "\n                WHERE `module_id` = " . (int) $_SESSION['module_id'] . "\n                AND `learnPath_id` = " . (int) $_SESSION['path_id'];
        claro_sql_query($sql);
        $dialogBoxContent = get_lang('Minimum raw to pass has been changed');
    }
    $out .= '<hr noshade="noshade" size="1" />';
    //####################################################################################\\
    //############################### DIALOG BOX SECTION #################################\\
    //####################################################################################\\
    if (!empty($dialogBoxContent)) {
        $dialogBox = new DialogBox();
        $dialogBox->success($dialogBoxContent);
        $out .= $dialogBox->render();
    }
    // form to change raw needed to pass the exercise
    $sql = "SELECT `lock`, `raw_to_pass`\n            FROM `" . $TABLELEARNPATHMODULE . "` AS LPM\n           WHERE LPM.`module_id` = " . (int) $_SESSION['module_id'] . "\n             AND LPM.`learnPath_id` = " . (int) $_SESSION['path_id'];
    $learningPath_module = claro_sql_query_fetch_all($sql);
    if (isset($learningPath_module[0]['lock']) && $learningPath_module[0]['lock'] == 'CLOSE' && isset($learningPath_module[0]['raw_to_pass'])) {
        $out .= "\n\n" . '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">' . "\n" . '<label for="newRaw">' . get_lang('Change minimum raw mark to pass this module (percentage) : ') . '</label>' . "\n" . '<input type="text" value="' . claro_htmlspecialchars($learningPath_module[0]['raw_to_pass']) . '" name="newRaw" id="newRaw" size="3" maxlength="3" /> % ' . "\n" . '<input type="submit" value="' . get_lang('Ok') . '" />' . "\n" . '</form>' . "\n\n";
    }
    return $out;
}
Example #3
0
 /**
  * Render content
  */
 public function render()
 {
     CssLoader::getInstance()->load('profile', 'all');
     load_kernel_config('user_profile');
     $userData = user_get_properties($this->userId);
     $pictureUrl = '';
     if (get_conf('allow_profile_picture')) {
         $picturePath = user_get_picture_path($userData);
         if ($picturePath && file_exists($picturePath)) {
             $pictureUrl = user_get_picture_url($userData);
         } else {
             $pictureUrl = get_icon_url('nopicture');
         }
     }
     $userFullName = claro_htmlspecialchars(get_lang('%firstName %lastName', array('%firstName' => $userData['firstname'], '%lastName' => $userData['lastname'])));
     $dock = new ClaroDock('userProfileBox');
     $template = new CoreTemplate('user_profilebox.tpl.php');
     $template->assign('userId', $this->userId);
     $template->assign('pictureUrl', $pictureUrl);
     $template->assign('userFullName', $userFullName);
     $template->assign('dock', $dock);
     $template->assign('condensedMode', $this->condensedMode);
     $template->assign('userData', $userData);
     return $template->render();
 }
Example #4
0
 public function renderContent()
 {
     $personnalCourseList = get_user_course_list(claro_get_current_user_id());
     $announcementEventList = announcement_get_items_portlet($personnalCourseList);
     $output = '';
     if ($announcementEventList) {
         $output .= '<dl id="portletMyAnnouncements">';
         foreach ($announcementEventList as $announcementItem) {
             // Hide hidden and expired elements
             $isVisible = (bool) ($announcementItem['visibility'] == 'SHOW') ? 1 : 0;
             $isOffDeadline = (bool) (isset($announcementItem['visibleFrom']) && strtotime($announcementItem['visibleFrom']) > time() || isset($announcementItem['visibleUntil']) && time() >= strtotime($announcementItem['visibleUntil'])) ? 1 : 0;
             if ($isVisible && !$isOffDeadline) {
                 $output .= '<dt>' . "\n" . '<img class="iconDefinitionList" src="' . get_icon_url('announcement', 'CLANN') . '" alt="" />' . ' <a href="' . $announcementItem['url'] . '">' . $announcementItem['title'] . '</a>' . "\n" . '</dt>' . "\n";
                 foreach ($announcementItem['eventList'] as $announcementEvent) {
                     // Prepare the render
                     $displayChar = 250;
                     if (strlen($announcementEvent['content']) > $displayChar) {
                         $content = substr($announcementEvent['content'], 0, $displayChar) . '... <a href="' . claro_htmlspecialchars(Url::Contextualize($announcementEvent['url'])) . '">' . '<b>' . get_lang('Read more &raquo;') . '</b></a>';
                     } else {
                         $content = $announcementEvent['content'];
                     }
                     $output .= '<dd>' . '<a href="' . $announcementEvent['url'] . '">' . $announcementItem['courseOfficialCode'] . '</a> : ' . "\n" . (!empty($announcementEvent['title']) ? $announcementEvent['title'] : get_lang('No title')) . "\n" . ' - ' . $content . "\n" . '</dd>' . "\n";
                 }
             }
         }
         $output .= '</dl>';
     } else {
         $output .= "\n" . '<dl>' . "\n" . '<dt>' . "\n" . '<img class="iconDefinitionList" src="' . get_icon_url('announcement', 'CLANN') . '" alt="" />' . ' ' . get_lang('No announcement to display') . "\n" . '</dt>' . "\n" . '</dl>' . "\n";
     }
     return $output;
 }
Example #5
0
 public function renderTitle()
 {
     $output = '<img ' . 'src="' . get_icon_url('headline', 'CLTI') . '"' . 'alt="' . get_lang('Headline') . '" /> ' . get_lang('Headlines');
     if (claro_is_allowed_to_edit()) {
         $output .= ' <span class="separator">|</span> <a href="' . claro_htmlspecialchars(Url::Contextualize(get_module_url('CLTI') . '/index.php')) . '">' . '<img src="' . get_icon_url('settings') . '" alt="' . get_lang('Settings') . '" /> ' . get_lang('Manage') . '</a>';
     }
     return $output;
 }
Example #6
0
 public function renderTitle()
 {
     $output = '<img ' . 'src="' . get_icon_url('announcement', 'CLANN') . '" ' . 'alt="Announcement icon" /> ' . get_lang('Latest announcements');
     if (claro_is_allowed_to_edit()) {
         $output .= ' <span class="separator">|</span> <a href="' . claro_htmlspecialchars(Url::Contextualize(get_module_url('CLANN') . '/announcements.php')) . '">' . '<img src="' . get_icon_url('settings') . '" alt="' . get_lang('Settings') . '" /> ' . get_lang('Manage') . '</a>';
     }
     return $output;
 }
Example #7
0
 public function renderContent()
 {
     $output = '';
     $output .= '<table class="claroTable emphaseLine" width="99%" border="0" cellspacing="2">' . "\n" . '<thead>' . "\n" . '<tr align="center" valign="top">' . "\n" . '<th>&nbsp;</th>' . "\n" . '<th>' . get_lang('Subject') . '</th>' . "\n" . '<th>' . get_lang('Sender') . '</th>' . "\n" . '<th>' . get_lang('Date') . '</th>' . "\n" . '</tr>' . "\n" . '</thead>' . "\n" . '<tbody>' . "\n";
     if ($this->inbox->getNumberOfMessage() > 0) {
         foreach ($this->inbox as $message) {
             if ($message->isPlatformMessage()) {
                 $classMessage = 'class="platformMessage"';
                 $iconMessage = '<img src="' . get_icon_url('important') . '" alt="' . get_lang('Important') . '" />';
             } else {
                 $classMessage = $message->isRead() ? 'class="readMessage"' : 'class="unreadMessage"';
                 $iconMessage = $message->isRead() ? '<img src="' . get_icon_url('mail_open') . '" alt="" />' : '<img src="' . get_icon_url('mail_close') . '" alt="" />';
             }
             $output .= "\n" . '<tr ' . $classMessage . '>' . "\n" . '<td>' . $iconMessage . '</td>' . "\n" . '<td>' . '<a href="' . get_path('clarolineRepositoryWeb') . 'messaging/readmessage.php?messageId=' . $message->getId() . '&amp;type=received">' . claro_htmlspecialchars($message->getSubject()) . '</a>' . "\n" . '</td>' . "\n" . '<td>' . claro_htmlspecialchars($message->getSenderLastName()) . '&nbsp;' . claro_htmlspecialchars($message->getSenderFirstName()) . '</td>' . "\n" . '<td align="center">' . claro_html_localised_date(get_locale('dateFormatLong'), strtotime($message->getSendTime())) . '</td>' . "\n" . '</tr>' . "\n";
         }
     } else {
         $output .= "\n" . '<tr>' . "\n" . '<td colspan="4" align="center">' . get_lang('Empty') . '</td>' . "\n" . '</tr>' . "\n";
     }
     $output .= "\n" . '</tbody>' . "\n" . '</table>' . "\n" . '<a href="' . get_path('clarolineRepositoryWeb') . 'messaging/index.php' . '">' . get_lang('View all my messages') . '</a>';
     return $output;
 }
Example #8
0
 protected function renderContent()
 {
     $html = '';
     $sql = "SELECT `data`,\n                        COUNT(DISTINCT `user_id`) AS `nbr_distinct_user_downloads`,\n                        COUNT(`data`) AS `nbr_total_downloads`\n                    FROM `" . $this->tbl_course_tracking_event . "`\n                    WHERE `type` = 'download'\n                      AND `group_id` IS NULL\n                    GROUP BY `data`\n                    ORDER BY substring_index(data,'\"',-2)";
     $results = claro_sql_query_fetch_all($sql);
     $html .= '<table class="claroTable" cellpadding="2" cellspacing="1" border="0" align="center" style="width: 99%;">' . "\n" . '<thead>' . "\n" . '<tr>' . "\n" . '<th>&nbsp;' . get_lang('Document') . '&nbsp;</th>' . "\n" . '<th>&nbsp;' . get_lang('Users Downloads') . '&nbsp;</th>' . "\n" . '<th>&nbsp;' . get_lang('Total Downloads') . '&nbsp;</th>' . "\n" . '</tr>' . "\n" . '</thead>' . "\n" . '<tbody>' . "\n";
     if (!empty($results) && is_array($results)) {
         foreach ($results as $result) {
             $data = unserialize($result['data']);
             if (!empty($data['url'])) {
                 $path = $data['url'];
                 $html .= '<tr>' . "\n" . '<td>' . claro_htmlspecialchars($path) . '</td>' . "\n" . '<td align="right"><a href="user_access_details.php?cmd=doc&amp;path=' . urlencode($path) . '">' . claro_htmlspecialchars($result['nbr_distinct_user_downloads']) . '</a></td>' . "\n" . '<td align="right">' . $result['nbr_total_downloads'] . '</td>' . "\n" . '</tr>' . "\n\n";
             } else {
                 // no data to display ... so drop this record
             }
         }
     } else {
         $html .= '<tr>' . "\n" . '<td colspan="3"><div align="center">' . get_lang('No result') . '</div></td>' . "\n" . '</tr>' . "\n";
     }
     $html .= '</tbody>' . '</table>' . "\n";
     return $html;
 }
Example #9
0
/**
 * CLAROLINE
 *
 * @version     $Revision: 14314 $
 * @copyright   (c) 2001-2011, Universite catholique de Louvain (UCL)
 * @license     http://www.gnu.org/copyleft/gpl.html (GPL) GENERAL PUBLIC LICENSE
 * @author      Piraux Sebastien <*****@*****.**>
 * @author      Lederer Guillaume <*****@*****.**>
 * @package     CLLNP
 * @since       1.8
 */
function lp_display_exercise($cmd, $TABLELEARNPATHMODULE, $TABLEMODULE, $TABLEASSET, $tbl_quiz_exercise)
{
    $out = '';
    if (isset($cmd) && ($cmd = "raw")) {
        // change raw if value is a number between 0 and 100
        if (isset($_POST['newRaw']) && is_num($_POST['newRaw']) && $_POST['newRaw'] <= 100 && $_POST['newRaw'] >= 0) {
            $sql = "UPDATE `" . $TABLELEARNPATHMODULE . "`\n                    SET `raw_to_pass` = " . (int) $_POST['newRaw'] . "\n                    WHERE `module_id` = " . (int) $_SESSION['module_id'] . "\n                    AND `learnPath_id` = " . (int) $_SESSION['path_id'];
            claro_sql_query($sql);
            $dialogBoxContent = get_lang('Minimum raw to pass has been changed');
        }
    }
    $out .= '<hr noshade="noshade" size="1" />';
    //####################################################################################\\
    //############################### DIALOG BOX SECTION #################################\\
    //####################################################################################\\
    if (!empty($dialogBoxContent)) {
        $dialogBox = new DialogBox();
        $dialogBox->success($dialogBoxContent);
        $out .= $dialogBox->render();
    }
    // form to change raw needed to pass the exercise
    $sql = "SELECT `lock`, `raw_to_pass`\n            FROM `" . $TABLELEARNPATHMODULE . "` AS LPM\n           WHERE LPM.`module_id` = " . (int) $_SESSION['module_id'] . "\n             AND LPM.`learnPath_id` = " . (int) $_SESSION['path_id'];
    $learningPath_module = claro_sql_query_get_single_row($sql);
    // if this module blocks the user if he doesn't complete
    if (isset($learningPath_module['lock']) && $learningPath_module['lock'] == 'CLOSE' && isset($learningPath_module['raw_to_pass'])) {
        $out .= '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">' . "\n" . claro_form_relay_context() . '<label for="newRaw">' . get_lang('Change minimum raw mark to pass this module (percentage) :') . ' </label>' . "\n" . '<input type="text" value="' . claro_htmlspecialchars($learningPath_module['raw_to_pass']) . '" name="newRaw" id="newRaw" size="3" maxlength="3" /> % ' . "\n" . '<input type="hidden" name="cmd" value="raw" />' . "\n" . '<input type="submit" value="' . get_lang('Ok') . '" />' . "\n" . '</form>' . "\n\n";
    }
    // display current exercise info and change comment link
    $sql = "SELECT `E`.`id` AS `exerciseId`, `M`.`name`\n            FROM `" . $TABLEMODULE . "` AS `M`,\n                 `" . $TABLEASSET . "`  AS `A`,\n                 `" . $tbl_quiz_exercise . "` AS `E`\n           WHERE `A`.`module_id` = M.`module_id`\n             AND `M`.`module_id` = " . (int) $_SESSION['module_id'] . "\n             AND `E`.`id` = `A`.`path`";
    $module = claro_sql_query_get_single_row($sql);
    if ($module) {
        $out .= "\n\n" . '<h4>' . get_lang('Exercise in module') . ' :</h4>' . "\n" . '<p>' . "\n" . claro_htmlspecialchars($module['name']) . '<a href="../exercise/admin/edit_exercise.php?exId=' . $module['exerciseId'] . '">' . '<img src="' . get_icon_url('edit') . '" alt="' . get_lang('Modify') . '" />' . '</a>' . "\n" . '</p>' . "\n";
    }
    // else sql error, do nothing except in debug mode, where claro_sql_query_fetch_all will show the error
    return $out;
}
Example #10
0
$cmdList = array();
switch ($display) {
    case DISP_PROFILE_FORM:
        // Display user tracking link
        $profileText = claro_text_zone::get_content('textzone_edit_profile_form');
        if (get_conf('is_trackingEnabled')) {
            // Display user tracking link
            $cmdList[] = array('img' => 'statistics', 'name' => get_lang('View my statistics'), 'url' => claro_htmlspecialchars(Url::Contextualize(get_conf('urlAppend') . '/claroline/tracking/userReport.php?userId=' . claro_get_current_user_id())));
        }
        // Display request course creator status
        if (!claro_is_allowed_to_create_course() && get_conf('can_request_course_creator_status')) {
            $cmdList[] = array('name' => get_lang('Request course creation status'), 'url' => claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=reqCCstatus')));
        }
        // Display user revoquation
        if (get_conf('can_request_revoquation')) {
            $cmdList[] = array('img' => 'delete', 'name' => get_lang('Delete my account'), 'url' => claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=reqRevoquation')));
        }
        if (claro_is_platform_admin()) {
            $dialogBox->info(get_lang('As a platform administrator, you can edit any field you want, even if this field isn\'t editable for other users.<br />You can check the list of editable fields in your platform\'s configuration.'));
        }
        break;
}
// Display
$out = '';
$out .= claro_html_tool_title($nameTools, null, $cmdList) . $dialogBox->render();
switch ($display) {
    case DISP_PROFILE_FORM:
        // Display form profile
        if (trim($profileText) != '') {
            $out .= '<div class="info profileEdit">' . $profileText . '</div>';
        }
Example #11
0
    $out .= get_lang('File (file required, description text optional)');
}
$out .= '<br />' . "\n" . '<b>' . get_lang('Submission visibility') . '</b> : ' . "\n" . ($assignment->getDefaultSubmissionVisibility() == 'VISIBLE' ? get_lang('Visible for all users') : get_lang('Only visible for teacher(s) and submitter(s)')) . '<br />' . "\n" . '<b>' . get_lang('Assignment type') . '</b> : ' . "\n" . ($assignment->getAssignmentType() == 'INDIVIDUAL' ? get_lang('Individual') : get_lang('Groups')) . '<br />' . "\n" . '<b>' . get_lang('Allow late upload') . '</b> : ' . "\n" . ($assignment->getAllowLateUpload() == 'YES' ? get_lang('Users can submit after end date') : get_lang('Users can not submit after end date')) . '</small>' . "\n" . '</p>' . "\n";
// description of assignment
if ($assignment->getDescription() != '') {
    $out .= '<b><small>' . get_lang('Description') . '</small></b>' . "\n" . '<blockquote>' . "\n" . '<small>' . "\n" . claro_parse_user_text($assignment->getDescription()) . '</small>' . "\n" . '</blockquote>' . "\n" . '<br />' . "\n";
}
// show to authenticated and anonymous users
if ($textOrFilePresent && ($showAfterEndDate || $showAfterPost)) {
    $out .= '<fieldset>' . "\n" . '<legend>' . '<b>' . get_lang('Feedback') . '</b>' . '</legend>';
    if ($assignment->getAutoFeedbackText() != '') {
        $out .= claro_parse_user_text($assignment->getAutoFeedbackText());
    }
    if ($assignment->getAutoFeedbackFilename() != '') {
        $target = get_conf('open_submitted_file_in_new_window') ? 'target="_blank"' : '';
        $out .= '<p><a href="' . claro_htmlspecialchars(Url::Contextualize($assignment->getAssigDirWeb() . $assignment->getAutoFeedbackFilename())) . '" ' . $target . '>' . $assignment->getAutoFeedbackFilename() . '</a></p>';
    }
    $out .= '</fieldset>' . '<br />' . "\n";
}
if ($is_allowedToEditAll) {
    // Submission download requested
    if ($cmd == 'rqDownload' && (claro_is_platform_admin() || get_conf('allow_download_all_submissions'))) {
        require_once $includePath . '/lib/form.lib.php';
        $downloadForm = '<strong>' . get_lang('Download') . '</strong>' . "\n" . '<form action="' . get_module_url('CLWRK') . '/export.php?assigId=' . $req['assignmentId'] . '" method="POST">' . "\n" . claro_form_relay_context() . '<input type="hidden" name="cmd" value="exDownload" />' . "\n" . '<input type="radio" name="downloadMode" id="downloadMode_from" value="from" checked /><label for="downloadMode_from">' . get_lang('Submissions posted or modified after date :') . '</label><br />' . "\n" . claro_html_date_form('day', 'month', 'year', time(), 'long') . ' ' . claro_html_time_form('hour', 'minute', time() - fmod(time(), 86400) - 3600) . '<small>' . get_lang('(d/m/y hh:mm)') . '</small>' . '<br /><br />' . "\n" . '<input type="radio" name="downloadMode" id="downloadMode_all" value="all" /><label for="downloadMode_all">' . get_lang('All submissions') . '</label><br /><br />' . "\n" . '<input type="checkbox" name="downloadOnlyCurrentMembers" id="downloadOnlyCurrentMembers_id" value="yes" checked="checked" /><label for="downloadOnlyCurrentMembers_id">' . get_lang('Download only submissions from current course members') . '</label><br /><br />' . "\n" . '<input type="checkbox" name="downloadScore" id="downloadScore_id" value="yes" checked="checked" /><label for="downloadScore_id">' . get_lang('Download score') . '</label><br /><br />' . "\n" . '<input type="submit" value="' . get_lang('OK') . '" />&nbsp;' . "\n" . claro_html_button('work_list.php?assigId=' . $req['assignmentId'], get_lang('Cancel')) . '</form>' . "\n";
        $dialogBox->form($downloadForm);
    }
}
// Render dialog box
$out .= $dialogBox->render();
/**
 * Submitter (User or group) listing
Example #12
0
        $icon = get_icon_url('tool');
    }
    $style = '';
    // patchy
    if (claro_is_platform_admin() || claro_is_course_manager()) {
        if (!$_groupProperties['tools'][$thisTool['label']]) {
            $style = 'invisible ';
        }
    }
    // see if tool name must be displayed 'as containing new items' (a red ball by default)  or not
    $classItem = '';
    if (in_array($thisTool['id'], $modified_tools)) {
        $classItem = " hot";
    }
    if (!empty($url)) {
        $toolLinkList[] = '<a class="' . trim($style . ' item' . $classItem) . '" href="' . claro_htmlspecialchars(Url::Contextualize($url)) . '">' . '<img src="' . $icon . '" alt="" />&nbsp;' . $toolName . '</a>' . "\n";
    } else {
        $toolLinkList[] = '<span ' . trim($style) . '>' . '<img src="' . $icon . '" alt="" />&nbsp;' . $toolName . '</span>' . "\n";
    }
}
/*****************
 * DISPLAY SECTION
 ******************/
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);
Example #13
0
         {
             if (confirm("' . get_lang('Are you sure to delete the message?') . '"))
             {
                 window.location=localPath;
                 return false;
             }
             else
             {
                 return false;
             }
         }
         </script>';
     $claroline->display->header->addHtmlHeader($javascriptDelete);
     foreach ($box as $key => $message) {
         $userData = user_get_properties($message->getSender());
         $content .= '<tr>' . "\n" . '<td class="im_list_selection"><input type="checkbox" name="msg[]" value="' . $message->getId() . '" /></td>' . "\n" . '<td><a href="readmessage.php?messageId=' . $message->getId() . '&amp;type=received">' . claro_htmlspecialchars($message->getSubject()) . '</a></td>' . "\n" . '<td><a href="sendmessage.php?cmd=rqMessageToUser&amp;userId=' . $message->getSender() . '">' . get_lang('%firstName %lastName', array('%firstName' => claro_htmlspecialchars($message->getSenderFirstName()), '%lastName' => claro_htmlspecialchars($message->getSenderLastName()))) . '</a>' . '</td>' . '<td>' . claro_htmlspecialchars($userData['username']) . '</td>' . "\n" . '<td>' . claro_html_localised_date(get_locale('dateTimeFormatLong'), strtotime($message->getSendTime())) . '</td>' . "\n" . '<td class="im_list_action"><a href="' . $linkDelete . 'cmd=rqDeleteMessage&amp;message_id=' . $message->getId() . '" ' . 'onclick="return deleteMessage(\'' . $linkDelete . 'cmd=exDeleteMessage&amp;message_id=' . $message->getId() . '\')"' . '><img src="' . get_icon_url('delete') . '" alt="" /></a></td>' . "\n" . '</tr>' . "\n\n";
     }
     $content .= '</table>' . '<input type="submit" value="' . get_lang('Delete selected message(s)') . '" />' . "\n\n";
 }
 $content .= '</form>';
 // prepare the link to change of page
 if ($box->getNumberOfPage() > 1) {
     // number of page to display in the page before and after thecurrent page
     $nbPageToDisplayBeforeAndAfterCurrentPage = 1;
     $content .= '<div id="im_paging">';
     $arg_paging = makeArgLink($arguments, array('page'));
     if ($arg_paging == "") {
         $linkPaging = $_SERVER['PHP_SELF'] . "?page=";
     } else {
         $linkPaging = $_SERVER['PHP_SELF'] . "?" . $arg_paging . "&amp;page=";
     }
Example #14
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 . '&amp;cmd=rqPost' . '&amp;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 #15
0
 protected function renderFooter()
 {
     return get_lang('Messages posted') . ' : ' . $this->getUserTotalForumPost() . '<br />' . "\n" . get_lang('Topics started') . ' : ' . $this->getUserTotalForumTopics() . '<br />' . "\n" . '<a href="' . claro_htmlspecialchars(Url::Contextualize(get_module_url('CLFRM') . '/viewsearch.php?searchUser='******'">' . get_lang('View all user\'s posts') . '</a>' . "\n";
 }
Example #16
0
 protected function renderContent()
 {
     if (isset($_REQUEST['exId']) && is_numeric($_REQUEST['exId'])) {
         $exId = (int) $_REQUEST['exId'];
     } else {
         $exId = null;
     }
     $exerciseResults = $this->prepareContent();
     $jsloader = JavascriptLoader::getInstance();
     $jsloader->load('jquery');
     $context = array('cidReq' => $this->courseId, 'cidReset' => true, 'userId' => $this->userId);
     $html = '<script language="javascript" type="text/javascript">' . "\n" . ' $(document).ready(function() {' . '  $(\'.exerciseDetails\').hide();' . '  $(\'.exerciseDetailsToggle\').click( function()' . '  {' . '   $(this).next(".exerciseDetails").toggle();' . '   return false;' . '  });' . ' });' . '</script>' . "\n\n";
     $html .= '<table class="claroTable emphaseLine" cellpadding="2" cellspacing="1" border="0" align="center" style="width: 99%;">' . "\n" . '<thead>' . "\n" . '<tr class="headerX">' . "\n" . '<th>' . get_lang('Exercises') . '</th>' . "\n" . '<th>' . get_lang('Worst score') . '</th>' . "\n" . '<th>' . get_lang('Best score') . '</th>' . "\n" . '<th>' . get_lang('Average score') . '</th>' . "\n" . '<th>' . get_lang('Average Time') . '</th>' . "\n" . '<th>' . get_lang('Attempts') . '</th>' . "\n" . '<th>' . get_lang('Last attempt') . '</th>' . "\n" . '</tr>' . "\n" . '</thead>' . "\n";
     if (!empty($exerciseResults) && is_array($exerciseResults)) {
         $html .= '<tbody>' . "\n";
         foreach ($exerciseResults as $result) {
             $html .= '<tr class="exerciseDetailsToggle">' . "\n" . '<td><a href="#">' . claro_htmlspecialchars($result['title']) . '</td>' . "\n" . '<td>' . (int) $result['minimum'] . '</td>' . "\n" . '<td>' . (int) $result['maximum'] . '</td>' . "\n" . '<td>' . round($result['average'] * 10) / 10 . '</td>' . "\n" . '<td>' . claro_html_duration(floor($result['avgTime'])) . '</td>' . "\n" . '<td>' . (int) $result['attempts'] . '</td>' . "\n" . '<td>' . claro_html_localised_date(get_locale('dateTimeFormatLong'), strtotime($result['lastAttempt'])) . "</td> \n";
             $html .= '</tr>' . "\n";
             // details
             $exerciseDetails = $this->getUserExerciceDetails($result['id']);
             if (is_array($exerciseDetails) && !empty($exerciseDetails)) {
                 $html .= '<tr class="exerciseDetails" >';
                 if (claro_is_course_manager()) {
                     $html .= '<td><a href="' . claro_htmlspecialchars(Url::Contextualize(get_module_url('CLQWZ') . '/track_exercise_reset.php?cmd=resetAllAttemptsForUser&exId=' . $result['id'], $context)) . '">' . get_lang('delete all') . '</a></td>';
                 } else {
                     $html .= '<td>&nbsp;</td>' . "\n";
                 }
                 $html .= '<td colspan="6" class="noHover">' . "\n" . '<table class="claroTable emphaseLine" cellspacing="1" cellpadding="2" border="0" width="100%" style="width: 99%;">' . "\n" . '<thead>' . "\n";
                 $html .= '' . '<tr>' . "\n" . '<th><small>' . get_lang('Date') . '</small></th>' . "\n" . '<th><small>' . get_lang('Score') . '</small></th>' . "\n" . '<th><small>' . get_lang('Time') . '</small></th>' . "\n" . '<th><small>' . get_lang('Delete') . '</small></th>' . "\n" . '</tr>' . "\n" . '</thead>' . "\n" . '<tbody>' . "\n";
                 foreach ($exerciseDetails as $details) {
                     $html .= '<tr>' . "\n" . '<td><small>' . "\n" . '<a href="' . get_module_url('CLQWZ') . '/track_exercise_details.php?trackedExId=' . $details['id'] . '">' . claro_html_localised_date(get_locale('dateTimeFormatLong'), strtotime($details['date'])) . '</a></small></td>' . "\n" . '<td><small>' . $details['result'] . '/' . $details['weighting'] . '</small></td>' . "\n" . '<td><small>' . claro_html_duration($details['time']) . '</small></td>' . "\n";
                     if (claro_is_course_manager()) {
                         $html .= '<td><small><a href="' . claro_htmlspecialchars(Url::Contextualize(get_module_url('CLQWZ') . '/track_exercise_reset.php?cmd=resetAttemptForUser&trackId=' . $details['id'], $context)) . '">' . get_lang('delete') . '</a></small></td>' . "\n";
                     } else {
                         $html .= '<td><small>-</small></td>';
                     }
                     $html .= '</tr>' . "\n";
                 }
                 $html .= '</tbody>' . "\n" . '</table>' . "\n\n" . '</td>' . "\n" . '</tr>' . "\n";
             }
         }
         $html .= '</tbody>' . "\n";
     } else {
         $html .= '<tbody>' . "\n" . '<tr>' . "\n" . '<td colspan="7" align="center">' . get_lang('No result') . '</td>' . "\n" . '</tr>' . "\n" . '</tbody>' . "\n";
     }
     $html .= '</table>' . "\n\n";
     return $html;
 }
Example #17
0
/**
 * Send e-mail to Claroline users form their ID a user of Claroline
 *
 * Send e-mail to Claroline users form their ID a user of Claroline
 * default from clause in email address will be the platorm admin adress
 * default from name clause in email will be the platform admin name and surname
 *
 * @author Hugues Peeters <*****@*****.**>
 * @param  int or array $userIdList - sender id's
 * @param  string $message - mail content
 * @param  string $subject - mail subject
 * @param  string $specificFrom (optional) sender's email address
 * @param  string  $specificFromName (optional) sender's name
 * @return int total count of sent email
 */
function claro_mail_user($userIdList, $message, $subject, $specificFrom = '', $specificFromName = '')
{
    if (!is_array($userIdList)) {
        $userIdList = array($userIdList);
    }
    if (count($userIdList) == 0) {
        return 0;
    }
    $tbl = claro_sql_get_main_tbl();
    $tbl_user = $tbl['user'];
    $sql = 'SELECT DISTINCT email
            FROM `' . $tbl_user . '`
            WHERE user_id IN (' . implode(', ', array_map('intval', $userIdList)) . ')';
    $emailList = claro_sql_query_fetch_all_cols($sql);
    $emailList = $emailList['email'];
    $emailList = array_filter($emailList, 'is_well_formed_email_address');
    $mail = new ClaroPHPMailer();
    if ($specificFrom != '') {
        $mail->From = $specificFrom;
    } else {
        $mail->From = get_conf('administrator_email');
    }
    if ($specificFromName != '') {
        $mail->FromName = $specificFromName;
    } else {
        $mail->FromName = get_conf('administrator_name');
    }
    $mail->Sender = $mail->From;
    if (strlen($subject) > 78) {
        $message = $subject . "\n" . $message;
        $subject = substr($subject, 0, 73) . '...';
    }
    $mail->Subject = $subject;
    $mail->Body = $message;
    $emailSentCount = 0;
    if (claro_debug_mode()) {
        $message = '<p>Subject : ' . claro_htmlspecialchars($subject) . '</p>' . "\n" . '<p>Message : <pre>' . claro_htmlspecialchars($message) . '</pre></p>' . "\n" . '<p>From : ' . claro_htmlspecialchars($mail->FromName) . ' - ' . claro_htmlspecialchars($mail->From) . '</p>' . "\n" . '<p>Dest : ' . implode(', ', $emailList) . '</p>' . "\n";
        pushClaroMessage($message, 'mail');
    }
    foreach ($emailList as $thisEmail) {
        $mail->AddAddress($thisEmail);
        if ($mail->Send()) {
            $emailSentCount++;
        } else {
            if (claro_debug_mode()) {
                pushClaroMessage($mail->getError(), 'error');
            }
        }
        $mail->ClearAddresses();
    }
    return $emailSentCount;
}
Example #18
0
}
$nameTools = get_lang('Create/edit document');
$out = '';
$out .= claro_html_tool_title(array('mainTitle' => get_lang('Documents and Links'), 'subTitle' => get_lang('Create/edit document')));
/*========================================================================
CREATE DOCUMENT
========================================================================*/
if ($cmd == 'rqMkHtml') {
    $out .= '<form action="' . claro_htmlspecialchars(get_module_entry_url('CLDOC')) . '" method="post">' . "\n" . claro_form_relay_context() . "\n" . '<input type="hidden" name="cmd" value="exMkHtml" />' . "\n" . '<input type="hidden" name="cwd" value="' . claro_htmlspecialchars(strip_tags($cwd)) . '" />' . "\n" . '<p>' . "\n" . '<b>' . get_lang('Document name') . '&nbsp;: </b><br />' . "\n" . '<input type="text" name="fileName" size="80" />' . "\n" . '</p>' . "\n" . '<p>' . "\n" . '<b>' . get_lang('Document content') . '&nbsp;: </b>' . "\n";
    if (!empty($_REQUEST['htmlContent'])) {
        $content = $_REQUEST['htmlContent'];
    } else {
        $content = "";
    }
    $out .= claro_html_textarea_editor('htmlContent', $content);
    // the second argument _REQUEST['htmlContent'] for the case when we have to
    // get to the editor because of an error at creation
    // (eg forgot to give a file name)
    $out .= '</p>' . "\n" . '<p>' . "\n" . '<input type="submit" value="' . get_lang('Ok') . '" />&nbsp;' . claro_html_button(claro_htmlspecialchars(Url::Contextualize('./document.php?cmd=exChDir&amp;file=' . strip_tags($cwd))), get_lang('Cancel')) . '</p>' . "\n" . '</form>' . "\n";
} elseif ($cmd == "rqEditHtml" && !empty($file)) {
    if (is_parent_path($baseWorkDir, $file)) {
        $fileContent = implode("\n", file($baseWorkDir . $file));
    } else {
        claro_die('WRONG PATH');
    }
    $fileContent = get_html_body_content($fileContent);
    $out .= '<form action="' . claro_htmlspecialchars(get_module_entry_url('CLDOC')) . '" method="post">' . "\n" . claro_form_relay_context() . "\n" . '<input type="hidden" name="cmd" value="exEditHtml" />' . "\n" . '<input type="hidden" name="file" value="' . claro_htmlspecialchars(base64_encode($file)) . '" />' . "\n" . '<b>' . get_lang('Document name') . ' : </b><br />' . "\n" . $file . "\n" . '</p>' . "\n" . '<p>' . "\n" . '<b>' . get_lang('Document content') . ' : </b>' . "\n" . claro_html_textarea_editor('htmlContent', $fileContent) . "\n" . '</p>' . '<p>' . '<input type="submit" value="' . get_lang('Ok') . '" />&nbsp;' . "\n" . claro_html_button(claro_htmlspecialchars(Url::Contextualize('./document.php?cmd=rqEdit&file=' . base64_encode($file))), get_lang('Cancel')) . "\n" . '</p>' . "\n" . '</form>' . "\n";
}
$out .= '<br />' . "\n" . '<br />' . "\n";
$claroline->display->body->appendContent($out);
echo $claroline->display->render();
Example #19
0
} else {
    $title = get_lang('Search on') . ' : ';
}
//Pager
if (isset($_REQUEST['order_crit'])) {
    $addToURL = '&amp;order_crit=' . $_SESSION['admin_register_order_crit'] . '&amp;dir=' . $_SESSION['admin_register_dir'];
}
//------------------------------------
// DISPLAY
//------------------------------------
// Display tool title
$out = '';
$out .= claro_html_tool_title($nameTools);
// Display Forms or dialog box(if needed)
$out .= $dialogBox->render();
$out .= '<table width="100%" class="claroTableForm" >' . '<tr>' . '<td align="left">' . "\n" . '<b>' . $title . '</b>' . "\n" . '<small>' . "\n" . $isSearched . "\n" . '</small>' . "\n" . '</td>' . "\n" . '<td align="right">' . "\n" . '<form action="' . $_SERVER['PHP_SELF'] . '" >' . "\n" . '<label for="search">' . get_lang('Make search') . '</label> :' . "\n" . '<input type="text" value="' . claro_htmlspecialchars($search) . '" name="search" id="search" />' . "\n" . '<input type="submit" value=" ' . get_lang('Ok') . ' "/>' . "\n" . '<input type="hidden" name="newsearch" value="yes" />' . "\n" . '<input type="hidden" name="cidToEdit" value="' . $cidToEdit . '" />' . "\n" . '</form>' . "\n" . '</td>' . "\n" . '</tr>' . "\n" . '</table>' . "\n" . '<a class="claroCmd" href="admincourseusers.php?cidToEdit=' . $cidToEdit . '">' . get_lang('Course members') . '</a><br /><br />' . $myPager->disp_pager_tool_bar($_SERVER['PHP_SELF'] . '?cidToEdit=' . $cidToEdit . $addToURL) . '<table class="claroTable emphaseLine" width="100%" border="0" cellspacing="2">' . "\n" . '<thead>' . "\n" . '<tr align="center" valign="top">' . "\n" . '<th>' . '<a href="' . $_SERVER['PHP_SELF'] . '?order_crit=user_id&amp;chdir=yes&amp;search=' . $search . '&amp;cidToEdit=' . $cidToEdit . '">' . get_lang('User id') . '</a>' . '</th>' . "\n" . '<th>' . '<a href="' . $_SERVER['PHP_SELF'] . '?order_crit=nom' . '&amp;chdir=yes&amp;search=' . $search . '&amp;cidToEdit=' . $cidToEdit . '">' . get_lang('Last name') . '</a>' . '</th>' . "\n" . '<th>' . '<a href="' . $_SERVER['PHP_SELF'] . '?order_crit=prenom' . '&amp;chdir=yes' . '&amp;search=' . $search . '&amp;cidToEdit=' . $cidToEdit . '">' . get_lang('First name') . '</a>' . '</th>' . "\n" . '<th>' . get_lang('Enrol as student') . '</th>' . "\n" . '<th>' . get_lang('Enrol as course manager') . '</th>' . "\n" . '</tr>' . "\n" . '</thead>' . "\n" . '<tbody>';
// Start the list of users...
$addToURL = isset($_REQUEST['addToURL']) ? $_REQUEST['addToURL'] : '';
if (isset($_REQUEST['order_crit'])) {
    $addToURL = '&amp;order_crit=' . $_REQUEST['order_crit'];
}
if (isset($_REQUEST['offset'])) {
    $addToURL = '&amp;offset=' . $_REQUEST['offset'];
}
foreach ($userList as $user) {
    if (isset($_REQUEST['search']) && $_REQUEST['search'] != '') {
        $user['nom'] = preg_replace("/^(" . $_REQUEST['search'] . ")/i", '<b>\\1</b>', $user['nom']);
        $user['prenom'] = preg_replace("/^(" . $_REQUEST['search'] . ")/i", "<b>\\1</b>", $user['prenom']);
    }
    $out .= '<tr>' . "\n" . '<td align="center">' . $user['ID'] . '</td>' . "\n" . '<td align="left">' . $user['nom'] . '</td>' . '<td align="left">' . $user['prenom'] . '</td>';
    if (!is_null($user['isCourseManager']) && $user['isCourseManager'] == 0) {
Example #20
0
 /**
  * Returns the html code needed to display the default textarea
  *
  * @access private
  * @return string html code needed to display the default textarea
  */
 function getTextArea($class = '')
 {
     $textArea = "\n" . '<textarea ' . 'id="' . $this->name . '" ' . 'name="' . $this->name . '" ' . 'style="width:100%" ';
     if (!empty($class)) {
         $textArea .= 'class="' . $class . '" ';
     }
     $textArea .= 'rows="' . $this->rows . '" ' . 'cols="' . $this->cols . '" ' . $this->optAttrib . ' >' . claro_htmlspecialchars($this->content) . '</textarea>' . "\n";
     return $textArea;
 }
Example #21
0
 /**
  * serialize the parsed wsdl
  *
  * @param mixed $debug whether to put debug=1 in endpoint URL
  * @return string serialization of WSDL
  * @access public 
  */
 function serialize($debug = 0)
 {
     $xml = '<?xml version="1.0" encoding="ISO-8859-1"?>';
     $xml .= "\n<definitions";
     foreach ($this->namespaces as $k => $v) {
         $xml .= " xmlns:{$k}=\"{$v}\"";
     }
     // 10.9.02 - add poulter fix for wsdl and tns declarations
     if (isset($this->namespaces['wsdl'])) {
         $xml .= " xmlns=\"" . $this->namespaces['wsdl'] . "\"";
     }
     if (isset($this->namespaces['tns'])) {
         $xml .= " targetNamespace=\"" . $this->namespaces['tns'] . "\"";
     }
     $xml .= '>';
     // imports
     if (sizeof($this->import) > 0) {
         foreach ($this->import as $ns => $list) {
             foreach ($list as $ii) {
                 if ($ii['location'] != '') {
                     $xml .= '<import location="' . $ii['location'] . '" namespace="' . $ns . '" />';
                 } else {
                     $xml .= '<import namespace="' . $ns . '" />';
                 }
             }
         }
     }
     // types
     if (count($this->schemas) >= 1) {
         $xml .= "\n<types>\n";
         foreach ($this->schemas as $ns => $list) {
             foreach ($list as $xs) {
                 $xml .= $xs->serializeSchema();
             }
         }
         $xml .= '</types>';
     }
     // messages
     if (count($this->messages) >= 1) {
         foreach ($this->messages as $msgName => $msgParts) {
             $xml .= "\n<message name=\"" . $msgName . '">';
             if (is_array($msgParts)) {
                 foreach ($msgParts as $partName => $partType) {
                     // print 'serializing '.$partType.', sv: '.$this->XMLSchemaVersion.'<br>';
                     if (strpos($partType, ':')) {
                         $typePrefix = $this->getPrefixFromNamespace($this->getPrefix($partType));
                     } elseif (isset($this->typemap[$this->namespaces['xsd']][$partType])) {
                         // print 'checking typemap: '.$this->XMLSchemaVersion.'<br>';
                         $typePrefix = 'xsd';
                     } else {
                         foreach ($this->typemap as $ns => $types) {
                             if (isset($types[$partType])) {
                                 $typePrefix = $this->getPrefixFromNamespace($ns);
                             }
                         }
                         if (!isset($typePrefix)) {
                             die("{$partType} has no namespace!");
                         }
                     }
                     $ns = $this->getNamespaceFromPrefix($typePrefix);
                     $localPart = $this->getLocalPart($partType);
                     $typeDef = $this->getTypeDef($localPart, $ns);
                     if ($typeDef['typeClass'] == 'element') {
                         $elementortype = 'element';
                         if (substr($localPart, -1) == '^') {
                             $localPart = substr($localPart, 0, -1);
                         }
                     } else {
                         $elementortype = 'type';
                     }
                     $xml .= "\n" . '  <part name="' . $partName . '" ' . $elementortype . '="' . $typePrefix . ':' . $localPart . '" />';
                 }
             }
             $xml .= '</message>';
         }
     }
     // bindings & porttypes
     if (count($this->bindings) >= 1) {
         $binding_xml = '';
         $portType_xml = '';
         foreach ($this->bindings as $bindingName => $attrs) {
             $binding_xml .= "\n<binding name=\"" . $bindingName . '" type="tns:' . $attrs['portType'] . '">';
             $binding_xml .= "\n" . '  <soap:binding style="' . $attrs['style'] . '" transport="' . $attrs['transport'] . '"/>';
             $portType_xml .= "\n<portType name=\"" . $attrs['portType'] . '">';
             foreach ($attrs['operations'] as $opName => $opParts) {
                 $binding_xml .= "\n" . '  <operation name="' . $opName . '">';
                 $binding_xml .= "\n" . '    <soap:operation soapAction="' . $opParts['soapAction'] . '" style="' . $opParts['style'] . '"/>';
                 if (isset($opParts['input']['encodingStyle']) && $opParts['input']['encodingStyle'] != '') {
                     $enc_style = ' encodingStyle="' . $opParts['input']['encodingStyle'] . '"';
                 } else {
                     $enc_style = '';
                 }
                 $binding_xml .= "\n" . '    <input><soap:body use="' . $opParts['input']['use'] . '" namespace="' . $opParts['input']['namespace'] . '"' . $enc_style . '/></input>';
                 if (isset($opParts['output']['encodingStyle']) && $opParts['output']['encodingStyle'] != '') {
                     $enc_style = ' encodingStyle="' . $opParts['output']['encodingStyle'] . '"';
                 } else {
                     $enc_style = '';
                 }
                 $binding_xml .= "\n" . '    <output><soap:body use="' . $opParts['output']['use'] . '" namespace="' . $opParts['output']['namespace'] . '"' . $enc_style . '/></output>';
                 $binding_xml .= "\n" . '  </operation>';
                 $portType_xml .= "\n" . '  <operation name="' . $opParts['name'] . '"';
                 if (isset($opParts['parameterOrder'])) {
                     $portType_xml .= ' parameterOrder="' . $opParts['parameterOrder'] . '"';
                 }
                 $portType_xml .= '>';
                 if (isset($opParts['documentation']) && $opParts['documentation'] != '') {
                     $portType_xml .= "\n" . '    <documentation>' . claro_htmlspecialchars($opParts['documentation']) . '</documentation>';
                 }
                 $portType_xml .= "\n" . '    <input message="tns:' . $opParts['input']['message'] . '"/>';
                 $portType_xml .= "\n" . '    <output message="tns:' . $opParts['output']['message'] . '"/>';
                 $portType_xml .= "\n" . '  </operation>';
             }
             $portType_xml .= "\n" . '</portType>';
             $binding_xml .= "\n" . '</binding>';
         }
         $xml .= $portType_xml . $binding_xml;
     }
     // services
     $xml .= "\n<service name=\"" . $this->serviceName . '">';
     if (count($this->ports) >= 1) {
         foreach ($this->ports as $pName => $attrs) {
             $xml .= "\n" . '  <port name="' . $pName . '" binding="tns:' . $attrs['binding'] . '">';
             $xml .= "\n" . '    <soap:address location="' . $attrs['location'] . ($debug ? '?debug=1' : '') . '"/>';
             $xml .= "\n" . '  </port>';
         }
     }
     $xml .= "\n" . '</service>';
     return $xml . "\n</definitions>";
 }
Example #22
0
" title="<?php 
        echo get_lang('Move this item up');
        ?>
">
            <img src="<?php 
        echo get_icon_url('move_up');
        ?>
" alt="<?php 
        echo get_lang('Move up');
        ?>
" />
        </a>
        
        <a
            href="<?php 
        echo claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=exMvDown&amp;id=' . $this->intro->getId()));
        ?>
"
            title="<?php 
        echo get_lang('Move this item down');
        ?>
">
            <img src="<?php 
        echo get_icon_url('move_down');
        ?>
" alt="<?php 
        echo get_lang('Move down');
        ?>
" />
        </a>
    </div>
Example #23
0
    ?>
                
                    <input type="text" name="email" id="email" value="<?php 
    echo claro_htmlspecialchars($this->data['email']);
    ?>
" />
                
                <?php 
} else {
    ?>
                
                    <?php 
    echo claro_htmlspecialchars($this->data['email']);
    ?>
                    <input type="hidden" name="email" id="email" value="<?php 
    echo claro_htmlspecialchars($this->data['email']);
    ?>
" />
                
                <?php 
}
?>
                    
            </dd>
            <dt>
                <label for="phone">
                    <?php 
echo get_lang('Phone');
?>
                </label>
            </dt>
Example #24
0
" />
                </a>
                <?php 
            } else {
                ?>
&nbsp;
                <?php 
            }
            ?>
            </td>
            <td align="center">
                <?php 
            if ($forumIterator < $thisCategory['forum_count']) {
                ?>
                <a href="<?php 
                echo get_lang(claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=exMvDownForum&amp;forumId=' . $thisForum['forum_id'])));
                ?>
">
                <img src="<?php 
                echo get_icon_url('move_down');
                ?>
" alt="<?php 
                echo get_lang('Move down');
                ?>
" />
                </a>
                <?php 
            } else {
                ?>
&nbsp;
                <?php 
Example #25
0
 /**
  * start-element handler
  *
  * @param    resource $parser XML parser object
  * @param    string $name element name
  * @param    array $attrs associative array of attributes
  * @access   private
  */
 function start_element($parser, $name, $attrs)
 {
     // position in a total number of elements, starting from 0
     // update class level pos
     $pos = $this->position++;
     // and set mine
     $this->message[$pos] = array('pos' => $pos, 'children' => '', 'cdata' => '');
     // depth = how many levels removed from root?
     // set mine as current global depth and increment global depth value
     $this->message[$pos]['depth'] = $this->depth++;
     // else add self as child to whoever the current parent is
     if ($pos != 0) {
         $this->message[$this->parent]['children'] .= '|' . $pos;
     }
     // set my parent
     $this->message[$pos]['parent'] = $this->parent;
     // set self as current parent
     $this->parent = $pos;
     // set self as current value for this depth
     $this->depth_array[$this->depth] = $pos;
     // get element prefix
     if (strpos($name, ':')) {
         // get ns prefix
         $prefix = substr($name, 0, strpos($name, ':'));
         // get unqualified name
         $name = substr(strstr($name, ':'), 1);
     }
     // set status
     if ($name == 'Envelope') {
         $this->status = 'envelope';
     } elseif ($name == 'Header' && ($this->status = 'envelope')) {
         $this->root_header = $pos;
         $this->status = 'header';
     } elseif ($name == 'Body' && ($this->status = 'envelope')) {
         $this->status = 'body';
         $this->body_position = $pos;
         // set method
     } elseif ($this->status == 'body' && $pos == $this->body_position + 1) {
         $this->status = 'method';
         $this->root_struct_name = $name;
         $this->root_struct = $pos;
         $this->message[$pos]['type'] = 'struct';
         $this->debug("found root struct {$this->root_struct_name}, pos {$this->root_struct}");
     }
     // set my status
     $this->message[$pos]['status'] = $this->status;
     // set name
     $this->message[$pos]['name'] = claro_htmlspecialchars($name);
     // set attrs
     $this->message[$pos]['attrs'] = $attrs;
     // loop through atts, logging ns and type declarations
     $attstr = '';
     foreach ($attrs as $key => $value) {
         $key_prefix = $this->getPrefix($key);
         $key_localpart = $this->getLocalPart($key);
         // if ns declarations, add to class level array of valid namespaces
         if ($key_prefix == 'xmlns') {
             if (ereg('^http://www.w3.org/[0-9]{4}/XMLSchema$', $value)) {
                 $this->XMLSchemaVersion = $value;
                 $this->namespaces['xsd'] = $this->XMLSchemaVersion;
                 $this->namespaces['xsi'] = $this->XMLSchemaVersion . '-instance';
             }
             $this->namespaces[$key_localpart] = $value;
             // set method namespace
             if ($name == $this->root_struct_name) {
                 $this->methodNamespace = $value;
             }
             // if it's a type declaration, set type
         } elseif ($key_localpart == 'type') {
             if (isset($this->message[$pos]['type']) && $this->message[$pos]['type'] == 'array') {
                 // do nothing: already processed arrayType
             } else {
                 $value_prefix = $this->getPrefix($value);
                 $value_localpart = $this->getLocalPart($value);
                 $this->message[$pos]['type'] = $value_localpart;
                 $this->message[$pos]['typePrefix'] = $value_prefix;
                 if (isset($this->namespaces[$value_prefix])) {
                     $this->message[$pos]['type_namespace'] = $this->namespaces[$value_prefix];
                 } else {
                     if (isset($attrs['xmlns:' . $value_prefix])) {
                         $this->message[$pos]['type_namespace'] = $attrs['xmlns:' . $value_prefix];
                     }
                 }
                 // should do something here with the namespace of specified type?
             }
         } elseif ($key_localpart == 'arrayType') {
             $this->message[$pos]['type'] = 'array';
             /* do arrayType ereg here
             			[1]    arrayTypeValue    ::=    atype asize
             			[2]    atype    ::=    QName rank*
             			[3]    rank    ::=    '[' (',')* ']'
             			[4]    asize    ::=    '[' length~ ']'
             			[5]    length    ::=    nextDimension* Digit+
             			[6]    nextDimension    ::=    Digit+ ','
             			*/
             $expr = '([A-Za-z0-9_]+):([A-Za-z]+[A-Za-z0-9_]+)\\[([0-9]+),?([0-9]*)\\]';
             if (ereg($expr, $value, $regs)) {
                 $this->message[$pos]['typePrefix'] = $regs[1];
                 $this->message[$pos]['arrayTypePrefix'] = $regs[1];
                 if (isset($this->namespaces[$regs[1]])) {
                     $this->message[$pos]['arrayTypeNamespace'] = $this->namespaces[$regs[1]];
                 } else {
                     if (isset($attrs['xmlns:' . $regs[1]])) {
                         $this->message[$pos]['arrayTypeNamespace'] = $attrs['xmlns:' . $regs[1]];
                     }
                 }
                 $this->message[$pos]['arrayType'] = $regs[2];
                 $this->message[$pos]['arraySize'] = $regs[3];
                 $this->message[$pos]['arrayCols'] = $regs[4];
             }
             // specifies nil value (or not)
         } elseif ($key_localpart == 'nil') {
             $this->message[$pos]['nil'] = $value == 'true' || $value == '1';
             // some other attribute
         } elseif ($key != 'href' && $key != 'xmlns' && $key_localpart != 'encodingStyle' && $key_localpart != 'root') {
             $this->message[$pos]['xattrs']['!' . $key] = $value;
         }
         if ($key == 'xmlns') {
             $this->default_namespace = $value;
         }
         // log id
         if ($key == 'id') {
             $this->ids[$value] = $pos;
         }
         // root
         if ($key_localpart == 'root' && $value == 1) {
             $this->status = 'method';
             $this->root_struct_name = $name;
             $this->root_struct = $pos;
             $this->debug("found root struct {$this->root_struct_name}, pos {$pos}");
         }
         // for doclit
         $attstr .= " {$key}=\"{$value}\"";
     }
     // get namespace - must be done after namespace atts are processed
     if (isset($prefix)) {
         $this->message[$pos]['namespace'] = $this->namespaces[$prefix];
         $this->default_namespace = $this->namespaces[$prefix];
     } else {
         $this->message[$pos]['namespace'] = $this->default_namespace;
     }
     if ($this->status == 'header') {
         if ($this->root_header != $pos) {
             $this->responseHeaders .= "<" . (isset($prefix) ? $prefix . ':' : '') . "{$name}{$attstr}>";
         }
     } elseif ($this->root_struct_name != '') {
         $this->document .= "<" . (isset($prefix) ? $prefix . ':' : '') . "{$name}{$attstr}>";
     }
 }
Example #26
0
/**
* display a page of thumbnails
*
 * @copyright   (c) 2001-2011, Universite catholique de Louvain (UCL)
* @param imageList (array) list containing all image file names
* @param fileList (array) file properties
* @param page (int) current page number
* @param thumbnailWidth (int) width of thumbnails
* @param colWidth (int) width of columns
* @param numberOfCols (int) number of columns
* @param numberOfRows (int) number of rows
* @global curDirPath
*/
function display_thumbnails($imageList, $fileList, $page, $thumbnailWidth, $colWidth, $numberOfCols, $numberOfRows)
{
    global $curDirPath;
    global $searchCmdUrl;
    // get index of first thumbnail on the page
    $displayed = get_offset($page);
    $html = '';
    // loop on rows
    for ($rows = 0; $rows < $numberOfRows; $rows++) {
        $html .= "<tr>\n";
        // loop on columns
        for ($cols = 0; $cols < $numberOfCols; $cols++) {
            // get index of image
            $num = $imageList[$displayed];
            // get file name
            $fileName = $fileList[$num]['path'];
            // visibility style
            if ($fileList[$num]['visibility'] == 'i') {
                $style = "style=\"font-style: italic; color: silver;\"";
            } else {
                $style = '';
            }
            // display thumbnail
            /*echo "<td style=\"text-align: center;\" style=\"width:"
              . $colWidth . "%;\">\n"
              ;*/
            // omit colwidth since already in th
            $html .= "<td style=\"text-align: center;\">\n";
            $html .= "<a href=\"" . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . "?docView=image&file=" . download_url_encode($fileName) . "&cwd=" . $curDirPath . $searchCmdUrl)) . "\">";
            // display image description using title attribute
            $title = "";
            if ($fileList[$num]['comment']) {
                $text = $fileList[$num]['comment'];
                $text = cutstring($text, 40, false, 5, "...");
                $title = "title=\"" . $text . "\"";
            }
            $html .= create_thumbnail($fileName, $thumbnailWidth, $title);
            // unset title for the next pass in the loop
            unset($title);
            $html .= "</a>\n";
            // display image name
            $imgName = strlen(basename($fileList[$num]['path'])) > 25 ? substr(basename($fileList[$num]['path']), 0, 25) . "..." : basename($fileList[$num]['path']);
            $html .= "<p " . $style . ">" . $imgName . "</p>";
            $html .= "</td>\n";
            // update image number
            $displayed++;
            // finished ?
            if ($displayed >= count($imageList)) {
                $html .= "</tr>\n";
                return $html;
            }
        }
        // end loop on columns
        $html .= "</tr>\n";
    }
    // end loop on rows
    return $html;
}
Example #27
0
} else {
    if (!is_null($categoryId)) {
        $pagerUrl = Url::Contextualize($_SERVER['PHP_SELF'] . '?filter=' . $filter);
    } else {
        ClaroBreadCrumbs::getInstance()->setCurrent(get_lang('Question pool'), Url::Contextualize($_SERVER['PHP_SELF']));
        $pagerUrl = Url::Contextualize($_SERVER['PHP_SELF']);
    }
}
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Exercises'), Url::Contextualize(get_module_url('CLQWZ') . '/exercise.php'));
$nameTools = get_lang('Question pool');
// Tool list
$toolList = array();
if (!is_null($exId)) {
    $toolList[] = array('img' => 'back', 'name' => get_lang('Go back to the exercise'), 'url' => claro_htmlspecialchars(Url::Contextualize('edit_exercise.php?exId=' . $exId)));
}
$toolList[] = array('img' => 'default_new', 'name' => get_lang('New question'), 'url' => claro_htmlspecialchars(Url::Contextualize('edit_question.php?cmd=rqEdit')));
$out = '';
$out .= claro_html_tool_title($nameTools, null, $toolList);
$out .= $dialogBox->render();
//-- filter listbox
$attr['onchange'] = 'filterForm.submit()';
$out .= "\n" . '<form method="get" name="filterForm" action="question_pool.php">' . "\n" . '<input type="hidden" name="exId" value="' . $exId . '" />' . "\n" . claro_form_relay_context() . "\n" . '<p align="right">' . "\n" . '<label for="filter">' . get_lang('Filter') . '&nbsp;:&nbsp;</label>' . "\n" . claro_html_form_select('filter', $filterList, $filter, $attr) . "\n" . '<noscript>' . "\n" . '<input type="submit" value="' . get_lang('Ok') . '" />' . "\n" . '</noscript>' . "\n" . '</p>' . "\n" . '</form>' . "\n\n";
//-- pager
$out .= $myPager->disp_pager_tool_bar($pagerUrl);
/*
 * enable multiple question selection
 */
if (!is_null($exId)) {
    $out .= '<form method="post" name="QCMEncode" action="' . $_SERVER['PHP_SELF'] . '?cmd=recupMultipleQuestions">' . "\n";
    $out .= '<input type="hidden" name="exId" value="' . $exId . '" />' . "\n";
}
Example #28
0
} else {
    foreach ($searchResultList as $thisPost) {
        // PREVENT USER TO CONSULT POST FROM A GROUP THEY ARE NOT ALLOWED
        if (!is_null($thisPost['group_id']) && $is_groupPrivate && !(in_array($thisPost['group_id'], $userGroupList) || in_array($thisPost['group_id'], $tutorGroupList) || claro_is_course_manager())) {
            continue;
        } else {
            // notify if is new message
            $post_time = datetime_to_timestamp($thisPost['post_time']);
            if ($post_time < $last_visit) {
                $class = ' class="item"';
            } else {
                $class = ' class="item hot"';
            }
            // get user picture
            $userData = user_get_properties($thisPost['poster_id']);
            $picturePath = user_get_picture_path($userData);
            if ($picturePath && file_exists($picturePath)) {
                $pictureUrl = user_get_picture_url($userData);
            } else {
                $pictureUrl = null;
            }
            $out .= '<div id="post' . $thisPost['post_id'] . '" class="threadPost">' . '<div class="threadPostInfo">' . (!is_null($pictureUrl) ? '<div class="threadPosterPicture"><img src="' . $pictureUrl . '" alt=" " /></div>' : '') . "\n" . '<b>' . $thisPost['firstname'] . ' ' . $thisPost['lastname'] . '</b> ' . '<br />' . '<small>' . claro_html_localised_date(get_locale('dateTimeFormatLong'), $post_time) . '</small>' . "\n";
            $out .= '  </div>' . "\n" . '<div class="threadPostContent">' . "\n" . '<img src="' . get_icon_url('topic') . '" alt="" />' . '<a href="' . claro_htmlspecialchars(Url::Contextualize(get_module_url('CLFRM') . '/viewtopic.php?topic=' . $thisPost['topic_id'])) . '">' . claro_htmlspecialchars($thisPost['topic_title']) . '</a>' . "\n" . '<span class="threadPostIcon ' . $class . '"><img src="' . get_icon_url('post') . '" alt="" /></span><br />' . "\n" . claro_parse_user_text($thisPost['post_text']) . "\n";
            $out .= '</div>' . "\n" . '<div class="spacer"></div>' . "\n\n" . '</div>' . "\n";
        }
        // end else if ( ! is_null($thisPost['group_id'])
    }
}
// end for each
$claroline->display->body->appendContent($out);
echo $claroline->display->render();
Example #29
0
 private function _buildOptionList()
 {
     $html = '';
     foreach ($this->value as $optionValue => $optionLabel) {
         // check if value must be selected
         if (in_array($optionValue, $this->selectedValueList)) {
             $displaySelected = 'selected="selected"';
         } else {
             $displaySelected = '';
         }
         $html .= '<option value="' . $optionValue . '" ' . $displaySelected . '>' . claro_htmlspecialchars($optionLabel) . '</option>' . "\n";
     }
     return $html;
 }
Example #30
0
" />
                        </a>
                    <?php 
            } else {
                ?>
                        &nbsp;
                    <?php 
            }
            ?>
                    </td>
                    <td align="center">
                    <?php 
            if ($questionIterator < count($this->questionList)) {
                ?>
                        <a href="<?php 
                echo claro_htmlspecialchars(Url::Contextualize('edit_exercise.php?exId=' . $this->exId . '&amp;cmd=mvDown&amp;quId=' . $question['id']));
                ?>
">
                            <img src="<?php 
                echo get_icon_url('move_down');
                ?>
" alt="<?php 
                echo get_lang('Move down');
                ?>
" />
                        </a>
                    <?php 
            } else {
                ?>
                        &nbsp;
                    <?php