public function __construct() { $this->breadcrumbs = ClaroBreadCrumbs::getInstance(); $this->viewmode = ClaroViewMode::getInstance(); parent::__construct('banner.tpl.php'); $this->breadcrumbLine = true; }
$tbl_qwz_answer_matching = $tbl_cdb_names['qwz_answer_matching']; $tbl_qwz_tracking = $tbl_cdb_names['qwz_tracking']; $tbl_qwz_tracking_questions = $tbl_cdb_names['qwz_tracking_questions']; $tbl_qwz_tracking_answers = $tbl_cdb_names['qwz_tracking_answers']; $is_allowedToTrack = claro_is_course_manager(); if (isset($_REQUEST['src']) && $_REQUEST['src'] == 'ex') { $src = '&src=ex'; ClaroBreadCrumbs::getInstance()->prepend(get_lang('Statistics of exercise'), Url::Contextualize('./track_exercises.php?exId=' . $exId . $src)); ClaroBreadCrumbs::getInstance()->prepend(get_lang('Exercises'), Url::Contextualize('./exercise.php')); } else { $src = ''; ClaroBreadCrumbs::getInstance()->prepend(get_lang('Statistics of exercise'), Url::Contextualize('./track_exercises.php?exId=' . $exId)); ClaroBreadCrumbs::getInstance()->prepend(get_lang('Statistics'), Url::Contextualize('../tracking/courseReport.php')); } $nameTools = get_lang('Statistics of question'); ClaroBreadCrumbs::getInstance()->setCurrent($nameTools, Url::Contextualize('./track_questions.php?exId=' . $exId . $src)); // if the question_id is not set display the stats of all questions of this exercise if (empty($_REQUEST['question_id'])) { // show the list of all question when no one is specified // a contribution of Jeremy Audry $sql = "SELECT `questionId`\n FROM `" . $tbl_qwz_rel_exercise_question . "`\n WHERE `exerciseId` = " . (int) $exId; $questionList = claro_sql_query_fetch_all($sql); // store all question_id for the selected exercise in a tab foreach ($questionList as $question) { $questionIdsToShow[] = $question['questionId']; } } else { $questionIdsToShow[0] = (int) $_REQUEST['question_id']; } $out = ''; // display title
/* * Output */ if (!is_null($exId)) { ClaroBreadCrumbs::getInstance()->prepend(get_lang('Exercise'), Url::Contextualize('./edit_exercise.php?exId=' . $exId)); ClaroBreadCrumbs::getInstance()->setCurrent(get_lang('Question pool'), Url::Contextualize($_SERVER['PHP_SELF'] . '?exId=' . $exId)); $pagerUrl = Url::Contextualize($_SERVER['PHP_SELF'] . '?exId=' . $exId); } 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') . ' : </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);
} } // build link to submissions page foreach ($workList as $workId => $thisWrk) { $thisWrk['is_mine'] = $assignment->getAssignmentType() == 'INDIVIDUAL' && $thisWrk['authId'] == claro_get_current_user_id() || $assignment->getAssignmentType() == 'GROUP' && in_array($thisWrk['authId'], $userGroupList); if ($thisWrk['is_mine']) { $workList[$workId]['name'] = '<b>' . $thisWrk['name'] . '</b>'; } $workList[$workId]['name'] = '<a class="item" href="' . claro_htmlspecialchars(Url::Contextualize('user_work.php' . '?authId=' . $thisWrk['authId'] . '&assigId=' . $req['assignmentId'])) . '">' . $workList[$workId]['name'] . '</a>'; } /** * HEADER */ $nameTools = get_lang('Assignment'); ClaroBreadCrumbs::getInstance()->setCurrent($nameTools, Url::Contextualize($_SERVER['PHP_SELF'] . '?assigId=' . (int) $req['assignmentId'])); ClaroBreadCrumbs::getInstance()->prepend(get_lang('Assignments'), Url::Contextualize('../work/work.php')); /** * TOOL TITLE */ $pageTitle['mainTitle'] = $nameTools; $pageTitle['subTitle'] = $assignment->getTitle(); // SHOW FEEDBACK // only if : // - there is a text OR a file in automatic feedback // AND // feedback must be shown after end date and end date is past // OR feedback must be shown directly after a post (from the time a work was uploaded by the student) // there is a prefill_ file or text, so there is something to show $textOrFilePresent = (bool) $assignment->getAutoFeedbackText() != '' || $assignment->getAutoFeedbackFilename() != ''; // feedback must be shown after end date and end date is past $showAfterEndDate = (bool) ($assignment->getAutoFeedbackSubmitMethod() == 'ENDDATE' && $assignment->getEndDate() < time());
} // module_id if (isset($_GET['module_id']) && $_GET['module_id'] != '') { $_SESSION['module_id'] = $_GET['module_id']; } // use viewMode claro_set_display_mode_available(true); $is_allowedToEdit = claro_is_allowed_to_edit(); // as teacher //-- breadcrumbs if ($is_allowedToEdit) { ClaroBreadCrumbs::getInstance()->prepend(get_lang('Learning path'), Url::Contextualize(get_module_url('CLLNP') . '/learningPathAdmin.php')); } else { ClaroBreadCrumbs::getInstance()->prepend(get_lang('Learning path'), Url::Contextualize(get_module_url('CLLNP') . '/learningPath.php')); } ClaroBreadCrumbs::getInstance()->prepend(get_lang('Learning path list'), Url::Contextualize(get_module_url('CLLNP') . '/learningPathList.php')); $nameTools = get_lang('Module'); // tables names $tbl_cdb_names = claro_sql_get_course_tbl(); $TABLELEARNPATH = $tbl_cdb_names['lp_learnPath']; $TABLEMODULE = $tbl_cdb_names['lp_module']; $TABLELEARNPATHMODULE = $tbl_cdb_names['lp_rel_learnPath_module']; $TABLEASSET = $tbl_cdb_names['lp_asset']; $TABLEUSERMODULEPROGRESS = $tbl_cdb_names['lp_user_module_progress']; // exercises $tbl_quiz_exercise = $tbl_cdb_names['qwz_exercise']; $dbTable = $TABLEASSET; // for old functions of document tool //lib of this tool require_once get_path('incRepositorySys') . "/lib/learnPath.lib.inc.php"; require_once get_path('incRepositorySys') . "/lib/fileDisplay.lib.php";
$childPath = realpath($parentPath . $childPath); if ($childPath !== false) { // verify if the file exists and if the file is under parent path return preg_match('|^' . preg_quote($parentPath) . '|', $childPath); } else { return false; } } if (claro_is_in_a_group() && claro_is_group_allowed()) { $_group = claro_get_current_group_data(); $courseDir = claro_get_course_path() . '/group/' . claro_get_current_group_data('directory'); ClaroBreadCrumbs::getInstance()->prepend(get_lang('Documents and Links'), 'document.php'); ClaroBreadCrumbs::getInstance()->prepend(get_lang('Groups'), '../group/group.php'); } else { $courseDir = claro_get_course_path() . '/document'; ClaroBreadCrumbs::getInstance()->prepend(get_lang('Documents and Links'), 'document.php'); } $noPHP_SELF = true; $baseWorkDir = get_path('coursesRepositorySys') . $courseDir; if (!empty($_REQUEST['cmd'])) { $cmd = $_REQUEST['cmd']; } else { $cmd = null; } if (!empty($_REQUEST['cwd'])) { $cwd = $_REQUEST['cwd']; } else { $cwd = ''; } if (isset($_REQUEST['file'])) { $file = download_url_decode($_REQUEST['file']);
*/ // reset course and groupe $cidReset = true; $gidReset = true; $uidRequired = true; // load Claroline kernel require_once dirname(__FILE__) . '/../../claroline/inc/claro_init_global.inc.php'; if (!claro_is_user_authenticated()) { claro_disp_auth_form(); } // load libraries FromKernel::uses('user.lib', 'utils/finder.lib'); require_once dirname(__FILE__) . '/lib/portlet.lib.php'; // Breadcrumb FromKernel::uses('display/userprofilebox.lib'); ClaroBreadCrumbs::getInstance()->append(get_lang('My desktop'), get_path('clarolineRepositoryWeb') . 'desktop/index.php'); $dialogBox = new DialogBox(); define('KERNEL_PORTLETS_PATH', dirname(__FILE__) . '/lib/portlet'); // Load and register (if needed) portlets try { $portletList = new PortletList(); $fileFinder = new Claro_FileFinder_Extension(KERNEL_PORTLETS_PATH, '.class.php', false); foreach ($fileFinder as $file) { // Require portlet file require_once $file->getPathname(); // Compute portlet class name from file name $pos = strpos($file->getFilename(), '.'); $className = substr($file->getFilename(), '0', $pos); // Load portlet from database $portletInDB = $portletList->loadPortlet($className); // If it's not in DB, add it
// javascript if ($action == 'rqEdit') { $jspath = document_web_path() . '/js'; $htmlHeadXtra[] = '<script type="text/javascript" src="' . $jspath . '/wiki_acl.js"></script>'; $claroBodyOnload[] = 'initBoxes();'; } // Breadcrumps $nameTools = get_lang('Wiki'); switch ($action) { case 'rqEdit': ClaroBreadCrumbs::getInstance()->append($wikiTitle); ClaroBreadCrumbs::getInstance()->append(claro_htmlspecialchars('Properties')); break; case 'rqDelete': ClaroBreadCrumbs::getInstance()->append($wikiTitle); ClaroBreadCrumbs::getInstance()->append(claro_htmlspecialchars('Delete')); break; case 'list': default: $noQUERY_STRING = true; } $out = ''; // --------- Start of display ---------------- // Tool title $toolTitle = array(); if (claro_is_in_a_group()) { $toolTitle['supraTitle'] = claro_get_current_group_data('name'); } switch ($action) { // edit form case 'rqEdit':
ClaroBreadCrumbs::getInstance()->append(claro_htmlspecialchars(get_lang('Preview'))); break; case 'all': ClaroBreadCrumbs::getInstance()->append(claro_htmlspecialchars(get_lang('All pages'))); break; case 'recent': ClaroBreadCrumbs::getInstance()->append(claro_htmlspecialchars(get_lang('Recent changes'))); break; case 'history': $dispTitle = '__MainPage__' == $title ? get_lang("Main page") : $title; ClaroBreadCrumbs::getInstance()->append(claro_htmlspecialchars($dispTitle), claro_htmlspecialchars(Url::Contextualize('page.php?action=show&wikiId=' . $wikiId . '&title=' . $title))); ClaroBreadCrumbs::getInstance()->append(claro_htmlspecialchars(get_lang("History"))); break; default: $pageTitle = '__MainPage__' == $title ? get_lang("Main page") : $title; ClaroBreadCrumbs::getInstance()->append(claro_htmlspecialchars($pageTitle)); } $out = ''; // Help URL $helpUrl = null; // Tool title $toolTitle = array(); $toolTitle['mainTitle'] = sprintf(get_lang('Wiki : %s'), $wiki->getTitle()); if (claro_is_in_a_group()) { $toolTitle['supraTitle'] = claro_get_current_group_data('name'); } switch ($action) { case 'all': $toolTitle['subTitle'] = get_lang("All pages"); break; case 'recent':
$dialogBox->question($question); } if ($cmd == 'exMerge') { $uidToKeep = $userInput->getMandatory('uidToKeep'); $uidToRemove = $userInput->getMandatory('uidToRemove'); if ($uidToKeep == $uidToRemove) { throw new Exception(get_lang('Cannot merge one user account with itself')); } if (!user_get_properties($uidToKeep)) { throw new Exception(get_lang('User to keep not found')); } if (!user_get_properties($uidToRemove)) { throw new Exception(get_lang('User to remove not found')); } $mergeUser = new MergeUser(); $mergeUser->merge($uidToRemove, $uidToKeep); if ($mergeUser->hasError()) { $dialogBox->error(get_lang('Some errors have occured while merging those user account, check the log table in the platform main database for more details')); } else { $dialogBox->success(get_lang('User accounts merged')); } } } catch (Exception $e) { $dialogBox->error(get_lang('Cannot perform the requested action') . ' : <br />' . $e->getMessage()); pushClaroMessage('<pre>' . $e->__toString() . '</pre>'); } ClaroBreadCrumbs::getInstance()->prepend(get_lang('Administration'), get_path('rootAdminWeb')); ClaroBreadCrumbs::getInstance()->setCurrent(get_lang('Merge user accounts'), php_self()); ClaroBody::getInstance()->appendContent(claro_html_tool_title(get_lang('Merge user accounts'))); ClaroBody::getInstance()->appendContent($dialogBox->render()); echo Claroline::getInstance()->display->render();
} else { Console::error("Class {$form_data['class_id']} cannot be removed from course " . claro_get_current_course_id() . " by " . claro_get_current_user_id() . " : " . var_export($registration->getErrorLog(), true)); $dialogBox->error(get_lang('Cannot enrol class')); } break; } /*---------------------------------------------------------------------*/ /*----------------------FIND information SECTION-----------------------*/ /*---------------------------------------------------------------------*/ $classList = get_class_list_by_course(claro_get_current_course_id()); /*---------------------------------------------------------------------*/ /*----------------------DISPLAY SECTION--------------------------------*/ /*---------------------------------------------------------------------*/ // set bredcrump $nameTools = get_lang('Enrol class'); ClaroBreadCrumbs::getInstance()->prepend(get_lang('Users'), 'user.php' . claro_url_relay_context('?')); // javascript confirm pop up declaration for header $htmlHeadXtra[] = '<script type="text/javascript"> function confirmation_enrol (name) { if (confirm("' . clean_str_for_javascript(get_lang('Are you sure you want to enrol the whole class on the course ?')) . '")) {return true;} else {return false;} } function confirmation_unenrol (name) { if (confirm("' . clean_str_for_javascript(get_lang('Are you sure you want to unenrol the whole class on the course ?')) . '")) {return true;} else {return false;}
$nextReqDate = mktime(1, 1, 1, date('m', $reqdate) + 1, 1, date('Y', $reqdate)); // prepare displayed date $displayedDate = claro_html_localised_date(get_locale('dateFormatCompact'), $reqdate); } $accessList = claro_sql_query_fetch_all($sqlAccessDates); /* * Output */ CssLoader::getInstance()->load('tracking', 'screen'); // initialize output $claroline->setDisplayType(Claroline::PAGE); // FIXME (link + parameters) $nameTools = get_lang('User access to course'); ClaroBreadCrumbs::getInstance()->setCurrent($nameTools, $_SERVER['PHP_SELF'] . '?userId=' . $userId); ClaroBreadCrumbs::getInstance()->prepend(get_lang('Users statistics'), claro_htmlspecialchars(Url::Contextualize('userReport.php?userId=' . $userId))); ClaroBreadCrumbs::getInstance()->prepend(get_lang('Users'), get_module_url('CLUSR') . '/user.php'); $output = ''; /* * Output of : user information */ $userProfileBox = new UserProfileBox(true); $userProfileBox->setUserId($userId); $output .= '<div id="rightSidebar">' . $userProfileBox->render() . '</div>'; $output .= '<div id="leftContent">' . "\n"; $output .= claro_html_tool_title($nameTools); // menu $output .= '<small>' . "\n" . '[<a href="' . $_SERVER['PHP_SELF'] . '?userId=' . $userId . '&period=week&reqdate=' . $reqdate . '">' . get_lang('Week') . '</a>]' . "\n" . '[<a href="' . $_SERVER['PHP_SELF'] . '?userId=' . $userId . '&period=month&reqdate=' . $reqdate . '">' . get_lang('Month') . '</a>]' . "\n" . ' || ' . "\n"; if ($period == 'week') { // previous and next date must be evaluated $output .= '[<a href="' . $_SERVER['PHP_SELF'] . '?userId=' . $userId . '&period=week&reqdate=' . $previousReqDate . '">' . get_lang('Previous week') . '</a>]' . "\n" . '[<a href="' . $_SERVER['PHP_SELF'] . '?userId=' . $userId . '&period=week&reqdate=' . $nextReqDate . '">' . get_lang('Next week') . '</a>]' . "\n"; } else {
$item = isset($_REQUEST['item']) ? $_REQUEST['item'] : 'GLOBAL'; $section_selected = isset($_REQUEST['section']) ? $_REQUEST['section'] : null; $moduleId = isset($_REQUEST['module_id']) ? (int) $_REQUEST['module_id'] : null; $module = get_module_info($moduleId); if (!$module) { claro_die("ERROR: INVALID MODULE ID!!!"); } language::load_module_translation($module['label']); $dockList = get_dock_list($module['type']); $nameTools = get_lang('Module settings'); $noPHP_SELF = true; // FIXME : BAD use of get_lang !!!!! ClaroBreadCrumbs::getInstance()->prepend(get_lang($module['module_name'])); ClaroBreadCrumbs::getInstance()->prepend(get_lang('Module list'), get_path('rootAdminWeb') . 'module/module_list.php?typeReq=' . $module['type']); ClaroBreadCrumbs::getInstance()->prepend(get_lang('Administration'), get_path('rootAdminWeb')); ClaroBreadCrumbs::getInstance()->setCurrent($nameTools); $dialogBox = new dialogBox(); //---------------------------------- // EXECUTE COMMAND //---------------------------------- switch ($cmd) { case 'activplatformadmin': if (allow_module_activation_by_course_manager($module['label'], false)) { $dialogBox->success(get_lang('Only PLATFORM_ADMIN can activate this module')); $module['accessManager'] = 'PLATFORM_ADMIN'; } else { $dialogBox->error(get_lang('Cannot change module activation on course creation')); } break; case 'activcoursemanager': if (allow_module_activation_by_course_manager($module['label'], true)) {
} elseif ($thisAttemptDetails['showAnswers'] == 'LASTTRY') { // we must check that user has at least "max_attempt" results $sql = "SELECT COUNT(`id`)\n FROM `" . $tbl_qwz_tracking . "`\n WHERE `user_id` = " . (int) claro_get_current_user_id() . "\n AND `exo_id` = " . $thisAttemptDetails['exo_id']; $userAttempts = claro_sql_query_get_single_value($sql); if ($userAttempts >= $thisAttemptDetails['attempts']) { $is_allowedToTrack = true; } else { $dialogBox->error(get_lang('You must reach the maximum number of allowed attempts to view these statistics.')); } } else { // user cannot see its full results if show_answer == 'NEVER' $dialogBox->error(get_lang('Display of detailed answers is not authorized.')); } } } ClaroBreadCrumbs::getInstance()->prepend(get_lang('Exercises'), './exercise.php'); $nameTools = get_lang('Statistics of exercise attempt'); $out = ''; // display title $titleTab['mainTitle'] = $nameTools; // Command list $cmdList = array(); $cmdList[] = array('img' => 'back', 'name' => get_lang('Back'), 'url' => claro_htmlspecialchars(Url::Contextualize('../tracking/userReport.php?userId=' . $thisAttemptDetails['user_id'] . '&exId=' . $thisAttemptDetails['id']))); $out .= claro_html_tool_title($titleTab, null, $cmdList); if ($is_allowedToTrack && get_conf('is_trackingEnabled')) { // get all question that user get for this attempt $sql = "SELECT TD.`id` as `trackId`, TD.`question_id`, TD.`result`\n FROM `" . $tbl_qwz_tracking_questions . "` as TD\n WHERE `exercise_track_id` = " . $trackedExId; $trackedQuestionList = claro_sql_query_fetch_all($sql); $i = 0; $totalResult = 0; $totalGrade = 0;
define('DO_MOVE_UP_EXTRA_FIELD_RANK', 'DO_MOVE_UP_EXTRA_FIELD_RANK'); define('DO_VIEW_EXTRA_FIELD_LIST', 'DO_VIEW_EXTRA_FIELD_LIST'); define('DO_ADD_EXTRA_FIELD', 'DO_ADD_EXTRA_FIELD'); define('DO_EDIT_EXTRA_FIELD', 'DO_EDIT_EXTRA_FIELD'); $tlabelReq = 'CLUSR'; $gidReset = true; require '../inc/claro_init_global.inc.php'; $messageList = array(); $descSizeToPrupose = array(3, 5, 10, 15, 20); // size in lines for desc - don't add 1 require_once get_path('incRepositorySys') . '/lib/admin.lib.inc.php'; require_once get_path('incRepositorySys') . '/lib/user.lib.php'; require_once get_path('incRepositorySys') . '/lib/course_user.lib.php'; require_once get_path('incRepositorySys') . '/lib/user_info.lib.php'; require_once dirname(__FILE__) . '/../messaging/lib/permission.lib.php'; ClaroBreadCrumbs::getInstance()->prepend(get_lang('Users'), Url::Contextualize('user.php')); $nameTools = get_lang('User'); /** OUTPUT **/ claro_set_display_mode_available(TRUE); if (!claro_is_in_a_course() || !claro_is_course_allowed()) { claro_disp_auth_form(); } /* * data found in settings are : * $uid * $isAdmin * $isAdminOfCourse * */ if (isset($_REQUEST['uInfo'])) { $userIdViewed = (int) $_REQUEST['uInfo'];
$display = DISP_REGISTRATION_FORM; $subscriptionText = claro_text_zone::get_content('textzone_inscription_form'); } else { $display = DISP_REGISTRATION_AGREEMENT; } } elseif (!get_conf('show_agreement_panel')) { // This section is not use actually. // it's only when selfReg =false so It's need another textZoneContent $display = DISP_REGISTRATION_AGREEMENT; } else { $display = DISP_REGISTRATION_NOT_ALLOWED; } /*= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = Display Section = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */ ClaroBreadCrumbs::getInstance()->append(get_lang('Create user account'), 'inscription.php'); $out = ''; // Display Title $out .= claro_html_tool_title(get_lang('Create user account')); if (DISP_REGISTRATION_SUCCEED == $display) { // Registration succeeded $out .= '<p>' . "\n" . get_lang('Dear %firstname %lastname, your personal settings have been registered.', array('%firstname' => $userData['firstname'], '%lastname' => $userData['lastname'])) . "\n"; if ($mailSent) { $out .= '<br />' . "\n" . get_lang('An email has been sent to help you remember your username and password.'); } $out .= '</p>' . "\n"; if (claro_is_allowed_to_create_course()) { $out .= '<p>' . get_lang('You can now create your course') . '</p>' . "\n"; } else { $out .= '<p>' . get_lang('You can now select, in the list, the courses you want to access') . '</p>' . "\n"; }
$displayType = ''; } if (!empty($_REQUEST['period']) && in_array($_REQUEST['period'], array('year', 'month', 'day'))) { $period = $_REQUEST['period']; } else { $period = 'day'; } if (!empty($_REQUEST['reqdate'])) { $reqdate = (int) $_REQUEST['reqdate']; } else { $reqdate = time(); } /* * Output */ ClaroBreadCrumbs::getInstance()->prepend(get_lang('Statistics'), 'courseReport.php'); $nameTools = get_lang('Traffic Details'); $html = ''; $html .= claro_html_tool_title($nameTools); //** dislayed period $html .= '<p><strong>'; switch ($period) { case 'year': $html .= date('Y', $reqdate); break; case 'month': $html .= claro_html_localised_date('%B %Y', $reqdate); break; case 'day': $html .= claro_html_localised_date('%A %d %B %Y', $reqdate); break;
$htmlContent .= get_lang('Attached file') . ' : ' . $submissionPrefix . $result['submitted_doc_path'] . '<br />' . "\n"; } $htmlContent .= '<div>' . "\n" . '<h3>' . get_lang('Description') . '</h3>' . "\n" . $result['submitted_text'] . '</div>' . "\n" . '</body></html>'; file_put_contents($zipPath . '/' . $submissionPrefix . $txtFileName, $htmlContent); } $zipFile = new PclZip($downloadArchiveFilePath); $created = $zipFile->create($zipPath, PCLZIP_OPT_REMOVE_PATH, $zipPath); if (!$created) { $dialogBox->error(get_lang('Unable to create the archive')); } else { claro_delete_file($zipPath); header('Content-Description: File Transfer'); header('Content-Type: application/force-download'); header('Content-Length: ' . filesize($downloadArchiveFilePath)); header('Content-Disposition: attachment; filename=' . str_replace(',', '', replace_dangerous_char($zipName))); readfile($downloadArchiveFilePath); claro_delete_file($downloadArchiveFilePath); if (!empty($tmpFolderPath)) { $gc = new ClaroGarbageCollector($tmpFolderPath, 3600); $gc->run(); } exit; } } else { $dialogBox->error(get_lang('There is no submission available for download with these settings.')); } } $out .= $dialogBox->render(); ClaroBreadCrumbs::getInstance()->prepend(get_lang('Assignments'), 'work.php'); $claroline->display->body->appendContent($out); echo $claroline->display->render();
break; case 2: $this_forum['anonymity'] = 'default'; break; default: $this_forum['anonymity'] = 'forbidden'; break; } // Visit only my group forum if not admin or tutor. // If tutor, see all groups but indicate my groups. // Group Category == 1 $displayList[] = $this_forum; } try { $display = new ModuleTemplate('CLFRM', 'forum_index.tpl.php'); $display->assign('categoryList', $categories); $display->assign('forumList', $forum_list); $display->assign('is_allowedToEdit', $is_allowedToEdit); $display->assign('claro_notifier', $claro_notifier); $out .= $display->render(); } catch (Exception $ex) { if (claro_debug_mode()) { $dialogBox->error('<pre>' . $ex->__toString() . '</pre>'); } else { $dialogBox->error($ex->getMessage()); } $out .= $dialogBox->render(); } ClaroBreadCrumbs::getInstance()->setCurrent($nameTools, 'index.php'); $claroline->display->body->appendContent($out); echo $claroline->display->render();
if (!isset($_REQUEST['offset'])) { $offset = 0; } else { $offset = $_REQUEST['offset']; } $displayForm = $cmd == 'rqEdit' ? true : false; // prepare query // we need to check if exercise is used as a module in a learning path // to display a more complete confirm message for delete aciton $sql = "SELECT `id`, `title`, `description`\n FROM `" . $tbl_qwz_question_categorie . "`\n ORDER BY `title`"; $myPager = new claro_sql_pager($sql, $offset, get_conf('exercisesPerPage', 25)); $questionCategoryList = $myPager->get_result_list(); /* * Output */ ClaroBreadCrumbs::getInstance()->prepend(get_lang('Exercises'), Url::Contextualize('../exercise.php')); $nameTools = get_lang('Question categories'); $noQUERY_STRING = true; // Tool list $toolList = array(); if ($is_allowedToEdit) { $toolList[] = array('img' => 'quiz_new', 'name' => get_lang('New category'), 'url' => claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=add'))); } $out = ''; $out .= $dialogBox->render(); $out .= claro_html_tool_title($nameTools, null, $toolList); if ($displayForm) { $out .= '<form method="post" action="' . $_SERVER['PHP_SELF'] . '" >' . "\n\n" . claro_form_relay_context() . '<input type="hidden" name="cmd" value="exEdit" />' . "\n" . '<input type="hidden" name="catId" value="' . $catId . '" />' . "\n" . '<input type="hidden" name="claroFormId" value="' . uniqid('') . '" />' . "\n"; $out .= '<table border="0" cellpadding="5">' . "\n"; //-- // title
<?php /** * CLAROLINE Applet * * @author Loic Fortemps * * @package MOBILE * */ $tlabelReq = 'MOBILE'; require_once dirname(__FILE__) . '/../../claroline/inc/claro_init_global.inc.php'; Claroline::initDisplay(Claroline::POPUP); CssLoader::getInstance()->load('mobile', 'all'); $pageTitle = array('mainTitle' => get_lang('Mobile Apps Configuration'), 'subTitle' => get_lang('Configuration helper')); ClaroBreadCrumbs::getInstance()->append($pageTitle['mainTitle'], $_SERVER['PHP_SELF']); ClaroBreadCrumbs::getInstance()->append($pageTitle['subTitle']); $template = new ModuleTemplate($tlabelReq, 'popup.tpl.php'); Claroline::getInstance()->display->body->appendContent(claro_html_tool_title($pageTitle) . $template->render()); echo Claroline::getInstance()->display->render();
if (is_numeric($display_profile)) { $display_profile_list[] = $display_profile; $display_profile_url_param = $display_profile; } } // default : display all profile if (empty($display_profile_list)) { $profileNameList = claro_get_all_profile_name_list(); $display_profile_list = array_keys($profileNameList); $display_profile_url_param = 'all'; } //================================= // Display section //================================= // define bredcrumb ClaroBreadCrumbs::getInstance()->prepend(get_lang('Course profile list'), 'profile_list.php'); $out = ''; // Set display right $profileRightHtml = new RightProfileToolRightHtml(); $profileRightHtml->addUrlParam('display_profile', $display_profile_url_param); $profileFoundCount = 0; foreach ($display_profile_list as $profileId) { $profile = new RightProfile(); if ($profile->load($profileId)) { $profileRight = new RightCourseProfileToolRight(); $profileRight->setCourseId(claro_get_current_course_id()); $profileRight->load($profile); $profileRightHtml->addRightProfileToolRight($profileRight); $profileFoundCount++; } }
if ($sqlClauseString) { $tbl_cdb_names = claro_sql_get_course_tbl(); $tbl_posts_text = $tbl_cdb_names['bb_posts_text']; $tbl_posts = $tbl_cdb_names['bb_posts']; $tbl_topics = $tbl_cdb_names['bb_topics']; $tbl_forums = $tbl_cdb_names['bb_forums']; $sql = "SELECT pt.post_id,\n pt.post_text,\n p.nom AS lastname,\n p.prenom AS firstname,\n p.`poster_id`,\n p.post_time,\n t.topic_id,\n t.topic_title,\n f.forum_id,\n f.forum_name,\n f.group_id\n FROM `" . $tbl_posts_text . "` AS pt,\n `" . $tbl_posts . "` AS p,\n `" . $tbl_topics . "` AS t,\n `" . $tbl_forums . "` AS f\n WHERE ( " . $sqlClauseString . ")\n AND pt.post_id = p.post_id\n AND p.topic_id = t.topic_id\n AND t.forum_id = f.forum_id\n ORDER BY p.post_time DESC, t.topic_id"; $searchResultList = claro_sql_query_fetch_all($sql); $userGroupList = get_user_group_list(claro_get_current_user_id()); $userGroupList = array_keys($userGroupList); $tutorGroupList = get_tutor_group_list(claro_get_current_user_id()); } else { $searchResultList = array(); } $pagetype = 'viewsearch'; ClaroBreadCrumbs::getInstance()->prepend(get_lang('Forums'), 'index.php'); CssLoader::getInstance()->load('clfrm', 'screen'); $noPHP_SELF = true; $out = ''; $out .= claro_html_tool_title(get_lang('Forums'), $is_allowedToEdit ? get_help_page_url('blockForumsHelp', 'CLFRM') : false); $out .= claro_html_menu_horizontal(disp_forum_toolbar($pagetype, null)) . disp_forum_breadcrumb($pagetype, null, null, null) . '<h4>' . get_lang('Search result') . ' : ' . (isset($_REQUEST['searchPattern']) ? claro_htmlspecialchars($_REQUEST['searchPattern']) : '') . '</h4>' . "\n"; if (count($searchResultList) < 1) { $out .= '<p>' . get_lang('No result') . '</p>'; } 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']);
include claro_get_conf_repository() . 'user_profile.conf.php'; // Include libraries require_once get_path('incRepositorySys') . '/lib/user.lib.php'; require_once get_path('incRepositorySys') . '/lib/file.lib.php'; require_once get_path('incRepositorySys') . '/lib/image.lib.php'; require_once get_path('incRepositorySys') . '/lib/fileUpload.lib.php'; require_once get_path('incRepositorySys') . '/lib/fileManage.lib.php'; require_once get_path('incRepositorySys') . '/lib/display/dialogBox.lib.php'; // Initialise variables $dialogBox = new DialogBox(); // Breadcrumb ClaroBreadCrumbs::getInstance()->append(get_lang('Administration'), get_path('rootAdminWeb')); if (isset($_REQUEST['cfrom']) && $_REQUEST['cfrom'] == 'ulist') { ClaroBreadCrumbs::getInstance()->append(get_lang('User list'), get_path('rootAdminWeb') . 'admin_users.php'); } ClaroBreadCrumbs::getInstance()->append(get_lang('User settings'), $_SERVER['REQUEST_URI']); /*===================================================================== Main Section =====================================================================*/ $userId = isset($_REQUEST['uidToEdit']) ? (int) $_REQUEST['uidToEdit'] : null; if (empty($userId)) { $dialogBox->error(get_lang('Cannot find user')); } else { $userData = user_get_properties($userId); $user_extra_data = user_get_extra_data($userId); } if (!empty($user_extra_data) && count($user_extra_data) > 0) { $dgExtra = new claro_datagrid(user_get_extra_data($userId)); } else { $dgExtra = null; }
$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();
$cmdList[] = array('name' => get_lang('View platform statistics'), 'url' => claro_htmlspecialchars('userReport.php?cidReset=true&userId=' . (int) $userId)); } else { $cmdList[] = array('img' => 'back', 'name' => get_lang('Back to user list'), 'url' => claro_htmlspecialchars(Url::Contextualize(get_path('url') . '/claroline/user/user.php'))); } /* * Output */ CssLoader::getInstance()->load('tracking', 'screen'); $nameTools = get_lang('Statistics'); ClaroBreadCrumbs::getInstance()->setCurrent($nameTools, claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?userId=' . $userId))); if ($canSwitchCourses && $selfStatistics) { ClaroBreadCrumbs::getInstance()->prepend(get_lang('My user account'), claro_htmlspecialchars(Url::Contextualize('../auth/profile.php'))); } elseif (claro_is_in_a_course()) { ClaroBreadCrumbs::getInstance()->prepend(get_lang('Users'), claro_htmlspecialchars(Url::Contextualize('../user/user.php'))); } else { ClaroBreadCrumbs::getInstance()->prepend(get_lang('User account')); } $output = ''; /* * Output of : user information */ $userProfileBox = new UserProfileBox(true); $userProfileBox->setUserId($userId); $output .= '<div id="rightSidebar">' . $userProfileBox->render() . '</div>'; /* * Output of : course list if required */ $output .= '<div id="leftContent">' . "\n"; $output .= claro_html_tool_title(get_lang('User statistics'), null, $cmdList); if ($canSwitchCourses && count($userCourseList)) { $displayedCourseList = array();
*/ // include configuration and library file include 'language.conf.php'; require_once 'language.lib.php'; require_once get_path('incRepositorySys') . '/lib/config.lib.inc.php'; // table $tbl_used_lang = '`' . $mainDbName . '`.`' . $mainTblPrefix . TABLE_USED_LANG_VAR . '`'; // get start time $starttime = get_time(); // Start content $nameTools = 'Extract variables from installation script'; $urlSDK = get_path('rootAdminWeb') . 'xtra/sdk/'; $urlTranslation = $urlSDK . 'translation_index.php'; ClaroBreadCrumbs::getInstance()->prepend(get_lang('Translation Tools'), $urlTranslation); ClaroBreadCrumbs::getInstance()->prepend(get_lang('SDK'), $urlSDK); ClaroBreadCrumbs::getInstance()->prepend(get_lang('Administration'), get_path('rootAdminWeb')); include get_path('incRepositorySys') . '/claro_init_header.inc.php'; echo claro_html_tool_title($nameTools); if (isset($_REQUEST['cmd']) && $_REQUEST['cmd'] == 'generate') { $files = array(get_path('rootSys') . 'claroline/install/index.php'); $total_var_count = 0; $languageVarList = array(); foreach ($files as $file) { echo "<h4>" . $file . "</h4>\n"; // extract variables $scannedFileList = array(); // re init the scannedFileList for each new script $fileVarList = get_lang_vars_from_file($file); $sourceFile = file_get_contents($file); $tokenList = token_get_all($sourceFile); // $languageVarList = detect_get_lang($tokenList);
$toolTitle = $nameTools; ClaroBreadCrumbs::getInstance()->prepend(get_lang('Exercises'), Url::Contextualize(get_module_url('CLQWZ') . '/exercise.php')); ClaroBreadCrumbs::getInstance()->setCurrent($nameTools, Url::Contextualize('./edit_exercise.php?cmd=rqEdit')); } elseif ($cmd == 'rqEdit') { $nameTools = get_lang('Edit exercise'); $toolTitle['mainTitle'] = $nameTools; $toolTitle['subTitle'] = $exercise->getTitle(); ClaroBreadCrumbs::getInstance()->prepend(get_lang('Exercise'), Url::Contextualize('./edit_exercise.php?exId=' . $exId)); ClaroBreadCrumbs::getInstance()->prepend(get_lang('Exercises'), Url::Contextualize(get_module_url('CLQWZ') . '/exercise.php')); ClaroBreadCrumbs::getInstance()->setCurrent($nameTools, Url::Contextualize('./edit_exercise.php?cmd=rqEdit&exId=' . $exId)); } else { $nameTools = get_lang('Exercise'); $toolTitle['mainTitle'] = $nameTools; $toolTitle['subTitle'] = $exercise->getTitle(); ClaroBreadCrumbs::getInstance()->prepend(get_lang('Exercises'), Url::Contextualize(get_module_url('CLQWZ') . '/exercise.php')); ClaroBreadCrumbs::getInstance()->setCurrent($nameTools, Url::Contextualize('./edit_exercise.php?exId=' . $exId)); } CssLoader::getInstance()->load('exercise', 'screen'); $out = ''; $out .= claro_html_tool_title($toolTitle, null, $cmdList); // dialog box if required $out .= $dialogBox->render(); if ($displayForm) { // -- edit form $display = new ModuleTemplate('CLQWZ', 'exercise_form.tpl.php'); $display->assign('exId', $exId); $display->assign('data', $form); $display->assign('relayContext', claro_form_relay_context()); $display->assign('questionCount', count($exercise->getQuestionList())); $out .= $display->render(); } else {
// display course creator status form $noQUERY_STRING = true; $display = DISP_REQUEST_COURSE_CREATOR_STATUS; ClaroBreadCrumbs::getInstance()->prepend($nameTools, $_SERVER['PHP_SELF']); $nameTools = get_lang('Request course creation status'); } elseif (get_conf('can_request_revoquation') && 'reqRevoquation' == $cmd) { // display revoquation form $noQUERY_STRING = true; ClaroBreadCrumbs::getInstance()->prepend($nameTools, $_SERVER['PHP_SELF']); $nameTools = get_lang('Request to remove this account'); $display = DISP_REQUEST_REVOQUATION; } elseif ('editExtraInfo' == $cmd && 0 < count($extraInfoDefList)) { // display revoquation form $noQUERY_STRING = true; $display = DISP_MOREINFO_FORM; ClaroBreadCrumbs::getInstance()->prepend($nameTools, $_SERVER['PHP_SELF']); $nameTools = get_lang('Complementary fields'); $userInfo = get_user_property_list(claro_get_current_user_id()); } elseif ('exMoreInfo' == $cmd && 0 < count($extraInfoDefList)) { if (array_key_exists('extraInfoList', $_REQUEST)) { foreach ($_REQUEST['extraInfoList'] as $extraInfoName => $extraInfoValue) { set_user_property(claro_get_current_user_id(), $extraInfoName, $extraInfoValue, 'userExtraInfo'); } } } // Initialise $userData['userExtraInfoList'] = get_user_property_list(claro_get_current_user_id()); // Command list $cmdList = array(); switch ($display) { case DISP_PROFILE_FORM:
claro_disp_auth_form(true); } $can_add_single_user = (bool) (claro_is_course_manager() && get_conf('is_coursemanager_allowed_to_enroll_single_user')) || claro_is_platform_admin(); if (!$can_add_single_user) { claro_die(get_lang('Not allowed')); } // include configuration file include claro_get_conf_repository() . 'user_profile.conf.php'; // include libraries require_once get_path('incRepositorySys') . '/lib/user.lib.php'; require_once get_path('incRepositorySys') . '/lib/course_user.lib.php'; require_once get_path('incRepositorySys') . '/lib/sendmail.lib.php'; From::module('CLUSR')->uses('profileselector.lib'); // Initialise variables $nameTools = get_lang('Add a user'); ClaroBreadCrumbs::getInstance()->prepend(get_lang('Users'), 'user.php'); $dialogBox = new DialogBox(); $platformRegSucceed = false; $courseRegSucceed = false; /*===================================================================== MAIN SECTION =====================================================================*/ // Initialise field variable from subscription form $userData = user_initialise(); $cmd = isset($_REQUEST['cmd']) ? $cmd = $_REQUEST['cmd'] : null; if (isset($_REQUEST['applySearch']) && $_REQUEST['applySearch'] != '') { $cmd = 'applySearch'; } $userData['confirmUserCreate'] = isset($_REQUEST['confirmUserCreate']) ? $_REQUEST['confirmUserCreate'] : null; $userId = isset($_REQUEST['userId']) ? (int) $_REQUEST['userId'] : null; $displayResultTable = false;