Merge branch '1.11.x' of github.com:chamilo/chamilo-lms into 1.11.x

pull/2487/head
jmontoyaa 9 years ago
commit c6254c87af
  1. 36
      app/Resources/public/css/base.css
  2. 2
      custompages/index-unlogged-dist.php
  3. 6
      main/admin/course_category.php
  4. 2
      main/admin/email_tester.php
  5. 24
      main/admin/skill_badge_create.php
  6. 6
      main/admin/skill_level.php
  7. 14
      main/admin/specific_fields_add.php
  8. 22
      main/attendance/attendance_controller.php
  9. 10
      main/badge/assign.php
  10. 22
      main/badge/issued.php
  11. 20
      main/badge/issued_all.php
  12. 2
      main/calendar/agenda.php
  13. 8
      main/chat/chat.php
  14. 4
      main/course_description/course_description_controller.php
  15. 10
      main/course_home/2column.php
  16. 24
      main/course_home/3column.php
  17. 4
      main/coursecopy/copy_course.php
  18. 6
      main/coursecopy/create_backup.php
  19. 2
      main/coursecopy/recycle_course.php
  20. 30
      main/document/create_paint.php
  21. 2
      main/document/download_scorm.php
  22. 90
      main/document/edit_paint.php
  23. 10
      main/document/show_content.php
  24. 100
      main/document/slideshow.php
  25. 2
      main/dropbox/recover_dropbox_files.php
  26. 26
      main/exercise/Draggable.php
  27. 2
      main/exercise/exercice.php
  28. 6
      main/exercise/exercise_reminder.php
  29. 6
      main/exercise/exercise_report.php
  30. 112
      main/exercise/export/scorm/scorm_classes.php
  31. 4
      main/exercise/freeanswer.class.php
  32. 6
      main/exercise/hotpotatoes.php
  33. 8
      main/exercise/hotspot_save.inc.php
  34. 12
      main/exercise/hotspot_savescore.inc.php
  35. 6
      main/gamification/my_progress.php
  36. 2
      main/glossary/glossary_ajax_request.php
  37. 8
      main/gradebook/certificate_report.php
  38. 6
      main/gradebook/get_badges.php
  39. 12
      main/gradebook/gradebook_add_cat.php
  40. 12
      main/gradebook/gradebook_add_link_select_course.php
  41. 8
      main/gradebook/gradebook_add_result.php
  42. 16
      main/gradebook/gradebook_add_user.php
  43. 10
      main/gradebook/gradebook_display_summary.php
  44. 14
      main/gradebook/gradebook_flatview.php
  45. 32
      main/gradebook/gradebook_statistics.php
  46. 42
      main/gradebook/lib/fe/exportgradebook.php
  47. 16
      main/group/group.php
  48. 8
      main/help/allowed_html_tags.php
  49. 6
      main/help/faq.php
  50. 8
      main/inc/ajax/record_audio_rtc.ajax.php
  51. 8
      main/inc/ajax/sequence.ajax.php
  52. 2
      main/inc/global_error_message.inc.php
  53. 2
      main/inc/lib/conditional_login.class.php
  54. 12
      main/inc/lib/formvalidator/Element/DateRangePicker.php
  55. 9
      main/inc/lib/formvalidator/Element/SelectAjax.php
  56. 34
      main/inc/lib/formvalidator/Rule/MaxFileSize.php
  57. 34
      main/inc/lib/formvalidator/Rule/UsernameAvailable.php
  58. 10
      main/inc/lib/internationalization.lib.php
  59. 18
      main/inc/lib/plugin.lib.php
  60. 2
      main/inc/lib/sessionmanager.lib.php
  61. 16
      main/inc/lib/skill.lib.php
  62. 1
      main/inc/lib/system/web/request.class.php
  63. 12
      main/inc/lib/timeline.lib.php
  64. 6
      main/inc/lib/zombie/zombie_manager.class.php
  65. 4
      main/inc/lib/zombie/zombie_report.class.php
  66. 14
      main/install/index.php
  67. 32
      main/install/install_files.inc.php
  68. 16
      main/lp/lp_add.php
  69. 2
      main/lp/lp_content.php
  70. 12
      main/lp/lp_edit.php
  71. 10
      main/lp/lp_impress.php
  72. 4
      main/lp/lp_report.php
  73. 6
      main/messages/download.php
  74. 18
      main/messages/view_message.php
  75. 30
      main/mySpace/company_reports.php
  76. 14
      main/mySpace/company_reports_resumed.php
  77. 20
      main/mySpace/session.php
  78. 286
      main/permissions/permissions_functions.inc.php
  79. 2
      main/portfolio/share.php
  80. 4
      main/reports/index.php
  81. 4
      main/session/session_user_edit.php
  82. 16
      main/social/message_for_group_form.inc.php
  83. 2
      main/social/my_skills_report.php
  84. 4
      main/survey/create_new_survey.php
  85. 3
      main/survey/fillsurvey.php
  86. 20
      main/survey/surveyUtil.class.php
  87. 19
      main/survey/survey_invite.php
  88. 268
      main/template/default/auth/session_catalog.tpl
  89. 4
      main/ticket/tutor_report.lib.php
  90. 4
      main/tracking/course_log_groups.php
  91. 12
      main/tracking/course_log_resources.php
  92. 14
      main/tracking/course_log_tools.php
  93. 32
      main/tracking/lp_results_by_user.php
  94. 16
      main/tracking/question_course_report.php
  95. 52
      main/tracking/userLog.php
  96. 30
      main/tracking/userlogCSV.php
  97. 4
      main/upload/index.php
  98. 98
      main/user/resume_session.php
  99. 32
      main/user/session_list.php
  100. 16
      main/user/user_import.php
  101. Some files were not shown because too many files have changed in this diff Show More

@ -4821,11 +4821,28 @@ div#chat-remote-video video {
.grid-courses .items .title{
line-height: 1.4;
padding: 0px;
font-size: 17px;
font-size: 14px;
font-weight: bold;
height: 42px;
min-height: 42px;
margin: 0;
}
.grid-courses .items .image .black-shadow {
top: 0px;
left: 0px;
width: 100%;
height: 100%;
opacity: 0;
box-sizing: border-box;
position: absolute;
background: rgba(0, 0, 0, 0.7) none repeat scroll 0% 0%;
padding: 40px 10px 10px;
}
.grid-courses .items .image .hovered-course {
opacity: 1;
transition: all 0.3s ease 0s;
}
.hot-courses .grid-courses .items .title{
line-height: 1.4;
padding: 0px;
@ -6695,8 +6712,12 @@ input.form-control[type="color"] {
text-align: right;
}
.actions .row .text-right a{
margin-left: 10px;
margin-right: 0;
margin-left: 10px;
margin-right: 0;
}
.section-catalog .grid-courses .col-sm-6:nth-child(2n+1) {
clear: left;
}
}
@ -6705,6 +6726,13 @@ input.form-control[type="color"] {
div.navbar-collapse {
padding-left: 0;
}
.section-catalog .grid-courses .col-sm-6:nth-child(2n+1) {
clear: none;
}
.section-catalog .grid-courses .col-md-3:nth-child(4n+1) {
clear: left;
}
}
/* Large devices (large desktops, 1200px and up) */

@ -77,7 +77,7 @@ $rootWeb = api_get_path('WEB_PATH');
<div id="login-form-box" class="form-box">
<div id="login-form-info" class="form-info">
<?php if (isset($content['info']) && !empty($content['info'])) {
echo $content['info'];
echo $content['info'];
}
?>
</div>

