} } 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); /* * 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"; } //-- list $display = new ModuleTemplate('CLQWZ', 'question_list.tpl.php'); $display->assign('exId', $exId); $display->assign('questionList', $questionList); $display->assign('context', is_null($exId) ? 'pool' : 'reuse'); $display->assign('localizedQuestionType', get_localized_question_type());
/** * display the answers as a form part for display in quizz submission page * * @author Sebastien Piraux <*****@*****.**> * @return string html code for display of answer */ public function getAnswerHtml() { if ($this->id == -1) { $html = "\n" . '<p>' . get_lang('There is no answer for the moment') . '</p>' . "\n\n"; } else { $answerCount = count($this->answerList); // build replacement $replacementList = array(); if ($this->type == LISTBOX_FILL) { // build the list shown in list box // prepare option list using good and wrong answers $allAnswerList = array_merge($this->answerList, $this->wrongAnswerList); // alphabetical sort of the list natcasesort($allAnswerList); $optionList[''] = ''; foreach ($allAnswerList as $answer) { $optionListValue = $this->answerDecode($answer); $optionList[$optionListValue] = $optionListValue; } for ($i = 0; $i < $answerCount; $i++) { if (isset($this->response[$i]) && array_key_exists($this->response[$i], $optionList)) { $selected = $this->response[$i]; } else { $selected = ''; // default is the empty element } $replacementList[] = str_replace('$', '\\$', claro_html_form_select('a_' . $this->questionId . '_' . $i, $optionList, $selected)); } } else { for ($i = 0; $i < $answerCount; $i++) { if (isset($this->response[$i])) { $value = $this->response[$i]; } else { $value = ''; } $replacementList[] = str_replace('$', '\\$', ' <input type="text" name="a_' . $this->questionId . '_' . $i . '" size="10" value="' . $value . '" /> '); } } // get all enclosed answers $blankList = array(); foreach ($this->answerList as $answer) { // filter slashes as they are modifiers in preg expressions $blankList[] = '/\\[' . preg_quote($this->answerDecode($this->addslashesEncodedBrackets($answer)), '/') . '\\]/'; } // apply replacement on answer, require limit parameter to replace only the first occurrence in case we // have several times the same word in a blank. $displayedAnswer = preg_replace($blankList, $replacementList, claro_parse_user_text($this->answerDecode($this->answerText)), 1); $html = '<table width="100%">' . "\n\n" . '<tr>' . "\n" . '<td>' . "\n" . $displayedAnswer . "\n" . '</td>' . "\n" . '</tr>' . "\n\n" . '</table>' . "\n" . '<p><small>' . get_lang('Fill in blanks') . '</small></p>' . "\n"; } return $html; }
echo get_lang('The categories appearing in grey are invisible categories.'); ?> </span> </dd> <!-- Course language select box --> <dt> <label for="course_language"> <?php echo get_lang('Language'); ?> </label><span class="required">*</span> </dt> <dd> <?php echo claro_html_form_select('course_language', $this->languageList, $this->course->language, array('id' => 'course_language')); ?> </dd> <!-- Course titular --> <dt> <label for="course_titular"> <?php echo get_lang('Lecturer(s)'); ?> </label> </dt> <dd> <input type="text" id="course_titular" name="course_titular" value="<?php echo claro_htmlspecialchars($this->course->titular); ?>
<textarea name="description" id="description" rows="4 "cols="70" ><?php echo $this->groupDescription; ?> </textarea> </dd> <!-- Group tutor --> <dt> <label for="tutor"><?php echo get_lang("Group Tutor"); ?> </label> </dt> <dd> <?php echo claro_html_form_select('tutor', $this->tutorList, $this->groupTutorId, array('id' => 'tutor')); ?> (<a href="../user/user.php?gidReset=true"><?php echo get_lang("View user list"); ?> </a>) </dd> <!-- Maximum number of seats --> <dt> <label for="maxMember"><?php echo get_lang("Seats"); ?> </label> </dt>
/** * Export the question part as a matrix-choice, with only one possible answer per line. * @author Amand Tihon <*****@*****.**> */ function export() { // prepare list of right proposition to allow // - easiest display // - easiest randomisation if needed one day // (here I use array_values to change array keys from $code1 $code2 ... to 0 1 ...) $displayedRightList = array_values($this->rightList); // get max length of displayed array $arrayLength = max(count($this->leftList), count($this->rightList)); $out = '<table width="100%">' . "\n\n"; $leftCpt = 1; $rightCpt = 'A'; for ($i = 0; $i < $arrayLength; $i++) { if (isset($this->leftList[$i]['answer'])) { // build html option list $optionList = array(); $optionCpt = 'A'; $optionList[0] = '--'; foreach ($this->rightList as $rightElt) { $optionList[$optionCpt] = $this->leftList[$i]['grade']; $optionCpt++; } $leftHtml = $leftCpt . '. ' . $this->leftList[$i]['answer']; $attr['id'] = 'scorm_' . getIdCounter(); $centerHtml = claro_html_form_select('matching_' . $this->questionId . '_' . $this->leftList[$i]['code'], $optionList, null, $attr); } else { $leftHtml = ' '; $centerHtml = ' '; } if (isset($displayedRightList[$i]['answer'])) { $rightHtml = $rightCpt . '. ' . $displayedRightList[$i]['answer']; } else { $rightHtml = ' '; } $out .= '<tr>' . "\n" . '<td valign="top" width="40%">' . "\n" . $leftHtml . "\n" . '</td>' . "\n" . '<td valign="top" width="20%">' . "\n" . $centerHtml . "\n" . '</td>' . "\n" . '<td valign="top" width="40%">' . "\n" . $rightHtml . "\n" . '</td>' . "\n" . '</tr>' . "\n\n"; $leftCpt++; $rightCpt++; } $out .= '</table>' . "\n" . '<p><small>' . get_lang('Matching') . '</small></p>' . "\n"; return $out; }
function claro_html_time_form($hourFieldName, $minuteFieldName, $unixDate = 0) { if ($unixDate == 0) { $selectedTime = date("H:i"); } else { $selectedTime = date("H:i", $unixDate); } //split selectedTime list($selHour, $selMinute) = explode(':', $selectedTime); if ($hourFieldName != '') { for ($hour = 0; $hour < 24; $hour++) { $aivailable_hours[$hour] = $hour; } $hourField = claro_html_form_select($hourFieldName, $aivailable_hours, $selHour, array('id' => $hourFieldName)); } if ($minuteFieldName != "") { for ($minuteCounter = 0; $minuteCounter < 60; $minuteCounter++) { $available_minutes[$minuteCounter] = $minuteCounter; } $minuteField = claro_html_form_select($minuteFieldName, $available_minutes, $selMinute, array('id' => $minuteFieldName)); } return ' ' . $hourField . ' ' . $minuteField; }
$diskUsage = sprintf('%01.2f', disk_usage(get_path('coursesRepositorySys'), get_path('mysqlRepositorySys'), 'm')) . ' ' . $byteUnits[2]; $out .= '<li>' . get_lang('Courses : %disk_usage (perhaps with other directories)', array('%disk_usage' => $diskUsage)) . '</li>'; } $out .= '</ul> <hr /> <form method="post" action="' . $_SERVER['PHP_SELF'] . '"> <input type="checkbox" id="disp_claro" name="disp_claro" value="true" /> <label for="disp_claro"> ' . get_lang('size of claroline scripts') . ' </label> <br /> <input type="checkbox" id="disp_allcrs" name="disp_allcrs" value="true" /> <label for="disp_allcrs">' . get_lang('!!!! size of course repository (include claroline and garbage in old systems)') . '</label> <br /> <input type="checkbox" name="disp_selCrs" id="disp_selCrs" value="true" /> <label for="disp_selCrs">' . get_lang('size of selected courses') . '</label><br />'; $out .= claro_html_form_select('coursesToCheck[]', $coursesToCheck_list, '', array('multiple' => 'multiple', 'size' => '')); $out .= '<input type="submit" /> </form> <hr />'; } if ($disp_selCrs && $coursesToCheck) { $out .= '<ol>'; $sqlListCourses = "\n SELECT administrativeNumber AS code,\n directory AS dir,\n dbName AS db,\n diskQuota\n FROM `" . $tbl_course . "` "; if ($coursesToCheck[0] == " all ") { $sqlListCourses .= " order by dbName"; } elseif (is_array($coursesToCheck)) { $sqlListCourses .= " where code in ('" . implode("','", $coursesToCheck) . "') order by dbName"; } else { unset($sqlListCourses); } if (isset($sqlListCourses)) {
<dt><label for="intitule"><?php echo get_lang('Course title'); ?> </label></dt> <dd><input type="text" size="40" name="intitule" id="intitule" value="<?php echo claro_htmlspecialchars($this->intitule); ?> "/></dd> <dt><label for="searchLang"><?php echo get_lang('Language'); ?> </label></dt> <dd> <?php echo claro_html_form_select('searchLang', $this->language_list, '', array('id' => 'searchLang')); ?> </dd> <dt><?php echo get_lang('Course access'); ?> </dt> <dd> <table> <tr> <td width="150px"> <input type="radio" name="access" value="public" id="access_public" <?php if ($this->access == "public") { echo 'checked="checked"'; }
<input type="text" name="mail" id="mail" value="<?php echo htmlspecialchars($this->mail); ?> "/> </td> </tr> <tr> <td align="right"> <label for="action"><?php echo get_lang('Action'); ?> </label> : <br /> </td> <td> <?php echo claro_html_form_select('action', $this->action_list, $this->action, array('id' => 'action')); ?> </td> </tr> <tr> <td> </td> <td> <input type="submit" class="claroButton" value="<?php echo get_lang('Search user'); ?> " /> </td> </tr> </table> </form>
<?php if ($this->exId && $this->questionCount > 0) { $questionDrawnOptions = array(); for ($i = 1; $i <= $this->questionCount; $i++) { $questionDrawnOptions[$i] = $i; } ?> <dt><label for="randomize"><?php echo get_lang('Random questions'); ?> </label></dt> <dd> <div> <input type="checkbox" name="randomize" id="randomize" class="checkbox" <?php echo ($this->data['randomize'] ? ' checked="checked"' : ' ') . '/> ' . get_lang('<label1>Yes</label1>, <label2>take</label2> %nb questions among %total', array('<label1>' => '<label for="randomize">', '</label1>' => '</label>', '<label2>' => '<label for="questionDrawn">', '</label2>' => '</label>', '%nb' => claro_html_form_select('questionDrawn', $questionDrawnOptions, $this->data['questionDrawn'], array('id' => 'questionDrawn')), '%total' => $this->questionCount)); ?> </div> <div> <input type="checkbox" name="useSameShuffle" value="1" class="checkbox" <?php echo $this->data['useSameShuffle'] ? ' checked="checked"' : ' '; ?> /> <?php echo get_lang('Reuse the same shuffle'); ?> </div> </dd> <?php } ?> </dl>
* 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(); if (is_null($courseId)) { // add an empty value in list if no course is selected $displayedCourseList[''] = ''; } foreach ($userCourseList as $course) { $displayedCourseList[$course['title']] = $course['sysCode']; } $attr['onchange'] = 'filterForm.submit()'; $attr['id'] = 'cidReq'; $output .= "\n" . '<form method="get" name="filterForm" action="' . claro_htmlspecialchars(Url::Contextualize('userReport.php')) . '">' . "\n" . '<input type="hidden" name="userId" value="' . (int) $userId . '" />' . "\n" . '<p>' . "\n" . '<label for="cidReq">' . get_lang('Choose a course') . ' : </label>' . "\n" . claro_html_form_select('cidReq', $displayedCourseList, $courseId, $attr) . "\n" . '<input type="submit" id="buttonOK" value="' . get_lang('Ok') . '" />' . "\n" . '</p>' . "\n" . '</form>' . "\n"; } /* * Prepare rendering : * Load and loop through available tracking renderers * Order of renderers blocks is arranged using "first found, first display" in the registry * Modify the registry to change the load order if required */ // get all renderers by using registry $trackingRendererRegistry = TrackingRendererRegistry::getInstance(claro_get_current_course_id()); if (!is_null($courseId)) { // we need user tracking renderers in course context $userTrackingRendererList = $trackingRendererRegistry->getUserRendererList(TrackingRendererRegistry::COURSE); } else { // we need user tracking renderers in platform context $userTrackingRendererList = $trackingRendererRegistry->getUserRendererList(TrackingRendererRegistry::PLATFORM);
/** * display the answers as a form part for display in quizz submission page * * @author Sebastien Piraux <*****@*****.**> * @return string html code for display of answer */ public function getAnswerHtml() { if (empty($this->leftList) || empty($this->rightList)) { $html = "\n" . '<p>' . get_lang('There is no answer for the moment') . '</p>' . "\n\n"; } else { // prepare list of right proposition to allow // - easiest display // - easiest randomisation if needed one day // (here I use array_values to change array keys from $code1 $code2 ... to 0 1 ...) $displayedRightList = array_values($this->rightList); // get max length of displayed array $arrayLength = max(count($this->leftList), count($this->rightList)); $html = '<table width="100%">' . "\n\n"; $leftCpt = 1; $rightCpt = 'A'; for ($i = 0; $i < $arrayLength; $i++) { if (isset($this->leftList[$i]['answer'])) { // build html option list - we have to do this here for "selected" attribute $optionList = array(); $optionCpt = 'A'; $selected = ''; $optionList['--'] = ''; foreach ($this->rightList as $rightElt) { $optionList[$optionCpt] = $rightElt['code']; if ($this->leftList[$i]['response'] == $rightElt['code']) { $selected = $rightElt['code']; } $optionCpt++; } $leftHtml = $leftCpt . '. ' . $this->leftList[$i]['answer']; $centerHtml = claro_html_form_select('a_' . $this->questionId . '_' . $this->leftList[$i]['code'], $optionList, $selected); } else { $leftHtml = ' '; $centerHtml = ' '; } if (isset($displayedRightList[$i]['answer'])) { $rightHtml = $rightCpt . '. ' . $displayedRightList[$i]['answer']; } else { $rightHtml = ' '; } $html .= '<tr>' . "\n" . '<td valign="top" width="40%">' . "\n" . $leftHtml . "\n" . '</td>' . "\n" . '<td valign="top" width="20%">' . "\n" . $centerHtml . "\n" . '</td>' . "\n" . '<td valign="top" width="40%">' . "\n" . $rightHtml . "\n" . '</td>' . "\n" . '</tr>' . "\n\n"; $leftCpt++; $rightCpt++; } $html .= '</table>' . "\n" . '<p><small>' . get_lang('Matching') . '</small></p>' . "\n"; } return $html; }
if (!$singleDbForm) { echo '<div class="row">' . "\n" . '<div class="rowTitle">' . "\n" . '<label for="dbStatsForm"><span class="required">*</span> ' . get_lang('Tracking database') . '</label>' . "\n" . '</div>' . "\n" . '<div class="rowField">' . "\n" . '<input type="text" size="30" id="dbStatsForm" name="dbStatsForm" value="' . claro_htmlspecialchars($dbStatsForm) . '" />' . "\n" . '<span class="example">' . get_lang('e.g.') . ' ' . $dbStatsForm . '</span>' . "\n" . '</div>' . "\n" . '</div>' . "\n\n" . '<div class="row">' . "\n" . '<div class="rowTitle">' . "\n" . '<label for="statsTblPrefixForm">' . get_lang('Prefix for tracking tables') . '</label>' . "\n" . '</div>' . "\n" . '<div class="rowField">' . "\n" . '<input type="text" size="5" id="statsTblPrefixForm" name="statsTblPrefixForm" value="' . claro_htmlspecialchars($statsTblPrefixForm) . '" />' . "\n" . '<span class="example">' . get_lang('e.g.') . ' ' . $statsTblPrefixForm . '</span>' . "\n" . '</div>' . "\n" . '</div>' . "\n\n" . '<blockquote><small>' . "\n" . get_lang('Tracking tables are stored by default into the main Claroline database.') . '<br />' . get_lang('However, you can record tracking data into a separate database or set a specific prefix for tracking tables.') . "\n" . '</small></blockquote>' . "\n"; } echo '<div class="row">' . "\n" . '<div class="rowTitle">' . "\n" . '<label for="dbPrefixForm">' . ($singleDbForm ? get_lang('Prefix for course tables') : get_lang('Prefix for course databases')) . '</label>' . "\n" . '</div>' . "\n" . '<div class="rowField">' . "\n" . '<input type="text" size="30" id="dbPrefixForm" name="dbPrefixForm" value="' . claro_htmlspecialchars($dbPrefixForm) . '" />' . "\n" . '<span class="example">' . get_lang('e.g.') . ' ' . $dbPrefixForm . '</span>' . "\n" . '</div>' . "\n" . '</div>' . "\n\n"; if (!$singleDbForm) { echo '<blockquote>' . "\n" . '<small>' . "\n" . '<strong>' . "\n" . get_lang('A database will be created for each course.') . "\n" . '</strong>' . "\n" . '<br />' . "\n" . get_lang('You can choose the prefix that will be used for these databases') . "\n" . '</small>' . "\n" . '</blockquote>' . "\n"; } echo '</fieldset>' . "\n\n" . '<small>' . get_lang('%requiredMark required field', array('%requiredMark' => '<span class="required">*</span>')) . '</small>' . "\n"; } elseif (DISP_ADMINISTRATOR_SETTING == $display) { echo '<input type="hidden" name="fromPanel" value="' . $display . '" />' . "\n" . '<h2>' . "\n" . get_lang('Step %step of %nb_step : %step_name', array('%step' => array_search(DISP_ADMINISTRATOR_SETTING, $panelSequence) + 1, '%nb_step' => count($panelSequence), '%step_name' => $panelTitle[DISP_ADMINISTRATOR_SETTING])) . '</h2>' . "\n"; if (is_array($missing_admin_data) || is_array($error_in_admin_data)) { echo '<div class="claroDialogBox boxError">' . "\n" . '<p>' . "\n" . '<strong>' . get_lang('Error') . '</strong> : ' . get_lang('Please enter missing information') . '</p>' . "\n" . '<p>' . "\n" . (is_array($missing_admin_data) ? 'Fill in ' . implode(', ', $missing_admin_data) . '<br />' : '') . (is_array($error_in_admin_data) ? 'Check ' . implode(', ', $error_in_admin_data) : '') . '</p>' . "\n" . '</div>' . "\n"; } echo '<fieldset>' . "\n" . '<legend>' . get_lang('Administrator details') . '</legend>' . "\n" . '<div class="row">' . "\n" . '<div class="rowTitle">' . "\n" . '<label for="loginForm"><span class="required">*</span> ' . get_lang('Login') . '</label>' . "\n" . '</div>' . "\n" . '<div class="rowField">' . "\n" . '<input type="text" size="30" id="loginForm" name="loginForm" value="' . claro_htmlspecialchars($loginForm) . '" />' . "\n" . '<span class="example">' . get_lang('e.g.') . ' jdoe</span>' . "\n" . '</div>' . "\n" . '</div>' . "\n\n" . '<div class="row">' . "\n" . '<div class="rowTitle">' . "\n" . '<label for="passForm"><span class="required">*</span> ' . get_lang('Password') . '</label>' . "\n" . '</div>' . "\n" . '<div class="rowField">' . "\n" . '<input type="text" size="30" id="passForm" name="passForm" value="' . claro_htmlspecialchars($passForm) . '" />' . "\n" . '<span class="example">' . get_lang('e.g.') . generate_passwd(8) . '</span>' . "\n" . '</div>' . "\n" . '</div>' . "\n\n" . '<div class="row">' . "\n" . '<div class="rowTitle">' . "\n" . '<label for="adminEmailForm"><span class="required">*</span> ' . get_lang('Email') . '</label>' . "\n" . '</div>' . "\n" . '<div class="rowField">' . "\n" . '<input type="text" size="30" id="adminEmailForm" name="adminEmailForm" value="' . claro_htmlspecialchars($adminEmailForm) . '" />' . "\n" . '<span class="example">' . get_lang('e.g.') . ' jdoe@mydomain.net</span>' . "\n" . '</div>' . "\n" . '</div>' . "\n\n" . '<div class="row">' . "\n" . '<div class="rowTitle">' . "\n" . '<label for="adminNameForm"><span class="required">*</span> ' . get_lang('Last name') . '</label>' . "\n" . '</div>' . "\n" . '<div class="rowField">' . "\n" . '<input type="text" size="30" id="adminNameForm" name="adminNameForm" value="' . claro_htmlspecialchars($adminNameForm) . '" />' . "\n" . '<span class="example">' . get_lang('e.g.') . ' Doe</span>' . "\n" . '</div>' . "\n" . '</div>' . "\n\n" . '<div class="row">' . "\n" . '<div class="rowTitle">' . "\n" . '<label for="adminSurnameForm"><span class="required">*</span> ' . get_lang('First name') . '</label>' . "\n" . '</div>' . "\n" . '<div class="rowField">' . "\n" . '<input type="text" size="30" id="adminSurnameForm" name="adminSurnameForm" value="' . claro_htmlspecialchars($adminSurnameForm) . '" />' . "\n" . '<span class="example">' . get_lang('e.g.') . ' John</span>' . "\n" . '</div>' . "\n" . '</div>' . "\n\n" . '</fieldset>' . "\n" . '<small>' . get_lang('%requiredMark required field', array('%requiredMark' => '<span class="required">*</span>')) . '</small>' . "\n"; } elseif (DISP_PLATFORM_SETTING == $display) { echo '<input type="hidden" name="fromPanel" value="' . $display . '" />' . "\n" . '<h2>' . "\n" . get_lang('Step %step of %nb_step : %step_name', array('%step' => array_search(DISP_PLATFORM_SETTING, $panelSequence) + 1, '%nb_step' => count($panelSequence), '%step_name' => $panelTitle[DISP_PLATFORM_SETTING])) . '</h2>' . "\n" . $msg_missing_platform_data . "\n" . '<fieldset>' . "\n" . '<legend>' . get_lang('Campus') . '</legend>' . "\n" . '<div class="row">' . "\n" . '<div class="rowTitle">' . "\n" . '<label for="campusForm"><span class="required">*</span> ' . get_lang('Name') . '</label>' . "\n" . '</div>' . "\n" . '<div class="rowField">' . "\n" . '<input type="text" size="30" id="campusForm" name="campusForm" value="' . claro_htmlspecialchars($campusForm) . '" />' . "\n" . '</div>' . "\n" . '</div>' . "\n\n" . '<div class="row">' . "\n" . '<div class="rowTitle">' . "\n" . '<label for="urlForm"><span class="required">*</span> ' . get_lang('Absolute URL') . '</label>' . "\n" . '</div>' . "\n" . '<div class="rowField">' . "\n" . '<input type="text" size="30" id="urlForm" name="urlForm" value="' . claro_htmlspecialchars($urlForm) . '" />' . "\n" . '</div>' . "\n" . '</div>' . "\n\n" . '<div class="row">' . "\n" . '<div class="rowTitle">' . "\n" . '<label for="courseRepositoryForm">' . get_lang('Path to courses repository (relative to the URL above)') . '</label>' . "\n" . '</div>' . "\n" . '<div class="rowField">' . "\n" . '<input type="text" size="30" id="courseRepositoryForm" name="courseRepositoryForm" value="' . claro_htmlspecialchars($courseRepositoryForm) . '" />' . "\n" . '</div>' . "\n" . '</div>' . "\n\n" . '<div class="row">' . "\n" . '<div class="rowTitle">' . "\n" . '<label for="languageForm"><span class="required">*</span> ' . get_lang('Main language') . '</label>' . "\n" . '</div>' . "\n" . '<div class="rowField">' . "\n" . claro_html_form_select('languageForm', $language_list, $languageForm, array('id' => 'languageForm')) . "\n" . '</div>' . "\n" . '</div>' . "\n\n" . '<div class="row">' . "\n" . '<div class="rowTitle">' . "\n" . '<label for="clmain_serverTimezone"><span class="required">*</span> ' . get_lang('Server timezone') . '</label>' . "\n" . '</div>' . "\n" . '<div class="rowField">' . "\n" . claro_html_form_select('clmain_serverTimezone', get_timezone_list(), $clmain_serverTimezone, array('id' => 'clmain_serverTimezone')) . "\n" . '</div>' . "\n" . '</div>' . "\n\n" . '</fieldset>' . "\n\n" . '<fieldset>' . "\n" . '<legend>' . get_lang('User') . '</legend>' . "\n" . '<div class="row">' . "\n" . '<div class="rowTitle">' . "\n" . '<span class="required">*</span> ' . "\n" . get_lang('Self-registration') . "\n" . '</div>' . "\n" . '<div class="rowField">' . "\n" . '<input type="radio" id="allowSelfReg_1" name="allowSelfReg" value="1" ' . ($allowSelfReg ? 'checked' : '') . ' />' . "\n" . '<label for="allowSelfReg_1">' . get_lang('Enabled') . '</label>' . "\n" . '<br />' . "\n" . '<input type="radio" id="allowSelfReg_0" name="allowSelfReg" value="0" ' . ($allowSelfReg ? '' : 'checked') . ' />' . "\n" . '<label for="allowSelfReg_0">' . get_lang('Disabled') . '</label>' . "\n" . '</div>' . "\n" . '</div>' . "\n\n" . '<div class="row">' . "\n" . '<div class="rowTitle">' . "\n" . '<span class="required">*</span> ' . "\n" . get_lang('Password storage') . "\n" . '</div>' . "\n" . '<div class="rowField">' . "\n" . '<input type="radio" name="encryptPassForm" id="encryptPassForm_0" value="0" ' . ($encryptPassForm ? '' : 'checked') . ' />' . "\n" . '<label for="encryptPassForm_0">' . get_lang('Clear text') . '</label>' . "\n" . '<br />' . "\n" . '<input type="radio" name="encryptPassForm" id="encryptPassForm_1" value="1" ' . ($encryptPassForm ? 'checked' : '') . ' />' . "\n" . '<label for="encryptPassForm_1">' . get_lang('Encrypted') . '</label>' . "\n" . '</div>' . "\n" . '</div>' . "\n\n" . '</fieldset>' . "\n" . '<small>' . get_lang('%requiredMark required field', array('%requiredMark' => '<span class="required">*</span>')) . '</small>' . "\n"; } elseif (DISP_ADMINISTRATIVE_SETTING == $display) { echo '<input type="hidden" name="fromPanel" value="' . $display . '" /><h2>' . get_lang('Step %step of %nb_step : %step_name', array('%step' => array_search(DISP_ADMINISTRATIVE_SETTING, $panelSequence) + 1, '%nb_step' => count($panelSequence), '%step_name' => $panelTitle[DISP_ADMINISTRATIVE_SETTING])) . '</h2>' . "\n" . $msg_missing_administrative_data . '<fieldset>' . "\n" . '<legend>' . get_lang('Related organization') . '</legend>' . "\n" . '<div class="row">' . "\n" . '<div class="rowTitle">' . "\n" . '<label for="institutionForm">' . get_lang('Institution name') . '</label>' . "\n" . '</div>' . "\n" . '<div class="rowField">' . "\n" . '<input type="text" size="30" id="institutionForm" name="institutionForm" value="' . claro_htmlspecialchars($institutionForm) . '" />' . "\n" . '</div>' . "\n" . '</div>' . "\n\n" . '<div class="row">' . "\n" . '<div class="rowTitle">' . "\n" . '<label for="institutionUrlForm">' . get_lang('Institution URL') . '</label>' . "\n" . '</div>' . "\n" . '<div class="rowField">' . "\n" . '<input type="text" size="30" id="institutionUrlForm" name="institutionUrlForm" value="' . claro_htmlspecialchars($institutionUrlForm) . '" />' . "\n" . '</div>' . "\n" . '</div>' . "\n\n" . '</fieldset>' . "\n\n" . '<fieldset>' . "\n" . '<legend>' . get_lang('Campus contact') . '</legend>' . "\n" . '<div class="row">' . "\n" . '<div class="rowTitle">' . "\n" . '<label for="contactNameForm"><span class="required">*</span> ' . get_lang('Contact name') . '</label>' . "\n" . '</div>' . "\n" . '<div class="rowField">' . "\n" . '<input type="text" size="30" id="contactNameForm" name="contactNameForm" value="' . claro_htmlspecialchars($contactNameForm) . '"/>' . "\n" . '</div>' . "\n" . '</div>' . "\n\n" . '<div class="row">' . "\n" . '<div class="rowTitle">' . "\n" . '<label for="contactEmailForm"><span class="required">*</span> ' . get_lang('Contact email') . '</label>' . "\n" . '</div>' . "\n" . '<div class="rowField">' . "\n" . '<input type="text" size="30" id="contactEmailForm" name="contactEmailForm" value="' . claro_htmlspecialchars($contactEmailForm) . '"/>' . "\n" . '</div>' . "\n" . '</div>' . "\n\n" . '<div class="row">' . "\n" . '<div class="rowTitle">' . "\n" . '<label for="contactPhoneForm">' . get_lang('Contact phone') . '</label>' . "\n" . '</div>' . "\n" . '<div class="rowField">' . "\n" . '<input type="text" size="30" id="contactPhoneForm" name="contactPhoneForm" value="' . claro_htmlspecialchars($contactPhoneForm) . '" />' . "\n" . '</div>' . "\n" . '</div>' . "\n\n" . '</fieldset>' . "\n" . '<small>' . get_lang('%requiredMark required field', array('%requiredMark' => '<span class="required">*</span>')) . '</small>' . "\n"; } elseif (DISP_LAST_CHECK_BEFORE_INSTALL == $display) { $pathForm = str_replace("\\\\", "/", $pathForm); //echo "pathForm $pathForm"; echo '<input type="hidden" name="fromPanel" value="' . $display . '" />' . "\n" . '<h2>' . get_lang('Step %step of %nb_step : %step_name', array('%step' => array_search(DISP_LAST_CHECK_BEFORE_INSTALL, $panelSequence) + 1, '%nb_step' => count($panelSequence), '%step_name' => $panelTitle[DISP_LAST_CHECK_BEFORE_INSTALL])) . '</h2>' . "\n" . '<p>' . "\n" . get_lang('Please check the values you entered.') . '<br />' . "\n" . get_lang('Print this page to keep your administrator password and other settings.') . "\n" . '</p>' . "\n" . '<fieldset>' . "\n" . '<legend>' . $panelTitle[DISP_DB_CONNECT_SETTING] . '</legend>' . "\n" . '<table class="checkList">' . "\n\n" . '<tr class="checkSubTitle">' . '<th colspan="2">' . get_lang('Mysql connection parameters') . '</th>' . '</tr>' . "\n" . '<tr class="check">' . "\n" . '<td class="checkTitle">' . "\n" . get_lang('Database host') . ' : ' . "\n" . '</td>' . "\n" . '<td class="checkValue">' . "\n" . claro_htmlspecialchars($dbHostForm) . '</td>' . "\n" . '</tr>' . "\n\n" . '<tr class="check">' . "\n" . '<td class="checkTitle">' . "\n" . get_lang('Database username') . ' : ' . "\n" . '</td>' . "\n" . '<td class="checkValue">' . "\n" . claro_htmlspecialchars($dbUsernameForm) . '</td>' . "\n" . '</tr>' . "\n\n" . '<tr class="check">' . "\n" . '<td class="checkTitle">' . "\n" . get_lang('Database password') . ' : ' . "\n" . '</td>' . "\n" . '<td class="checkValue">' . "\n" . claro_htmlspecialchars(empty($dbPassForm) ? '--empty--' : $dbPassForm) . '</td>' . "\n" . '</tr>' . "\n\n" . '</table>' . "\n\n" . '<table class="checkList">' . "\n\n" . '<tr class="checkSubTitle">' . '<th colspan="2">' . get_lang('Database usage') . '</th>' . '<tr>' . "\n" . '<tr class="check">' . "\n" . '<td class="checkTitle">' . "\n" . get_lang('Database mode') . ' : ' . "\n" . '</td>' . "\n" . '<td class="checkValue">' . "\n" . ($singleDbForm ? get_lang('Single') : get_lang('Multi')) . '</td>' . "\n" . '</tr>' . "\n\n" . '</table>' . "\n\n" . '</fieldset>' . "\n" . '<fieldset>' . "\n" . '<legend>' . $panelTitle[DISP_DB_NAMES_SETTING] . '</legend>' . "\n" . '<table class="checkList">' . "\n\n" . '<tr class="check">' . "\n" . '<td class="checkTitle">' . "\n" . get_lang('Main database') . ' : ' . "\n" . '</td>' . "\n" . '<td class="checkValue">' . "\n" . claro_htmlspecialchars($dbNameForm) . '</td>' . "\n" . '</tr>' . "\n\n" . '<tr class="check">' . "\n" . '<td class="checkTitle">' . "\n" . get_lang('Tracking database') . ' : ' . "\n" . '</td>' . "\n" . '<td class="checkValue">' . "\n" . claro_htmlspecialchars($dbStatsForm) . '</td>' . "\n" . '</tr>' . "\n\n" . '</table>' . "\n\n" . '<table class="checkList">' . "\n\n" . '<tr class="checkSubTitle">' . '<th colspan="2">' . get_lang('Table prefixes') . '</th>' . '<tr>' . "\n"; if ('' != $mainTblPrefixForm) { echo '<tr class="check">' . "\n" . '<td class="checkTitle">' . "\n" . get_lang('Main tables') . ' : ' . "\n" . '</td>' . "\n" . '<td class="checkValue">' . "\n" . claro_htmlspecialchars($mainTblPrefixForm) . '</td>' . "\n" . '</tr>' . "\n\n"; } if ('' != $statsTblPrefixForm) { echo '<tr class="check">' . "\n" . '<td class="checkTitle">' . "\n" . get_lang('Tracking tables') . ' : ' . "\n" . '</td>' . "\n" . '<td class="checkValue">' . "\n" . claro_htmlspecialchars($statsTblPrefixForm) . '</td>' . "\n" . '</tr>' . "\n\n"; } if ('' != $dbPrefixForm) { echo '<tr class="check">' . "\n" . '<td class="checkTitle">' . "\n" . get_lang('Course databases') . ' : ' . "\n" . '</td>' . "\n" . '<td class="checkValue">' . "\n" . claro_htmlspecialchars($dbPrefixForm) . '</td>' . "\n" . '</tr>' . "\n\n"; }
/** * Get html select box for a user language preference * * @return string html * @since 1.8 */ function user_display_preferred_language_select_box() { $language_list = get_language_to_display_list(); $form = ''; if (is_array($language_list) && count($language_list) > 1) { // get the the current language $user_language = language::current_language(); // build language selector form $form .= claro_html_form_select('language', $language_list, $user_language, array('id' => 'language_selector')); } return $form; }