@ -26,7 +26,7 @@ if (!empty($action)) {
if ($action == 'delete') {
CourseCategory::deleteNode($categoryId);
Display::addFlash(Display::return_message(get_lang('Deleted')));
header('Location: ' . api_get_self() . '?category=' . Security::remove_XSS($category));
header('Location: '.api_get_self().'?category='.Security::remove_XSS($category));
exit();
} elseif (($action == 'add' || $action == 'edit') && isset($_POST['formSent']) && $_POST['formSent']) {
if ($action == 'add') {
@ -54,7 +54,7 @@ if (!empty($action)) {
}
} elseif ($action == 'moveUp') {
CourseCategory::moveNodeUp($categoryId, $_GET['tree_pos'], $category);
header('Location: ' . api_get_self() . '?category=' . Security::remove_XSS($category));
header('Location: '.api_get_self().'?category='.Security::remove_XSS($category));
Display::addFlash(Display::return_message(get_lang('Updated')));
exit();
}
@ -78,7 +78,7 @@ if ($action == 'add' || $action == 'edit') {
$form_title = ($action == 'add') ? get_lang('AddACategory') : get_lang('EditNode');
if (!empty($category)) {
$form_title .= ' ' . get_lang('Into') . ' ' . Security::remove_XSS($category);
$form_title .= ' '.get_lang('Into').' '.Security::remove_XSS($category);
}
$url = api_get_self().'?action='.Security::remove_XSS($action).'&category='.Security::remove_XSS($category).'&id='.Security::remove_XSS($categoryId);
$form = new FormValidator('course_category', 'post', $url);

@ -55,7 +55,7 @@ if ($form->validate()) {
Display::return_message(get_lang('MailingTestSent'), 'warning')
);
header('Location: ' . api_get_self());
header('Location: '.api_get_self());
exit;
}

@ -24,16 +24,16 @@ $skillId = intval($_GET['id']);
$objSkill = new Skill();
$skill = $objSkill->get($skillId);
$htmlHeadXtra[] = '<link href="'. api_get_path(WEB_LIBRARY_JS_PATH) .'badge-studio/media/css/core.css" rel="stylesheet">';
$htmlHeadXtra[] = '<link href="'.api_get_path(WEB_LIBRARY_JS_PATH).'badge-studio/media/css/core.css" rel="stylesheet">';
// Add badge studio paths
$badgeStudio = [
'core' => api_get_path(WEB_LIBRARY_JS_PATH) .'badge-studio/',
'media' => api_get_path(WEB_LIBRARY_JS_PATH) .'badge-studio/media/',
'templates' => api_get_path(WEB_LIBRARY_JS_PATH) .'badge-studio/media/images/templates/',
'masks' => api_get_path(WEB_LIBRARY_JS_PATH) .'badge-studio/media/images/masks/',
'script_js' => '<script src="'. api_get_path(WEB_LIBRARY_JS_PATH) .'badge-studio/media/js/studio.js?"></script>'
'core' => api_get_path(WEB_LIBRARY_JS_PATH).'badge-studio/',
'media' => api_get_path(WEB_LIBRARY_JS_PATH).'badge-studio/media/',
'templates' => api_get_path(WEB_LIBRARY_JS_PATH).'badge-studio/media/images/templates/',
'masks' => api_get_path(WEB_LIBRARY_JS_PATH).'badge-studio/media/images/masks/',
'script_js' => '<script src="'.api_get_path(WEB_LIBRARY_JS_PATH).'badge-studio/media/js/studio.js?"></script>'
];
@ -60,10 +60,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if ($existsBadgesDirectory) {
if (!empty($skill['icon'])) {
$iconFileAbsolutePath = $badgePath . $skill['icon'];
$iconFileAbsolutePath = $badgePath.$skill['icon'];
if (Security::check_abs_path($iconFileAbsolutePath, $badgePath)) {
unlink($badgePath . $skill['icon']);
unlink($badgePath.$skill['icon']);
}
}
@ -93,24 +93,24 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$objSkill->update($params);
header('Location: ' . api_get_path(WEB_CODE_PATH) . 'admin/skill_badge_list.php');
header('Location: '.api_get_path(WEB_CODE_PATH).'admin/skill_badge_list.php');
exit;
}
$interbreadcrumb = array(
array(
'url' => api_get_path(WEB_CODE_PATH) . 'admin/index.php',
'url' => api_get_path(WEB_CODE_PATH).'admin/index.php',
'name' => get_lang('Administration')
),
array(
'url' => api_get_path(WEB_CODE_PATH) . 'admin/skill_badge.php',
'url' => api_get_path(WEB_CODE_PATH).'admin/skill_badge.php',
'name' => get_lang('Badges')
)
);
$toolbar = Display::toolbarButton(
get_lang('ManageSkills'),
api_get_path(WEB_CODE_PATH) . 'admin/skill_list.php',
api_get_path(WEB_CODE_PATH).'admin/skill_list.php',
'list',
'primary',
['title' => get_lang('ManageSkills')]

@ -20,7 +20,7 @@ $list = $em->getRepository('ChamiloSkillBundle:Level')->findAll();
$listAction = api_get_self();
$action = '';
$action = '';
if (isset($_GET['action']) && in_array($_GET['action'], ['add', 'edit', 'delete', 'add_level'])) {
$action = $_GET['action'];
}
@ -53,8 +53,8 @@ if (!empty($item)) {
}
$formToDisplay = $form->returnForm();
$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array ('url' => api_get_self(), 'name' => get_lang('SkillProfile'));
$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array('url' => api_get_self(), 'name' => get_lang('SkillProfile'));
$tpl = new Template($action);
switch ($action) {

@ -32,18 +32,18 @@ if (isset($_GET['action']) && $_GET['action'] === 'edit') {
// Create the form
$form = new FormValidator('specific_fields_add');
// Field variable name
$form->addElement('hidden','field_id', $fieldId);
$form->addElement('text','field_name',get_lang('FieldName'));
$form->applyFilter('field_name','html_filter');
$form->applyFilter('field_name','trim');
$form->addElement('hidden', 'field_id', $fieldId);
$form->addElement('text', 'field_name', get_lang('FieldName'));
$form->applyFilter('field_name', 'html_filter');
$form->applyFilter('field_name', 'trim');
$form->addRule('field_name', get_lang('ThisFieldIsRequired'), 'required');
$form->addRule('field_name', get_lang('OnlyLettersAndNumbersAllowed'), 'username');
$form->addRule('field_name', '', 'maxlength',20);
$form->addRule('field_name', '', 'maxlength', 20);
// Set default values (only not empty when editing)
$defaults = array();
if ($fieldId) {
$form_information = get_specific_field_list(array( 'id' => $fieldId ));
$form_information = get_specific_field_list(array('id' => $fieldId));
$defaults['field_name'] = $form_information[0]['name'];
}
$form->setDefaults($defaults);
@ -54,7 +54,7 @@ $form->addButtonCreate(get_lang('Add'), 'submit');
if ($form->validate()) {
$field = $form->exportValues();
$field_name = $field['field_name'];
if (is_numeric($field['field_id']) && $field['field_id']<>0 && !empty($field['field_id'])) {
if (is_numeric($field['field_id']) && $field['field_id'] <> 0 && !empty($field['field_id'])) {
edit_specific_field($field['field_id'], $field['field_name']);
$message = get_lang('FieldEdited');
} else {

@ -550,17 +550,17 @@ class AttendanceController
}
}
$max_cols_per_page = 12; //10 dates + 2 name and number
$max_dates_per_page = $max_dates_per_page_original = $max_cols_per_page - 2;//10
$max_dates_per_page = $max_dates_per_page_original = $max_cols_per_page - 2; //10
$rows = count($data_table);
if ($cols > $max_cols_per_page) {
$number_tables = round(($cols-2)/$max_dates_per_page);
$number_tables = round(($cols - 2) / $max_dates_per_page);
$headers = $data_table[0];
$all = array();
$tables = array();
$changed = 1;
for ($i= 0; $i <= $rows; $i++) {
for ($i = 0; $i <= $rows; $i++) {
$row = isset($data_table[$i]) ? $data_table[$i] : null;
$key = 1;
$max_dates_per_page = 10;
@ -571,7 +571,7 @@ class AttendanceController
foreach ($item as $value) {
if ($count_j >= $max_dates_per_page) {
$key++;
$max_dates_per_page = $max_dates_per_page_original*$key;
$max_dates_per_page = $max_dates_per_page_original * $key;
//magic hack
$tables[$key][$i][] = $tables[1][$i][0];
$tables[$key][$i][] = $tables[1][$i][1];
@ -628,8 +628,8 @@ class AttendanceController
$form = new FormValidator(
'search',
'post',
api_get_self() . '?' . api_get_cidreq(
) . '&action=calendar_logins'
api_get_self().'?'.api_get_cidreq(
).'&action=calendar_logins'
);
$form->addDateRangePicker('range', get_lang('DateRange'));
$form->addButton('submit', get_lang('Submit'));
@ -642,11 +642,11 @@ class AttendanceController
}
$formToDisplay = $form->returnForm();
} else {
if (!empty($sessionId)) {
$sessionInfo = api_get_session_info($sessionId);
$startDate = $sessionInfo['access_start_date'];
$endDate = $sessionInfo['access_end_date'];
}
if (!empty($sessionId)) {
$sessionInfo = api_get_session_info($sessionId);
$startDate = $sessionInfo['access_start_date'];
$endDate = $sessionInfo['access_end_date'];
}
}
$attendance = new Attendance();

@ -33,7 +33,7 @@ if (!$user) {
Display::return_message(get_lang('NoUser'), 'error')
);
header('Location: ' . api_get_path(WEB_PATH));
header('Location: '.api_get_path(WEB_PATH));
exit;
}
@ -46,7 +46,7 @@ $url = api_get_path(WEB_CODE_PATH)."badge/assign.php?user=".$_REQUEST['user']."&
$htmlHeadXtra[] = '<script>
$( document ).ready(function() {
$("#skill").on("change", function() {
$(location).attr("href", "'. $url .'"+$(this).val());
$(location).attr("href", "'. $url.'"+$(this).val());
});
});
</script>';
@ -131,7 +131,7 @@ if ($form->validate()) {
Display::return_message(get_lang('SkillNotFound'), 'error')
);
header('Location: ' . api_get_self() . '?' . http_build_query(['user' => $user->getId()]));
header('Location: '.api_get_self().'?'.http_build_query(['user' => $user->getId()]));
exit;
}
@ -143,7 +143,7 @@ if ($form->validate()) {
)
);
header('Location: ' . api_get_self() . '?' . http_build_query(['user' => $user->getId()]));
header('Location: '.api_get_self().'?'.http_build_query(['user' => $user->getId()]));
exit;
}
@ -167,7 +167,7 @@ if ($form->validate()) {
)
);
header('Location: ' . api_get_path(WEB_PATH) . "badge/{$skillUser->getId()}");
header('Location: '.api_get_path(WEB_PATH)."badge/{$skillUser->getId()}");
exit;
}

@ -12,7 +12,7 @@ require_once __DIR__.'/../inc/global.inc.php';
$issue = isset($_REQUEST['issue']) ? intval($_REQUEST['issue']) : 0;
if (!$issue) {
header('Location: ' . api_get_path(WEB_PATH));
header('Location: '.api_get_path(WEB_PATH));
exit;
}
@ -26,7 +26,7 @@ if (!$skillIssue) {
Display::return_message(get_lang('TheUserXNotYetAchievedTheSkillX'), 'error')
);
header('Location: ' . api_get_path(WEB_PATH));
header('Location: '.api_get_path(WEB_PATH));
exit;
}
@ -38,7 +38,7 @@ if (!$user || !$skill) {
Display::return_message(get_lang('NoResults'), 'error')
);
header('Location: ' . api_get_path(WEB_PATH));
header('Location: '.api_get_path(WEB_PATH));
exit;
}
@ -177,7 +177,7 @@ if ($formAcquiredLevel->validate() && $allowComment) {
$entityManager->persist($skillIssue);
$entityManager->flush();
header("Location: " . $skillIssue->getIssueUrl());
header("Location: ".$skillIssue->getIssueUrl());
exit;
}
@ -208,7 +208,7 @@ if ($form->validate() && $allowComment) {
$entityManager->persist($skillUserComment);
$entityManager->flush();
header("Location: " . $skillIssue->getIssueUrl());
header("Location: ".$skillIssue->getIssueUrl());
exit;
}
@ -224,11 +224,11 @@ if ($allowDownloadExport) {
$backpack = $configBackpack;
}
$htmlHeadXtra[] = '<script src="' . $backpack . 'issuer.js"></script>';
$htmlHeadXtra[] = '<script src="'.$backpack.'issuer.js"></script>';
$objSkill = new Skill();
$assertionUrl = $skillIssueInfo['badge_assertion'];
$skills = $objSkill->get($skillId);
$unbakedBadge = api_get_path(SYS_UPLOAD_PATH) . "badges/".$skills['icon'];
$unbakedBadge = api_get_path(SYS_UPLOAD_PATH)."badges/".$skills['icon'];
if (!is_file($unbakedBadge)) {
$unbakedBadge = api_get_path(WEB_CODE_PATH).'img/icons/128/badges-default.png';
}
@ -246,12 +246,12 @@ if ($allowDownloadExport) {
mkdir($bakedBadge, api_get_permissions_for_new_directories(), true);
}
$skillRelUserId = $skillIssueInfo['id'];
if (!file_exists($bakedBadge . "/badge_" . $skillRelUserId)) {
file_put_contents($bakedBadge . "/badge_" . $skillRelUserId . ".png", $bakedInfo);
if (!file_exists($bakedBadge."/badge_".$skillRelUserId)) {
file_put_contents($bakedBadge."/badge_".$skillRelUserId.".png", $bakedInfo);
}
//Process to validate a baked badge
$badgeContent = file_get_contents($bakedBadge . "/badge_" . $skillRelUserId . ".png");
$badgeContent = file_get_contents($bakedBadge."/badge_".$skillRelUserId.".png");
$verifyBakedBadge = $png->extractBadgeInfo($badgeContent);
if (!is_array($verifyBakedBadge)) {
$badgeInfoError = true;
@ -259,7 +259,7 @@ if ($allowDownloadExport) {
if (!$badgeInfoError) {
$personalBadge = UserManager::getUserPathById($userId, "web");
$personalBadge = $personalBadge."badges/badge_" . $skillRelUserId . ".png";
$personalBadge = $personalBadge."badges/badge_".$skillRelUserId.".png";
}
}
}

@ -12,7 +12,7 @@ $userId = isset($_GET['user']) ? intval($_GET['user']) : 0;
$skillId = isset($_GET['skill']) ? intval($_GET['skill']) : 0;
if (!$userId || !$skillId) {
header('Location: ' . api_get_path(WEB_PATH));
header('Location: '.api_get_path(WEB_PATH));
exit;
}
@ -30,7 +30,7 @@ if (!$user || !$skill) {
Display::return_message(get_lang('NoResults'), 'error')
);
header('Location: ' . api_get_path(WEB_PATH));
header('Location: '.api_get_path(WEB_PATH));
exit;
}
@ -167,7 +167,7 @@ foreach ($userSkills as $index => $skillIssue) {
$entityManager->persist($skillIssue);
$entityManager->flush();
header("Location: " . $skillIssue->getIssueUrlAll());
header("Location: ".$skillIssue->getIssueUrlAll());
exit;
}
@ -198,7 +198,7 @@ foreach ($userSkills as $index => $skillIssue) {
$entityManager->persist($skillUserComment);
$entityManager->flush();
header("Location: " . $skillIssue->getIssueUrlAll());
header("Location: ".$skillIssue->getIssueUrlAll());
exit;
}
@ -214,11 +214,11 @@ foreach ($userSkills as $index => $skillIssue) {
$backpack = $configBackpack;
}
$htmlHeadXtra[] = '<script src="' . $backpack . 'issuer.js"></script>';
$htmlHeadXtra[] = '<script src="'.$backpack.'issuer.js"></script>';
$objSkill = new Skill();
$assertionUrl = $skillIssueInfo['badge_assertion'];
$skills = $objSkill->get($skillId);
$unbakedBadge = api_get_path(SYS_UPLOAD_PATH) . "badges/".$skills['icon'];
$unbakedBadge = api_get_path(SYS_UPLOAD_PATH)."badges/".$skills['icon'];
if (!is_file($unbakedBadge)) {
$unbakedBadge = api_get_path(WEB_CODE_PATH).'img/icons/128/badges-default.png';
}
@ -236,12 +236,12 @@ foreach ($userSkills as $index => $skillIssue) {
mkdir($bakedBadge, api_get_permissions_for_new_directories(), true);
}
$skillRelUserId = $skillIssueInfo['id'];
if (!file_exists($bakedBadge . "/badge_" . $skillRelUserId)) {
file_put_contents($bakedBadge . "/badge_" . $skillRelUserId . ".png", $bakedInfo);
if (!file_exists($bakedBadge."/badge_".$skillRelUserId)) {
file_put_contents($bakedBadge."/badge_".$skillRelUserId.".png", $bakedInfo);
}
//Process to validate a baked badge
$badgeContent = file_get_contents($bakedBadge . "/badge_" . $skillRelUserId . ".png");
$badgeContent = file_get_contents($bakedBadge."/badge_".$skillRelUserId.".png");
$verifyBakedBadge = $png->extractBadgeInfo($badgeContent);
if (!is_array($verifyBakedBadge)) {
$badgeInfoError = true;
@ -249,7 +249,7 @@ foreach ($userSkills as $index => $skillIssue) {
if (!$badgeInfoError) {
$personalBadge = UserManager::getUserPathById($userId, "web");
$personalBadge = $personalBadge."badges/badge_" . $skillRelUserId . ".png";
$personalBadge = $personalBadge."badges/badge_".$skillRelUserId.".png";
}
}
}

@ -283,7 +283,7 @@ if ($allowToEdit) {
$content = $form->returnForm();
break;
case "delete":
if (!(api_is_course_coach() && !api_is_element_in_the_session(TOOL_AGENDA, $eventId) )) {
if (!(api_is_course_coach() && !api_is_element_in_the_session(TOOL_AGENDA, $eventId))) {
// a coach can only delete an element belonging to his session
$content = $agenda->deleteEvent($eventId);
}

@ -19,11 +19,11 @@ $externalCSS = [
];
foreach ($externalCSS as $css) {
$htmlHeadXtra[] = api_get_css(api_get_path(WEB_LIBRARY_JS_PATH) . $css);
$htmlHeadXtra[] = api_get_css(api_get_path(WEB_LIBRARY_JS_PATH).$css);
}
$htmlHeadXtra[] = api_get_css(api_get_path(WEB_CSS_PATH) . 'chat.css');
$htmlHeadXtra[] = api_get_css(api_get_path(WEB_CSS_PATH) . 'markdown.css');
$htmlHeadXtra[] = api_get_css(api_get_path(WEB_CSS_PATH).'chat.css');
$htmlHeadXtra[] = api_get_css(api_get_path(WEB_CSS_PATH).'markdown.css');
$externalJS = [
'highlight/highlight.pack.js',
@ -43,7 +43,7 @@ foreach (Emojione\Emojione::$shortcode_replace as $key => $icon) {
continue;
}
$iconList[$key] = strtoupper($icon) . '.png';
$iconList[$key] = strtoupper($icon).'.png';
}
$view = new Template(get_lang('Chat'), false, false, false, true, false);

@ -153,7 +153,7 @@ class CourseDescriptionController
if (isset($_GET['id_session'])) {
$session_id = intval($_GET['id_session']);
}
$course_description_data = $course_description->get_data_by_id(
$course_description_data = $course_description->get_data_by_id(
$id,
null,
$session_id
@ -162,7 +162,7 @@ class CourseDescriptionController
$data['description_title'] = $course_description_data['description_title'];
$data['description_content'] = $course_description_data['description_content'];
$data['progress'] = $course_description_data['progress'];
$data['descriptions'] = $course_description->get_data_by_description_type(
$data['descriptions'] = $course_description->get_data_by_description_type(
$description_type,
null,
$session_id

@ -56,7 +56,7 @@ if (api_is_platform_admin()) {
// Show message to confirm that a tool it to be hidden from available tools
// visibility 0,1->2
if (!empty($_GET['askDelete'])) {
$content .='<div id="toolhide">'.get_lang('DelLk').'<br />&nbsp;&nbsp;&nbsp;
$content .= '<div id="toolhide">'.get_lang('DelLk').'<br />&nbsp;&nbsp;&nbsp;
<a href="'.api_get_self().'">'.get_lang('No').'</a>&nbsp;|&nbsp;
<a href="'.api_get_self().'?delete=yes&id='.intval($_GET['id']).'">'.get_lang('Yes').'</a>
</div>';
@ -92,7 +92,7 @@ if (api_is_allowed_to_edit(null, true) && !api_is_coach()) {
/* INACTIVE TOOLS - HIDDEN (GREY) LINKS */
$content .= "<tr><td colspan=\"4\"><hr style='color:\"#4171B5\"' noshade=\"noshade\" size=\"1\" /></td></tr>\n".
$content .= "<tr><td colspan=\"4\"><hr style='color:\"#4171B5\"' noshade=\"noshade\" size=\"1\" /></td></tr>\n".
"<tr>\n".
"<td colspan=\"4\">\n".
"<div style=\"margin-bottom: 10px;\"><font color=\"#808080\">\n".get_lang('InLnk')."</font></div>".
@ -101,14 +101,14 @@ if (api_is_allowed_to_edit(null, true) && !api_is_coach()) {
$content .= CourseHome::show_tool_2column(TOOL_PUBLIC_BUT_HIDDEN);
$content .= "</table>";
$content .= "</div> ";
$content .= "</table>";
$content .= "</div> ";
}
/* Tools for platform admin only */
if (api_is_platform_admin() && api_is_allowed_to_edit(null, true) && !api_is_coach()) {
$content .='<div class="platformadminview">
$content .= '<div class="platformadminview">
<span class="viewcaption">'.get_lang('PlatformAdminOnly').'</span>
<table width="100%">
'.CourseHome::show_tool_2column(TOOL_PLATFORM_ADMIN).'

@ -126,14 +126,14 @@ elseif (isset($update) && $update) {
"</td>\n".
"<td>\n".
"<select name=\"image\">\n".
"<option selected>". $image. "</option>\n";
"<option selected>".$image."</option>\n";
if ($dir = @opendir($chemin)) {
while ($file = readdir($dir)) {
if ($file == '..' || $file == '.') {
unset($file);
}
$content .= "<option>". $file. "</option>\n";
$content .= "<option>".$file."</option>\n";
}
closedir($dir);
}
@ -142,15 +142,15 @@ elseif (isset($update) && $update) {
"</td>\n".
"</tr>\n".
"<tr>\n".
"<td>". get_lang('NameOfTheLink'). " : </td>\n".
"<td><input type=\"text\" name=\"name\" value=\"". $name. "\"></td>\n".
"<td>".get_lang('NameOfTheLink')." : </td>\n".
"<td><input type=\"text\" name=\"name\" value=\"".$name."\"></td>\n".
"</tr>\n".
"<tr>\n".
"<td>Lien :</td>\n".
"<td><input type=\"text\" name=\"link\" value=\"". $link. "\"></td>\n".
"<td><input type=\"text\" name=\"link\" value=\"".$link."\"></td>\n".
"</tr>\n".
"<tr>\n".
"<td colspan=\"2\"><input type=\"submit\" name=\"submit\" value=\"". get_lang('Ok'). "\"></td>\n".
"<td colspan=\"2\"><input type=\"submit\" name=\"submit\" value=\"".get_lang('Ok')."\"></td>\n".
"</tr>\n".
"</form>\n".
"</table>\n".
@ -203,21 +203,21 @@ if (api_is_allowed_to_edit(null, true) && !api_is_coach()) {
"<tr><td colspan=\"6\"><font color=\"#F66105\">\n".get_lang('CourseAdminOnly')."</font>
</td></tr>\n";
$content .= "<tr>\n<td colspan=\"6\">";
$content .=CourseHome::show_tool_3column('courseAdmin');
$content .= CourseHome::show_tool_3column('courseAdmin');
$content .= "</td>\n</tr>\n";
}
/* TOOLS FOR PLATFORM ADMIN ONLY */
if (api_is_platform_admin() && api_is_allowed_to_edit(null, true) && !api_is_coach()) {
$content .= "<tr>"."<td colspan=\"6\">".
$content .= "<tr>"."<td colspan=\"6\">".
"<hr noshade size=\"1\" />".
"</td>"."</tr>\n".
"<tr>\n"."<td colspan=\"6\">\n".
"<font color=\"#F66105\" >". get_lang('PlatformAdminOnly'). "</font>\n".
"<font color=\"#F66105\" >".get_lang('PlatformAdminOnly')."</font>\n".
"</td>\n"."</tr>\n";
$content .= "<tr>\n<td colspan=\"6\">";
$content .= "<tr>\n<td colspan=\"6\">";
$content .= CourseHome::show_tool_3column('platformAdmin');
$content .= "</td>\n</tr>\n";
$content .= "</td>\n</tr>\n";
}
$content .= "</table>\n";
$content .= "</table>\n";

@ -12,7 +12,7 @@ use Chamilo\CourseBundle\Component\CourseCopy\CourseRestorer;
// Setting the global file that gets the general configuration, the databases, the languages, ...
require_once __DIR__.'/../inc/global.inc.php';
$current_course_tool = TOOL_COURSE_MAINTENANCE;
$current_course_tool = TOOL_COURSE_MAINTENANCE;
api_protect_course_script(true);
if (!api_is_allowed_to_edit()) {
@ -122,7 +122,7 @@ if (Security::check_token('post') && (
$form->addGroup($group, '', get_lang('SameFilename'));
$form->addProgress();
$form->addButtonSave(get_lang('CopyCourse'));
$form->setDefaults(array('copy_option' =>'select_items','same_file_name_option' => FILE_OVERWRITE));
$form->setDefaults(array('copy_option' =>'select_items', 'same_file_name_option' => FILE_OVERWRITE));
// Add Security token
$token = Security::get_token();

@ -70,8 +70,8 @@ if (Security::check_token('post') && (
$zip_file = CourseArchiver::createBackup($course);
Display::display_confirmation_message(get_lang('BackupCreated'));
echo '<br /><a class="btn btn-primary btn-large" href="' . api_get_path(WEB_CODE_PATH) . 'course_info/download.php?archive=' . $zip_file . '&' . api_get_cidreq() . '">
' . get_lang('Download') . '</a>';
echo '<br /><a class="btn btn-primary btn-large" href="'.api_get_path(WEB_CODE_PATH).'course_info/download.php?archive='.$zip_file.'&'.api_get_cidreq().'">
' . get_lang('Download').'</a>';
} elseif (Security::check_token('post') && (
isset($_POST['backup_option']) &&
@ -96,7 +96,7 @@ if (Security::check_token('post') && (
$form = new FormValidator(
'create_backup_form',
'post',
api_get_self() . '?' . api_get_cidreq()
api_get_self().'?'.api_get_cidreq()
);
$form->addElement('header', get_lang('SelectOptionForBackup'));
$form->addElement('radio', 'backup_option', '', get_lang('CreateFullBackup'), 'full_backup');

@ -13,7 +13,7 @@ use Chamilo\CourseBundle\Component\CourseCopy\CourseRecycler;
*/
require_once __DIR__.'/../inc/global.inc.php';
$current_course_tool = TOOL_COURSE_MAINTENANCE;
$current_course_tool = TOOL_COURSE_MAINTENANCE;
api_protect_course_script(true);
// Check access rights (only teachers are allowed here)

@ -131,27 +131,27 @@ echo '</div>';
// pixlr
// max size 1 Mb ??
$title = urlencode(utf8_encode(get_lang('NewImage')));//TODO:check
$title = urlencode(utf8_encode(get_lang('NewImage'))); //TODO:check
//
$image = Display::returnIconPath('canvas1024x768.png');
//
$pixlr_code_translation_table = array('' => 'en', 'pt' => 'pt-Pt', 'sr' => 'sr_latn');
$langpixlr = api_get_language_isocode();
$langpixlr = api_get_language_isocode();
$langpixlr = isset($pixlr_code_translation_table[$langpixlr]) ? $pixlredit_code_translation_table[$langpixlr] : $langpixlr;
$loc=$langpixlr;// deprecated ?? TODO:check pixlr read user browser
$exit_path=api_get_path(WEB_CODE_PATH).'document/exit_pixlr.php';
$_SESSION['exit_pixlr']=$document_data['path'];
$referrer="Chamilo";
$target_path=api_get_path(WEB_CODE_PATH).'document/save_pixlr.php';
$target=$target_path;
$locktarget="true";
$locktitle="false";
if ($_SERVER['HTTP_HOST']=="localhost") {
$path_and_file= api_get_path(SYS_PATH).'/crossdomain.xml';
$loc = $langpixlr; // deprecated ?? TODO:check pixlr read user browser
$exit_path = api_get_path(WEB_CODE_PATH).'document/exit_pixlr.php';
$_SESSION['exit_pixlr'] = $document_data['path'];
$referrer = "Chamilo";
$target_path = api_get_path(WEB_CODE_PATH).'document/save_pixlr.php';
$target = $target_path;
$locktarget = "true";
$locktitle = "false";
if ($_SERVER['HTTP_HOST'] == "localhost") {
$path_and_file = api_get_path(SYS_PATH).'/crossdomain.xml';
if (!file_exists($path_and_file)) {
$crossdomain='<?xml version="1.0"?>
$crossdomain = '<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="cdn.pixlr.com" />

@ -39,7 +39,7 @@ $doc_url = str_replace('///', '&', $doc_url);
$doc_url = str_replace(' ', '+', $doc_url);
$doc_url = str_replace(array('../', '\\..', '\\0', '..\\'), array('', '', '', ''), $doc_url); //echo $doc_url;
if (strpos($doc_url,'../') || strpos($doc_url,'/..')) {
if (strpos($doc_url, '../') || strpos($doc_url, '/..')) {
$doc_url = '';
}

@ -37,26 +37,26 @@ if (empty($document_data)) {
$my_cur_dir_path = isset($_GET['curdirpath']) ? Security::remove_XSS($_GET['curdirpath']) : null;
}
$dir= str_replace('\\', '/', $dir);//and urlencode each url $curdirpath (hack clean $curdirpath under Windows - Bug #3261)
$dir = str_replace('\\', '/', $dir); //and urlencode each url $curdirpath (hack clean $curdirpath under Windows - Bug #3261)
/* Constants & Variables */
$current_session_id=api_get_session_id();
$current_session_id = api_get_session_id();
//path for pixlr save
$_SESSION['paint_dir']=Security::remove_XSS($dir);
if($_SESSION['paint_dir']=='/'){
$_SESSION['paint_dir']='';
$_SESSION['paint_dir'] = Security::remove_XSS($dir);
if ($_SESSION['paint_dir'] == '/') {
$_SESSION['paint_dir'] = '';
}
$_SESSION['paint_file']=basename(Security::remove_XSS($file_path));
$_SESSION['paint_file'] = basename(Security::remove_XSS($file_path));
$get_file = Security::remove_XSS($file_path);
$file = basename($get_file);
$temp_file = explode(".",$file);
$filename=$temp_file[0];
$nameTools = get_lang('EditDocument') . ': '.$filename;
$temp_file = explode(".", $file);
$filename = $temp_file[0];
$nameTools = get_lang('EditDocument').': '.$filename;
$courseDir = $_course['path'].'/document';
$courseDir = $_course['path'].'/document';
$is_allowed_to_edit = api_is_allowed_to_edit(null, true);
@ -100,15 +100,15 @@ if (!empty($groupId)) {
$is_certificate_mode = DocumentManager::is_certificate_mode($dir);
if (!$is_certificate_mode)
$interbreadcrumb[]= array("url" => "./document.php?curdirpath=".urlencode($my_cur_dir_path).'&'.api_get_cidreq(), "name"=> get_lang('Documents'));
$interbreadcrumb[] = array("url" => "./document.php?curdirpath=".urlencode($my_cur_dir_path).'&'.api_get_cidreq(), "name"=> get_lang('Documents'));
else
$interbreadcrumb[]= array ('url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('Gradebook'));
$interbreadcrumb[] = array('url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('Gradebook'));
// Interbreadcrumb for the current directory root path
if (empty($document_data['parents'])) {
$interbreadcrumb[] = array('url' => '#', 'name' => $document_data['title']);
} else {
foreach($document_data['parents'] as $document_sub_data) {
foreach ($document_data['parents'] as $document_sub_data) {
if ($document_data['title'] == $document_sub_data['title']) {
continue;
}
@ -128,33 +128,33 @@ Event::event_access_tool(TOOL_DOCUMENT);
Display :: display_header($nameTools, 'Doc');
echo '<div class="actions">';
echo '<a href="document.php?id='.$parent_id.'&'.api_get_cidreq().'">'.
Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'), '', ICON_SIZE_MEDIUM).'</a>';
echo '<a href="edit_document.php?'.api_get_cidreq().'&id='.$document_id.'&'.api_get_cidreq().'&origin=editpaint">'.
Display::return_icon('edit.png', get_lang('Rename').'/'.get_lang('Comment'),'',ICON_SIZE_MEDIUM).'</a>';
Display::return_icon('edit.png', get_lang('Rename').'/'.get_lang('Comment'), '', ICON_SIZE_MEDIUM).'</a>';
echo '</div>';
///pixlr
$title=$file;//disk name. No sql name because pixlr return this when save
$title = $file; //disk name. No sql name because pixlr return this when save
$pixlr_code_translation_table = array('' => 'en', 'pt' => 'pt-Pt', 'sr' => 'sr_latn');
$langpixlr = api_get_language_isocode();
$langpixlr = api_get_language_isocode();
$langpixlr = isset($pixlr_code_translation_table[$langpixlr]) ? $pixlredit_code_translation_table[$langpixlr] : $langpixlr;
$loc=$langpixlr;// deprecated ?? TODO:check pixlr read user browser
$loc = $langpixlr; // deprecated ?? TODO:check pixlr read user browser
$exit_path=api_get_path(WEB_CODE_PATH).'document/exit_pixlr.php';
$_SESSION['exit_pixlr']= Security::remove_XSS($parent_id);
$exit_path = api_get_path(WEB_CODE_PATH).'document/exit_pixlr.php';
$_SESSION['exit_pixlr'] = Security::remove_XSS($parent_id);
$referrer="Chamilo";
$referrer = "Chamilo";
$target_path=api_get_path(WEB_CODE_PATH).'document/save_pixlr.php';
$target=$target_path;
$target_path = api_get_path(WEB_CODE_PATH).'document/save_pixlr.php';
$target = $target_path;
$locktarget="true";
$locktitle="false";
$locktarget = "true";
$locktitle = "false";
if ($_SERVER['HTTP_HOST']=="localhost") {
$path_and_file= api_get_path(SYS_PATH).'/crossdomain.xml';
if ($_SERVER['HTTP_HOST'] == "localhost") {
$path_and_file = api_get_path(SYS_PATH).'/crossdomain.xml';
if (!file_exists($path_and_file)) {
$crossdomain='<?xml version="1.0"?>
$crossdomain = '<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="cdn.pixlr.com" />
@ -163,23 +163,23 @@ if ($_SERVER['HTTP_HOST']=="localhost") {
</cross-domain-policy>';//more open domain="*"
@file_put_contents($path_and_file, $crossdomain);
}
$credentials="true";
$credentials = "true";
}
else {
$credentials="false";
$credentials = "false";
}
//make temp images
$temp_folder=api_get_path(SYS_ARCHIVE_PATH).'temp/images';
$temp_folder = api_get_path(SYS_ARCHIVE_PATH).'temp/images';
if (!file_exists($temp_folder)) {
@mkdir($temp_folder, api_get_permissions_for_new_directories(), true);//TODO:check $permissions value, now empty;
@mkdir($temp_folder, api_get_permissions_for_new_directories(), true); //TODO:check $permissions value, now empty;
}
//make htaccess with allow from all, and file index.html into temp/images
$htaccess=api_get_path(SYS_ARCHIVE_PATH).'temp/images/.htaccess';
$htaccess = api_get_path(SYS_ARCHIVE_PATH).'temp/images/.htaccess';
if (!file_exists($htaccess)) {
$htaccess_content="order deny,allow\r\nallow from all\r\nOptions -Indexes";
$htaccess_content = "order deny,allow\r\nallow from all\r\nOptions -Indexes";
$fp = @ fopen(api_get_path(SYS_ARCHIVE_PATH).'temp/images/.htaccess', 'w');
if ($fp) {
@ -188,9 +188,9 @@ if (!file_exists($htaccess)) {
}
}
$html_index=api_get_path(SYS_ARCHIVE_PATH).'temp/images/index.html';
$html_index = api_get_path(SYS_ARCHIVE_PATH).'temp/images/index.html';
if (!file_exists($html_index)) {
$html_index_content="<html><head></head><body></body></html>";
$html_index_content = "<html><head></head><body></body></html>";
$fp = @ fopen(api_get_path(SYS_ARCHIVE_PATH).'temp/images/index.html', 'w');
if ($fp) {
fwrite($fp, $html_index_content);
@ -199,20 +199,20 @@ if (!file_exists($html_index)) {
}
//encript temp name file
$name_crip=sha1(uniqid());//encript
$findext= explode(".", $file);
$extension= $findext[count($findext)-1];
$file_crip=$name_crip.'.'.$extension;
$name_crip = sha1(uniqid()); //encript
$findext = explode(".", $file);
$extension = $findext[count($findext) - 1];
$file_crip = $name_crip.'.'.$extension;
//copy file to temp/images directory
$from=$filepath.$file;
$to=api_get_path(SYS_ARCHIVE_PATH).'temp/images/'.$file_crip;
$from = $filepath.$file;
$to = api_get_path(SYS_ARCHIVE_PATH).'temp/images/'.$file_crip;
copy($from, $to);
$_SESSION['temp_realpath_image']=$to;
$_SESSION['temp_realpath_image'] = $to;
//load image to url
$to_url=api_get_path(WEB_ARCHIVE_PATH).'temp/images/'.$file_crip;
$image=urlencode($to_url);
$to_url = api_get_path(WEB_ARCHIVE_PATH).'temp/images/'.$file_crip;
$image = urlencode($to_url);
$pixlr_url = api_get_protocol().'://pixlr.com/editor/?title='.$title.'&image='.$image.'&loc='.$loc.'&referrer='.$referrer.'&target='.$target.'&exit='.$exit_path.'&locktarget='.$locktarget.'&locktitle='.$locktitle.'&credentials='.$credentials;
//make frame an send image

@ -98,12 +98,12 @@ $browser_display_title = 'Documents - '.Security::remove_XSS($_GET['cidReq']).'
$file_url_web = api_get_path(WEB_COURSE_PATH).$_course['path'].'/document'.$header_file.'?'.api_get_cidreq();
$pathinfo = pathinfo($header_file);
if ($pathinfo['extension']=='swf') {
$width='83%';
$height='83%';
if ($pathinfo['extension'] == 'swf') {
$width = '83%';
$height = '83%';
} else {
$width='100%';
$height='100%';
$width = '100%';
$height = '100%';
}
echo '<iframe border="0" frameborder="0" scrolling="no" style="width:'.$width.'; height:'.$height.';background-color:#ffffff;" id="mainFrame" name="mainFrame" src="'.$file_url_web.'?'.api_get_cidreq().'&amp;rand='.mt_rand(1, 1000).'"></iframe>';

@ -64,7 +64,7 @@ function MM_openBrWindow(theURL,winName,features) { //v2.0
if ($slide_id != 'all') {
$image = null;
if (isset($image_files_only[$slide])) {
$image = $sys_course_path . $_course['path'] . '/document' . $folder . $image_files_only[$slide];
$image = $sys_course_path.$_course['path'].'/document'.$folder.$image_files_only[$slide];
}
if (file_exists($image)) {
echo '<div class="actions-pagination">';
@ -105,7 +105,7 @@ if ($slide_id != 'all') {
$last = Display::return_icon('action_last_na.png', get_lang('LastSlide'));
} else {
$imgn = 'action_next.png';
$last = '<a href="slideshow.php?slide_id='.($total_slides-1).'&curdirpath='.$pathurl.'">
$last = '<a href="slideshow.php?slide_id='.($total_slides - 1).'&curdirpath='.$pathurl.'">
'.Display::return_icon('action_last.png', get_lang('LastSlide')).'
</a>';
}
@ -122,18 +122,18 @@ if ($slide_id != 'all') {
// Exit the slideshow
echo '<a href="document.php?action=exit_slideshow&curdirpath='.$pathurl.'&'.api_get_cidreq().'">'.
Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'), '', ICON_SIZE_MEDIUM).'</a>';
// Show thumbnails
if ($slide_id != 'all') {
echo '<a href="slideshow.php?slide_id=all&curdirpath='.$pathurl.'&'.api_get_cidreq().'">'.
Display::return_icon('thumbnails.png',get_lang('ShowThumbnails'),'',ICON_SIZE_MEDIUM).'</a>';
Display::return_icon('thumbnails.png', get_lang('ShowThumbnails'), '', ICON_SIZE_MEDIUM).'</a>';
} else {
echo Display::return_icon('thumbnails_na.png',get_lang('ShowThumbnails'),'',ICON_SIZE_MEDIUM);
echo Display::return_icon('thumbnails_na.png', get_lang('ShowThumbnails'), '', ICON_SIZE_MEDIUM);
}
// Slideshow options
echo '<a href="slideshowoptions.php?curdirpath='.$pathurl.'&'.api_get_cidreq().'">'.
Display::return_icon('settings.png', get_lang('SetSlideshowOptions'),'',ICON_SIZE_MEDIUM).'</a>';
Display::return_icon('settings.png', get_lang('SetSlideshowOptions'), '', ICON_SIZE_MEDIUM).'</a>';
echo '</div>';
echo '<br />';
@ -157,7 +157,7 @@ if (isset($_POST['Submit'])) {
}
$target_width = $target_height = null;
// The target height and width depends if we choose resizing or no resizing
if (isset($_SESSION["image_resizing"]) && $_SESSION["image_resizing"] == "resizing") {
if (isset($_SESSION["image_resizing"]) && $_SESSION["image_resizing"] == "resizing") {
$target_width = $_SESSION["image_resizing_width"];
$target_height = $_SESSION["image_resizing_height"];
}
@ -165,7 +165,7 @@ if (isset($_SESSION["image_resizing"]) && $_SESSION["image_resizing"] == "resiz
/* THUMBNAIL VIEW */
// This is for viewing all the images in the slideshow as thumbnails.
$image_tag = array ();
$image_tag = array();
$html = '';
if ($slide_id == 'all') {
@ -173,16 +173,16 @@ if ($slide_id == 'all') {
$allowed_thumbnail_types = array('jpg', 'jpeg', 'gif', 'png');
$max_thumbnail_width = 250;
$max_thumbnail_height = 250;
$png_compression = 0;//0(none)-9
$jpg_quality = 75;//from 0 to 100 (default is 75). More quality less compression
$png_compression = 0; //0(none)-9
$jpg_quality = 75; //from 0 to 100 (default is 75). More quality less compression
$directory_thumbnails = $sys_course_path.$_course['path'].'/document'.$folder.'.thumbs/';
//Other parameters only for show tumbnails
$row_items = 4;//only in slideshow.php
$number_image = 7;//num icons cols to show
$thumbnail_width_frame=$max_thumbnail_width;//optional $max_thumbnail_width+x
$thumbnail_height_frame=$max_thumbnail_height;
$row_items = 4; //only in slideshow.php
$number_image = 7; //num icons cols to show
$thumbnail_width_frame = $max_thumbnail_width; //optional $max_thumbnail_width+x
$thumbnail_height_frame = $max_thumbnail_height;
// Create the template_thumbnails folder (if no exist)
@ -195,20 +195,20 @@ if ($slide_id == 'all') {
foreach ($image_files_only as $one_image_file) {
$image = $sys_course_path.$_course['path'].'/document'.$folder.$one_image_file;
$image_thumbnail= $directory_thumbnails.'.'.$one_image_file;
$image_thumbnail = $directory_thumbnails.'.'.$one_image_file;
if (file_exists($image)) {
//check thumbnail
$imagetype = explode(".", $image);
//or check $imagetype = image_type_to_extension(exif_imagetype($image), false);
$imagetype = strtolower($imagetype[count($imagetype)-1]);
$imagetype = strtolower($imagetype[count($imagetype) - 1]);
if(in_array($imagetype,$allowed_thumbnail_types)) {
if (!file_exists($image_thumbnail)){
if (in_array($imagetype, $allowed_thumbnail_types)) {
if (!file_exists($image_thumbnail)) {
//run each once we view thumbnails is too heavy, then need move into !file_exists($image_thumbnail, and only run when haven't the thumbnail
$original_image_size = api_getimagesize($image);
switch($imagetype) {
switch ($imagetype) {
case 'gif':
$source_img = imagecreatefromgif($image);
break;
@ -230,17 +230,17 @@ if ($slide_id == 'all') {
$max_thumbnail_height
);
if($max_thumbnail_width>$original_image_size['width'] && $max_thumbnail_height>$original_image_size['height']){
$new_thumbnail_size['width']=$original_image_size['width'];
$new_thumbnail_size['height']=$original_image_size['height'];
if ($max_thumbnail_width > $original_image_size['width'] && $max_thumbnail_height > $original_image_size['height']) {
$new_thumbnail_size['width'] = $original_image_size['width'];
$new_thumbnail_size['height'] = $original_image_size['height'];
}
$crop = imagecreatetruecolor($new_thumbnail_size['width'], $new_thumbnail_size['height']);
// preserve transparency
if($imagetype == "png"){
if ($imagetype == "png") {
imagesavealpha($crop, true);
$color = imagecolorallocatealpha($crop,0x00,0x00,0x00,127);
$color = imagecolorallocatealpha($crop, 0x00, 0x00, 0x00, 127);
imagefill($crop, 0, 0, $color);
}
@ -248,7 +248,7 @@ if ($slide_id == 'all') {
$transindex = imagecolortransparent($source_img);
$palletsize = imagecolorstotal($source_img);
//GIF89a for transparent and anim (first clip), either GIF87a
if ($transindex >= 0 && $transindex < $palletsize){
if ($transindex >= 0 && $transindex < $palletsize) {
$transcol = imagecolorsforindex($source_img, $transindex);
$transindex = imagecolorallocatealpha($crop, $transcol['red'], $transcol['green'], $transcol['blue'], 127);
imagefill($crop, 0, 0, $transindex);
@ -272,16 +272,16 @@ if ($slide_id == 'all') {
switch ($imagetype) {
case 'gif':
imagegif($crop,$image_thumbnail);
imagegif($crop, $image_thumbnail);
break;
case 'jpg':
imagejpeg($crop,$image_thumbnail,$jpg_quality);
imagejpeg($crop, $image_thumbnail, $jpg_quality);
break;
case 'jpeg':
imagejpeg($crop,$image_thumbnail,$jpg_quality);
imagejpeg($crop, $image_thumbnail, $jpg_quality);
break;
case 'png':
imagepng($crop,$image_thumbnail,$png_compression);
imagepng($crop, $image_thumbnail, $png_compression);
break;
}
@ -291,26 +291,26 @@ if ($slide_id == 'all') {
//show thumbnail and link
$one_image_thumbnail_file='.thumbs/.'.$one_image_file;//get path thumbnail
$one_image_thumbnail_file = '.thumbs/.'.$one_image_file; //get path thumbnail
$doc_url = ($path && $path !== '/') ? $path.'/'.$one_image_thumbnail_file : $path.$one_image_thumbnail_file;
$image_tag[] = '<img class="img-gallery" src="download.php?doc_url='.$doc_url.'" border="0" title="'.$one_image_file.'">';
} else {
//if images aren't support by gd (not gif, jpg, jpeg, png)
if ($imagetype=="bmp") {
if ($imagetype == "bmp") {
// use getimagesize instead api_getimagesize($image); becasuse api_getimagesize doesn't support bmp files. Put here for each show, only for a few bmp files isn't heavy
$original_image_size = getimagesize($image);
if ($max_thumbnail_width<$original_image_size[0] || $max_thumbnail_height<$original_image_size[1]){
$thumbnail_size=api_calculate_image_size($original_image_size[0], $original_image_size[1], $max_thumbnail_width, $max_thumbnail_height);//don't use resize_image because doesn't run with bmp files
if ($max_thumbnail_width < $original_image_size[0] || $max_thumbnail_height < $original_image_size[1]) {
$thumbnail_size = api_calculate_image_size($original_image_size[0], $original_image_size[1], $max_thumbnail_width, $max_thumbnail_height); //don't use resize_image because doesn't run with bmp files
$image_height = $thumbnail_size['height'];
$image_width = $thumbnail_size['width'];
} else {
$image_height=$original_image_size[0];
$image_width=$original_image_size[1];
$image_height = $original_image_size[0];
$image_width = $original_image_size[1];
}
} else {
//example for svg files,...
$image_width=$max_thumbnail_width;
$image_height=$max_thumbnail_height;
$image_width = $max_thumbnail_width;
$image_height = $max_thumbnail_height;
}
$doc_url = ($path && $path !== '/') ? $path.'/'.$one_image_file : $path.$one_image_file;
@ -326,7 +326,7 @@ if ($slide_id == 'all') {
$i = 0;
$count_image = count($image_tag);
$number_iteration = ceil($count_image/$number_image);
$number_iteration = ceil($count_image / $number_image);
$p = 0;
$html = '';
$html .= '<div class="gallery">';
@ -338,7 +338,7 @@ if ($slide_id == 'all') {
$html .= '<a class="canvas-two" href="slideshow.php?slide_id='.$p.'&curdirpath='.$pathurl.'">';
$html .= '<div class="frame">';
$html .= '<div class="photo">';
$html .= $image_tag[$p];
$html .= $image_tag[$p];
$html .= '</div>';
$html .= '</div>';
$html .= '</a>';
@ -393,7 +393,7 @@ if ($slide_id != 'all' && !empty($image_files_only)) {
list($width, $height) = getimagesize($image);
// Auto resize
if (isset($_SESSION["image_resizing"]) && $_SESSION["image_resizing"] == 'resizing') {
if (isset($_SESSION["image_resizing"]) && $_SESSION["image_resizing"] == 'resizing') {
?>
<script type="text/javascript">
@ -410,7 +410,7 @@ if ($slide_id != 'all' && !empty($image_files_only)) {
start_height=initial_height;
}
document.write('<img id="image" src="<?php echo 'download.php?doc_url='.$path.'/'.$image_files_only[$slide]; ?>" width="'+start_width+'" height="'+start_height+'" border="0" alt="<?php echo $image_files_only[$slide] ;?>">');
document.write('<img id="image" src="<?php echo 'download.php?doc_url='.$path.'/'.$image_files_only[$slide]; ?>" width="'+start_width+'" height="'+start_height+'" border="0" alt="<?php echo $image_files_only[$slide]; ?>">');
function resizeImage() {
@ -454,7 +454,7 @@ if ($slide_id != 'all' && !empty($image_files_only)) {
echo '</a>';
echo '<div class="caption text-center">';
echo Display::tag('h3', $row['title']);
echo '<p>' . $row['comment'] . '</p>';
echo '<p>'.$row['comment'].'</p>';
echo '</div>';
echo '</div>';
@ -467,7 +467,7 @@ if ($slide_id != 'all' && !empty($image_files_only)) {
$resize_info = get_lang('Resizing').'<br />';
$resize_width = $_SESSION["image_resizing_width"].' x ';
$resize_height = $_SESSION['image_resizing_height'];
} elseif (isset($_SESSION['image_resizing']) && $_SESSION['image_resizing'] != 'noresizing'){
} elseif (isset($_SESSION['image_resizing']) && $_SESSION['image_resizing'] != 'noresizing') {
$resize_info = get_lang('Resizing').'<br />';
$resize_width = get_lang('Auto').' x ';
$resize_height = get_lang('Auto');
@ -478,10 +478,10 @@ if ($slide_id != 'all' && !empty($image_files_only)) {
}
echo '<li class="text-center">';
echo $image_files_only[$slide] . ' ';
echo $image_files_only[$slide].' ';
echo Display::toolbarButton(
get_lang('Modify'),
'edit_document.php?' . api_get_cidreq() . '&' . http_build_query([
'edit_document.php?'.api_get_cidreq().'&'.http_build_query([
'id' => $row['id'],
'origin' => 'slideshow',
'origin_opt' => $edit_slide_id,
@ -493,11 +493,11 @@ if ($slide_id != 'all' && !empty($image_files_only)) {
false
);
echo '</li>';
echo '<li class="text-center">' . $width.' x '.$height . '</li>';
echo '<li class="text-center">' . round((filesize($image) / 1024), 2) . ' KB - ' . $ext . '</li>';
echo '<li class="text-center">' . $resize_info . '</li>';
echo '<li class="text-center">' . $resize_width . '</li>';
echo '<li class="text-center">' . $resize_height . '</li>';
echo '<li class="text-center">'.$width.' x '.$height.'</li>';
echo '<li class="text-center">'.round((filesize($image) / 1024), 2).' KB - '.$ext.'</li>';
echo '<li class="text-center">'.$resize_info.'</li>';
echo '<li class="text-center">'.$resize_width.'</li>';
echo '<li class="text-center">'.$resize_height.'</li>';
echo '</ul>';
}

@ -33,7 +33,7 @@ $sql = "SELECT * FROM $file_tbl
$result = Database::query($sql);
if (Database::num_rows($result)) {
$files = Database::store_result($result);
$files = Database::store_result($result);
$rows = array();
foreach ($files as $file) {
//Check if I have this file:

@ -60,13 +60,13 @@ class Draggable extends Question
for ($i = 1; $i <= $answer->nbrAnswers; $i++) {
if ($answer->isCorrect($i)) {
$nb_matches++;
$defaults['answer[' . $nb_matches . ']'] = $answer->selectAnswer($i);
$defaults['weighting[' . $nb_matches . ']'] = float_format($answer->selectWeighting($i), 1);
$defaults['answer['.$nb_matches.']'] = $answer->selectAnswer($i);
$defaults['weighting['.$nb_matches.']'] = float_format($answer->selectWeighting($i), 1);
$answerInfo = $answer->getAnswerByAutoId($answer->correct[$i]);
$defaults['matches[' . $nb_matches . ']'] = isset($answerInfo['answer']) ? $answerInfo['answer'] : '';
$defaults['matches['.$nb_matches.']'] = isset($answerInfo['answer']) ? $answerInfo['answer'] : '';
} else {
$nb_options++;
$defaults['option[' . $nb_options . ']'] = $answer->selectAnswer($i);
$defaults['option['.$nb_options.']'] = $answer->selectAnswer($i);
}
}
}
@ -89,9 +89,9 @@ class Draggable extends Question
$html = '<table class="table table-striped table-hover">
<thead>
<tr>
<th width="85%">' . get_lang('Answer') . '</th>
<th width="15%">' . get_lang('MatchesTo') . '</th>
<th width="10">' . get_lang('Weighting') . '</th>
<th width="85%">' . get_lang('Answer').'</th>
<th width="15%">' . get_lang('MatchesTo').'</th>
<th width="10">' . get_lang('Weighting').'</th>
</tr>
</thead>
<tbody>';
@ -185,9 +185,9 @@ class Draggable extends Question
for ($i = 1; $i <= $nb_matches; ++$i) {
$position++;
$answer = $form->getSubmitValue('answer[' . $i . ']');
$matches = $form->getSubmitValue('matches[' . $i . ']');
$weighting = $form->getSubmitValue('weighting[' . $i . ']');
$answer = $form->getSubmitValue('answer['.$i.']');
$matches = $form->getSubmitValue('matches['.$i.']');
$weighting = $form->getSubmitValue('weighting['.$i.']');
$this->weighting += $weighting;
$objAnswer->createAnswer(
$answer,
@ -212,10 +212,10 @@ class Draggable extends Question
public function return_header($feedback_type = null, $counter = null, $score = null)
{
$header = parent::return_header($feedback_type, $counter, $score);
$header .= '<table class="' . $this->question_table_class . '">
$header .= '<table class="'.$this->question_table_class.'">
<tr>
<th>' . get_lang('ElementList') . '</th>
<th>' . get_lang('Status') . '</th>
<th>' . get_lang('ElementList').'</th>
<th>' . get_lang('Status').'</th>
</tr>';
return $header;

@ -7,4 +7,4 @@
// directly to exercise.php. This redirection is enabled for 1.10.x (2015-04-21)
// The final goal of this file is to be removed in a few years time, if
// considered realistically not harmful
require __DIR__ . '/exercise.php';
require __DIR__.'/exercise.php';

@ -17,7 +17,7 @@ $this_section = SECTION_COURSES;
// notice for unauthorized people.
api_protect_course_script(true);
if ($debug>0) {
if ($debug > 0) {
error_log('Entered exercise_result.php: '.print_r($_POST, 1));
}
@ -100,7 +100,7 @@ if ($time_control) {
if (isset($_SESSION['exe_id'])) {
$exe_id = intval($_SESSION['exe_id']);
}
$exercise_stat_info = $objExercise->get_stat_track_exercise_info_by_exe_id($exe_id);
$exercise_stat_info = $objExercise->get_stat_track_exercise_info_by_exe_id($exe_id);
if (!empty($exercise_stat_info['data_tracking'])) {
$question_list = explode(',', $exercise_stat_info['data_tracking']);
}
@ -253,7 +253,7 @@ $exercise_actions .= '&nbsp;'.
Display::url(
get_lang('ReviewQuestions'),
'javascript://',
array('onclick'=>'review_questions();','class'=>'btn btn-success')
array('onclick'=>'review_questions();', 'class'=>'btn btn-success')
);
echo Display::div('', array('class'=>'clear'));

@ -227,7 +227,7 @@ if (isset($_REQUEST['comments']) &&
Display::addFlash(
Display::return_message(get_lang('MessageSent'))
);
header('Location: ' . api_get_self().'?'.api_get_cidreq().'&exerciseId='.$exerciseId);
header('Location: '.api_get_self().'?'.api_get_cidreq().'&exerciseId='.$exerciseId);
exit;
}
}
@ -258,8 +258,8 @@ if ($is_allowedToEdit && $origin != 'learnpath') {
api_is_course_tutor() || api_is_course_coach()
) {
$actions .= '<a href="admin.php?exerciseId='.intval($_GET['exerciseId']).'">'.Display :: return_icon('back.png', get_lang('GoBackToQuestionList'), '', ICON_SIZE_MEDIUM).'</a>';
$actions .='<a href="live_stats.php?'.api_get_cidreq().'&exerciseId='.$exercise_id.'">'.Display :: return_icon('activity_monitor.png', get_lang('LiveResults'), '', ICON_SIZE_MEDIUM).'</a>';
$actions .='<a href="stats.php?'.api_get_cidreq().'&exerciseId='.$exercise_id.'">'.Display :: return_icon('statistics.png', get_lang('ReportByQuestion'), '', ICON_SIZE_MEDIUM).'</a>';
$actions .= '<a href="live_stats.php?'.api_get_cidreq().'&exerciseId='.$exercise_id.'">'.Display :: return_icon('activity_monitor.png', get_lang('LiveResults'), '', ICON_SIZE_MEDIUM).'</a>';
$actions .= '<a href="stats.php?'.api_get_cidreq().'&exerciseId='.$exercise_id.'">'.Display :: return_icon('statistics.png', get_lang('ReportByQuestion'), '', ICON_SIZE_MEDIUM).'</a>';
$actions .= '<a id="export_opener" href="'.api_get_self().'?export_report=1&exerciseId='.intval($_GET['exerciseId']).'" >'.
Display::return_icon('save.png', get_lang('Export'), '', ICON_SIZE_MEDIUM).'</a>';

@ -43,9 +43,9 @@ class ScormQuestion extends Question
$question->type = $qst->type;
$question->question = $qst->question;
$question->description = $qst->description;
$question->weighting=$qst->weighting;
$question->position=$qst->position;
$question->picture=$qst->picture;
$question->weighting = $qst->weighting;
$question->position = $qst->position;
$question->picture = $qst->picture;
$assessmentItem = new ScormAssessmentItem($question, $standalone);
return $assessmentItem->export();
@ -227,7 +227,7 @@ class ScormAnswerMultipleChoice extends Answer
<input name="'.$identifier.'" id="'.$identifier.'" value="'.$i.'" type="checkbox" />
</td>
<td width="95%">
<label for="'.$identifier.'">' . Security::remove_XSS($this->answer[$i]) . '</label>
<label for="'.$identifier.'">'.Security::remove_XSS($this->answer[$i]).'</label>
</td>
</tr>';
@ -239,7 +239,7 @@ class ScormAnswerMultipleChoice extends Answer
$jstmpw .= 'questions_answers_correct['.$this->questionJSId.']['.$i.'] = '.$this->correct[$i].';';
$id++;
}
$js .= 'questions_answers['.$this->questionJSId.'] = new Array('.substr($jstmp,0,-1).');'."\n";
$js .= 'questions_answers['.$this->questionJSId.'] = new Array('.substr($jstmp, 0, -1).');'."\n";
$js .= 'questions_types['.$this->questionJSId.'] = \'mcma\';'."\n";
$js .= $jstmpw;
} elseif ($type == MULTIPLE_ANSWER_COMBINATION) {
@ -255,7 +255,7 @@ class ScormAnswerMultipleChoice extends Answer
<input name="'.$identifier.'" id="'.$identifier.'" value="'.$i.'" type="checkbox" />
</td>
<td width="95%">
<label for="'.$identifier.'">' . Security::remove_XSS($this->answer[$i]) . '</label>
<label for="'.$identifier.'">'.Security::remove_XSS($this->answer[$i]).'</label>
</td>
</tr>';
@ -267,7 +267,7 @@ class ScormAnswerMultipleChoice extends Answer
$jstmpw .= 'questions_answers_correct['.$this->questionJSId.']['.$i.'] = '.$this->correct[$i].";";
$id++;
}
$js .= 'questions_answers['.$this->questionJSId.'] = new Array('.substr($jstmp,0,-1).');';
$js .= 'questions_answers['.$this->questionJSId.'] = new Array('.substr($jstmp, 0, -1).');';
$js .= 'questions_types['.$this->questionJSId.'] = "exact";';
$js .= $jstmpw;
} else {
@ -283,7 +283,7 @@ class ScormAnswerMultipleChoice extends Answer
<input name="'.$identifier_name.'" id="'.$identifier.'" value="'.$i.'" type="checkbox"/>
</td>
<td width="95%">
<label for="'.$identifier.'">' . Security::remove_XSS($this->answer[$i]) . '</label>
<label for="'.$identifier.'">'.Security::remove_XSS($this->answer[$i]).'</label>
</td>
</tr>';
$jstmp .= $i.',';
@ -294,7 +294,7 @@ class ScormAnswerMultipleChoice extends Answer
$jstmpw .= 'questions_answers_correct['.$this->questionJSId.']['.$i.'] = '.$this->correct[$i].';';
$id++;
}
$js .= 'questions_answers['.$this->questionJSId.'] = new Array('.substr($jstmp,0,-1).');';
$js .= 'questions_answers['.$this->questionJSId.'] = new Array('.substr($jstmp, 0, -1).');';
$js .= 'questions_types['.$this->questionJSId.'] = \'mcua\';';
$js .= $jstmpw;
}
@ -329,7 +329,7 @@ class ScormAnswerTrueFalse extends Answer
<input name="'.$identifier_true.'" id="'.$identifier_true.'" value="'.$this->trueGrade.'" type="radio" />
</td>
<td width="95%">
<label for="'.$identifier_true.'">' . get_lang('True') . '</label>
<label for="'.$identifier_true.'">'.get_lang('True').'</label>
</td>
</tr>';
$html .=
@ -338,7 +338,7 @@ class ScormAnswerTrueFalse extends Answer
<input name="'.$identifier_false.'" id="'.$identifier_false.'" value="'.$this->falseGrade.'" type="radio" />
</td>
<td width="95%">
<label for="'.$identifier_false.'">' . get_lang('False') . '</label>
<label for="'.$identifier_false.'">'.get_lang('False').'</label>
</td>
</tr></table></td></tr>';
$js .= 'questions_answers['.$this->questionJSId.'] = new Array(\'true\',\'false\');'."\n";
@ -383,30 +383,30 @@ class ScormAnswerFillInBlanks extends Answer
}
// splits text and weightings that are joined with the character '::'
list($answer,$weight)=explode('::',$answer);
$weights = explode(',',$weight);
list($answer, $weight) = explode('::', $answer);
$weights = explode(',', $weight);
// because [] is parsed here we follow this procedure:
// 1. find everything between the [ and ] tags
$i=1;
$i = 1;
$jstmp = '';
$jstmpc = '';
$jstmpw = 'questions_answers_ponderation['.$this->questionJSId.'] = new Array();'."\n";
$jstmpw .= 'questions_answers_ponderation['.$this->questionJSId.'][0] = 0;'."\n";
$startlocations=api_strpos($answer,'[');
$endlocations=api_strpos($answer,']');
$startlocations = api_strpos($answer, '[');
$endlocations = api_strpos($answer, ']');
while ($startlocations !== false && $endlocations !== false) {
$texstring = api_substr($answer,$startlocations,($endlocations-$startlocations)+1);
$texstring = api_substr($answer, $startlocations, ($endlocations - $startlocations) + 1);
$answer = api_substr_replace(
$answer,
'<input type="text" name="question_'.$this->questionJSId.'_fib_'.$i.'" id="question_'.$this->questionJSId.'_fib_'.$i.'" size="10" value="" />',
$startlocations,
($endlocations-$startlocations)+1
($endlocations - $startlocations) + 1
);
$jstmp .= $i.',';
if (!empty($texstring)) {
$sub = api_substr($texstring, 1, -1);
if (!empty($sub)) {
$jstmpc .= "'" . api_htmlentities($sub, ENT_QUOTES, $charset) . "',";
$jstmpc .= "'".api_htmlentities($sub, ENT_QUOTES, $charset)."',";
}
}
$my_weight = explode('@', $weights[$i - 1]);
@ -426,12 +426,12 @@ class ScormAnswerFillInBlanks extends Answer
'.$answer.'
</td>
</tr></table></td></tr>';
$js .= 'questions_answers['.$this->questionJSId.'] = new Array('.api_substr($jstmp,0,-1).');'."\n";
$js .= 'questions_answers_correct['.$this->questionJSId.'] = new Array('.api_substr($jstmpc,0,-1).');'."\n";
$js .= 'questions_answers['.$this->questionJSId.'] = new Array('.api_substr($jstmp, 0, -1).');'."\n";
$js .= 'questions_answers_correct['.$this->questionJSId.'] = new Array('.api_substr($jstmpc, 0, -1).');'."\n";
$js .= 'questions_types['.$this->questionJSId.'] = \'fib\';'."\n";
$js .= $jstmpw;
return array($js,$html);
return array($js, $html);
}
}
@ -457,8 +457,8 @@ class ScormAnswerMatching extends Answer
// get max length of displayed array
$nbrAnswers = $this->selectNbrAnswers();
$cpt1='A';
$cpt2=1;
$cpt1 = 'A';
$cpt2 = 1;
$Select = array();
$qId = $this->questionJSId;
$s = '';
@ -467,37 +467,37 @@ class ScormAnswerMatching extends Answer
$jstmpw = 'questions_answers_ponderation['.$this->questionJSId.'] = new Array();'."\n";
$jstmpw .= 'questions_answers_ponderation['.$this->questionJSId.'][0] = 0;'."\n";
for ($answerId=1;$answerId <= $nbrAnswers;$answerId++) {
for ($answerId = 1; $answerId <= $nbrAnswers; $answerId++) {
$identifier = 'question_'.$qId.'_matching_';
$answer=$this->selectAnswer($answerId);
$answerCorrect=$this->isCorrect($answerId);
$weight=$this->selectWeighting($answerId);
$answer = $this->selectAnswer($answerId);
$answerCorrect = $this->isCorrect($answerId);
$weight = $this->selectWeighting($answerId);
$jstmp .= $answerId.',';
if (!$answerCorrect) {
// options (A, B, C, ...) that will be put into the list-box
$Select[$answerId]['Lettre']=$cpt1;
$Select[$answerId]['Lettre'] = $cpt1;
// answers that will be shown at the right side
$Select[$answerId]['Reponse'] = $answer;
$cpt1++;
} else {
$s.='<tr>';
$s.='<td width="40%" valign="top"><b>'.$cpt2.'</b>.&nbsp;'.$answer."</td>";
$s.='<td width="20%" align="center">&nbsp;&nbsp;<select name="'.$identifier.$cpt2.'" id="'.$identifier.$cpt2.'">';
$s.=' <option value="0">--</option>';
$s .= '<tr>';
$s .= '<td width="40%" valign="top"><b>'.$cpt2.'</b>.&nbsp;'.$answer."</td>";
$s .= '<td width="20%" align="center">&nbsp;&nbsp;<select name="'.$identifier.$cpt2.'" id="'.$identifier.$cpt2.'">';
$s .= ' <option value="0">--</option>';
// fills the list-box
foreach ($Select as $key => $val) {
$s .= '<option value="'.$key.'">'.$val['Lettre'].'</option>';
} // end foreach()
$s.='</select>&nbsp;&nbsp;</td>';
$s.='<td width="40%" valign="top">';
$s .= '</select>&nbsp;&nbsp;</td>';
$s .= '<td width="40%" valign="top">';
if (isset($Select[$cpt2])) {
$s .= '<b>'.$Select[$cpt2]['Lettre'].'.</b> '.$Select[$cpt2]['Reponse'];
} else {
$s .= '&nbsp;';
}
$s.="</td></tr>";
$s .= "</td></tr>";
$jstmpc .= '['.$answerCorrect.','.$cpt2.'],';
@ -514,22 +514,22 @@ class ScormAnswerMatching extends Answer
if ($answerId == $nbrAnswers) {
// if there remain answers to be shown on the right side
while (isset($Select[$cpt2])) {
$s.= '<tr>';
$s.= '<td width="60%" colspan="2">&nbsp;</td>';
$s.= '<td width="40%" valign="top">';
$s.= '<b>'.$Select[$cpt2]['Lettre'].'.</b> '.$Select[$cpt2]['Reponse'];
$s.= "</td></tr>";
$s .= '<tr>';
$s .= '<td width="60%" colspan="2">&nbsp;</td>';
$s .= '<td width="40%" valign="top">';
$s .= '<b>'.$Select[$cpt2]['Lettre'].'.</b> '.$Select[$cpt2]['Reponse'];
$s .= "</td></tr>";
$cpt2++;
} // end while()
} // end if()
}
}
$js .= 'questions_answers['.$this->questionJSId.'] = new Array('.substr($jstmp,0,-1).');'."\n";
$js .= 'questions_answers_correct['.$this->questionJSId.'] = new Array('.substr($jstmpc,0,-1).');'."\n";
$js .= 'questions_answers['.$this->questionJSId.'] = new Array('.substr($jstmp, 0, -1).');'."\n";
$js .= 'questions_answers_correct['.$this->questionJSId.'] = new Array('.substr($jstmpc, 0, -1).');'."\n";
$js .= 'questions_types['.$this->questionJSId.'] = \'matching\';'."\n";
$js .= $jstmpw;
$html .= $s;
$html .= '</table></td></tr>' . "\n";
$html .= '</table></td></tr>'."\n";
return array($js, $html);
}
@ -634,7 +634,7 @@ class ScormAnswerHotspot extends Answer
$html .= '';
// Get the answers, make a list
$nbrAnswers=$this->selectNbrAnswers();
$nbrAnswers = $this->selectNbrAnswers();
$answer_list = '<div style="padding: 10px; margin-left: -8px; border: 1px solid #4271b5; height: 448px; width: 200px;"><b>'.get_lang('HotspotZones').'</b><ol>';
for ($answerId = 1; $answerId <= $nbrAnswers; $answerId++) {
@ -698,7 +698,7 @@ class ScormAssessmentItem
{
$this->question = $question;
$this->question->setAnswer();
$this->questionIdent = "QST_" . $question->id ;
$this->questionIdent = "QST_".$question->id;
$this->standalone = $standalone;
}
@ -798,7 +798,7 @@ class ScormAssessmentItem
$js .= 'var questions_answers = new Array();';
$js .= 'var questions_answers_correct = new Array();';
$js .= 'var questions_types = new Array();';
$js .= "\n" .
$js .= "\n".
'/**
* Assigns any event handler to any element
* @param object Element on which the event is added
@ -1014,11 +1014,11 @@ class ScormSection
{
$js = file_get_contents('../inc/lib/javascript/hotspot/js/hotspot.js');
$js .= 'var questions = new Array();' . "\n";
$js .= 'var questions_answers = new Array();' . "\n";
$js .= 'var questions_answers_correct = new Array();' . "\n";
$js .= 'var questions_types = new Array();' . "\n";
$js .= "\n" .
$js .= 'var questions = new Array();'."\n";
$js .= 'var questions_answers = new Array();'."\n";
$js .= 'var questions_answers_correct = new Array();'."\n";
$js .= 'var questions_types = new Array();'."\n";
$js .= "\n".
'/**
* Assigns any event handler to any element
* @param object Element on which the event is added
@ -1063,7 +1063,7 @@ class ScormSection
$js .= '';
$js .= 'addEvent(window,\'load\',addListeners,false);'."\n";
return $js. "\n";
return $js."\n";
}
/**
@ -1110,8 +1110,8 @@ class ScormSection
$head = '';
if ($this->standalone) {
$head = '<?xml version = "1.0" encoding = "' . $charset . '" standalone = "no"?>' . "\n"
. '<!DOCTYPE questestinterop SYSTEM "ims_qtiasiv2p1.dtd">' . "\n";
$head = '<?xml version = "1.0" encoding = "'.$charset.'" standalone = "no"?>'."\n"
. '<!DOCTYPE questestinterop SYSTEM "ims_qtiasiv2p1.dtd">'."\n";
}
list($js, $html) = $this->export_questions();
@ -1153,7 +1153,7 @@ class ScormSection
$js = $html = "";
$js_id = 0;
foreach ($this->exercise->selectQuestionList() as $q) {
list($jstmp, $htmltmp)= ScormQuestion::export_question($q, false, $js_id);
list($jstmp, $htmltmp) = ScormQuestion::export_question($q, false, $js_id);
$js .= $jstmp."\n";
$html .= $htmltmp."\n";
++$js_id;

@ -59,9 +59,9 @@ class FreeAnswer extends Question
$score['revised'] = false;
}
$header = parent::return_header($feedback_type, $counter, $score);
$header .= '<table class="' . $this->question_table_class . '" >
$header .= '<table class="'.$this->question_table_class.'" >
<tr>
<th>' . get_lang("Answer") . '</th>
<th>' . get_lang("Answer").'</th>
</tr>';
return $header;

@ -31,7 +31,7 @@ if (!empty($gradebook) && $gradebook == 'view') {
}
// The breadcrumbs.
$interbreadcrumb[] = array(
'url' => api_get_path(WEB_CODE_PATH) . '.exercise/exercise.php?' . api_get_cidreq(),
'url' => api_get_path(WEB_CODE_PATH).'.exercise/exercise.php?'.api_get_cidreq(),
'name' => get_lang('Exercises')
);
@ -151,7 +151,7 @@ if ((api_is_allowed_to_edit(null, true)) && (($finish == 0) || ($finish == 2)))
$_course,
$_FILES['userFile'],
$document_sys_path,
$uploadPath . '/' . $fld,
$uploadPath.'/'.$fld,
api_get_user_id(),
null,
null,
@ -163,7 +163,7 @@ if ((api_is_allowed_to_edit(null, true)) && (($finish == 0) || ($finish == 2)))
$imgparams = $_POST['imgparams'];
$checked = CheckImageName($imgparams, $filename);
if ($checked) {
$imgcount = $imgcount-1;
$imgcount = $imgcount - 1;
} else {
$dialogBox .= $filename.' '.get_lang('NameNotEqual');
my_delete($document_sys_path.$uploadPath.'/'.$fld.'/'.$filename);

@ -12,7 +12,7 @@ require_once __DIR__.'/../inc/global.inc.php';
$TBL_ANSWER = Database::get_course_table(TABLE_QUIZ_ANSWER);
$questionId = intval($_GET['questionId']);
$answerId = intval($_GET['answerId']);
$answerId = intval($_GET['answerId']);
if ($_GET['type'] == "square" || $_GET['type'] == "circle") {
$hotspot_type = $_GET['type'];
@ -20,11 +20,11 @@ if ($_GET['type'] == "square" || $_GET['type'] == "circle") {
}
if ($_GET['type'] == "poly" || $_GET['type'] == "delineation" || $_GET['type'] == "oar") {
$hotspot_type = $_GET['type'];
$tmp_coord = explode(",",$_GET['co']);
$tmp_coord = explode(",", $_GET['co']);
$i = 0;
$hotspot_coordinates = "";
foreach ($tmp_coord as $coord) {
if ($i%2 == 0) {
if ($i % 2 == 0) {
$delimiter = ";";
} else {
$delimiter = "|";
@ -32,7 +32,7 @@ if ($_GET['type'] == "poly" || $_GET['type'] == "delineation" || $_GET['type'] =
$hotspot_coordinates .= $coord.$delimiter;
$i++;
}
$hotspot_coordinates = api_substr($hotspot_coordinates,0,-2);
$hotspot_coordinates = api_substr($hotspot_coordinates, 0, -2);
}
$course_id = api_get_course_int_id();
$sql = "UPDATE $TBL_ANSWER SET

@ -16,7 +16,7 @@ $coordinates = $_GET['coord'];
$objExercise = Session::read('objExercise');
$exerciseId = $objExercise->selectId();
// Save clicking order
$answerOrderId = count($_SESSION['exerciseResult'][$questionId]['ids'])+1;
$answerOrderId = count($_SESSION['exerciseResult'][$questionId]['ids']) + 1;
if ($_GET['answerId'] == "0") {
// click is NOT on a hotspot
$hit = 0;
@ -24,18 +24,18 @@ if ($_GET['answerId'] == "0") {
} else {
// user clicked ON a hotspot
$hit = 1;
$answerId = api_substr($_GET['answerId'],22,2);
$answerId = api_substr($_GET['answerId'], 22, 2);
// Save into session
$_SESSION['exerciseResult'][$questionId][$answerId] = $hit;
}
//round-up the coordinates
$coords = explode('/',$coordinates);
$coords = explode('/', $coordinates);
$coordinates = '';
foreach ($coords as $coord) {
list($x,$y) = explode(';',$coord);
list($x, $y) = explode(';', $coord);
$coordinates .= round($x).';'.round($y).'/';
}
$coordinates = substr($coordinates,0,-1);
$coordinates = substr($coordinates, 0, -1);
$TBL_TRACK_E_HOTSPOT = Database::get_main_table(TABLE_STATISTIC_TRACK_E_HOTSPOT);
// Save into db
@ -45,7 +45,7 @@ $params = [
'quiz_id' => $exerciseId,
'question_id' => $questionId,
'answer_id' => $answerId,
'correct' => $hit ,
'correct' => $hit,
'coordinate' => $coordinates
];
// Save insert id into session if users changes answer.

@ -42,7 +42,7 @@ if (empty($sessionId)) {
$UserIsSubscribedToSession = SessionManager::isUserSubscribedAsStudent($lastSessionId, $user->getId());
if (!empty($lastSessionId) && $UserIsSubscribedToSession) {
$urlWithSession = api_get_self() . '?' . http_build_query([
$urlWithSession = api_get_self().'?'.http_build_query([
'session_id' => $lastCourseAccess->getSessionId()
]);
@ -116,13 +116,13 @@ if ($currentSession) {
foreach ($learningPathList->list as $learningPathId => $learningPath) {
$courseData['stats'][] = [
$learningPath['lp_name'],
'lp/lp_controller.php?' . http_build_query([
'lp/lp_controller.php?'.http_build_query([
'action' => 'stats',
'cidReq' => $course->getCode(),
'id_session' => $currentSession->getId(),
'gidReq' => 0,
'lp_id' => $learningPathId
]) . api_get_cidreq()
]).api_get_cidreq()
];
}

@ -41,7 +41,7 @@ if (isset($_POST['glossary_id']) &&
$glossary_all_data = implode('[|.|_|.|-|.|]', $glossary_all_data);
echo api_xml_http_response_encode($glossary_all_data);
}
} elseif(isset($_POST['glossary_name'])) {
} elseif (isset($_POST['glossary_name'])) {
$my_glossary_name = Security::remove_XSS($_POST['glossary_name']);
$my_glossary_name = api_convert_encoding($my_glossary_name, $charset, 'UTF-8');
$my_glossary_name = trim($my_glossary_name);

@ -18,7 +18,7 @@ $this_section = SECTION_TRACKING;
api_block_anonymous_users();
$interbreadcrumb[] = array(
"url" => api_is_student_boss()?"#":api_get_path(WEB_CODE_PATH) . "mySpace/index.php?".api_get_cidreq(),
"url" => api_is_student_boss() ? "#" : api_get_path(WEB_CODE_PATH)."mySpace/index.php?".api_get_cidreq(),
"name" => get_lang("MySpace")
);
@ -111,7 +111,7 @@ if ($searchSessionAndCourse || $searchCourseOnly) {
}
if (!is_null($gradebook)) {
$exportAllLink = api_get_path(WEB_CODE_PATH) . "gradebook/gradebook_display_certificate.php?";
$exportAllLink = api_get_path(WEB_CODE_PATH)."gradebook/gradebook_display_certificate.php?";
$exportAllLink .= http_build_query(array(
"action" => "export_all_certificates",
"cidReq" => $selectedCourseInfo['code'],
@ -246,7 +246,7 @@ $template = new Template(get_lang('GradebookListOfStudentsCertificates'));
$form = new FormValidator(
'certificate_report_form',
'post',
api_get_path(WEB_CODE_PATH) . 'gradebook/certificate_report.php'
api_get_path(WEB_CODE_PATH).'gradebook/certificate_report.php'
);
$form->addSelect('session', get_lang('Sessions'), $sessions, ['id' => 'session']);
$form->addSelect('course', get_lang('Courses'), $courses, ['id' => 'course']);
@ -285,7 +285,7 @@ if (api_is_student_boss()) {
$searchForm = new FormValidator(
'certificate_report_form',
'post',
api_get_path(WEB_CODE_PATH) . 'gradebook/certificate_report.php'
api_get_path(WEB_CODE_PATH).'gradebook/certificate_report.php'
);
$searchForm->addSelect('student', get_lang('Students'), $students, ['id' => 'student']);
$searchForm->addButtonSearch();

@ -33,7 +33,7 @@ $assertions = array();
foreach ($userSkills as $skill) {
$skillId = current($skill);
$assertionUrl = api_get_path(WEB_CODE_PATH) . "badge/assertion.php?";
$assertionUrl = api_get_path(WEB_CODE_PATH)."badge/assertion.php?";
$assertionUrl .= http_build_query(array(
'user' => $userId,
'skill' => $skillId,
@ -51,7 +51,7 @@ if (strcmp($backpack, $configBackpack) !== 0) {
$backpack = $configBackpack;
}
$htmlHeadXtra[] = '<script src="' . $backpack . 'issuer.js"></script>';
$htmlHeadXtra[] = '<script src="'.$backpack.'issuer.js"></script>';
$tpl = new Template(get_lang('Badges'), false, false);
@ -59,7 +59,7 @@ $tpl->assign(
'content',
"<script>
$(document).on('ready', function (){
OpenBadges.issue_no_modal(" . json_encode($assertions) . ");
OpenBadges.issue_no_modal(" . json_encode($assertions).");
});
</script>"
);

@ -8,7 +8,7 @@
require_once __DIR__.'/../inc/global.inc.php';
$_in_course = true;
$course_code = api_get_course_id();
if (empty($course_code )) {
if (empty($course_code)) {
$_in_course = false;
}
@ -23,7 +23,7 @@ $catadd = new Category();
$my_user_id = api_get_user_id();
$catadd->set_user_id($my_user_id);
$catadd->set_parent_id($get_select_cat);
$catcourse = Category :: load ($get_select_cat);
$catcourse = Category :: load($get_select_cat);
if ($_in_course) {
$catadd->set_course_code($course_code);
@ -37,12 +37,12 @@ $form = new CatForm(
$catadd,
'add_cat_form',
null,
api_get_self() . '?selectcat='.$get_select_cat.'&'.api_get_cidreq()
api_get_self().'?selectcat='.$get_select_cat.'&'.api_get_cidreq()
);
if ($form->validate()) {
$values = $form->exportValues();
$select_course=isset($values['select_course']) ? $values['select_course'] : array();
$select_course = isset($values['select_course']) ? $values['select_course'] : array();
$cat = new Category();
if ($values['hid_parent_id'] == '0') {
if ($select_course == 'COURSEINDEPENDENT') {
@ -89,12 +89,12 @@ if ($form->validate()) {
}
$cat->set_visible($visible);
$result = $cat->add();
header('Location: '.Security::remove_XSS($_SESSION['gradebook_dest']).'?addcat=&selectcat=' . $cat->get_parent_id().'&'.api_get_cidreq());
header('Location: '.Security::remove_XSS($_SESSION['gradebook_dest']).'?addcat=&selectcat='.$cat->get_parent_id().'&'.api_get_cidreq());
exit;
}
if (!$_in_course) {
$interbreadcrumb[] = array (
$interbreadcrumb[] = array(
'url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.$get_select_cat.'&'.api_get_cidreq(),
'name' => get_lang('Gradebook')
);

@ -7,24 +7,24 @@
*/
require_once __DIR__.'/../inc/global.inc.php';
$current_course_tool = TOOL_GRADEBOOK;
$current_course_tool = TOOL_GRADEBOOK;
api_protect_course_script(true);
api_block_anonymous_users();
GradebookUtils::block_students();
$selectCat = isset($_GET['selectcat']) ? (int) $_GET['selectcat'] : 0;
$selectCat = isset($_GET['selectcat']) ? (int) $_GET['selectcat'] : 0;
$catadd = new Category();
$catadd->set_user_id(api_get_user_id());
$catadd->set_parent_id($selectCat);
$catcourse = Category :: load ($selectCat);
$catcourse = Category :: load($selectCat);
$form = new CatForm(
CatForm :: TYPE_SELECT_COURSE,
$catadd,
'add_cat_form',
null,
api_get_self() . '?selectcat=' . $selectCat.'&'.api_get_cidreq()
api_get_self().'?selectcat='.$selectCat.'&'.api_get_cidreq()
);
if ($form->validate()) {
@ -32,11 +32,11 @@ if ($form->validate()) {
$cat = new Category();
$cat->set_course_code($values['select_course']);
$cat->set_name($values['name']);
header('location: gradebook_add_link.php?selectcat=' .$selectCat.'&course_code='.Security::remove_XSS($values['select_course']).'&'.api_get_cidreq());
header('location: gradebook_add_link.php?selectcat='.$selectCat.'&course_code='.Security::remove_XSS($values['select_course']).'&'.api_get_cidreq());
exit;
}
$interbreadcrumb[] = array (
$interbreadcrumb[] = array(
'url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.$selectCat.'&'.api_get_cidreq(),
'name' => get_lang('Gradebook')
);

@ -7,7 +7,7 @@
*/
//$cidReset = true;
require_once __DIR__.'/../inc/global.inc.php';
$current_course_tool = TOOL_GRADEBOOK;
$current_course_tool = TOOL_GRADEBOOK;
api_protect_course_script(true);
api_block_anonymous_users();
@ -25,14 +25,14 @@ $add_result_form = new EvalForm(
$resultadd,
'add_result_form',
null,
api_get_self() . '?selectcat=' . Security::remove_XSS($category) . '&selecteval=' . $selectEval.'&'.api_get_cidreq()
api_get_self().'?selectcat='.Security::remove_XSS($category).'&selecteval='.$selectEval.'&'.api_get_cidreq()
);
$table = $add_result_form->toHtml();
if ($add_result_form->validate()) {
$values = $add_result_form->exportValues();
$nr_users = $values['nr_users'];
if ($nr_users == '0') {
header('Location: gradebook_view_result.php?addresultnostudents=&selecteval=' . $selectEval.'&'.api_get_cidreq());
header('Location: gradebook_view_result.php?addresultnostudents=&selecteval='.$selectEval.'&'.api_get_cidreq());
exit;
}
$scores = ($values['score']);
@ -47,7 +47,7 @@ if ($add_result_form->validate()) {
$res->add();
next($scores);
}
header('Location: gradebook_view_result.php?addresult=&selecteval=' . $selectEval.'&'.api_get_cidreq());
header('Location: gradebook_view_result.php?addresult=&selecteval='.$selectEval.'&'.api_get_cidreq());
exit;
}
$interbreadcrumb[] = array(

@ -14,11 +14,11 @@ $this_section = SECTION_MYGRADEBOOK;
api_block_anonymous_users();
GradebookUtils::block_students();
$evaluation= Evaluation :: load($_GET['selecteval']);
$evaluation = Evaluation :: load($_GET['selecteval']);
$newstudents = $evaluation[0]->get_not_subscribed_students();
if (count($newstudents) == '0') {
header('Location: gradebook_view_result.php?nouser=&selecteval=' . Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq());
header('Location: gradebook_view_result.php?nouser=&selecteval='.Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq());
exit;
}
$add_user_form = new EvalForm(
@ -65,16 +65,16 @@ if (isset($_POST['submit_button'])) {
}
}
$interbreadcrumb[]= array ('url' => Security::remove_XSS($_SESSION['gradebook_dest']),'name' => get_lang('Gradebook'));
$interbreadcrumb[]= array(
'url' => 'gradebook_view_result.php?selecteval=' .Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq(),
$interbreadcrumb[] = array('url' => Security::remove_XSS($_SESSION['gradebook_dest']), 'name' => get_lang('Gradebook'));
$interbreadcrumb[] = array(
'url' => 'gradebook_view_result.php?selecteval='.Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq(),
'name' => get_lang('ViewResult')
);
Display :: display_header(get_lang('AddUserToEval'));
if (isset ($_GET['erroroneuser'])){
Display :: display_warning_message(get_lang('AtLeastOneUser'),false);
if (isset ($_GET['erroroneuser'])) {
Display :: display_warning_message(get_lang('AtLeastOneUser'), false);
}
DisplayGradebook :: display_header_result($evaluation[0], null, 0,0);
DisplayGradebook :: display_header_result($evaluation[0], null, 0, 0);
echo '<div class="main">';
echo $add_user_form->toHtml();
echo '</div>';

@ -9,7 +9,7 @@ use ChamiloSession as Session;
*/
require_once __DIR__.'/../inc/global.inc.php';
$current_course_tool = TOOL_GRADEBOOK;
$current_course_tool = TOOL_GRADEBOOK;
api_protect_course_script();
@ -21,7 +21,7 @@ if (!api_is_allowed_to_edit()) {
api_not_allowed(true);
}
$cat_id = isset($_GET['selectcat']) ? (int)$_GET['selectcat'] : null;
$cat_id = isset($_GET['selectcat']) ? (int) $_GET['selectcat'] : null;
$action = isset($_GET['action']) && $_GET['action'] ? $_GET['action'] : null;
$userList = CourseManager::get_user_list_from_course_code(
@ -111,8 +111,8 @@ switch ($action) {
$course_code = api_get_course_id();
$interbreadcrumb[] = array('url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?', 'name' => get_lang('Gradebook'));
$interbreadcrumb[] = array('url' => '#','name' => get_lang('GradebookListOfStudentsReports'));
$interbreadcrumb[] = array('url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?', 'name' => get_lang('Gradebook'));
$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('GradebookListOfStudentsReports'));
$this_section = SECTION_COURSES;
@ -129,7 +129,7 @@ if (count($userList) > 0) {
}
echo '</div>';
if (count($userList) == 0 ) {
if (count($userList) == 0) {
echo Display::display_warning_message(get_lang('NoResultsAvailable'));
} else {
echo '<br /><br /><table class="data_table">';

@ -8,7 +8,7 @@
require_once __DIR__.'/../inc/global.inc.php';
require_once api_get_path(SYS_CODE_PATH).'gradebook/lib/fe/exportgradebook.php';
$current_course_tool = TOOL_GRADEBOOK;
$current_course_tool = TOOL_GRADEBOOK;
api_protect_course_script(true);
@ -74,7 +74,7 @@ $simple_search_form = new UserForm(
null,
'simple_search_form',
null,
api_get_self() . '?selectcat=' . $category_id
api_get_self().'?selectcat='.$category_id
);
$values = $simple_search_form->exportValues();
@ -148,15 +148,15 @@ if (isset($_GET['export_pdf']) && $_GET['export_pdf'] == 'category') {
}
}
if (isset($_GET['exportpdf'])) {
$interbreadcrumb[] = array (
'url' => api_get_self().'?selectcat=' . Security::remove_XSS($_GET['selectcat']).'&'.api_get_cidreq(),
if (isset($_GET['exportpdf'])) {
$interbreadcrumb[] = array(
'url' => api_get_self().'?selectcat='.Security::remove_XSS($_GET['selectcat']).'&'.api_get_cidreq(),
'name' => get_lang('FlatView')
);
$pageNum = isset($_GET['flatviewlist_page_nr']) ? intval($_GET['flatviewlist_page_nr']) : null;
$perPage = isset($_GET['flatviewlist_per_page']) ? intval($_GET['flatviewlist_per_page']) : null;
$url = api_get_self() . '?' . api_get_cidreq() . '&' . http_build_query([
$url = api_get_self().'?'.api_get_cidreq().'&'.http_build_query([
'exportpdf' => '',
'offset' => $offset,
'selectcat' => intval($_GET['selectcat']),
@ -195,7 +195,7 @@ if (isset($_GET['exportpdf'])) {
}
}
if (isset($_GET['print'])) {
if (isset($_GET['print'])) {
$printable_data = GradebookUtils::get_printable_data(
$cat[0],
$users,

@ -9,21 +9,21 @@ require_once __DIR__.'/../inc/global.inc.php';
api_block_anonymous_users();
$eval= Evaluation :: load($_GET['selecteval']);
$eval = Evaluation :: load($_GET['selecteval']);
if ($eval[0]->get_category_id() < 0) {
// if category id is negative, then the evaluation's origin is a link
$link= LinkFactory :: get_evaluation_link($eval[0]->get_id());
$link = LinkFactory :: get_evaluation_link($eval[0]->get_id());
$currentcat = Category :: load($link->get_category_id());
} else {
$currentcat = Category :: load($eval[0]->get_category_id());
}
$interbreadcrumb[]= array (
'url' => $_SESSION['gradebook_dest'].'?selectcat=' . $currentcat[0]->get_id(), 'name' => get_lang('ToolGradebook'));
$interbreadcrumb[] = array(
'url' => $_SESSION['gradebook_dest'].'?selectcat='.$currentcat[0]->get_id(), 'name' => get_lang('ToolGradebook'));
if (api_is_allowed_to_edit()) {
$interbreadcrumb[]= array (
'url' => 'gradebook_view_result.php?selecteval=' . Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq(),
$interbreadcrumb[] = array(
'url' => 'gradebook_view_result.php?selecteval='.Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq(),
'name' => get_lang('ViewResult')
);
}
@ -45,7 +45,7 @@ if (!$displayscore->is_custom() || empty($displays)) {
Display :: display_error_message(get_lang('PleaseEnableScoringSystem'), false);
}
} else {
$allresults = Result::load(null,null,$eval[0]->get_id());
$allresults = Result::load(null, null, $eval[0]->get_id());
$nr_items = array();
foreach ($displays as $itemsdisplay) {
$nr_items[$itemsdisplay['display']] = 0;
@ -78,19 +78,19 @@ if (!$displayscore->is_custom() || empty($displays)) {
}
// Generate table
$stattable= '<table class="data_table" cellspacing="0" cellpadding="3">';
$stattable .= '<tr><th>' . get_lang('ScoringSystem') . '</th>';
$stattable .= '<th>' . get_lang('Percentage') . '</th>';
$stattable .= '<th>' . get_lang('CountUsers') . '</th>';
$stattable = '<table class="data_table" cellspacing="0" cellpadding="3">';
$stattable .= '<tr><th>'.get_lang('ScoringSystem').'</th>';
$stattable .= '<th>'.get_lang('Percentage').'</th>';
$stattable .= '<th>'.get_lang('CountUsers').'</th>';
//$stattable .= '<th>' . get_lang('Statistics') . '</th></tr>';
$counter=0;
$counter = 0;
foreach ($keys as $key) {
$bar = ($highest_ratio > 0?($nr_items[$key] / $highest_ratio) * 100:0);
$stattable .= '<tr class="row_' . ($counter % 2 == 0 ? 'odd' : 'even') . '">';
$stattable .= '<td width="150">' . $key . '</td>';
$bar = ($highest_ratio > 0 ? ($nr_items[$key] / $highest_ratio) * 100 : 0);
$stattable .= '<tr class="row_'.($counter % 2 == 0 ? 'odd' : 'even').'">';
$stattable .= '<td width="150">'.$key.'</td>';
$stattable .= '<td width="550">'.Display::bar_progress($bar).'</td>';
$stattable .= '<td align="right">' . $nr_items[$key] . '</td>';
$stattable .= '<td align="right">'.$nr_items[$key].'</td>';
$counter++;
}
$stattable .= '</tr></table>';

@ -12,7 +12,7 @@
* @param string View to print as a title for the table
* @param string Course name to print as title for the table
*/
function print_table($data_array,$header_names,$view,$coursename)
function print_table($data_array, $header_names, $view, $coursename)
{
$printdata = '<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
@ -161,7 +161,7 @@ function export_pdf_attendance($headers_table, $data_table, $headers_pdf, $foote
$count_pages = ceil(count($data_table) / $items_per_page);
$content_table = '';
for ($x = 0; $x<$count_pages; $x++) {
for ($x = 0; $x < $count_pages; $x++) {
$content_table .= '<table width="100%" border="1" style="border-collapse:collapse">';
// header table
$content_table .= '<tr>';
@ -170,7 +170,7 @@ function export_pdf_attendance($headers_table, $data_table, $headers_pdf, $foote
foreach ($headers_table as $head_table) {
if (!empty($head_table[0])) {
$width = (!empty($head_table[1])?$head_table[1].'%':'');
$width = (!empty($head_table[1]) ? $head_table[1].'%' : '');
$content_table .= '<th width="'.$width.'">'.$head_table[0].'</th>';
$i++;
}
@ -179,16 +179,16 @@ function export_pdf_attendance($headers_table, $data_table, $headers_pdf, $foote
$content_table .= '</tr>';
// body table
if (is_array($data_table) && count($data_table) > 0) {
$offset = $x*$items_per_page;
$data_table = array_slice ($data_table, $offset, count($data_table));
$offset = $x * $items_per_page;
$data_table = array_slice($data_table, $offset, count($data_table));
$i = 1;
$item = $offset+1;
$item = $offset + 1;
foreach ($data_table as $data) {
$content_table .= '<tr>';
$content_table .= '<td>'.($item<10?'0'.$item:$item).'</td>';
$content_table .= '<td>'.($item < 10 ? '0'.$item : $item).'</td>';
foreach ($data as $key => $content) {
if (isset($content)) {
$key == 1 ? $align='align="left"':$align='align="center"';
$key == 1 ? $align = 'align="left"' : $align = 'align="center"';
$content_table .= '<td '.$align.' style="padding:4px;" >'.$content.'</td>';
}
}
@ -241,10 +241,10 @@ function export_pdf_with_html($headers_table, $data_table, $headers_pdf, $footer
<h1>'.$title_pdf.'</h1></td></tr>';
foreach ($headers_pdf as $header_pdf) {
if (!empty($header_pdf[0]) && !empty($header_pdf[1])) {
$header.= '<tr><td><strong>'.$header_pdf[0].'</strong> </td><td>'.$header_pdf[1].'</td></tr>';
$header .= '<tr><td><strong>'.$header_pdf[0].'</strong> </td><td>'.$header_pdf[1].'</td></tr>';
}
}
$header.='</table><br />';
$header .= '</table><br />';
}
// preparing footer pdf
@ -268,7 +268,7 @@ function export_pdf_with_html($headers_table, $data_table, $headers_pdf, $footer
}
$items_per_page = 30;
$count_pages = ceil(count($data_table) / $items_per_page);
for ($x = 0; $x<$count_pages; $x++) {
for ($x = 0; $x < $count_pages; $x++) {
$content_table .= '<table width="100%" border="1" style="border-collapse:collapse">';
// header table
$content_table .= '<tr>';
@ -276,7 +276,7 @@ function export_pdf_with_html($headers_table, $data_table, $headers_pdf, $footer
if (is_array($headers_table)) {
foreach ($headers_table as $head_table) {
if (!empty($head_table[0])) {
$width = (!empty($head_table[1])?$head_table[1].'%':'');
$width = (!empty($head_table[1]) ? $head_table[1].'%' : '');
$content_table .= '<th width="'.$width.'">'.$head_table[0].'</th>';
$i++;
}
@ -286,16 +286,16 @@ function export_pdf_with_html($headers_table, $data_table, $headers_pdf, $footer
// body table
if (is_array($data_table) && count($data_table) > 0) {
$offset = $x*$items_per_page;
$data_table = array_slice ($data_table, $offset, count($data_table));
$offset = $x * $items_per_page;
$data_table = array_slice($data_table, $offset, count($data_table));
$i = 1;
$item = $offset+1;
$item = $offset + 1;
foreach ($data_table as $data) {
$content_table .= '<tr>';
$content_table .= '<td>'.($item<10?'0'.$item:$item).'</td>';
$content_table .= '<td>'.($item < 10 ? '0'.$item : $item).'</td>';
foreach ($data as $key => $content) {
if (isset($content)) {
$key == 1 ? $align='align="left"':$align='align="center"';
$key == 1 ? $align = 'align="left"' : $align = 'align="center"';
$content_table .= '<td '.$align.' style="padding:4px;" >'.$content.'</td>';
}
}
@ -313,7 +313,7 @@ function export_pdf_with_html($headers_table, $data_table, $headers_pdf, $footer
$pdf = new PDF();
$pdf->set_custom_footer($footer);
$pdf->set_custom_header($headers_in_pdf);
$pdf->content_to_pdf($header.$content_table, $css, $title_pdf );
$pdf->content_to_pdf($header.$content_table, $css, $title_pdf);
exit;
}
@ -328,8 +328,8 @@ function export_pdf_with_html($headers_table, $data_table, $headers_pdf, $footer
function export_pdf($pdf, $newarray, $header_names, $format)
{
$pdf->selectFont(api_get_path(LIBRARY_PATH).'ezpdf/fonts/Courier.afm');
$pdf->ezSetCmMargins(0,0,0,0);
$pdf->ezSetY(($format=='portrait')?'820':'570');
$pdf->ezSetCmMargins(0, 0, 0, 0);
$pdf->ezSetY(($format == 'portrait') ? '820' : '570');
$pdf->selectFont(api_get_path(LIBRARY_PATH).'ezpdf/fonts/Courier.afm');
if ($format == 'portrait') {
$pdf->line(40, 790, 540, 790);
@ -338,7 +338,7 @@ function export_pdf($pdf, $newarray, $header_names, $format)
$pdf->line(40, 540, 790, 540);
$pdf->line(40, 40, 790, 40);
}
$pdf->ezSetY(($format=='portrait')?'750':'520');
$pdf->ezSetY(($format == 'portrait') ? '750' : '520');
$pdf->ezTable($newarray, $header_names, '', array(
'showHeadings' => 1,
'shaded' => 1,

@ -22,7 +22,7 @@ $is_allowed_in_course = api_is_allowed_in_course();
$userId = api_get_user_id();
$this_section = SECTION_COURSES;
$current_course_tool = TOOL_GROUP;
$current_course_tool = TOOL_GROUP;
// Notice for unauthorized people.
api_protect_course_script(true);
@ -186,7 +186,7 @@ if (api_is_allowed_to_edit(false, true)) {
Display::return_icon('add-groups.png', get_lang('NewGroupCreate'), '', ICON_SIZE_MEDIUM).'</a>';
if (api_get_setting('allow_group_categories') === 'true') {
$actionsLeft .= '<a href="group_category.php?'.api_get_cidreq().'&action=add_category">'.
$actionsLeft .= '<a href="group_category.php?'.api_get_cidreq().'&action=add_category">'.
Display::return_icon('new_folder.png', get_lang('AddCategory'), '', ICON_SIZE_MEDIUM).'</a>';
} else {
$actionsLeft .= '<a href="group_category.php?'.api_get_cidreq().'&id=2">'.
@ -240,7 +240,7 @@ if (api_get_setting('allow_group_categories') === 'true') {
$actions = null;
if (api_is_allowed_to_edit(false, true) && !empty($categoryId)) {
$actions .= '<a href="group_category.php?'.api_get_cidreq().'&id='.$categoryId.'" title="'.get_lang('Edit').'">'.
Display::return_icon('edit.png', get_lang('EditGroup'),'',ICON_SIZE_SMALL).'</a>';
Display::return_icon('edit.png', get_lang('EditGroup'), '', ICON_SIZE_SMALL).'</a>';
$actions .=
Display::url(
Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL),
@ -250,17 +250,17 @@ if (api_get_setting('allow_group_categories') === 'true') {
)
);
if ($index != 0) {
$actions .= ' <a href="group.php?'.api_get_cidreq().'&action=swap_cat_order&id1='.$categoryId.'&id2='.$group_cats[$index -1]['id'].'">'.
Display::return_icon('up.png','&nbsp;','',ICON_SIZE_SMALL).'</a>';
$actions .= ' <a href="group.php?'.api_get_cidreq().'&action=swap_cat_order&id1='.$categoryId.'&id2='.$group_cats[$index - 1]['id'].'">'.
Display::return_icon('up.png', '&nbsp;', '', ICON_SIZE_SMALL).'</a>';
}
if ($index != count($group_cats) - 1) {
$actions .= ' <a href="group.php?'.api_get_cidreq().'&action=swap_cat_order&id1='.$categoryId.'&id2='.$group_cats[$index +1]['id'].'">'.
Display::return_icon('down.png','&nbsp;','',ICON_SIZE_SMALL).'</a>';
$actions .= ' <a href="group.php?'.api_get_cidreq().'&action=swap_cat_order&id1='.$categoryId.'&id2='.$group_cats[$index + 1]['id'].'">'.
Display::return_icon('down.png', '&nbsp;', '', ICON_SIZE_SMALL).'</a>';
}
}
echo Display::page_header(
Security::remove_XSS($category['title'].' '. $label.' ').$actions,
Security::remove_XSS($category['title'].' '.$label.' ').$actions,
null,
'h4',
false

@ -50,10 +50,10 @@ $table_header = array();
$table_header[] = array('tag', true);
$table_header[] = array('attributes', false);
foreach ($tags as $tag => & $attributes) {
$row = array();
$row[] = '<kbd>'.$tag.'</kbd>';
$row[] = '<kbd>&nbsp;'.implode(', ', array_keys($attributes)).'</kbd>';
$table_data[] = $row;
$row = array();
$row[] = '<kbd>'.$tag.'</kbd>';
$row[] = '<kbd>&nbsp;'.implode(', ', array_keys($attributes)).'</kbd>';
$table_data[] = $row;
}
Display::display_sortable_table($table_header, $table_data, array(), array(), array('fullpage' => intval($_GET['fullpage'])));
?>

@ -47,9 +47,9 @@ if (!empty($_GET['edit']) && $_GET['edit'] == 'true' && api_is_platform_admin())
$form->display();
}
} else {
$faq_content = @(string)file_get_contents(api_get_path(SYS_APP_PATH).'home/'.$faq_file);
$faq_content = api_to_system_encoding($faq_content, api_detect_encoding(strip_tags($faq_content)));
echo $faq_content;
$faq_content = @(string)file_get_contents(api_get_path(SYS_APP_PATH).'home/'.$faq_file);
$faq_content = api_to_system_encoding($faq_content, api_detect_encoding(strip_tags($faq_content)));
echo $faq_content;
}
Display::display_footer();

@ -27,16 +27,16 @@ $audioFileName = Security::remove_XSS($file['name']);
$audioFileName = Database::escape_string($audioFileName);
$audioFileName = api_replace_dangerous_char($audioFileName);
$audioFileName = disable_dangerous_file($audioFileName);
$audioDir = Security::remove_XSS($audioDir);
$audioDir = Security::remove_XSS($audioDir);
$dirBaseDocuments = api_get_path(SYS_COURSE_PATH) . $courseInfo['path'] . '/document';
$saveDir = $dirBaseDocuments . $audioDir;
$dirBaseDocuments = api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/document';
$saveDir = $dirBaseDocuments.$audioDir;
if (!is_dir($saveDir)) {
DocumentManager::createDefaultAudioFolder($courseInfo);
}
$documentPath = $saveDir . '/' . $audioFileName;
$documentPath = $saveDir.'/'.$audioFileName;
$file['file'] = $file;

@ -42,7 +42,7 @@ switch ($action) {
try {
$graphImage = $graphviz->createImageHtml($graph);
} catch (UnexpectedValueException $e) {
error_log($e->getMessage() . ' - Graph could not be rendered in resources sequence because GraphViz command "dot" could not be executed - Make sure graphviz is installed.');
error_log($e->getMessage().' - Graph could not be rendered in resources sequence because GraphViz command "dot" could not be executed - Make sure graphviz is installed.');
$graphImage = '<p class="text-center"><small>'.get_lang('MissingChartLibraryPleaseCheckLog').'</small></p>';
}
echo $graphImage;
@ -88,11 +88,11 @@ switch ($action) {
);
}
$link = '<div class="parent" data-id="' . $id . '">';
$link = '<div class="parent" data-id="'.$id.'">';
$link .= '<div class="big-icon">';
$link .= $image;
$link .= '<div class="sequence-course">' . $sessionInfo['name'] . '</div>';
$link .= '<a href="#" class="sequence-id">' . $id . '</a>';
$link .= '<div class="sequence-course">'.$sessionInfo['name'].'</div>';
$link .= '<a href="#" class="sequence-id">'.$id.'</a>';
$link .= $linkDelete;
$link .= $linkUndo;
$link .= '</div></div>';

@ -98,7 +98,7 @@ if (is_int($global_error_code) && $global_error_code > 0) {
$global_error_message['description'] = $IncorrectPhpVersionDescription;
break;
case 2:
require __DIR__ . '/../install/version.php';
require __DIR__.'/../install/version.php';
$global_error_message['section'] = $SectionInstallation;
$global_error_message['title'] = $InstallationTitle;
if (($pos = strpos($InstallationDescription, '%s')) === false) {

@ -22,7 +22,7 @@ class ConditionalLogin
if (isset($condition['conditional_function']) && $condition['conditional_function']($user) == false) {
$_SESSION['conditional_login']['uid'] = $user['user_id'];
$_SESSION['conditional_login']['can_login'] = false;
header("Location:". $condition['url']);
header("Location:".$condition['url']);
exit();
}
}

@ -7,8 +7,8 @@
class DateRangePicker extends HTML_QuickForm_text
{
/**
* Constructor
*/
* Constructor
*/
public function __construct($elementName = null, $elementLabel = null, $attributes = null)
{
if (!isset($attributes['id'])) {
@ -154,10 +154,10 @@ class DateRangePicker extends HTML_QuickForm_text
}
/**
* @param array $dates result of parseDateRange()
*
* @return bool
*/
* @param array $dates result of parseDateRange()
*
* @return bool
*/
public function validateDates($dates, $format = null)
{
if (empty($dates['start']) || empty($dates['end'])) {

@ -25,7 +25,7 @@ class SelectAjax extends HTML_QuickForm_select
$iso = api_get_language_isocode(api_get_interface_language());
$languageCondition = '';
if (file_exists(api_get_path(SYS_PATH) . "web/assets/select2/dist/js/i18n/$iso.js")) {
if (file_exists(api_get_path(SYS_PATH)."web/assets/select2/dist/js/i18n/$iso.js")) {
$html .= api_get_asset("select2/dist/js/i18n/$iso.js");
$languageCondition = "language: '$iso',";
}
@ -50,8 +50,7 @@ class SelectAjax extends HTML_QuickForm_select
//Get the minimumInputLength for select2
$minimumInputLength = $this->getAttribute('minimumInputLength') > 3 ?
$this->getAttribute('minimumInputLength') :
3
$this->getAttribute('minimumInputLength') : 3
;
$plHolder = $this->getAttribute('placeholder');
@ -84,7 +83,7 @@ class SelectAjax extends HTML_QuickForm_select
$multiple = $multiple ? 'true' : 'false';
$max = $this->getAttribute('maximumSelectionLength');
$max = !empty($max) ? "maximumSelectionLength: $max, ": '';
$max = !empty($max) ? "maximumSelectionLength: $max, " : '';
$html .= <<<JS
<script>
@ -128,7 +127,7 @@ JS;
$this->removeAttribute('url_function');
$this->setAttribute('style', 'width: 100%;');
return parent::toHtml() . $html;
return parent::toHtml().$html;
}
/**

@ -7,22 +7,22 @@
*/
class HTML_QuickForm_Rule_MaxFileSize extends HTML_QuickForm_Rule
{
/**
* @param $value array Uploaded file info (from $_FILES)
* @param null $options
* @return bool
*/
public function validate($elementValue, $maxSize)
{
if (!empty($elementValue['error']) &&
(UPLOAD_ERR_FORM_SIZE == $elementValue['error'] || UPLOAD_ERR_INI_SIZE == $elementValue['error'])
) {
return false;
}
if (!HTML_QuickForm_file::_ruleIsUploadedFile($elementValue)) {
return true;
}
/**
* @param $value array Uploaded file info (from $_FILES)
* @param null $options
* @return bool
*/
public function validate($elementValue, $maxSize)
{
if (!empty($elementValue['error']) &&
(UPLOAD_ERR_FORM_SIZE == $elementValue['error'] || UPLOAD_ERR_INI_SIZE == $elementValue['error'])
) {
return false;
}
if (!HTML_QuickForm_file::_ruleIsUploadedFile($elementValue)) {
return true;
}
return ($maxSize >= @filesize($elementValue['tmp_name']));
}
return ($maxSize >= @filesize($elementValue['tmp_name']));
}
}

@ -6,24 +6,24 @@
*/
class HTML_QuickForm_Rule_UsernameAvailable extends HTML_QuickForm_Rule
{
/**
* Function to check if a username is available
* @see HTML_QuickForm_Rule
* @param string $username Wanted username
* @param string $current_username
* @return boolean True if username is available
*/
function validate($username, $current_username = null) {
$user_table = Database::get_main_table(TABLE_MAIN_USER);
/**
* Function to check if a username is available
* @see HTML_QuickForm_Rule
* @param string $username Wanted username
* @param string $current_username
* @return boolean True if username is available
*/
function validate($username, $current_username = null) {
$user_table = Database::get_main_table(TABLE_MAIN_USER);
$username = Database::escape_string($username);
$current_username = Database::escape_string($current_username);
$sql = "SELECT * FROM $user_table WHERE username = '$username'";
if (!is_null($current_username)) {
$sql .= " AND username != '$current_username'";
}
$res = Database::query($sql);
$number = Database::num_rows($res);
return $number == 0;
}
$sql = "SELECT * FROM $user_table WHERE username = '$username'";
if (!is_null($current_username)) {
$sql .= " AND username != '$current_username'";
}
$res = Database::query($sql);
$number = Database::num_rows($res);
return $number == 0;
}
}

@ -646,10 +646,10 @@ function api_format_date($time, $format = null, $language = null)
$date_format = str_replace(
array('%A', '%a', '%B', '%b'),
array(
$translated['days_long'][(int)strftime('%w', $time)],
$translated['days_short'][(int)strftime('%w', $time)],
$translated['months_long'][(int)strftime('%m', $time) - 1],
$translated['months_short'][(int)strftime('%m', $time) - 1],
$translated['days_long'][(int) strftime('%w', $time)],
$translated['days_short'][(int) strftime('%w', $time)],
$translated['months_long'][(int) strftime('%m', $time) - 1],
$translated['months_short'][(int) strftime('%m', $time) - 1],
),
$date_format
);
@ -1611,7 +1611,7 @@ function api_natrsort(&$array, $language = null, $encoding = null)
* @return string Returns the encoding identificator modified in suitable for comparison way.
*/
function api_refine_encoding_id($encoding) {
if (is_array($encoding)){
if (is_array($encoding)) {
return array_map('api_refine_encoding_id', $encoding);
}
return strtoupper(str_replace('_', '-', $encoding));

@ -175,9 +175,9 @@ class AppPlugin
}
/**
* @param string $pluginName
* @param int $urlId
*/
* @param string $pluginName
* @param int $urlId
*/
public function uninstall($pluginName, $urlId = null)
{
if (empty($urlId)) {
@ -254,12 +254,12 @@ class AppPlugin
}
/**
* @param string $region
* @param string $template
* @param bool $forced
*
* @return null|string
*/
* @param string $region
* @param string $template
* @param bool $forced
*
* @return null|string
*/
public function load_region($region, $template, $forced = false)
{
if ($region == 'course_tool_plugin') {

@ -6452,7 +6452,7 @@ class SessionManager
]);
}
/**
/**
* Get the count of user courses in session
* @param int $sessionId The session id
* @return array

@ -35,11 +35,11 @@ class SkillProfile extends Model
}
/**
* This function is for editing profile info from profile_id.
* @param int $profileId
* @param string $name
* @param string $description
*/
* This function is for editing profile info from profile_id.
* @param int $profileId
* @param string $name
* @param string $description
*/
public function updateProfileInfo($profileId, $name, $description)
{
$profileId = intval($profileId);
@ -133,9 +133,9 @@ class SkillRelProfile extends Model
}
/**
* This function is for getting profile info from profile_id.
* @param int $profileId
*/
* This function is for getting profile info from profile_id.
* @param int $profileId
*/
public function getProfileInfo($profileId)
{

@ -2,7 +2,6 @@
/**
* Provides access to various HTTP request elements: GET, POST, FILE, etc paramaters.
* @license see /license.txt
* @deprecated
* @author Laurent Opprecht <laurent@opprecht.info> for the Univesity of Geneva

@ -27,7 +27,7 @@ class Timeline extends Model
public function __construct()
{
$this->table = Database::get_course_table(TABLE_TIMELINE);
$this->table = Database::get_course_table(TABLE_TIMELINE);
}
/**
@ -46,7 +46,7 @@ class Timeline extends Model
*/
public function get_all($where_conditions = array())
{
return Database::select('*',$this->table, array('where'=>$where_conditions,'order' =>'headline ASC'));
return Database::select('*', $this->table, array('where'=>$where_conditions, 'order' =>'headline ASC'));
}
/**
@ -57,7 +57,7 @@ class Timeline extends Model
// action links
$html = '<div class="actions">';
//$html .= '<a href="career_dashboard.php">'.Display::return_icon('back.png',get_lang('Back'),'','32').'</a>';
$html .= '<a href="'.api_get_self().'?action=add">'.Display::return_icon('add.png', get_lang('Add'),'','32').'</a>';
$html .= '<a href="'.api_get_self().'?action=add">'.Display::return_icon('add.png', get_lang('Add'), '', '32').'</a>';
$html .= '</div>';
$html .= Display::grid_html('timelines');
return $html;
@ -89,7 +89,7 @@ class Timeline extends Model
$form->addElement('text', 'headline', get_lang('Name'), array('size' => '70'));
//$form->addHtmlEditor('description', get_lang('Description'), false, false, array('ToolbarSet' => 'Careers','Width' => '100%', 'Height' => '250'));
$status_list = $this->get_status_list();
$status_list = $this->get_status_list();
$form->addElement('select', 'status', get_lang('Status'), $status_list);
if ($action == 'edit') {
//$form->addElement('text', 'created_at', get_lang('CreatedAt'));
@ -173,7 +173,7 @@ class Timeline extends Model
// Setting the rules
$form->addRule('headline', get_lang('ThisFieldIsRequired'), 'required');
return $form;
return $form;
}
@ -244,7 +244,7 @@ class Timeline extends Model
}
unset($item['end_date']);
// Assets
$item['asset'] = array( 'media' => $item['media'],
$item['asset'] = array('media' => $item['media'],
'credit' => $item['media_credit'],
'caption' => $item['media_caption'],
);

@ -79,7 +79,7 @@ class ZombieManager
$count = intval($count);
$from = intval($from);
$sql .= " ORDER BY $column $direction";
$sql .= " ORDER BY $column $direction";
$sql .= " LIMIT $count, $from ";
$result = Database::query($sql);
@ -93,8 +93,8 @@ class ZombieManager
static function deactivate_zombies($ceiling)
{
$zombies = self::list_zombies($ceiling);
$ids = array();
foreach($zombies as $zombie) {
$ids = array();
foreach ($zombies as $zombie) {
$ids[] = $zombie['user_id'];
}
UserManager::deactivate_users($ids);

@ -167,7 +167,7 @@ class ZombieReport implements Countable
}
$action = $this->get_action();
$f = array($this, 'action_' . $action);
$f = array($this, 'action_'.$action);
if (is_callable($f)) {
return call_user_func($f, $ids);
}
@ -292,7 +292,7 @@ class ZombieReport implements Countable
$text = get_lang('No');
}
$result = Display::return_icon($image . '.png', $text);
$result = Display::return_icon($image.'.png', $text);
return $result;
}

@ -105,7 +105,7 @@ $charset = 'UTF-8';
\Patchwork\Utf8\Bootup::initAll();
// Page encoding initialization.
header('Content-Type: text/html; charset='. $charset);
header('Content-Type: text/html; charset='.$charset);
// Setting the error reporting levels.
error_reporting(E_ALL);
@ -207,7 +207,7 @@ if ($installType == 'update' && in_array($my_old_version, $update_from_version_8
// This is the main configuration file of the system before the upgrade.
// Old configuration file.
// Don't change to include_once
$oldConfigPath = api_get_path(SYS_CODE_PATH) . 'inc/conf/configuration.php';
$oldConfigPath = api_get_path(SYS_CODE_PATH).'inc/conf/configuration.php';
if (file_exists($oldConfigPath)) {
include $oldConfigPath;
}
@ -337,7 +337,7 @@ if ($encryptPassForm == '1') {
//Blocking step6 button
$("#button_step6").click(function() {
$("#button_step6").hide();
$("#button_please_wait").html('<?php echo addslashes(get_lang('PleaseWait'));?>');
$("#button_please_wait").html('<?php echo addslashes(get_lang('PleaseWait')); ?>');
$("#button_please_wait").show();
$("#button_please_wait").attr('disabled', true);
$("#is_executable").attr("value",'step6');
@ -414,7 +414,7 @@ if ($encryptPassForm == '1') {
$instalation_type_label = '';
if ($installType == 'new') {
$instalation_type_label = get_lang('NewInstallation');
$instalation_type_label = get_lang('NewInstallation');
} elseif ($installType == 'update') {
$update_from_version = isset($update_from_version) ? $update_from_version : null;
$instalation_type_label = get_lang('UpdateFromLMSVersion').(is_array($update_from_version) ? implode('|', $update_from_version) : '');
@ -584,8 +584,8 @@ if (@$_POST['step2']) {
<?php
if ($installType == 'new') {
echo get_lang('AdminLogin') . ' : <strong>' . $loginForm . '</strong><br />';
echo get_lang('AdminPass') . ' : <strong>' . $passForm . '</strong><br /><br />'; /* TODO: Maybe this password should be hidden too? */
echo get_lang('AdminLogin').' : <strong>'.$loginForm.'</strong><br />';
echo get_lang('AdminPass').' : <strong>'.$passForm.'</strong><br /><br />'; /* TODO: Maybe this password should be hidden too? */
}
$allowSelfRegistrationLiteral = ($allowSelfReg == 'true') ? get_lang('Yes') : ($allowSelfReg == 'approval' ? get_lang('Approval') : get_lang('No'));
echo get_lang('AdminFirstName').' : '.$adminFirstName, '<br />', get_lang('AdminLastName').' : '.$adminLastName, '<br />';
@ -597,7 +597,7 @@ if (@$_POST['step2']) {
<?php echo get_lang('DBLogin').' : '.$dbUsernameForm; ?><br />
<?php echo get_lang('DBPassword').' : '.str_repeat('*', api_strlen($dbPassForm)); ?><br />
<?php echo get_lang('MainDB').' : <strong>'.$dbNameForm; ?></strong><br />
<?php echo get_lang('AllowSelfReg').' : '. $allowSelfRegistrationLiteral; ?><br />
<?php echo get_lang('AllowSelfReg').' : '.$allowSelfRegistrationLiteral; ?><br />
<?php echo get_lang('EncryptMethodUserPass').' : ';
echo $encryptPassForm;
?>

@ -17,7 +17,7 @@
if (defined('SYSTEM_INSTALLATION')) {
// Write the system config file
write_system_config_file(api_get_path(CONFIGURATION_PATH) . 'configuration.php');
write_system_config_file(api_get_path(CONFIGURATION_PATH).'configuration.php');
// Write a distribution file with the config as a backup for the admin
//write_system_config_file(api_get_path(CONFIGURATION_PATH) . 'configuration.dist.php');
@ -27,33 +27,33 @@ if (defined('SYSTEM_INSTALLATION')) {
// Copy distribution files with renaming for being the actual system configuration files.
copy(
api_get_path(CONFIGURATION_PATH) . 'add_course.conf.dist.php',
api_get_path(CONFIGURATION_PATH) . 'add_course.conf.php'
api_get_path(CONFIGURATION_PATH).'add_course.conf.dist.php',
api_get_path(CONFIGURATION_PATH).'add_course.conf.php'
);
copy(
api_get_path(CONFIGURATION_PATH) . 'course_info.conf.dist.php',
api_get_path(CONFIGURATION_PATH) . 'course_info.conf.php'
api_get_path(CONFIGURATION_PATH).'course_info.conf.dist.php',
api_get_path(CONFIGURATION_PATH).'course_info.conf.php'
);
copy(
api_get_path(CONFIGURATION_PATH) . 'mail.conf.dist.php',
api_get_path(CONFIGURATION_PATH) . 'mail.conf.php'
api_get_path(CONFIGURATION_PATH).'mail.conf.dist.php',
api_get_path(CONFIGURATION_PATH).'mail.conf.php'
);
copy(
api_get_path(CONFIGURATION_PATH) . 'profile.conf.dist.php',
api_get_path(CONFIGURATION_PATH) . 'profile.conf.php'
api_get_path(CONFIGURATION_PATH).'profile.conf.dist.php',
api_get_path(CONFIGURATION_PATH).'profile.conf.php'
);
copy(
api_get_path(CONFIGURATION_PATH) . 'events.conf.dist.php',
api_get_path(CONFIGURATION_PATH) . 'events.conf.php'
api_get_path(CONFIGURATION_PATH).'events.conf.dist.php',
api_get_path(CONFIGURATION_PATH).'events.conf.php'
);
copy(
api_get_path(CONFIGURATION_PATH) . 'auth.conf.dist.php',
api_get_path(CONFIGURATION_PATH) . 'auth.conf.php'
api_get_path(CONFIGURATION_PATH).'auth.conf.dist.php',
api_get_path(CONFIGURATION_PATH).'auth.conf.php'
);
copy(
api_get_path(CONFIGURATION_PATH) . 'portfolio.conf.dist.php',
api_get_path(CONFIGURATION_PATH) . 'portfolio.conf.php'
api_get_path(CONFIGURATION_PATH).'portfolio.conf.dist.php',
api_get_path(CONFIGURATION_PATH).'portfolio.conf.php'
);
} else {
echo 'You are not allowed here !' . __FILE__;
echo 'You are not allowed here !'.__FILE__;
}

@ -59,7 +59,7 @@ if (isset($_SESSION['gradebook'])) {
}
if (!empty($gradebook) && $gradebook == 'view') {
$interbreadcrumb[]= array (
$interbreadcrumb[] = array(
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'name' => get_lang('ToolGradebook')
);
@ -83,7 +83,7 @@ if ($_POST && empty($_REQUEST['lp_name'])) {
$form = new FormValidator(
'lp_add',
'post',
api_get_path(WEB_CODE_PATH) . 'lp/lp_controller.php?'.api_get_cidreq()
api_get_path(WEB_CODE_PATH).'lp/lp_controller.php?'.api_get_cidreq()
);
// Form title
@ -112,17 +112,17 @@ $form->addElement(
// Start date
$form->addElement('checkbox', 'activate_start_date_check', null, get_lang('EnableStartTime'), array('onclick' => 'activate_start_date()'));
$form->addElement('html','<div id="start_date_div" style="display:block;">');
$form->addElement('html', '<div id="start_date_div" style="display:block;">');
$form->addDatePicker('publicated_on', get_lang('PublicationDate'));
$form->addElement('html','</div>');
$form->addElement('html', '</div>');
//End date
$form->addElement('checkbox', 'activate_end_date_check', null, get_lang('EnableEndTime'), array('onclick' => 'activate_end_date()'));
$form->addElement('html','<div id="end_date_div" style="display:none;">');
$form->addElement('html', '<div id="end_date_div" style="display:none;">');
$form->addDatePicker('expired_on', get_lang('ExpirationDate'));
$form->addElement('html','</div>');
$form->addElement('html', '</div>');
$form->addElement('html','</div>');
$form->addElement('html', '</div>');
$defaults['activate_start_date_check'] = 1;
@ -133,7 +133,7 @@ if (api_get_setting('scorm_cumulative_session_time') == 'true') {
}
$defaults['publicated_on'] = date('Y-m-d 08:00:00');
$defaults['expired_on'] = date('Y-m-d 08:00:00',time()+86400);
$defaults['expired_on'] = date('Y-m-d 08:00:00', time() + 86400);
$form->setDefaults($defaults);
$form->addButtonCreate(get_lang('CreateLearningPath'));

@ -104,7 +104,7 @@ if (!empty($gradebook) && $gradebook == 'view') {
// Define the 'doc.inc.php' as language file.
$nameTools = $_SESSION['oLP']->get_name();
$interbreadcrumb[] = array(
'url' => api_get_path(WEB_CODE_PATH) . 'lp/lp_list.php?'.api_get_cidreq(),
'url' => api_get_path(WEB_CODE_PATH).'lp/lp_list.php?'.api_get_cidreq(),
'name' => get_lang('Doc'),
);
// Update global setting to avoid displaying right menu.

@ -20,7 +20,7 @@ if (isset($_SESSION['gradebook'])) {
}
if (!empty($gradebook) && $gradebook == 'view') {
$interbreadcrumb[] = array (
$interbreadcrumb[] = array(
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'name' => get_lang('ToolGradebook')
);
@ -76,7 +76,7 @@ $hide_toc_frame = $form->addElement(
);
if (api_get_setting('allow_course_theme') === 'true') {
$mycourselptheme = api_get_course_setting('allow_learning_path_theme');
if (!empty($mycourselptheme) && $mycourselptheme!=-1 && $mycourselptheme== 1) {
if (!empty($mycourselptheme) && $mycourselptheme != -1 && $mycourselptheme == 1) {
//LP theme picker
$theme_select = $form->addElement('SelectTheme', 'lp_theme', get_lang('Theme'));
$form->applyFilter('lp_theme', 'trim');
@ -105,7 +105,7 @@ if (strlen($_SESSION['oLP']->get_preview_image()) > 0) {
$label = ($_SESSION['oLP']->get_preview_image() != '' ? get_lang('UpdateImage') : get_lang('AddImage'));
$form->addElement('file', 'lp_preview_image', array($label, get_lang('ImageWillResizeMsg')));
$form->addRule('lp_preview_image', get_lang('OnlyImagesAllowed'), 'filetype', array ('jpg', 'jpeg', 'png', 'gif'));
$form->addRule('lp_preview_image', get_lang('OnlyImagesAllowed'), 'filetype', array('jpg', 'jpeg', 'png', 'gif'));
// Search terms (only if search is activated).
if (api_get_setting('search_enabled') === 'true') {
@ -134,7 +134,7 @@ $defaults['lp_name'] = Security::remove_XSS($_SESSION['oLP']->get_name());
$defaults['lp_author'] = Security::remove_XSS($_SESSION['oLP']->get_author());
$defaults['hide_toc_frame'] = Security::remove_XSS($_SESSION['oLP']->get_hide_toc_frame());
$defaults['category_id'] = intval($_SESSION['oLP']->getCategoryId());
$defaults['accumulate_scorm_time'] = $_SESSION['oLP']->getAccumulateScormTime();
$defaults['accumulate_scorm_time'] = $_SESSION['oLP']->getAccumulateScormTime();
$expired_on = $_SESSION['oLP']->expired_on;
$publicated_on = $_SESSION['oLP']->publicated_on;
@ -214,14 +214,14 @@ $form->addElement('hidden', 'lp_id', $_SESSION['oLP']->get_id());
if ($enableLpExtraFields) {
$htmlHeadXtra[] = '<script>
$(function() {
' . $extra['jquery_ready_content'] . '
' . $extra['jquery_ready_content'].'
});
</script>';
}
$defaults['publicated_on'] = !empty($publicated_on) && $publicated_on !== '0000-00-00 00:00:00' ? api_get_local_time($publicated_on) : null;
$defaults['expired_on'] = (!empty($expired_on) )? api_get_local_time($expired_on): date('Y-m-d 12:00:00', time()+84600);
$defaults['expired_on'] = (!empty($expired_on)) ? api_get_local_time($expired_on) : date('Y-m-d 12:00:00', time() + 84600);
$defaults['subscribe_users'] = $_SESSION['oLP']->getSubscribeUsers();
$form->setDefaults($defaults);

@ -35,7 +35,7 @@ $visibility = api_get_item_visibility(
null,
api_get_group_id()
);
if (!api_is_allowed_to_edit(null, true) && intval($visibility) == 0 ) {
if (!api_is_allowed_to_edit(null, true) && intval($visibility) == 0) {
api_not_allowed();
}
@ -73,22 +73,22 @@ if ($is_allowed_to_edit) {
$html = '';
$step = 1;
foreach ($list as $toc) {
$x = 1000*$step;
$x = 1000 * $step;
$html .= '<div id="step-'.$step.'" class="step slide" data-x="'.$x.'" data-y="-1500" >';
$html .= '<div class="impress-content">';
$src = $_SESSION['oLP']->get_link('http', $toc['id']);
if ($toc['type'] !== 'dir') {
//just showing the src in a iframe ...
$html .= '<h2>'.$toc['title'].'</h2>';
$html .= '<iframe border="0" frameborder="0" style="width:100%;height:600px" src="' . $src . '"></iframe>';
}else{
$html .= '<iframe border="0" frameborder="0" style="width:100%;height:600px" src="'.$src.'"></iframe>';
} else {
$html .= "<div class='impress-title'>";
$html .= '<h1>'.$toc['title'].'</h1>';
$html .= "</div>";
}
$html .= "</div>";
$html .= "</div>";
$step ++;
$step++;
}
//Setting the template

@ -109,7 +109,7 @@ if (!empty($users)) {
// View
$interbreadcrumb[] = [
'url' => api_get_path(WEB_CODE_PATH) . 'lp/lp_controller.php?'.api_get_cidreq(),
'url' => api_get_path(WEB_CODE_PATH).'lp/lp_controller.php?'.api_get_cidreq(),
'name' => get_lang('LearningPaths')
];
@ -120,7 +120,7 @@ $actions = Display::url(
array(),
ICON_SIZE_MEDIUM
),
api_get_path(WEB_CODE_PATH) . 'lp/lp_controller.php?' . api_get_cidreq()
api_get_path(WEB_CODE_PATH).'lp/lp_controller.php?'.api_get_cidreq()
);
$template = new Template(get_lang('StudentScore'));

@ -48,8 +48,8 @@ $current_uid = api_get_user_id();
// get message user id for inbox/outbox
$message_uid = '';
$message_type = array('inbox','outbox');
if (in_array($_GET['type'],$message_type)) {
$message_type = array('inbox', 'outbox');
if (in_array($_GET['type'], $message_type)) {
if ($_GET['type'] == 'inbox') {
$message_uid = $row_users['user_receiver_id'];
} else {
@ -63,7 +63,7 @@ $userGroup = new UserGroup();
if (!empty($row_users['group_id'])) {
$users_group = $userGroup->get_all_users_by_group($row_users['group_id']);
if (!in_array($current_uid,array_keys($users_group))) {
if (!in_array($current_uid, array_keys($users_group))) {
$not_allowed_to_edit = true;
}
} else {

@ -6,22 +6,22 @@
$cidReset = true;
require_once __DIR__.'/../inc/global.inc.php';
api_block_anonymous_users();
if (api_get_setting('allow_message_tool')!='true') {
if (api_get_setting('allow_message_tool') != 'true') {
api_not_allowed();
}
if (isset($_REQUEST['f']) && $_REQUEST['f'] == 'social') {
$this_section = SECTION_SOCIAL;
$interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/social/home.php','name' => get_lang('Social'));
$interbreadcrumb[]= array ('url' => 'inbox.php?f=social','name' => get_lang('Inbox'));
$interbreadcrumb[] = array('url' => api_get_path(WEB_PATH).'main/social/home.php', 'name' => get_lang('Social'));
$interbreadcrumb[] = array('url' => 'inbox.php?f=social', 'name' => get_lang('Inbox'));
} else {
$this_section = SECTION_MYPROFILE;
$interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/auth/profile.php','name' => get_lang('Profile'));
$interbreadcrumb[] = array('url' => api_get_path(WEB_PATH).'main/auth/profile.php', 'name' => get_lang('Profile'));
}
$social_right_content = '';
if (isset($_GET['f']) && $_GET['f']=='social') {
if (isset($_GET['f']) && $_GET['f'] == 'social') {
$social_parameter = '?f=social';
} else {
if (api_get_setting('extended_profile') == 'true') {
@ -33,11 +33,11 @@ if (isset($_GET['f']) && $_GET['f']=='social') {
}
if (api_get_setting('allow_message_tool') === 'true') {
$social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.
Display::return_icon('message_new.png',get_lang('ComposeMessage')).'</a>';
Display::return_icon('message_new.png', get_lang('ComposeMessage')).'</a>';
$social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.
Display::return_icon('inbox.png',get_lang('Inbox')).'</a>';
Display::return_icon('inbox.png', get_lang('Inbox')).'</a>';
$social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.
Display::return_icon('outbox.png',get_lang('Outbox')).'</a>';
Display::return_icon('outbox.png', get_lang('Outbox')).'</a>';
}
$social_right_content .= '</div>';
}
@ -53,7 +53,7 @@ if (empty($_GET['id'])) {
$show_menu = 'messages_inbox';
}
$message = '';
$message = '';
// LEFT COLUMN
if (api_get_setting('allow_social_tool') === 'true') {

@ -16,7 +16,7 @@ if ($userNotAllowed) {
api_not_allowed(true);
}
$interbreadcrumb[] = array ('url' => api_is_student_boss()?'#':'index.php', 'name' => get_lang('MySpace'));
$interbreadcrumb[] = array('url' => api_is_student_boss() ? '#' : 'index.php', 'name' => get_lang('MySpace'));
$tool_name = get_lang('Report');
$this_section = SECTION_TRACKING;
@ -42,13 +42,13 @@ $columns = array(
//Column config
$column_model = array(
array('name'=>'course', 'index'=>'title', 'width'=>'180', 'align'=>'left', 'wrap_cell' => 'true'),
array('name'=>'user', 'index'=>'user', 'width'=>'100', 'align'=>'left','sortable'=>'false', 'wrap_cell' => 'true'),
array('name'=>'email', 'index'=>'email', 'width'=>'100', 'align'=>'left','sortable'=>'false', 'wrap_cell' => 'true'),
array('name'=>'time', 'index'=>'time', 'width'=>'50', 'align'=>'left','sortable'=>'false'),
array('name'=>'certificate', 'index'=>'certificate', 'width'=>'50', 'align'=>'left','sortable'=>'false'),
array('name'=>'progress_100', 'index'=>'progress_100', 'width'=>'50', 'align'=>'left','sortable'=>'false'),
array('name'=>'progress', 'index'=>'progress', 'width'=>'50', 'align'=>'left','sortable'=>'false')
array('name'=>'course', 'index'=>'title', 'width'=>'180', 'align'=>'left', 'wrap_cell' => 'true'),
array('name'=>'user', 'index'=>'user', 'width'=>'100', 'align'=>'left', 'sortable'=>'false', 'wrap_cell' => 'true'),
array('name'=>'email', 'index'=>'email', 'width'=>'100', 'align'=>'left', 'sortable'=>'false', 'wrap_cell' => 'true'),
array('name'=>'time', 'index'=>'time', 'width'=>'50', 'align'=>'left', 'sortable'=>'false'),
array('name'=>'certificate', 'index'=>'certificate', 'width'=>'50', 'align'=>'left', 'sortable'=>'false'),
array('name'=>'progress_100', 'index'=>'progress_100', 'width'=>'50', 'align'=>'left', 'sortable'=>'false'),
array('name'=>'progress', 'index'=>'progress', 'width'=>'50', 'align'=>'left', 'sortable'=>'false')
);
if (!empty($extra_fields)) {
@ -67,7 +67,7 @@ if (!empty($extra_fields)) {
}
if (api_is_student_boss()) {
$column_model[] = array('name'=>'group', 'index'=>'group', 'width'=>'50', 'align'=>'left','sortable'=>'false');
$column_model[] = array('name'=>'group', 'index'=>'group', 'width'=>'50', 'align'=>'left', 'sortable'=>'false');
$columns[] = get_lang('Group');
}
@ -78,7 +78,7 @@ $extra_params['height'] = 'auto';
$htmlHeadXtra[] = '<script>
$(function() {
'.Display::grid_js('user_course_report', $url, $columns, $column_model, $extra_params, array(), null, true).'
'.Display::grid_js('user_course_report', $url, $columns, $column_model, $extra_params, array(), null, true).'
jQuery("#user_course_report").jqGrid("navGrid","#user_course_report_pager",{
view:false,
edit:false,
@ -102,11 +102,11 @@ $actions = null;
if (api_is_student_boss()) {
$actions .= Display::url(
Display::return_icon('stats.png', get_lang('MyStats'), '', ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH) . "auth/my_progress.php"
api_get_path(WEB_CODE_PATH)."auth/my_progress.php"
);
$actions .= Display::url(
Display::return_icon('user.png', get_lang('Students'), array(), ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH) . "mySpace/student.php"
api_get_path(WEB_CODE_PATH)."mySpace/student.php"
);
$actions .= Display::url(
Display::return_icon("statistics.png", get_lang("CompanyReport"), array(), ICON_SIZE_MEDIUM),
@ -119,7 +119,7 @@ if (api_is_student_boss()) {
[],
ICON_SIZE_MEDIUM
),
api_get_path(WEB_CODE_PATH) . "gradebook/certificate_report.php"
api_get_path(WEB_CODE_PATH)."gradebook/certificate_report.php"
);
}
@ -130,13 +130,13 @@ if (!empty($actions)) {
}
$content .= Display::url(
get_lang("CompanyReportResumed"),
api_get_path(WEB_CODE_PATH) . "mySpace/company_reports_resumed.php",
api_get_path(WEB_CODE_PATH)."mySpace/company_reports_resumed.php",
array(
'class' => 'btn btn-success'
)
);
$content .= '</div>';
$content .= '<h1 class="page-header">' . get_lang('CompanyReport') . '</h1>';
$content .= '<h1 class="page-header">'.get_lang('CompanyReport').'</h1>';
$content .= Display::grid_html('user_course_report');
$tpl = new Template($tool_name);

@ -15,7 +15,7 @@ if ($userNotAllowed) {
api_not_allowed(true);
}
$interbreadcrumb[] = array('url' => api_is_student_boss()?'#':'index.php', 'name' => get_lang('MySpace'));
$interbreadcrumb[] = array('url' => api_is_student_boss() ? '#' : 'index.php', 'name' => get_lang('MySpace'));
$tool_name = get_lang('Report');
$this_section = SECTION_TRACKING;
@ -89,15 +89,15 @@ $actions = null;
if (api_is_student_boss()) {
$actions .= Display::url(
Display::return_icon('stats.png', get_lang('MyStats'), '', ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH) . "auth/my_progress.php"
api_get_path(WEB_CODE_PATH)."auth/my_progress.php"
);
$actions .= Display::url(
Display::return_icon('user.png', get_lang('Students'), array(), ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH) . "mySpace/student.php"
api_get_path(WEB_CODE_PATH)."mySpace/student.php"
);
$actions .= Display::url(
Display::return_icon("statistics.png", get_lang("CompanyReport"), array(), ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH) . "mySpace/company_reports.php"
api_get_path(WEB_CODE_PATH)."mySpace/company_reports.php"
);
$actions .= Display::url(
Display::return_icon(
@ -106,7 +106,7 @@ if (api_is_student_boss()) {
[],
ICON_SIZE_MEDIUM
),
api_get_path(WEB_CODE_PATH) . "gradebook/certificate_report.php"
api_get_path(WEB_CODE_PATH)."gradebook/certificate_report.php"
);
}
@ -119,7 +119,7 @@ if (!empty($actions)) {
if (!api_is_student_boss()) {
$content .= Display::url(
get_lang("CompanyReport"),
api_get_path(WEB_CODE_PATH) . "mySpace/company_reports.php",
api_get_path(WEB_CODE_PATH)."mySpace/company_reports.php",
array(
'class' => 'btn btn-success'
)
@ -127,7 +127,7 @@ if (!api_is_student_boss()) {
}
$content .= '</div>';
$content .= '<h1 class="page-header">' . get_lang('CompanyReportResumed') . '</h1>';
$content .= '<h1 class="page-header">'.get_lang('CompanyReportResumed').'</h1>';
$content .= Display::grid_html('user_course_report');
$tpl = new Template($tool_name);

@ -16,7 +16,7 @@ $this_section = SECTION_TRACKING;
api_block_anonymous_users();
$htmlHeadXtra[] = api_get_jqgrid_js();
$interbreadcrumb[] = array ("url" => "index.php", "name" => get_lang('MySpace'));
$interbreadcrumb[] = array("url" => "index.php", "name" => get_lang('MySpace'));
Display::display_header(get_lang('Sessions'));
$export_csv = false;
@ -39,7 +39,7 @@ if (api_is_drh() || api_is_session_admin() || api_is_platform_admin()) {
if (!api_is_session_admin()) {
$menu_items[] = Display::url(
Display::return_icon('stats.png', get_lang('MyStats'), '', ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH) . "auth/my_progress.php"
api_get_path(WEB_CODE_PATH)."auth/my_progress.php"
);
$menu_items[] = Display::url(
Display::return_icon('user.png', get_lang('Students'), array(), ICON_SIZE_MEDIUM),
@ -61,11 +61,11 @@ if (api_is_drh() || api_is_session_admin() || api_is_platform_admin()) {
$menu_items[] = Display::url(
Display::return_icon('works.png', get_lang('WorksReport'), [], ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH) . 'mySpace/works_in_session_report.php'
api_get_path(WEB_CODE_PATH).'mySpace/works_in_session_report.php'
);
$menu_items[] = Display::url(
Display::return_icon('clock.png', get_lang('TeacherTimeReportBySession'), [], ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH) . 'admin/teachers_time_by_session_report.php'
api_get_path(WEB_CODE_PATH).'admin/teachers_time_by_session_report.php'
);
$actionsLeft = '';
@ -84,7 +84,7 @@ if (api_is_drh() || api_is_session_admin() || api_is_platform_admin()) {
);
$actionsRight .= Display::url(
Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), array(), 32),
api_get_self() . '?export=csv'
api_get_self().'?export=csv'
);
}
@ -99,7 +99,7 @@ if (api_is_drh() || api_is_session_admin() || api_is_platform_admin()) {
} elseif (api_is_teacher()) {
$actionsRight = Display::url(
Display::return_icon('clock.png', get_lang('TeacherTimeReportBySession'), [], ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH) . 'admin/teachers_time_by_session_report.php'
api_get_path(WEB_CODE_PATH).'admin/teachers_time_by_session_report.php'
);
$toolbar = Display::toolbarAction(
@ -139,10 +139,10 @@ $columns = array(
// Column config
$columnModel = array(
array('name'=>'name', 'index'=>'name', 'width'=>'255', 'align'=>'left'),
array('name'=>'date', 'index'=>'date', 'width'=>'150', 'align'=>'left','sortable'=>'false'),
array('name'=>'course_per_session', 'index'=>'course_per_session', 'width'=>'150','sortable'=>'false'),
array('name'=>'student_per_session', 'index'=>'student_per_session', 'width'=>'100','sortable'=>'false'),
array('name'=>'details', 'index'=>'details', 'width'=>'100','sortable'=>'false')
array('name'=>'date', 'index'=>'date', 'width'=>'150', 'align'=>'left', 'sortable'=>'false'),
array('name'=>'course_per_session', 'index'=>'course_per_session', 'width'=>'150', 'sortable'=>'false'),
array('name'=>'student_per_session', 'index'=>'student_per_session', 'width'=>'100', 'sortable'=>'false'),
array('name'=>'details', 'index'=>'details', 'width'=>'100', 'sortable'=>'false')
);
$extraParams = array(

@ -26,34 +26,34 @@ function store_permissions($content, $id) {
$course_id = api_get_course_int_id();
// Which database are we using (depending on the $content parameter)
if ($content=='user')
if ($content == 'user')
{
$table=Database::get_course_table(TABLE_PERMISSION_USER);
$table = Database::get_course_table(TABLE_PERMISSION_USER);
$id_field = user_id;
}
if ($content=='group')
if ($content == 'group')
{
$table=Database::get_course_table(TABLE_PERMISSION_GROUP);
$table = Database::get_course_table(TABLE_PERMISSION_GROUP);
$id_field = group_id;
}
if ($content=='role')
if ($content == 'role')
{
$table=Database::get_course_table(TABLE_ROLE_PERMISSION);
$table = Database::get_course_table(TABLE_ROLE_PERMISSION);
$id_field = role_id;
}
// We first delete all the existing permissions for that user/group/role
$sql="DELETE FROM $table WHERE c_id = $course_id AND $id_field = '".Database::escape_string($id)."'";
$result=Database::query($sql);
$sql = "DELETE FROM $table WHERE c_id = $course_id AND $id_field = '".Database::escape_string($id)."'";
$result = Database::query($sql);
// looping through the post values to find the permission (containing the string permission* )
foreach ($_POST as $key => $value)
{
if (strstr($key,"permission*"))
if (strstr($key, "permission*"))
{
list($brol,$tool,$action)=explode("*",$key);
$sql="INSERT INTO $table (c_id, $id_field,tool,action) VALUES ($course_id, '".Database::escape_string($id)."','".Database::escape_string($tool)."','".Database::escape_string($action)."')";
$result=Database::query($sql);
list($brol, $tool, $action) = explode("*", $key);
$sql = "INSERT INTO $table (c_id, $id_field,tool,action) VALUES ($course_id, '".Database::escape_string($id)."','".Database::escape_string($tool)."','".Database::escape_string($action)."')";
$result = Database::query($sql);
}
}
return get_lang('PermissionsStored');
@ -69,7 +69,7 @@ function store_permissions($content, $id) {
* @author Patrick Cool <patrick.cool@ugent.be>, Ghent University
* @version 1.0
*/
function store_one_permission($content, $action, $id, $tool,$permission) {
function store_one_permission($content, $action, $id, $tool, $permission) {
global $rights_full;
$course_id = api_get_course_int_id();
// for some reason I don't know, he can't get to the $rights_full array, so commented the following lines out.
@ -82,35 +82,35 @@ function store_one_permission($content, $action, $id, $tool,$permission) {
// Which database are we using (depending on the $content parameter)
if ($content=='user') {
$table=Database::get_course_table(TABLE_PERMISSION_USER);
if ($content == 'user') {
$table = Database::get_course_table(TABLE_PERMISSION_USER);
$id_field = user_id;
}
if ($content=='group')
if ($content == 'group')
{
$table=Database::get_course_table(TABLE_PERMISSION_GROUP);
$table = Database::get_course_table(TABLE_PERMISSION_GROUP);
$id_field = group_id;
}
if ($content=='role')
if ($content == 'role')
{
$table=Database::get_course_table(TABLE_ROLE_PERMISSION);
$table = Database::get_course_table(TABLE_ROLE_PERMISSION);
$id_field = role_id;
}
// grating a right
if ($action=='grant') {
$sql="INSERT INTO $table (c_id, $id_field,tool,action) VALUES ($course_id, '".Database::escape_string($id)."','".Database::escape_string($tool)."','".Database::escape_string($permission)."')";
$result=Database::query($sql);
if($result) {
$result_message=get_lang('PermissionGranted');
if ($action == 'grant') {
$sql = "INSERT INTO $table (c_id, $id_field,tool,action) VALUES ($course_id, '".Database::escape_string($id)."','".Database::escape_string($tool)."','".Database::escape_string($permission)."')";
$result = Database::query($sql);
if ($result) {
$result_message = get_lang('PermissionGranted');
}
}
if ($action=='revoke')
if ($action == 'revoke')
{
$sql="DELETE FROM $table WHERE c_id = $course_id AND $id_field = '".Database::escape_string($id)."' AND tool='".Database::escape_string($tool)."' AND action='".Database::escape_string($permission)."'";
$result=Database::query($sql);
if($result) {
$result_message=get_lang('PermissionRevoked');
$sql = "DELETE FROM $table WHERE c_id = $course_id AND $id_field = '".Database::escape_string($id)."' AND tool='".Database::escape_string($tool)."' AND action='".Database::escape_string($permission)."'";
$result = Database::query($sql);
if ($result) {
$result_message = get_lang('PermissionRevoked');
}
}
return $result_message;
@ -125,44 +125,44 @@ function store_one_permission($content, $action, $id, $tool,$permission) {
*/
function get_permissions($content, $id) {
$course_id = api_get_course_int_id();
$currentpermissions=array();
$currentpermissions = array();
// Which database are we using (depending on the $content parameter)
$course_id_condition = " c_id = $course_id AND ";
if ($content == 'user')
{
$table=Database::get_course_table(TABLE_PERMISSION_USER);
$table = Database::get_course_table(TABLE_PERMISSION_USER);
$id_field = 'user_id';
}
elseif ($content == 'group')
{
$table=Database::get_course_table(TABLE_PERMISSION_GROUP);
$table = Database::get_course_table(TABLE_PERMISSION_GROUP);
$id_field = 'group_id';
}
elseif ($content == 'role')
{
$table=Database::get_course_table(TABLE_ROLE_PERMISSION);
$table = Database::get_course_table(TABLE_ROLE_PERMISSION);
$id_field = 'role_id';
}
elseif ($content == 'platform_role')
{
$table=Database::get_main_table(TABLE_ROLE_PERMISSION);
$table = Database::get_main_table(TABLE_ROLE_PERMISSION);
$id_field = 'role_id';
$course_id_condition = '';
}
elseif ($content == 'task')
{
$table=Database::get_course_table(TABLE_BLOGS_TASKS_PERMISSIONS);
$table = Database::get_course_table(TABLE_BLOGS_TASKS_PERMISSIONS);
$id_field = 'task_id';
}
// finding all the permissions. We store this in a multidimensional array
// where the first dimension is the tool.
$sql="
SELECT * FROM " . $table . "
WHERE $course_id_condition " . $id_field . "='" . Database::escape_string($id) . "'";
$sql = "
SELECT * FROM " . $table."
WHERE $course_id_condition ".$id_field."='".Database::escape_string($id)."'";
$result = Database::query($sql);
while($row = Database::fetch_array($result))
while ($row = Database::fetch_array($result))
$currentpermissions[$row['tool']][] = $row['action'];
return $currentpermissions;
@ -179,7 +179,7 @@ function get_permissions($content, $id) {
*/
function limited_or_full($current_permissions)
{
if (api_get_setting('permissions')=='limited')
if (api_get_setting('permissions') == 'limited')
{
foreach ($current_permissions as $tool=>$tool_rights)
{
@ -187,15 +187,15 @@ function limited_or_full($current_permissions)
// if it is visibility or move we have to grant the edit right
foreach ($tool_rights as $key=>$value)
{
if ($value=='View')
if ($value == 'View')
{
unset($current_permissions[$tool][$key]);
}
if ($value=='Visibility' OR $value=='Move')
if ($value == 'Visibility' OR $value == 'Move')
{
if (!in_array('Edit',$current_permissions[$tool]))
if (!in_array('Edit', $current_permissions[$tool]))
{
$current_permissions[$tool][]='Edit';
$current_permissions[$tool][] = 'Edit';
}
unset($current_permissions[$tool][$key]);
}
@ -207,7 +207,7 @@ function limited_or_full($current_permissions)
}
return $current_permissions;
}
if (api_get_setting('permissions')=='full')
if (api_get_setting('permissions') == 'full')
{
return $current_permissions;
}
@ -222,12 +222,12 @@ function limited_or_full($current_permissions)
* @author Patrick Cool <patrick.cool@ugent.be>, Ghent University
* @version 1.0
*/
function display_checkbox_matrix($permission_array, $tool, $permission, $inherited_permissions=array())
function display_checkbox_matrix($permission_array, $tool, $permission, $inherited_permissions = array())
{
$checked="";
if (is_array($permission_array[$tool]) AND in_array($permission,$permission_array[$tool]))
$checked = "";
if (is_array($permission_array[$tool]) AND in_array($permission, $permission_array[$tool]))
{
$checked="checked";
$checked = "checked";
}
echo "\t\t\t<input type=\"checkbox\" name=\"permission*$tool*$permission\" $checked>\n";
@ -243,28 +243,28 @@ function display_checkbox_matrix($permission_array, $tool, $permission, $inherit
* @author Patrick Cool <patrick.cool@ugent.be>, Ghent University
* @version 1.0
*/
function display_image_matrix($permission_array, $tool, $permission,$inherited_permissions=array(), $course_admin=false, $editable=true)
function display_image_matrix($permission_array, $tool, $permission, $inherited_permissions = array(), $course_admin = false, $editable = true)
{
if ($course_admin) {
echo "\t\t\t<img src=\"../img/checkbox_on3.gif\" border=\"0\"/ title=\"".get_lang('PermissionGrantedByGroupOrRole')."\">";
} else {
if (in_array($permission,$inherited_permissions[$tool])) {
if (in_array($permission, $inherited_permissions[$tool])) {
echo "\t\t\t<img src=\"../img/checkbox_on3.gif\" border=\"0\"/ title=\"".get_lang('PermissionGrantedByGroupOrRole')."\">";
} else {
if (is_array($permission_array[$tool]) AND in_array($permission,$permission_array[$tool])) {
if (is_array($permission_array[$tool]) AND in_array($permission, $permission_array[$tool])) {
if ($editable) {
$url=api_get_self();
$url = api_get_self();
$urlparameters = '';
foreach($_GET as $key=>$value) {
$parameter[$key]=$value;
foreach ($_GET as $key=>$value) {
$parameter[$key] = $value;
}
$parameter['action']='revoke';
$parameter['permission']=$permission;
$parameter['tool']=$tool;
$parameter['action'] = 'revoke';
$parameter['permission'] = $permission;
$parameter['tool'] = $tool;
foreach ($parameter as $key=>$value) {
$urlparameters.=$key.'='.$value.'&amp;';
$urlparameters .= $key.'='.$value.'&amp;';
}
$url=$url.'?'.$urlparameters;
$url = $url.'?'.$urlparameters;
echo "\t\t\t <a href=\"".$url."\">";
}
@ -275,20 +275,20 @@ function display_image_matrix($permission_array, $tool, $permission,$inherited_p
} else {
if ($editable)
{
$url=api_get_self();
$url = api_get_self();
$urlparameters = '';
foreach ($_GET as $key=>$value)
{
$parameter[$key]=$value;
$parameter[$key] = $value;
}
$parameter['action']='grant';
$parameter['permission']=$permission;
$parameter['tool']=$tool;
$parameter['action'] = 'grant';
$parameter['permission'] = $permission;
$parameter['tool'] = $tool;
foreach ($parameter as $key=>$value)
{
$urlparameters.=$key.'='.$value.'&amp;';
$urlparameters .= $key.'='.$value.'&amp;';
}
$url=$url.'?'.$urlparameters;
$url = $url.'?'.$urlparameters;
//echo "\t\t\t <a href=\"".str_replace('&', '&amp;', $_SERVER['REQUEST_URI'])."&amp;action=grant&amp;permission=$permission&amp;tool=$tool\">";
echo "\t\t\t <a href=\"".$url."\">";
@ -315,7 +315,7 @@ function display_image_matrix($permission_array, $tool, $permission,$inherited_p
* @author Patrick Cool <patrick.cool@ugent.be>, Ghent University
* @version 1.0
*/
function display_image_matrix_for_blogs($permission_array, $user_id, $tool, $permission,$inherited_permissions=array(), $course_admin=false, $editable=true)
function display_image_matrix_for_blogs($permission_array, $user_id, $tool, $permission, $inherited_permissions = array(), $course_admin = false, $editable = true)
{
if ($course_admin)
@ -324,32 +324,32 @@ function display_image_matrix_for_blogs($permission_array, $user_id, $tool, $per
}
else
{
if (!empty($inherited_permissions) and in_array($permission,$inherited_permissions[$tool]))
if (!empty($inherited_permissions) and in_array($permission, $inherited_permissions[$tool]))
{
echo "\t\t\t<img src=\"../img/checkbox_on3.gif\" border=\"0\"/ title=\"".get_lang('PermissionGrantedByGroupOrRole')."\">";
}
else
{
if (is_array($permission_array[$tool]) AND in_array($permission,$permission_array[$tool]))
if (is_array($permission_array[$tool]) AND in_array($permission, $permission_array[$tool]))
{
if ($editable)
{
$url = api_get_self();
$urlparameters = '';
foreach($_GET as $key => $value)
foreach ($_GET as $key => $value)
{
$parameter[$key] = $value;
}
$parameter['action']='manage_rights';
$parameter['do']='revoke';
$parameter['permission']=$permission;
$parameter['tool']=$tool;
$parameter['user_id']=$user_id;
$parameter['action'] = 'manage_rights';
$parameter['do'] = 'revoke';
$parameter['permission'] = $permission;
$parameter['tool'] = $tool;
$parameter['user_id'] = $user_id;
foreach ($parameter as $key=>$value)
{
$urlparameters .= $key . '=' . $value . '&amp;';
$urlparameters .= $key.'='.$value.'&amp;';
}
$url = $url . '?' . $urlparameters;
$url = $url.'?'.$urlparameters;
echo "\t\t\t <a href=\"".$url."\">";
}
@ -362,17 +362,17 @@ function display_image_matrix_for_blogs($permission_array, $user_id, $tool, $per
$url = api_get_self();
$urlparameters = '';
foreach ($_GET as $key=>$value) {
$parameter[$key]=$value;
$parameter[$key] = $value;
}
$parameter['action']='manage_rights';
$parameter['do']='grant';
$parameter['permission']=$permission;
$parameter['tool']=$tool;
$parameter['user_id']=$user_id;
$parameter['action'] = 'manage_rights';
$parameter['do'] = 'grant';
$parameter['permission'] = $permission;
$parameter['tool'] = $tool;
$parameter['user_id'] = $user_id;
foreach ($parameter as $key=>$value) {
$urlparameters .= $key . '=' . $value . '&amp;';
$urlparameters .= $key.'='.$value.'&amp;';
}
$url=$url.'?'.$urlparameters;
$url = $url.'?'.$urlparameters;
//echo "\t\t\t <a href=\"".str_replace('&', '&amp;', $_SERVER['REQUEST_URI'])."&amp;action=grant&amp;permission=$permission&amp;tool=$tool\">";
echo "\t\t\t <a href=\"".$url."\">";
@ -397,30 +397,30 @@ function display_role_list($current_course_roles, $current_platform_roles)
global $setting_visualisation;
$course_id = api_get_course_int_id();
$coures_roles_table=Database::get_course_table(TABLE_ROLE);
$coures_roles_table = Database::get_course_table(TABLE_ROLE);
// course roles
$sql="SELECT * FROM $coures_roles_table WHERE c_id = $course_id ";
$result=Database::query($sql);
while ($row=Database::fetch_array($result))
$sql = "SELECT * FROM $coures_roles_table WHERE c_id = $course_id ";
$result = Database::query($sql);
while ($row = Database::fetch_array($result))
{
if (in_array($row['role_id'], $current_course_roles))
{
$checked='checked';
$image='checkbox_on2.gif';
$action='revoke';
$checked = 'checked';
$image = 'checkbox_on2.gif';
$action = 'revoke';
}
else
{
$checked='';
$image='wrong.gif';
$action='grant';
$checked = '';
$image = 'wrong.gif';
$action = 'grant';
}
if ($setting_visualisation=='checkbox')
if ($setting_visualisation == 'checkbox')
{
echo "<input type=\"checkbox\" name=\"role*course*".$row['role_id']."\" $checked>";
}
if ($setting_visualisation=='image')
if ($setting_visualisation == 'image')
{
echo "<a href=\"".str_replace('&', '&amp;', $_SERVER['REQUEST_URI'])."&amp;action=$action&amp;role=".$row['role_id']."&amp;scope=course\"><img src=\"../img/".$image."\" border=\"0\"/></a>";
}
@ -440,24 +440,24 @@ function display_role_list($current_course_roles, $current_platform_roles)
* @author Patrick Cool <patrick.cool@ugent.be>, Ghent University
* @version 1.0
*/
function get_roles($content,$id, $scope='course') {
$course_id = api_get_course_int_id();
if ($content=='user') {
$table=Database::get_course_table(TABLE_ROLE_USER);
function get_roles($content, $id, $scope = 'course') {
$course_id = api_get_course_int_id();
if ($content == 'user') {
$table = Database::get_course_table(TABLE_ROLE_USER);
$id_field = user_id;
}
if ($content=='group') {
$table=Database::get_course_table(TABLE_ROLE_GROUP);
if ($content == 'group') {
$table = Database::get_course_table(TABLE_ROLE_GROUP);
$id_field = 'group_id';
}
$table_role=Database::get_course_table(TABLE_ROLE);
$table_role = Database::get_course_table(TABLE_ROLE);
$current_roles=array();
$current_roles = array();
//$sql="SELECT role.role_id FROM $table role_group_user, $table_role role WHERE role_group_user.$id_field = '$id' AND role_group_user.role_id=role.role_id AND role_group_user.scope='".$scope."'";$sql="SELECT role.role_id FROM $table role_group_user, $table_role role WHERE role_group_user.$id_field = '$id' AND role_group_user.role_id=role.role_id AND role_group_user.scope='".$scope."'";
$sql="SELECT role_id FROM $table WHERE c_id = $course_id AND $id_field = '$id' AND scope='".$scope."'";
$result=Database::query($sql);
while ($row=Database::fetch_array($result)) {
$current_roles[]=$row['role_id'];
$sql = "SELECT role_id FROM $table WHERE c_id = $course_id AND $id_field = '$id' AND scope='".$scope."'";
$result = Database::query($sql);
while ($row = Database::fetch_array($result)) {
$current_roles[] = $row['role_id'];
}
return $current_roles;
}
@ -468,26 +468,26 @@ function get_roles($content,$id, $scope='course') {
* @author Patrick Cool <patrick.cool@ugent.be>, Ghent University
* @version 1.0
*/
function get_all_roles($content='course') {
function get_all_roles($content = 'course') {
$course_id = api_get_course_int_id();
$course_id_condition = " WHERE c_id = $course_id ";
if ($content=='course')
if ($content == 'course')
{
$table_role=Database::get_course_table(TABLE_ROLE);
$table_role = Database::get_course_table(TABLE_ROLE);
}
if ($content=='platform')
if ($content == 'platform')
{
$table_role=Database::get_main_table(TABLE_ROLE);
$table_role = Database::get_main_table(TABLE_ROLE);
$course_id_condition = '';
}
$current_roles=array();
$sql="SELECT * FROM $table_role $course_id_condition ";
$result=Database::query($sql);
while ($row=Database::fetch_array($result))
$current_roles = array();
$sql = "SELECT * FROM $table_role $course_id_condition ";
$result = Database::query($sql);
while ($row = Database::fetch_array($result))
{
$roles[]=$row;
$roles[] = $row;
}
return $roles;
@ -504,10 +504,10 @@ function get_all_roles($content='course') {
* @author Patrick Cool <patrick.cool@ugent.be>, Ghent University
* @version 1.0
*/
function get_roles_permissions($content,$id, $scope='course') {
function get_roles_permissions($content, $id, $scope = 'course') {
$course_id = api_get_course_int_id();
if ($content == 'user') {
$table=Database::get_course_table(TABLE_ROLE_USER);
$table = Database::get_course_table(TABLE_ROLE_USER);
$id_field = 'user_id';
}
@ -536,21 +536,21 @@ function get_roles_permissions($content,$id, $scope='course') {
$sql = "
SELECT *
FROM
" . $table . " role_group_user,
" . $table_role . " role,
" . $table_role_permissions . " role_permissions
" . $table." role_group_user,
" . $table_role." role,
" . $table_role_permissions." role_permissions
WHERE
role_group_user.c_id = $course_id AND
$role_condition
role_group_user.scope = '" . $scope . "' AND
role_group_user." . $id_field . " = '" . $id . "' AND
role_group_user.scope = '".$scope."' AND
role_group_user." . $id_field." = '".$id."' AND
role_group_user.role_id = role.role_id AND
role.role_id = role_permissions.role_id";
$result = Database::query($sql);
$current_role_permissions = array();
while ($row=Database::fetch_array($result)) {
$current_role_permissions[$row['tool']][]=$row['action'];
while ($row = Database::fetch_array($result)) {
$current_role_permissions[$row['tool']][] = $row['action'];
}
return $current_role_permissions;
}
@ -564,33 +564,33 @@ function get_roles_permissions($content,$id, $scope='course') {
* @author Patrick Cool <patrick.cool@ugent.be>, Ghent University
*/
function assign_role($content, $action, $id, $role_id, $scope='course') {
function assign_role($content, $action, $id, $role_id, $scope = 'course') {
$course_id = api_get_course_int_id();
// Which database are we using (depending on the $content parameter)
if ($content=='user') {
$table=Database::get_course_table(TABLE_ROLE_USER);
if ($content == 'user') {
$table = Database::get_course_table(TABLE_ROLE_USER);
$id_field = 'user_id';
} elseif($content=='group') {
$table=Database::get_course_table(TABLE_ROLE_GROUP);
} elseif ($content == 'group') {
$table = Database::get_course_table(TABLE_ROLE_GROUP);
$id_field = 'group_id';
} else {
return get_lang('Error');
}
// grating a right
if ($action=='grant') {
$sql="INSERT INTO $table (c_id, role_id, scope, $id_field) VALUES ($course_id, '".Database::escape_string($role_id)."','".Database::escape_string($scope)."','".Database::escape_string($id)."')";
$result=Database::query($sql);
if ($action == 'grant') {
$sql = "INSERT INTO $table (c_id, role_id, scope, $id_field) VALUES ($course_id, '".Database::escape_string($role_id)."','".Database::escape_string($scope)."','".Database::escape_string($id)."')";
$result = Database::query($sql);
if ($result) {
$result_message=get_lang('RoleGranted');
$result_message = get_lang('RoleGranted');
}
}
if ($action=='revoke') {
$sql="DELETE FROM $table WHERE c_id = $course_id AND $id_field = '".Database::escape_string($id)."' AND role_id='".Database::escape_string($role_id)."'";
$result=Database::query($sql);
if ($action == 'revoke') {
$sql = "DELETE FROM $table WHERE c_id = $course_id AND $id_field = '".Database::escape_string($id)."' AND role_id='".Database::escape_string($role_id)."'";
$result = Database::query($sql);
if ($result) {
$result_message=get_lang('RoleRevoked');
$result_message = get_lang('RoleRevoked');
}
}
return $result_message;
@ -607,7 +607,7 @@ function permission_array_merge($array1, $array2)
{
foreach ($permissions as $permissionkey=>$permissionvalue)
{
$array1[$tool][]=$permissionvalue;
$array1[$tool][] = $permissionvalue;
}
}
return $array1;

@ -5,7 +5,7 @@
* @license see /license.txt
* @author Laurent Opprecht <laurent@opprecht.info> for the Univesity of Geneva
*/
require_once __DIR__ . '/../inc/global.inc.php';
require_once __DIR__.'/../inc/global.inc.php';
$has_access = api_protect_course_script();
if (!$has_access) {

@ -135,14 +135,14 @@ Display::display_header($tool_name);
<select class="input_field_12em link required" name="type" id="type">
<?php
foreach ($reports_template as $key => $value) {
echo '<option value="'.$key.'">'.$value['description'].'</option>';
echo '<option value="'.$key.'">'.$value['description'].'</option>';
}
?>
</select><br />
</span>
<?php
foreach ($reports_template as $key => $value) {
echo $value['wizard'];
echo $value['wizard'];
}
?>
<span id="format" class="step submit_step">

@ -28,7 +28,7 @@ if (empty($sessionId) || empty($userId)) {
}
$interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList'));
$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList'));
$interbreadcrumb[] = array(
'url' => "resume_session.php?id_session=".$sessionId,
"name" => get_lang('SessionOverview')
@ -60,7 +60,7 @@ if (count($userAccess) == 0) {
if ($days > 0) {
$msg = sprintf(get_lang('FirstAccessWasXSessionDurationYEndDateInZDays'), $firstAccessString, $duration, $days);
} else {
$endDateInSeconds = $firstAccess + $duration * 24*60*60;
$endDateInSeconds = $firstAccess + $duration * 24 * 60 * 60;
$last = api_convert_and_format_date($endDateInSeconds, DATE_FORMAT_SHORT);
$msg = sprintf(get_lang('FirstAccessWasXSessionDurationYEndDateWasZ'), $firstAccessString, $duration, $last);
}

@ -17,8 +17,8 @@ if (api_get_setting('allow_social_tool') != 'true') {
$tok = Security::get_token();
if (isset($_REQUEST['user_friend'])) {
$info_user_friend=array();
$info_path_friend=array();
$info_user_friend = array();
$info_path_friend = array();
$userfriend_id = intval($_REQUEST['user_friend']);
$info_user_friend = api_get_user_info($userfriend_id);
$info_path_friend = UserManager::get_user_picture_path_by_id($userfriend_id, 'web');
@ -28,7 +28,7 @@ $group_id = isset($_GET['group_id']) ? intval($_GET['group_id']) : null;
$message_id = isset($_GET['message_id']) ? intval($_GET['message_id']) : null;
$actions = array('add_message_group', 'edit_message_group', 'reply_message_group');
$allowed_action = isset($_GET['action']) && in_array($_GET['action'],$actions) ? Security::remove_XSS($_GET['action']):'';
$allowed_action = isset($_GET['action']) && in_array($_GET['action'], $actions) ? Security::remove_XSS($_GET['action']) : '';
$to_group = '';
$subject = '';
@ -54,13 +54,13 @@ if (!empty($group_id) && $allowed_action) {
}
}
$page_item = !empty($_GET['topics_page_nr']) ? intval($_GET['topics_page_nr']):1;
$param_item_page = isset($_GET['items_page_nr']) && isset($_GET['topic_id']) ? ('&items_'.intval($_GET['topic_id']).'_page_nr='.(!empty($_GET['topics_page_nr'])?intval($_GET['topics_page_nr']):1)):'';
$page_item = !empty($_GET['topics_page_nr']) ? intval($_GET['topics_page_nr']) : 1;
$param_item_page = isset($_GET['items_page_nr']) && isset($_GET['topic_id']) ? ('&items_'.intval($_GET['topic_id']).'_page_nr='.(!empty($_GET['topics_page_nr']) ? intval($_GET['topics_page_nr']) : 1)) : '';
if (isset($_GET['topic_id'])) {
$param_item_page .= '&topic_id='.intval($_GET['topic_id']);
}
$page_topic = isset($_GET['topics_page_nr']) ? intval($_GET['topics_page_nr']) : 1;
$anchor_topic = isset($_GET['anchor_topic']) ? Security::remove_XSS($_GET['anchor_topic']) : null;
$page_topic = isset($_GET['topics_page_nr']) ? intval($_GET['topics_page_nr']) : 1;
$anchor_topic = isset($_GET['anchor_topic']) ? Security::remove_XSS($_GET['anchor_topic']) : null;
$url = api_get_path(WEB_CODE_PATH).'social/group_topics.php?id='.$group_id.'&anchor_topic='.$anchor_topic.'&topics_page_nr='.$page_topic.$param_item_page;
@ -96,7 +96,7 @@ if (api_get_setting('allow_message_tool') === 'true') {
'
<div id="link-more-attach">
<a class="btn btn-default" href="javascript://" onclick="return add_image_form()">
' . get_lang('AddOneMoreFile') . '
' . get_lang('AddOneMoreFile').'
</a>
</div>
'

@ -14,7 +14,7 @@ $isStudentBoss = api_is_student_boss();
$isDRH = api_is_drh();
if (!$isStudent && !$isStudentBoss && !$isDRH) {
header('Location: ' . api_get_path(WEB_CODE_PATH) . 'social/skills_wheel.php');
header('Location: '.api_get_path(WEB_CODE_PATH).'social/skills_wheel.php');
exit;
}

@ -100,7 +100,7 @@ if ($_GET['action'] == 'edit' && isset($survey_id) && is_numeric($survey_id)) {
$form = new FormValidator(
'survey',
'post',
api_get_self().'?action='.Security::remove_XSS($_GET['action']).'&survey_id='.$survey_id. '&' . api_get_cidreq()
api_get_self().'?action='.Security::remove_XSS($_GET['action']).'&survey_id='.$survey_id.'&'.api_get_cidreq()
);
$form->addElement('header', $tool_name);
@ -216,7 +216,7 @@ if (isset($_GET['action']) && $_GET['action'] == 'edit' && !empty($survey_id)) {
foreach ($field_list as $key => & $field) {
if ($field['visibility'] == 1) {
$form->addElement('checkbox', 'profile_'.$key, ' ', '&nbsp;&nbsp;'.$field['name']);
$input_name_list.= 'profile_'.$key.',';
$input_name_list .= 'profile_'.$key.',';
}
}

@ -6,8 +6,7 @@
* @author unknown, the initial survey that did not make it in 1.8 because of bad code
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University: cleanup, refactoring and rewriting large parts of the code
* @author Julio Montoya Armas <gugli100@gmail.com>, Chamilo: Personality Test modification and rewriting large parts of the code as well
* @todo check if the user already filled the survey and if this is the case then the answers have to be updated and not stored again.
* @todo check if the user already filled the survey and if this is the case then the answers have to be updated and not stored again.
* @todo performance could be improved if not the survey_id was stored with the invitation but the survey_code
*/
// Unsetting the course id (because it is in the URL)

@ -2054,22 +2054,28 @@ class SurveyUtil
* This function saves all the invitations of course users and additional users in the database
* and sends the invitations by email
*
* @param array Users array can be both a list of course uids AND a list of additional emailaddresses
* @param string Title of the invitation, used as the title of the mail
* @param string Text of the invitation, used as the text of the mail.
* The text has to contain a **link** string or this will automatically be added to the end
* @param $users_array Users $array array can be both a list of course uids AND a list of additional emailaddresses
* @param $invitation_title Title $string of the invitation, used as the title of the mail
* @param $invitation_text Text $string of the invitation, used as the text of the mail.
* The text has to contain a **link** string or this will automatically be added to the end
* @param int $reminder
* @param bool $sendmail
* @param int $remindUnAnswered
* @return int
* @internal param
* @internal param
* @internal param
* The text has to contain a **link** string or this will automatically be added to the end
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
* @author Julio Montoya - Adding auto-generated link support
* @version January 2007
*
*/
public static function saveInvitations(
$users_array,
$invitation_title,
$invitation_text,
$reminder = 0,
$sendmail = 0,
$sendmail = false,
$remindUnAnswered = 0
) {
if (!is_array($users_array)) {
@ -2163,7 +2169,7 @@ class SurveyUtil
}
// Send the email if checkboxed
if (($new_user || $reminder == 1) && $sendmail != 0) {
if (($new_user || $reminder == 1) && $sendmail) {
// Make a change for absolute url
if (isset($invitation_text)) {
$invitation_text = api_html_entity_decode($invitation_text, ENT_QUOTES);

@ -171,7 +171,12 @@ $form->addElement('label', null, $auto_survey_link);
if ($form->validate()) {
$values = $form->exportValues();
if (isset($values['send_mail']) && $values['send_mail'] == 1) {
$resendAll = isset($values['resend_to_all']) ? $values['resend_to_all'] : '';
$sendMail = isset($values['send_mail']) ? $values['send_mail'] : '';
$remindUnAnswered = isset($values['remindUnAnswered']) ? $values['remindUnAnswered'] : '';
if ($sendMail) {
if (empty($values['mail_title']) || empty($values['mail_text'])) {
Display :: display_error_message(get_lang('FormHasErrorsPleaseComplete'));
// Getting the invited users
@ -197,10 +202,6 @@ if ($form->validate()) {
!empty($survey_data['invite_mail'])
);
$resendAll = isset($values['resend_to_all']) ? $values['resend_to_all'] : '';
$sendMail = isset($values['send_mail']) ? $values['send_mail'] : '';
$remindUnAnswered = isset($values['remindUnAnswered']) ? $values['remindUnAnswered'] : '';
// Saving the invitations for the course users
$count_course_users = SurveyUtil::saveInvitations(
$values['users'],
@ -248,8 +249,12 @@ if ($form->validate()) {
$message .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_invitation.php?view=invited&survey_id='.$survey_data['survey_id'].'">'.
$total_invited.'</a> ';
$message .= get_lang('WereInvited');
Display::display_normal_message($message, false);
Display::display_confirmation_message($total_count.' '.get_lang('InvitationsSend'));
echo Display::return_message($message, 'normal', false);
if ($sendMail) {
echo Display::return_message($total_count.' '.get_lang('InvitationsSend'), 'success', false);
}
}
} else {
// Getting the invited users

@ -8,124 +8,140 @@
});
});
</script>
<div class="col-md-12">
<h3>{{ 'Sessions'|get_lang }}</h3>
<div class="search-session">
<div class="row">
<div class="col-md-{{ show_courses ? '4' : '6' }}">
<form class="form-inline" method="post" action="{{ _p.web_self }}?action=display_sessions">
<div class="form-group">
<label>{{ "ByDate"|get_lang }}</label>
<div class="input-group">
<input type="date" name="date" id="date" title="{{ 'Date'|get_lang }}" class="form-control" value="{{ search_date }}" readonly>
<span class="input-group-btn">
<button class="btn btn-default" type="submit"><em class="fa fa-search"></em> {{ 'Search'|get_lang }}</button>
</span>
</div>
</div>
</form>
</div>
<div class="col-md-{{ show_courses ? '4' : '6' }}">
<form class="form-inline" method="post" action="{{ _p.web_self }}?action=search_tag">
<label>{{ "ByTag"|get_lang }}</label>
<div class="input-group">
<input type="text" name="search_tag" title="{{ 'ByTag'|get_lang }}" class="form-control" value="{{ search_tag }}" />
<span class="input-group-btn">
<button class="btn btn-default" type="submit"><em class="fa fa-search"></em> {{ 'Search'|get_lang }}</button>
</span>
</div>
</form>
</div>
{% if show_courses %}
<div class="col-md-4">
<a class="btn btn-default btn-block btn-catalog" href="{{ _p.web_self }}">
{{ "CourseManagement"|get_lang }}
</a>
</div>
{% endif %}
</div>
</div>
</div>
<!-- new view session grib -->
<div class="grid-courses col-md-12">
<div class="row">
{% for item in sessions %}
<div class="col-md-3 col-sm-6 col-xs-6">
<div id="session-{{ item.id }}" class="items">
<div class="image">
<img class="img-responsive" src="{{ item.image ? _p.web_upload ~ item.image : 'session_default.png'|icon() }}">
{% if item.category != '' %}
<span class="category">{{ item.category }}</span>
<div class="cribbon"></div>
{% endif %}
<div class="black-shadow">
{% if show_tutor %}
<div class="author-card">
<a href="{{ item.coach_url }}" class="ajax" data-title="{{ item.coach_name }}">
<img src="{{ item.coach_avatar }}"/>
</a>
<div class="teachers-details">
<h5>
<a href="{{ item.coach_url }}" class="ajax" data-title="{{ item.coach_name }}">
{{ item.coach_name }}
</a>
</h5>
</div>
</div>
{% endif %}
<div class="session-date">
<i class="fa fa-calendar-o" aria-hidden="true"></i> {{ item.date }}
</div>
<div class="col-md-12">
<h3 class="page-header">{{ 'Sessions'|get_lang }}</h3>
<div class="search-session">
<div class="row">
<div class="col-md-{{ show_courses ? '4' : '6' }}">
<form class="form-inline" method="post" action="{{ _p.web_self }}?action=display_sessions">
<div class="form-group">
<label>{{ "ByDate"|get_lang }}</label>
<div class="input-group">
<input type="date" name="date" id="date" title="{{ 'Date'|get_lang }}"
class="form-control" value="{{ search_date }}" readonly>
<span class="input-group-btn">
<button class="btn btn-default" type="submit">
<em class="fa fa-search"></em> {{ 'Search'|get_lang }}
</button>
</span>
</div>
</div>
</form>
</div>
<div class="admin-actions">
<div class="btn-group" role="group">
{% if item.edit_actions != '' %}
<a class="btn btn-default btn-sm" href="{{ item.edit_actions }}">
<i class="fa fa-pencil" aria-hidden="true"></i>
</a>
{% endif %}
{% if item.is_subscribed %}
{{ already_subscribed_label }}
{% endif %}
</div>
<div class="col-md-{{ show_courses ? '4' : '6' }}">
<form class="form-inline" method="post" action="{{ _p.web_self }}?action=search_tag">
<label>{{ "ByTag"|get_lang }}</label>
<div class="input-group">
<input type="text" name="search_tag" title="{{ 'ByTag'|get_lang }}" class="form-control"
value="{{ search_tag }}"/>
<span class="input-group-btn">
<button class="btn btn-default" type="submit">
<em class="fa fa-search"></em> {{ 'Search'|get_lang }}
</button>
</span>
</div>
</form>
</div>
</div>
<div class="description">
<h4 class="title">
<a href="{{ _p.web ~ 'session/' ~ item.id ~ '/about/' }}" title="{{ item.name }}">
{{ item.name }}
</a>
</h4>
<div class="toolbar">
<div class="left">
{% if item.price %}
{{ item.price }}
{% endif %}
</div>
<br />
<div class="info">
<span><i class="fa fa-book" aria-hidden="true"></i> {{ item.nbr_courses }} {{ 'Courses'|get_lang }}</span>
<span><i class="fa fa-user" aria-hidden="true"></i> {{ item.nbr_users }} {{ 'NbUsers'|get_lang }} </span>
{% if show_courses %}
<div class="col-md-4">
<a class="btn btn-default btn-block" href="{{ _p.web_self }}">
{{ "CourseManagement"|get_lang }}
</a>
</div>
{% if not _u.logged %}
&nbsp;
{% else %}
<div class="btn-group btn-group-sm" role="group">
{% if item.sequences is empty %}
&nbsp;
{% else %}
<a class="btn btn-default btn-sm" role="button" title="{{ 'SeeSequences'|get_lang }}" data-toggle="popover" id="session-{{ item.id }}-sequences"><i class="fa fa-sitemap" aria-hidden="true"></i></a>
{% endif %}
{% if item.is_subscribed == false %}
{{ item.subscribe_button }}
{% endif %}
</div>
{% endif %}
</div>
{% endif %}
</div>
{% if _u.logged %}
</div>
</div>
</div>
<!-- new view session grib -->
<div class="row">
<div class="grid-courses col-md-12">
<div class="row">
{% for item in sessions %}
<div class="col-md-3 col-sm-6 col-xs-6">
<div id="session-{{ item.id }}" class="items">
<div class="image">
<img class="img-responsive"
src="{{ item.image ? _p.web_upload ~ item.image : 'session_default.png'|icon() }}">
{% if item.category != '' %}
<span class="category">{{ item.category }}</span>
<div class="cribbon"></div>
{% endif %}
<div class="black-shadow">
{% if show_tutor %}
<div class="author-card">
<a href="{{ item.coach_url }}" class="ajax" data-title="{{ item.coach_name }}">
<img src="{{ item.coach_avatar }}"/>
</a>
<div class="teachers-details">
<h5>
<a href="{{ item.coach_url }}" class="ajax"
data-title="{{ item.coach_name }}">
{{ item.coach_name }}
</a>
</h5>
</div>
</div>
{% endif %}
<div class="session-date">
<i class="fa fa-calendar-o" aria-hidden="true"></i> {{ item.date }}
</div>
</div>
<div class="admin-actions">
<div class="btn-group" role="group">
{% if item.edit_actions != '' %}
<a class="btn btn-default btn-sm" href="{{ item.edit_actions }}">
<i class="fa fa-pencil" aria-hidden="true"></i>
</a>
{% endif %}
{% if item.is_subscribed %}
{{ already_subscribed_label }}
{% endif %}
</div>
</div>
</div>
<div class="description">
<h4 class="title">
<a href="{{ _p.web ~ 'session/' ~ item.id ~ '/about/' }}" title="{{ item.name }}">
{{ item.name }}
</a>
</h4>
<div class="toolbar">
<div class="left">
{% if item.price %}
{{ item.price }}
{% endif %}
</div>
<br/>
<ul class="info list-inline">
<li>
<i class="fa fa-book" aria-hidden="true"></i>
{{ item.nbr_courses ~ ' ' ~ 'Courses'|get_lang }}
</li>
<li>
<i class="fa fa-user" aria-hidden="true"></i>
{{ item.nbr_users ~ ' ' ~ 'NbUsers'|get_lang }}
</li>
</ul>
{% if _u.logged %}
<div class="btn-group btn-group-sm" role="group">
{% if not item.sequences is empty %}
<a class="btn btn-default btn-sm" role="button"
title="{{ 'SeeSequences'|get_lang }}" data-toggle="popover"
id="session-{{ item.id }}-sequences">
<i class="fa fa-sitemap" aria-hidden="true"></i>
</a>
{% endif %}
{% if item.is_subscribed == false %}
{{ item.subscribe_button }}
{% endif %}
</div>
{% endif %}
</div>
</div>
{% if _u.logged %}
<script>
$('#session-{{ item.id }}-sequences').popover({
placement: 'bottom',
@ -171,22 +187,24 @@
{% else %}
content = "{{ 'NoDependencies'|get_lang }}";
{% endif %}
return content;
}
});
</script>
{% endif %}
{% endif %}
</div>
</div>
{% else %}
<div class="col-xs-12">
<div class="alert alert-warning">
{{ 'NoResults'|get_lang }}
</div>
</div>
{% endfor %}
</div>
</div>
{% else %}
<div class="col-xs-12">
<div class="alert alert-warning">
{{ 'NoResults'|get_lang }}
</div>
</div>
{% endfor %}
</div>
</div>
<!-- end view session grib -->
{{ catalog_pagination }}
{% endblock %}
<!-- end view session grib -->
{{ catalog_pagination }}
{% endblock %}

@ -21,7 +21,7 @@ function initializeReport($course_code)
$table_post = Database::get_course_table(TABLE_FORUM_POST);
$table_work = Database::get_course_table(TABLE_STUDENT_PUBLICATION);
$course_code = Database::escape_string($course_code);
$res = Database::query("SELECT COUNT(*) as cant FROM $table_reporte_semanas WHERE course_code = '" . $course_code . "'");
$res = Database::query("SELECT COUNT(*) as cant FROM $table_reporte_semanas WHERE course_code = '".$course_code."'");
$sqlWeeks = "SELECT semanas FROM $table_semanas_curso WHERE course_code = '$course_code'";
$resWeeks = Database::query($sqlWeeks);
$weeks = Database::fetch_object($resWeeks);
@ -167,7 +167,7 @@ function showResults($courseInfo, $weeksCount, $page)
if ($row['week_id'] > (($page - 1) * 7) && $row['week_id'] <= (7 * $page)) {
$results[$row['username']][$row['week_id']] = $row;
if (count($results[$row['username']]) == 7) {
$html.= showStudentResult($results[$row['username']], $page);
$html .= showStudentResult($results[$row['username']], $page);
}
}
if (count($resultadose[$row['username']]) == $weeksCount) {

@ -99,7 +99,7 @@ $extra_params['height'] = 'auto';
$action_links = '
function action_formatter(cellvalue, options, rowObject) {
return \'<a href="course_log_tools.php?id_session=0&cidReq='.$course_code.'&gidReq=\'+options.rowId+\'">'.Display::return_icon('2rightarrow.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>'.
return \'<a href="course_log_tools.php?id_session=0&cidReq='.$course_code.'&gidReq=\'+options.rowId+\'">'.Display::return_icon('2rightarrow.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>'.
'\';
}';
@ -109,7 +109,7 @@ $htmlHeadXtra[] = api_get_jqgrid_js();
$htmlHeadXtra[] = '
<script>
$(function() {
'.Display::grid_js('group_users',$url, $columns, $column_model, $extra_params, array(), $action_links, true).'
'.Display::grid_js('group_users', $url, $columns, $column_model, $extra_params, array(), $action_links, true).'
});
</script>';

@ -42,8 +42,8 @@ if (empty($session_id)) {
// Breadcrumbs.
if (isset($_GET['origin']) && $_GET['origin'] == 'resume_session') {
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'admin/index.php','name' => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'session/session_list.php','name' => get_lang('SessionList'));
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'admin/index.php', 'name' => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'session/session_list.php', 'name' => get_lang('SessionList'));
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'session/resume_session.php?id_session='.api_get_session_id(), 'name' => get_lang('SessionOverview'));
}
@ -73,21 +73,21 @@ echo Display::url(
echo Display::return_icon('tools_na.png', get_lang('ResourcesTracking'), array(), ICON_SIZE_MEDIUM);
echo '<span style="float:right; padding-top:0px;">';
echo '<a href="javascript: void(0);" onclick="javascript: window.print();">'.
Display::return_icon('printer.png', get_lang('Print'),'',ICON_SIZE_MEDIUM).
Display::return_icon('printer.png', get_lang('Print'), '', ICON_SIZE_MEDIUM).
'</a>';
$addional_param = '';
if (isset($_GET['additional_profile_field'])) {
$addional_param ='additional_profile_field='.intval($_GET['additional_profile_field']);
$addional_param = 'additional_profile_field='.intval($_GET['additional_profile_field']);
}
$users_tracking_per_page = '';
if (isset($_GET['users_tracking_per_page'])) {
$users_tracking_per_page= '&users_tracking_per_page='.intval($_GET['users_tracking_per_page']);
$users_tracking_per_page = '&users_tracking_per_page='.intval($_GET['users_tracking_per_page']);
}
echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&export=csv&'.$addional_param.$users_tracking_per_page.'">
'.Display::return_icon('export_csv.png', get_lang('ExportAsCSV'),'',ICON_SIZE_MEDIUM).'</a>';
'.Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), '', ICON_SIZE_MEDIUM).'</a>';
echo '</span>';
echo '</div>';

@ -62,8 +62,8 @@ $csv_content = array();
// Breadcrumbs.
if (isset($_GET['origin']) && $_GET['origin'] == 'resume_session') {
$interbreadcrumb[] = array('url' => '../admin/index.php','name' => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array('url' => '../session/session_list.php','name' => get_lang('SessionList'));
$interbreadcrumb[] = array('url' => '../admin/index.php', 'name' => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array('url' => '../session/session_list.php', 'name' => get_lang('SessionList'));
$interbreadcrumb[] = array('url' => '../session/resume_session.php?id_session='.api_get_session_id(), 'name' => get_lang('SessionOverview'));
}
@ -75,7 +75,7 @@ Display::display_header($nameTools, 'Tracking');
// getting all the students of the course
if (empty($session_id)) {
// Registered students in a course outside session.
// Registered students in a course outside session.
$a_students = CourseManager:: get_student_list_from_course_code(
api_get_course_id(),
false,
@ -86,7 +86,7 @@ if (empty($session_id)) {
api_get_group_id()
);
} else {
// Registered students in session.
// Registered students in session.
$a_students = CourseManager:: get_student_list_from_course_code(
api_get_course_id(),
true,
@ -131,10 +131,10 @@ echo Display::url(
echo '<span style="float:right; padding-top:0px;">';
echo '<a href="javascript: void(0);" onclick="javascript: window.print();">'.
Display::return_icon('printer.png', get_lang('Print'),'',ICON_SIZE_MEDIUM).'</a>';
Display::return_icon('printer.png', get_lang('Print'), '', ICON_SIZE_MEDIUM).'</a>';
echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&id_session='.api_get_session_id().'&export=csv">
'.Display::return_icon('export_csv.png', get_lang('ExportAsCSV'),'',ICON_SIZE_MEDIUM).'</a>';
'.Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), '', ICON_SIZE_MEDIUM).'</a>';
echo '</span>';
echo '</div>';
@ -247,7 +247,7 @@ if ($exerciseReporting) {
$quiz_avg_score = round(($quiz_avg_score / $studentCount), 2).'%';
$url = api_get_path(
WEB_CODE_PATH
) . 'exercise/overview.php?exerciseId='.$quiz['id'].$course_path_params;
).'exercise/overview.php?exerciseId='.$quiz['id'].$course_path_params;
echo '<tr><td>'.Display::url(
$quiz['title'],

@ -26,7 +26,7 @@ if (isset($_GET['export'])) {
$export_to_csv = true;
}
if (api_is_platform_admin() ) {
if (api_is_platform_admin()) {
$global = true;
} else {
$global = false;
@ -34,7 +34,7 @@ if (api_is_platform_admin() ) {
if ($global) {
$temp_course_list = CourseManager :: get_courses_list();
foreach($temp_course_list as $temp_course_item) {
foreach ($temp_course_list as $temp_course_item) {
$course_item = CourseManager ::get_course_information($temp_course_item['code']);
$course_list[] = array(
'code' => $course_item['code'],
@ -47,14 +47,14 @@ if ($global) {
}
$new_course_select = array();
foreach($course_list as $data) {
foreach ($course_list as $data) {
$new_course_select[$data['code']] = $data['title'];
}
$form = new FormValidator('search_simple', 'POST', '', '', null, false);
$form->addElement('select','course_code',get_lang('Course'), $new_course_select);
$form->addElement('select', 'course_code', get_lang('Course'), $new_course_select);
if ($global) {
$form->addElement('hidden','view','admin');
$form->addElement('hidden', 'view', 'admin');
} else {
//Get exam lists
$course_id = api_get_course_int_id();
@ -64,7 +64,7 @@ if ($global) {
ORDER BY quiz.title ASC";
$resultExercices = Database::query($sqlExercices);
$exercise_list[0] = get_lang('All');
while($a_exercices = Database::fetch_array($resultExercices)) {
while ($a_exercices = Database::fetch_array($resultExercices)) {
$exercise_list[$a_exercices['id']] = $a_exercices['title'];
}
$form->addElement('select', 'exercise_id', get_lang('Exercise'), $exercise_list);
@ -88,7 +88,7 @@ if (!$export_to_csv) {
echo '<div style="float:right"> <a href="'.api_get_self().'?export=1&score='.$filter_score.'&exercise_id='.$exercise_id.'">
'.Display::return_icon('csv.gif').'
&nbsp;'.get_lang('ExportAsCSV').'</a>' .
&nbsp;'.get_lang('ExportAsCSV').'</a>'.
'<a href="javascript: void(0);" onclick="javascript: window.print()">
'.Display::return_icon('printmgr.gif').'
&nbsp;'.get_lang('Print').'</a>
@ -102,10 +102,10 @@ if (!$export_to_csv) {
}
$menu_items[] = get_lang('ExamTracking');
$nb_menu_items = count($menu_items);
if($nb_menu_items>1) {
foreach($menu_items as $key=> $item) {
if ($nb_menu_items > 1) {
foreach ($menu_items as $key=> $item) {
echo $item;
if($key!=$nb_menu_items-1) {
if ($key != $nb_menu_items - 1) {
echo ' | ';
}
}
@ -129,7 +129,7 @@ $main_result = array();
$session_id = 0;
$user_list = array();
// Getting course list
foreach ($course_list as $current_course ) {
foreach ($course_list as $current_course) {
$course_info = api_get_course_info($current_course['code']);
$_course = $course_info;
@ -163,7 +163,7 @@ foreach ($course_list as $current_course ) {
}
if (!empty($user_list)) {
foreach($user_list as $user_id) {
foreach ($user_list as $user_id) {
$user_data = api_get_user_info($user_id);
$user_list_name[$user_id] = api_get_person_name(
$user_data['firstname'],
@ -171,7 +171,7 @@ if (!empty($user_list)) {
);
}
}
$export_array = array();
$export_array = array();
if (!empty($main_result)) {
$html_result .= '<table class="data_table">';
@ -194,9 +194,9 @@ if (!empty($main_result)) {
foreach ($exercises as $exercise_id => $exercise_data) {
$users = $exercise_data['users'];
foreach($users as $user_id => $attempts) {
foreach ($users as $user_id => $attempts) {
$attempt = 1;
foreach($attempts as $exe_id => $attempt_data) {
foreach ($attempts as $exe_id => $attempt_data) {
$html_result .= '<tr colspan="">';
$html_result .= Display::tag('td', $course_code);
$html_result .= Display::tag('td', $lp_list_name[$lp_id]);
@ -223,7 +223,7 @@ if (!empty($main_result)) {
}
}
}
$html_result .='</table>';
$html_result .= '</table>';
}
if (!$export_to_csv) {

@ -24,7 +24,7 @@ if (isset($_GET['export'])) {
$export_to_xls = true;
}
if (api_is_platform_admin() ) {
if (api_is_platform_admin()) {
$global = true;
} else {
$global = false;
@ -52,7 +52,7 @@ if (empty($session_id)) {
foreach ($temp_course_list as $temp_course_item) {
$course_item = CourseManager ::get_course_information($temp_course_item['code']);
$course_select_list[$temp_course_item['code']] = $course_item['title'];
$course_select_list[$temp_course_item['code']] = $course_item['title'];
}
//Get session list
@ -90,7 +90,7 @@ if (empty($course_code)) {
$course_code = 0;
}
$form->setDefaults(array('course_code'=>(string)$course_code));
$form->setDefaults(array('course_code'=>(string) $course_code));
$course_info = api_get_course_info($course_code);
@ -125,9 +125,9 @@ if (!empty($course_info)) {
foreach ($exercise_stats as $stats) {
if (!empty($stats['question_list'])) {
foreach($stats['question_list'] as $my_question_stat) {
foreach ($stats['question_list'] as $my_question_stat) {
if ($question_id == $my_question_stat['question_id']) {
$question_result = $question_result + $my_question_stat['marks'];
$question_result = $question_result + $my_question_stat['marks'];
$quantity_exercises++;
}
}
@ -187,9 +187,9 @@ if (!empty($main_question_list) && is_array($main_question_list)) {
foreach ($main_question_list as $question) {
$total_student = 0;
$counter ++;
$counter++;
$s_css_class = 'row_even';
if ($counter % 2 ==0 ) {
if ($counter % 2 == 0) {
$s_css_class = 'row_odd';
}
$html_result .= "<tr class='$s_css_class'>
@ -211,7 +211,7 @@ if (!empty($main_question_list) && is_array($main_question_list)) {
$html_result .= "</td>";
}
$html_result .="</tr>";
$html_result .= "</tr>";
$html_result .= '</table>';
} else {
if (!empty($course_code)) {

@ -27,7 +27,7 @@ $is_allowed = true;
require_once api_get_path(SYS_CODE_PATH).'exercise/hotpotatoes.lib.php';
if (isset($uInfo)) {
$interbreadcrumb[]= array(
$interbreadcrumb[] = array(
'url'=>'../user/userInfo.php?uInfo='.Security::remove_XSS($uInfo),
"name"=> api_ucfirst(get_lang('Users'))
);
@ -48,7 +48,7 @@ td {border-bottom: thin dashed gray;}
/*]]>*/
</style>";
Display::display_header($nameTools,"Tracking");
Display::display_header($nameTools, "Tracking");
/* Constants and variables */
@ -56,11 +56,11 @@ $is_allowedToTrack = $is_courseAdmin;
$is_course_member = CourseManager::is_user_subscribed_in_real_or_linked_course($user_id, $courseId);
// Database Table Definitions
$TABLECOURSUSER = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$TABLEUSER = Database::get_main_table(TABLE_MAIN_USER);
$tbl_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$TABLECOURSE_GROUPSUSER = Database::get_course_table(TABLE_GROUP_USER);
$TABLECOURSUSER = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$TABLEUSER = Database::get_main_table(TABLE_MAIN_USER);
$tbl_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$TABLECOURSE_GROUPSUSER = Database::get_course_table(TABLE_GROUP_USER);
$now = api_get_utc_datetime();
$sql = "SELECT 1
@ -72,8 +72,8 @@ $sql = "SELECT 1
OR (access_start_date IS NULL AND access_end_date IS NULL))
WHERE session_id='".api_get_session_id()."' AND c_id = $courseId";
//echo $sql;
$result=Database::query($sql);
if(!Database::num_rows($result)){
$result = Database::query($sql);
if (!Database::num_rows($result)) {
$disabled = true;
}
@ -82,7 +82,7 @@ $tbl_learnpath_item = Database::get_course_table(TABLE_LP_ITEM);
$tbl_learnpath_view = Database::get_course_table(TABLE_LP_VIEW);
$tbl_learnpath_item_view = Database::get_course_table(TABLE_LP_ITEM_VIEW);
$documentPath=api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
$documentPath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
// The variables for the days and the months
$DaysShort = api_get_week_days_short();
@ -107,7 +107,7 @@ $is_allowedToTrackEverybodyInCourse = $is_allowedToTrack; // allowed to track al
<table width="100%" cellpadding="2" cellspacing="3" border="0">
<?php
// check if uid is tutor of this group
if (( $is_allowedToTrack || $is_allowedToTrackEverybodyInCourse )) {
if (($is_allowedToTrack || $is_allowedToTrackEverybodyInCourse)) {
if (!$uInfo && !isset($uInfo)) {
/*
* Display list of user of this group
@ -131,7 +131,7 @@ if (( $is_allowedToTrack || $is_allowedToTrackEverybodyInCourse )) {
$step = 25; // number of student per page
if ($userGroupNb > $step) {
if (!isset($offset)) {
$offset=0;
$offset = 0;
}
$next = $offset + $step;
@ -184,13 +184,13 @@ if (( $is_allowedToTrack || $is_allowedToTrackEverybodyInCourse )) {
$list_users = getManyResults3Col($sql);
echo "<table width='100%' cellpadding='2' cellspacing='1' border='0'>\n"
."<tr align='center' valign='top' bgcolor='#E6E6E6'>\n"
."<td align='left'>",get_lang('UserName'),"</td>\n"
."<td align='left'>", get_lang('UserName'), "</td>\n"
."</tr>\n";
for ($i = 0; $i < sizeof($list_users); $i++) {
echo "<tr valign='top' align='center'>\n"
."<td align='left'>"
."<a href='".api_get_self()."?uInfo=",$list_users[$i][0],"'>"
.$list_users[$i][1]," ",$list_users[$i][2]
."<a href='".api_get_self()."?uInfo=", $list_users[$i][0], "'>"
.$list_users[$i][1], " ", $list_users[$i][2]
."</a>".
"</td>\n";
}
@ -247,7 +247,7 @@ if (( $is_allowedToTrack || $is_allowedToTrackEverybodyInCourse )) {
";
if (!isset($view)) {
$view ='0000000';
$view = '0000000';
}
//Logins
TrackingUserLog::display_login_tracking_info($view, $uInfo, $courseId);
@ -279,8 +279,8 @@ if (( $is_allowedToTrack || $is_allowedToTrackEverybodyInCourse )) {
</tr>";
$sql = "SELECT id, name FROM $tbl_learnpath_main";
$result=Database::query($sql);
$ar=Database::fetch_array($result);
$result = Database::query($sql);
$ar = Database::fetch_array($result);
echo "<tr><td style='padding-left : 40px;padding-right : 40px;'>";
echo "<table cellpadding='2' cellspacing='1' border='0' align='center'><tr>
@ -297,14 +297,14 @@ if (( $is_allowedToTrack || $is_allowedToTrackEverybodyInCourse )) {
if ($ar['id'] == $scormcontopen) {
//have to list the students here
$contentId = intval($ar['id']);
$sql3 = "SELECT iv.status, iv.score, i.title, iv.total_time " .
"FROM $tbl_learnpath_item i " .
"INNER JOIN $tbl_learnpath_item_view iv ON i.id=iv.lp_item_id " .
"INNER JOIN $tbl_learnpath_view v ON iv.lp_view_id=v.id " .
$sql3 = "SELECT iv.status, iv.score, i.title, iv.total_time ".
"FROM $tbl_learnpath_item i ".
"INNER JOIN $tbl_learnpath_item_view iv ON i.id=iv.lp_item_id ".
"INNER JOIN $tbl_learnpath_view v ON iv.lp_view_id=v.id ".
"WHERE (v.user_id=".intval($uInfo)." and v.lp_id=$contentId)
ORDER BY v.id, i.id";
$result3=Database::query($sql3);
$ar3=Database::fetch_array($result3);
$result3 = Database::query($sql3);
$ar3 = Database::fetch_array($result3);
if (is_array($ar3)) {
echo "<tr><td>&nbsp;&nbsp;&nbsp;</td>
<td class='secLine'>
@ -326,7 +326,7 @@ if (( $is_allowedToTrack || $is_allowedToTrackEverybodyInCourse )) {
echo "<tr><td>&nbsp;&nbsp;&nbsp;</td><td>";
echo "$title</td><td align=right>{$ar3['status']}</td><td align=right>{$ar3['score']}</td><td align=right>$time</td>";
echo "</tr>";
$ar3=Database::fetch_array($result3);
$ar3 = Database::fetch_array($result3);
}
} else {
echo "<tr>";
@ -337,7 +337,7 @@ if (( $is_allowedToTrack || $is_allowedToTrackEverybodyInCourse )) {
$ar = Database::fetch_array($result);
}
} else {
$noscorm=true;
$noscorm = true;
}
if ($noscorm) {

@ -20,7 +20,7 @@ $courseId = api_get_course_int_id();
//YW Hack security to quick fix RolesRights bug
$is_allowed = true;
require_once api_get_path(SYS_CODE_PATH) . 'exercise/hotpotatoes.lib.php';
require_once api_get_path(SYS_CODE_PATH).'exercise/hotpotatoes.lib.php';
/* Header */
@ -64,7 +64,7 @@ $sql = "SELECT 1
AND ((access_start_date <= '$now'
AND access_end_date >= '$now')
OR (access_start_date IS NULL AND access_end_date IS NULL))
WHERE session_id='" . api_get_session_id() . "' AND c_id = $courseId";
WHERE session_id='".api_get_session_id()."' AND c_id = $courseId";
//echo $sql;
$result = Database::query($sql);
if (!Database::num_rows($result)) {
@ -77,7 +77,7 @@ $tbl_learnpath_item = Database::get_course_table(TABLE_LP_ITEM);
$tbl_learnpath_view = Database::get_course_table(TABLE_LP_VIEW);
$tbl_learnpath_item_view = Database::get_course_table(TABLE_LP_ITEM_VIEW);
$documentPath = api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/document';
$documentPath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
// The variables for the days and the months
$DaysShort = api_get_week_days_short();
@ -109,7 +109,7 @@ if (($is_allowedToTrack || $is_allowedToTrackEverybodyInCourse)) {
// if user can track everybody : list user of course
$sql = "SELECT count(user_id)
FROM $TABLECOURSUSER
WHERE c_id = '$courseId' AND relation_type<>" . COURSE_RELATION_TYPE_RRHH . "";
WHERE c_id = '$courseId' AND relation_type<>".COURSE_RELATION_TYPE_RRHH."";
} else {
// if user can only track one group : list users of this group
@ -147,7 +147,7 @@ if (($is_allowedToTrack || $is_allowedToTrackEverybodyInCourse)) {
// list of users in this course
$sql = "SELECT u.user_id, u.firstname,u.lastname
FROM $TABLECOURSUSER cu , $TABLEUSER u
WHERE cu.user_id = u.user_id AND cu.relation_type<>" . COURSE_RELATION_TYPE_RRHH . "
WHERE cu.user_id = u.user_id AND cu.relation_type<>".COURSE_RELATION_TYPE_RRHH."
AND cu.c_id = '$courseId'
LIMIT $offset,$step";
} else {
@ -173,7 +173,7 @@ if (($is_allowedToTrack || $is_allowedToTrackEverybodyInCourse)) {
// check if user is in this course
$tracking_is_accepted = $is_course_member;
$tracked_user_info = api_get_user_info($uInfo);
$title[0] = $tracked_user_info[1] . '_' . $tracked_user_info[2];
$title[0] = $tracked_user_info[1].'_'.$tracked_user_info[2];
} else {
// check if user is in the group of this tutor
$sql = "SELECT u.firstname,u.lastname, u.email
@ -187,7 +187,7 @@ if (($is_allowedToTrack || $is_allowedToTrackEverybodyInCourse)) {
$tracking_is_accepted = true;
}
$title[0] = $tracked_user_info['firstname'] . '_' . $tracked_user_info['lastname'];
$title[0] = $tracked_user_info['firstname'].'_'.$tracked_user_info['lastname'];
}
if ($tracking_is_accepted) {
@ -235,8 +235,8 @@ if (($is_allowedToTrack || $is_allowedToTrackEverybodyInCourse)) {
$_cid
);
$title_line = $title_line1 . $title_line2 . $title_line3 . $title_line4 . $title_line5;
$line = $line1 . $line2 . $line3 . $line4 . $line5;
$title_line = $title_line1.$title_line2.$title_line3.$title_line4.$title_line5;
$line = $line1.$line2.$line3.$line4.$line5;
} else {
echo get_lang('ErrorUserNotInGroup');
}
@ -303,22 +303,22 @@ if (($is_allowedToTrack || $is_allowedToTrackEverybodyInCourse)) {
* force the browser to save the file instead of opening it
*/
$len = strlen($title_line . $line);
$len = strlen($title_line.$line);
header('Content-type: application/octet-stream');
//header('Content-Type: application/force-download');
header('Content-length: ' . $len);
header('Content-length: '.$len);
$filename = html_entity_decode(
str_replace(
":",
"",
str_replace(" ", "_", $title[0] . '_' . $title[1] . '.csv')
str_replace(" ", "_", $title[0].'_'.$title[1].'.csv')
)
);
$filename = api_replace_dangerous_char($filename);
if (preg_match("/MSIE 5.5/", $_SERVER['HTTP_USER_AGENT'])) {
header('Content-Disposition: filename= ' . $filename);
header('Content-Disposition: filename= '.$filename);
} else {
header('Content-Disposition: attachment; filename= ' . $filename);
header('Content-Disposition: attachment; filename= '.$filename);
}
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE')) {
header('Pragma: ');
@ -327,7 +327,7 @@ if (($is_allowedToTrack || $is_allowedToTrackEverybodyInCourse)) {
'Cache-Control: public'
); // IE cannot download from sessions without a cache
}
header('Content-Description: ' . $filename);
header('Content-Description: '.$filename);
header('Content-transfer-encoding: binary');
echo api_html_entity_decode($title_line, ENT_QUOTES, $charset);

@ -40,9 +40,9 @@ if (!$is_allowed_to_edit) {
api_not_allowed(true);
}
$courseDir = $_course['path'] . "/document";
$courseDir = $_course['path']."/document";
$sys_course_path = api_get_path(SYS_COURSE_PATH);
$base_work_dir = $sys_course_path . $courseDir;
$base_work_dir = $sys_course_path.$courseDir;
$noPHP_SELF = true;
$max_filled_space = DocumentManager::get_course_quota();

@ -60,9 +60,9 @@ if ($allowTutors === 'true') {
$session_category = '';
if (Database::num_rows($rs)>0) {
$rows_session_category = Database::store_result($rs);
$rows_session_category = $rows_session_category[0];
$session_category = $rows_session_category['name'];
$rows_session_category = Database::store_result($rs);
$rows_session_category = $rows_session_category[0];
$session_category = $rows_session_category['name'];
}
$action = isset($_GET['action']) ? $_GET['action'] : null;
@ -140,22 +140,22 @@ if ($allowTutors === 'true') {
<td><?php echo get_lang('Date'); ?> :</td>
<td>
<?php
if ($session['access_start_date'] == '00-00-0000' && $session['access_end_date']== '00-00-0000' ) {
echo get_lang('NoTimeLimits');
if ($session['access_start_date'] == '00-00-0000' && $session['access_end_date']== '00-00-0000' ) {
echo get_lang('NoTimeLimits');
}
else {
else {
if ($session['access_start_date'] != '00-00-0000') {
//$session['date_start'] = Display::tag('i', get_lang('NoTimeLimits'));
//$session['date_start'] = Display::tag('i', get_lang('NoTimeLimits'));
$session['access_start_date'] = get_lang('From').' '.$session['access_start_date'];
} else {
$session['access_start_date'] = '';
$session['access_start_date'] = '';
}
if ($session['access_end_date'] == '00-00-0000') {
$session['access_end_date'] ='';
} else {
$session['access_end_date'] = get_lang('Until').' '.$session['access_end_date'];
$session['access_end_date'] = get_lang('Until').' '.$session['access_end_date'];
}
echo $session['access_start_date'].' '.$session['access_end_date'];
echo $session['access_start_date'].' '.$session['access_end_date'];
}
?>
</td>
@ -214,22 +214,22 @@ if ($allowTutors === 'true') {
</tr>
<?php
if ($session['nbr_courses'] == 0) {
echo '<tr>
echo '<tr>
<td colspan="4">'.get_lang('NoCoursesForThisSession').'</td>
</tr>';
} else {
// select the courses
$sql = "SELECT c.id, code,title,visual_code, nbr_users
// select the courses
$sql = "SELECT c.id, code,title,visual_code, nbr_users
FROM $tbl_course c,$tbl_session_rel_course sc
WHERE c.id = sc.c_id
AND session_id='$id_session'
ORDER BY title";
$result=Database::query($sql);
$courses=Database::store_result($result);
foreach ($courses as $course) {
//select the number of users
$result=Database::query($sql);
$courses=Database::store_result($result);
foreach ($courses as $course) {
//select the number of users
$sql = "SELECT count(*) FROM $tbl_session_rel_user sru, $tbl_session_rel_course_rel_user srcru
$sql = "SELECT count(*) FROM $tbl_session_rel_user sru, $tbl_session_rel_course_rel_user srcru
WHERE
srcru.user_id = sru.user_id AND
srcru.session_id = sru.session_id AND
@ -237,49 +237,49 @@ if ($allowTutors === 'true') {
sru.relation_type<>".SESSION_RELATION_TYPE_RRHH." AND
srcru.session_id = '".intval($id_session)."'";
$rs = Database::query($sql);
$course['nbr_users'] = Database::result($rs,0,0);
$rs = Database::query($sql);
$course['nbr_users'] = Database::result($rs,0,0);
// Get coachs of the courses in session
// Get coachs of the courses in session
$sql = "SELECT user.lastname,user.firstname,user.username
$sql = "SELECT user.lastname,user.firstname,user.username
FROM $tbl_session_rel_course_rel_user session_rcru, $tbl_user user
WHERE
session_rcru.user_id = user.user_id AND
session_rcru.session_id = '".intval($id_session)."' AND
session_rcru.c_id ='".Database::escape_string($course['id'])."' AND
session_rcru.status=2";
$rs = Database::query($sql);
$rs = Database::query($sql);
$coachs = array();
if (Database::num_rows($rs) > 0) {
while ($info_coach = Database::fetch_array($rs)) {
$coachs = array();
if (Database::num_rows($rs) > 0) {
while ($info_coach = Database::fetch_array($rs)) {
$coachs[] = api_get_person_name(
$info_coach['firstname'],
$info_coach['lastname']
).' ('.$info_coach['username'].')';
}
} else {
$coach = get_lang('None');
}
if (count($coachs) > 0) {
$coach = implode('<br />',$coachs);
} else {
$coach = get_lang('None');
}
$orig_param = '&origin=resume_session';
//hide_course_breadcrumb the parameter has been added to hide the
}
} else {
$coach = get_lang('None');
}
if (count($coachs) > 0) {
$coach = implode('<br />',$coachs);
} else {
$coach = get_lang('None');
}
$orig_param = '&origin=resume_session';
//hide_course_breadcrumb the parameter has been added to hide the
// name of the course, that appeared in the default $interbreadcrumb
echo '
echo '
<tr>
<td>'.Display::url($course['title'].' ('.$course['visual_code'].')', api_get_path(WEB_COURSE_PATH).$course['code'].'/?id_session='.$id_session),'</td>
<td>'.$coach.'</td>
<td>'.$course['nbr_users'].'</td>
</tr>';
}
}
}
?>
</table>
@ -300,11 +300,11 @@ if ($allowTutors === 'true') {
<?php
if ($session['nbr_users']==0) {
echo '<tr>
echo '<tr>
<td colspan="2">'.get_lang('NoUsersForThisSession').'</td>
</tr>';
} else {
$order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname' : ' ORDER BY lastname, firstname';
$order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname' : ' ORDER BY lastname, firstname';
if ($multiple_url_is_on) {
$sql = "SELECT u.user_id, lastname, firstname, username, access_url_id
@ -322,11 +322,11 @@ if ($allowTutors === 'true') {
AND su.session_id = ".$id_session.$order_clause;
}
$result = Database::query($sql);
$users = Database::store_result($result);
$result = Database::query($sql);
$users = Database::store_result($result);
// change breadcrumb in destination page
$orig_param = '&origin=resume_session&id_session='.$id_session;
foreach ($users as $user) {
$orig_param = '&origin=resume_session&id_session='.$id_session;
foreach ($users as $user) {
$user_link = '';
if (!empty($user['user_id'])) {
$user_link = '<a href="'.api_get_path(WEB_CODE_PATH).'admin/user_information.php?user_id='.intval($user['user_id']).'">'.
@ -343,7 +343,7 @@ if ($allowTutors === 'true') {
}
}
echo '<tr>
echo '<tr>
<td width="90%">
'.$user_link.'
</td>
@ -357,7 +357,7 @@ if ($allowTutors === 'true') {
'.$link_to_add_user_in_url.'
</td>
</tr>';
}
}
}
?>
</table>

@ -46,15 +46,15 @@ if ($allowTutors == 'true') {
);
//Column config
$column_model = array(
array('name'=>'name', 'index'=>'name', 'width'=>'160', 'align'=>'left', 'search' => 'true', 'wrap_cell' => "true"),
array('name'=>'nbr_courses', 'index'=>'nbr_courses', 'width'=>'30', 'align'=>'left', 'search' => 'true'),
array('name'=>'nbr_users', 'index'=>'nbr_users', 'width'=>'30', 'align'=>'left', 'search' => 'true'),
array('name'=>'category_name', 'index'=>'category_name', 'width'=>'70', 'align'=>'left', 'search' => 'true'),
array('name'=>'access_start_date', 'index'=>'access_start_date', 'width'=>'40', 'align'=>'left', 'search' => 'true'),
array('name'=>'access_end_date', 'index'=>'access_end_date', 'width'=>'40', 'align'=>'left', 'search' => 'true'),
array('name'=>'coach_name', 'index'=>'coach_name', 'width'=>'80', 'align'=>'left', 'search' => 'false'),
array('name'=>'status', 'index'=>'session_active','width'=>'40', 'align'=>'left', 'search' => 'true', 'stype'=>'select',
$column_model = array(
array('name'=>'name', 'index'=>'name', 'width'=>'160', 'align'=>'left', 'search' => 'true', 'wrap_cell' => "true"),
array('name'=>'nbr_courses', 'index'=>'nbr_courses', 'width'=>'30', 'align'=>'left', 'search' => 'true'),
array('name'=>'nbr_users', 'index'=>'nbr_users', 'width'=>'30', 'align'=>'left', 'search' => 'true'),
array('name'=>'category_name', 'index'=>'category_name', 'width'=>'70', 'align'=>'left', 'search' => 'true'),
array('name'=>'access_start_date', 'index'=>'access_start_date', 'width'=>'40', 'align'=>'left', 'search' => 'true'),
array('name'=>'access_end_date', 'index'=>'access_end_date', 'width'=>'40', 'align'=>'left', 'search' => 'true'),
array('name'=>'coach_name', 'index'=>'coach_name', 'width'=>'80', 'align'=>'left', 'search' => 'false'),
array('name'=>'status', 'index'=>'session_active', 'width'=>'40', 'align'=>'left', 'search' => 'true', 'stype'=>'select',
//for the bottom bar
'searchoptions' => array(
'defaultValue' => '1',
@ -62,8 +62,8 @@ if ($allowTutors == 'true') {
),
//for the top bar
'editoptions' => array('value' => ':'.get_lang('All').';1:'.get_lang('Active').';0:'.get_lang('Inactive'))),
array('name'=>'visibility', 'index'=>'visibility', 'width'=>'40', 'align'=>'left', 'search' => 'false'),
array('name'=>'actions', 'index'=>'actions', 'width'=>'100', 'align'=>'left','formatter'=>'action_formatter','sortable'=>'false', 'search' => 'false')
array('name'=>'visibility', 'index'=>'visibility', 'width'=>'40', 'align'=>'left', 'search' => 'false'),
array('name'=>'actions', 'index'=>'actions', 'width'=>'100', 'align'=>'left', 'formatter'=>'action_formatter', 'sortable'=>'false', 'search' => 'false')
);
//Autowidth
$extra_params['autowidth'] = 'true';
@ -75,7 +75,7 @@ if ($allowTutors == 'true') {
//With this function we can add actions to the jgrid (edit, delete, etc)
$action_links = 'function action_formatter(cellvalue, options, rowObject) {
return \'&nbsp;<a href="add_users_to_session.php?page=session_list.php&id_session=\'+options.rowId+\'">'.Display::return_icon('user_subscribe_session.png',get_lang('SubscribeUsersToSession'),'',ICON_SIZE_SMALL).'</a>'.
return \'&nbsp;<a href="add_users_to_session.php?page=session_list.php&id_session=\'+options.rowId+\'">'.Display::return_icon('user_subscribe_session.png', get_lang('SubscribeUsersToSession'), '', ICON_SIZE_SMALL).'</a>'.
'\';
}';
?>
@ -96,7 +96,7 @@ if ($allowTutors == 'true') {
$(function() {
<?php
echo Display::grid_js('sessions', $url,$columns,$column_model,$extra_params, array(), $action_links,true);
echo Display::grid_js('sessions', $url, $columns, $column_model, $extra_params, array(), $action_links, true);
?>
setSearchSelect("status");
@ -138,9 +138,9 @@ if ($allowTutors == 'true') {
<?php if (api_is_platform_admin()) {?>
<div class="actions">
<?php
echo '<a href="'.api_get_path(WEB_CODE_PATH).'session/session_add.php">'.Display::return_icon('new_session.png',get_lang('AddSession'),'',ICON_SIZE_MEDIUM).'</a>';
echo '<a href="'.api_get_path(WEB_CODE_PATH).'session/add_many_session_to_category.php">'.Display::return_icon('session_to_category.png',get_lang('AddSessionsInCategories'),'',ICON_SIZE_MEDIUM).'</a>';
echo '<a href="'.api_get_path(WEB_CODE_PATH).'session/session_category_list.php">'.Display::return_icon('folder.png',get_lang('ListSessionCategory'),'',ICON_SIZE_MEDIUM).'</a>';
echo '<a href="'.api_get_path(WEB_CODE_PATH).'session/session_add.php">'.Display::return_icon('new_session.png', get_lang('AddSession'), '', ICON_SIZE_MEDIUM).'</a>';
echo '<a href="'.api_get_path(WEB_CODE_PATH).'session/add_many_session_to_category.php">'.Display::return_icon('session_to_category.png', get_lang('AddSessionsInCategories'), '', ICON_SIZE_MEDIUM).'</a>';
echo '<a href="'.api_get_path(WEB_CODE_PATH).'session/session_category_list.php">'.Display::return_icon('folder.png', get_lang('ListSessionCategory'), '', ICON_SIZE_MEDIUM).'</a>';
echo '</div>';
}
} else {

@ -15,8 +15,8 @@ if (api_get_setting('allow_user_course_subscription_by_course_admin') == 'false'
$tool_name = get_lang('ImportUsersToACourse');
$interbreadcrumb[] = array ("url" => "user.php", "name" => get_lang("Users"));
$interbreadcrumb[] = array ("url" => "#", "name" => get_lang("ImportUsersToACourse"));
$interbreadcrumb[] = array("url" => "user.php", "name" => get_lang("Users"));
$interbreadcrumb[] = array("url" => "#", "name" => get_lang("ImportUsersToACourse"));
$form = new FormValidator('user_import', 'post', 'user_import.php');
$form->addElement('header', $tool_name);
@ -39,7 +39,7 @@ if ($form->validate()) {
if (isset($_FILES['import_file']['size']) && $_FILES['import_file']['size'] !== 0) {
$unsubscribe_users = isset($_POST['unsubscribe_users']) ? true : false;
//@todo : csvToArray deprecated
$users = Import::csvToArray($_FILES['import_file']['tmp_name']);
$users = Import::csvToArray($_FILES['import_file']['tmp_name']);
$invalid_users = array();
$clean_users = array();
@ -76,7 +76,7 @@ if ($form->validate()) {
$user_ids = array();
foreach ($current_user_list as $user) {
if (!CourseManager::is_course_teacher($user['user_id'], $course_code)) {
$user_ids[]= $user['user_id'];
$user_ids[] = $user['user_id'];
}
}
CourseManager::unsubscribe_user($user_ids, $course_code, $session_id);
@ -89,12 +89,12 @@ if ($form->validate()) {
if (empty($session_id)) {
//just to make sure
if (CourseManager :: is_user_subscribed_in_course($userId, $course_code)) {
$user_to_show[]= $userInfo['complete_name'];
$user_to_show[] = $userInfo['complete_name'];
}
} else {
//just to make sure
if (CourseManager::is_user_subscribed_in_course($userId, $course_code, true, $session_id)) {
$user_to_show[]= $userInfo['complete_name'];
$user_to_show[] = $userInfo['complete_name'];
}
}
}
@ -102,7 +102,7 @@ if ($form->validate()) {
$message = get_lang('CheckUsersWithId');
$type = 'warning';
foreach ($invalid_users as $invalid_user) {
$user_to_show[]= $invalid_user;
$user_to_show[] = $invalid_user;
}
}
}
@ -127,7 +127,7 @@ if (!empty($message)) {
Display::display_warning_message($message.': <br />'.$userMessage, false);
}
} else {
$empty_line_msg = ($empty_line == 0) ? get_lang('ErrorsWhenImportingFile'): get_lang('ErrorsWhenImportingFile').': '.get_lang('EmptyHeaderLine');
$empty_line_msg = ($empty_line == 0) ? get_lang('ErrorsWhenImportingFile') : get_lang('ErrorsWhenImportingFile').': '.get_lang('EmptyHeaderLine');
Display::display_error_message($empty_line_msg);
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save