Scrutinizer Auto-Fixes

This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
pull/2487/head
Scrutinizer Auto-Fixer 9 years ago
parent 6ad9c6b253
commit 6507b7772a
  1. 8
      main/admin/access_url_add_usergroup_to_url.php
  2. 8
      main/admin/access_url_check_user_session.php
  3. 26
      main/admin/access_url_edit_courses_to_url.php
  4. 2
      main/admin/archive_cleanup.php
  5. 10
      main/admin/configure_extensions.php
  6. 10
      main/admin/course_intro_pdf_import.php
  7. 26
      main/admin/course_list.php
  8. 2
      main/admin/course_request_accepted.php
  9. 30
      main/admin/extra_field_options.php
  10. 36
      main/admin/ldap_import_students_to_session.php
  11. 2
      main/admin/system_status.php
  12. 4
      main/admin/usergroup_export.php
  13. 12
      main/attendance/attendance_edit.php
  14. 2
      main/auth/shibboleth/test/shibboleth_test.class.php
  15. 40
      main/blog/blog.php
  16. 6
      main/calendar/ical_export.php
  17. 10
      main/course_description/add.php
  18. 12
      main/course_description/edit.php
  19. 18
      main/course_description/listing.php
  20. 6
      main/course_progress/thematic_plan.php
  21. 6
      main/forum/newthread.php
  22. 4
      main/gradebook/lib/be/linkfactory.class.php
  23. 10
      main/gradebook/lib/fe/usertable.class.php
  24. 4
      main/inc/ajax/session.ajax.php
  25. 20
      main/inc/lib/add_courses_to_session_functions.lib.php
  26. 2
      main/inc/lib/extra_field_option.lib.php
  27. 2
      main/inc/lib/lp_item.lib.php
  28. 4
      main/inc/lib/security.lib.php
  29. 2
      main/lp/aiccItem.class.php
  30. 2
      main/lp/blank.php
  31. 6
      main/lp/lp_ajax_save_item.php
  32. 8
      main/lp/lp_edit_item.php
  33. 2
      main/lp/lp_subscribe_users.php
  34. 4
      main/mySpace/course.php
  35. 14
      main/mySpace/users.php
  36. 4
      main/session/session_import_drh.php
  37. 6
      main/social/group_add.php
  38. 14
      main/social/group_invitation.php
  39. 4
      main/survey/ch_multiplechoice.php
  40. 2
      main/survey/ch_score.php
  41. 2
      main/survey/ch_yesno.php
  42. 4
      main/ticket/categories.php
  43. 44
      main/tracking/course_session_report.php
  44. 4
      main/user/classes.php
  45. 2
      src/Chamilo/CourseBundle/Component/CourseCopy/Resources/CourseSession.php
  46. 4
      src/Chamilo/CourseBundle/Component/CourseCopy/Resources/Glossary.php
  47. 2
      src/Chamilo/CourseBundle/Component/CourseCopy/Resources/Link.php
  48. 4
      src/Chamilo/CourseBundle/Component/CourseCopy/Resources/LinkCategory.php

@ -30,8 +30,8 @@ $tbl_user = Database:: get_main_table(TABLE_MAIN_USER);
$tbl_course = Database:: get_main_table(TABLE_MAIN_COURSE); $tbl_course = Database:: get_main_table(TABLE_MAIN_COURSE);
$tool_name = get_lang('AddUserGroupToURL'); $tool_name = get_lang('AddUserGroupToURL');
$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array ('url' => 'access_urls.php', 'name' => get_lang('MultipleAccessURLs')); $interbreadcrumb[] = array('url' => 'access_urls.php', 'name' => get_lang('MultipleAccessURLs'));
Display::display_header($tool_name); Display::display_header($tool_name);
@ -46,8 +46,8 @@ api_display_tool_title($tool_name);
if (isset($_POST['form_sent']) && $_POST['form_sent']) { if (isset($_POST['form_sent']) && $_POST['form_sent']) {
$form_sent = $_POST['form_sent']; $form_sent = $_POST['form_sent'];
$userGroups = is_array($_POST['user_group_list']) ? $_POST['user_group_list'] : array() ; $userGroups = is_array($_POST['user_group_list']) ? $_POST['user_group_list'] : array();
$urlList = is_array($_POST['url_list']) ? $_POST['url_list'] : array() ; $urlList = is_array($_POST['url_list']) ? $_POST['url_list'] : array();
$firstLetterUserGroup = $_POST['first_letter_user_group']; $firstLetterUserGroup = $_POST['first_letter_user_group'];
if ($form_sent == 1) { if ($form_sent == 1) {

@ -15,8 +15,8 @@ api_protect_admin_script(true);
$tool_name = get_lang('SessionOverview'); $tool_name = get_lang('SessionOverview');
$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin')); $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
$interbreadcrumb[]=array('url' => 'session_list.php','name' => get_lang('SessionList')); $interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList'));
// Database Table Definitions // Database Table Definitions
$tbl_user = Database::get_main_table(TABLE_MAIN_USER); $tbl_user = Database::get_main_table(TABLE_MAIN_USER);
@ -26,7 +26,7 @@ $url_id = api_get_current_access_url_id();
$action = $_GET['action']; $action = $_GET['action'];
switch($action) { switch ($action) {
case 'add_user_to_url': case 'add_user_to_url':
$user_id = $_REQUEST['user_id']; $user_id = $_REQUEST['user_id'];
$result = UrlManager::add_user_to_url($user_id, $url_id); $result = UrlManager::add_user_to_url($user_id, $url_id);
@ -58,7 +58,7 @@ if ($show_users_with_problems) {
} }
foreach($session_list as $session_item) { foreach ($session_list as $session_item) {
$session_id = $session_item['id']; $session_id = $session_item['id'];
$html .= '<h3>'.$session_item['name'].'</h3>'; $html .= '<h3>'.$session_item['name'].'</h3>';

@ -35,12 +35,12 @@ $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdm
$interbreadcrumb[] = array('url' => 'access_urls.php', 'name' => get_lang('MultipleAccessURLs')); $interbreadcrumb[] = array('url' => 'access_urls.php', 'name' => get_lang('MultipleAccessURLs'));
$add_type = 'multiple'; $add_type = 'multiple';
if (isset($_REQUEST['add_type']) && $_REQUEST['add_type']!='') { if (isset($_REQUEST['add_type']) && $_REQUEST['add_type'] != '') {
$add_type = Security::remove_XSS($_REQUEST['add_type']); $add_type = Security::remove_XSS($_REQUEST['add_type']);
} }
$access_url_id = 1; $access_url_id = 1;
if (isset($_REQUEST['access_url_id']) && $_REQUEST['access_url_id']!='') { if (isset($_REQUEST['access_url_id']) && $_REQUEST['access_url_id'] != '') {
$access_url_id = Security::remove_XSS($_REQUEST['access_url_id']); $access_url_id = Security::remove_XSS($_REQUEST['access_url_id']);
} }
@ -157,23 +157,23 @@ $url_list = UrlManager::get_url_data();
<?php echo $link_add_type_unique ?>&nbsp;|&nbsp;<?php echo $link_add_type_multiple ?> <?php echo $link_add_type_unique ?>&nbsp;|&nbsp;<?php echo $link_add_type_multiple ?>
</div> </div>
<br /><br /> <br /><br />
<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?> > <form name="formulaire" method="post" action="<?php echo api_get_self(); ?>" style="margin:0px;" <?php if ($ajax_search) {echo ' onsubmit="valide();"'; }?> >
<?php echo get_lang('SelectUrl').' : '; ?> <?php echo get_lang('SelectUrl').' : '; ?>
<select name="access_url_id" onchange="javascript:send();"> <select name="access_url_id" onchange="javascript:send();">
<option value="0">-- <?php echo get_lang('SelectUrl')?> -- </option> <option value="0">-- <?php echo get_lang('SelectUrl')?> -- </option>
<?php <?php
$url_selected=''; $url_selected = '';
foreach ($url_list as $url_obj) { foreach ($url_list as $url_obj) {
$checked = ''; $checked = '';
if (!empty($access_url_id)) { if (!empty($access_url_id)) {
if ($url_obj[0]==$access_url_id) { if ($url_obj[0] == $access_url_id) {
$checked = 'selected=true'; $checked = 'selected=true';
$url_selected=$url_obj[1]; $url_selected = $url_obj[1];
} }
} }
if ($url_obj['active']==1) { if ($url_obj['active'] == 1) {
?> ?>
<option <?php echo $checked;?> value="<?php echo $url_obj[0]; ?>"> <?php echo $url_obj[1]; ?></option> <option <?php echo $checked; ?> value="<?php echo $url_obj[0]; ?>"> <?php echo $url_obj[1]; ?></option>
<?php <?php
} }
} }
@ -196,7 +196,7 @@ $url_list = UrlManager::get_url_data();
<td align="center"> <td align="center">
<div id="content_source"> <div id="content_source">
<?php <?php
if($ajax_search) { if ($ajax_search) {
?> ?>
<input type="text" id="course_to_add" onkeyup="xajax_search_courses(this.value,document.formulaire.access_url_id.options[document.formulaire.access_url_id.selectedIndex].value)" /> <input type="text" id="course_to_add" onkeyup="xajax_search_courses(this.value,document.formulaire.access_url_id.options[document.formulaire.access_url_id.selectedIndex].value)" />
<div id="ajax_list_courses"></div> <div id="ajax_list_courses"></div>
@ -205,7 +205,7 @@ $url_list = UrlManager::get_url_data();
?> ?>
<select id="origin_users" name="no_course_list[]" multiple="multiple" size="15" style="width:380px;"> <select id="origin_users" name="no_course_list[]" multiple="multiple" size="15" style="width:380px;">
<?php <?php
foreach($no_course_list as $no_course) { foreach ($no_course_list as $no_course) {
?> ?>
<option value="<?php echo $no_course['id']; ?>"><?php echo $no_course['title'].' ('.$no_course['code'].')'; ?></option> <option value="<?php echo $no_course['id']; ?>"><?php echo $no_course['title'].' ('.$no_course['code'].')'; ?></option>
<?php <?php
@ -220,7 +220,7 @@ $url_list = UrlManager::get_url_data();
</td> </td>
<td width="10%" valign="middle" align="center"> <td width="10%" valign="middle" align="center">
<?php <?php
if($ajax_search) { if ($ajax_search) {
?> ?>
<button class="btn btn-default" type="button" onclick="remove_item(document.getElementById('destination_users'))" > <button class="btn btn-default" type="button" onclick="remove_item(document.getElementById('destination_users'))" >
<em class="fa fa-arrow-left"></em> <em class="fa fa-arrow-left"></em>
@ -243,7 +243,7 @@ $url_list = UrlManager::get_url_data();
<td align="center"> <td align="center">
<select id="destination_users" name="course_list[]" multiple="multiple" size="15" style="width:380px;"> <select id="destination_users" name="course_list[]" multiple="multiple" size="15" style="width:380px;">
<?php <?php
foreach($course_list as $course) { foreach ($course_list as $course) {
$courseInfo = api_get_course_info_by_id($course['id']); $courseInfo = api_get_course_info_by_id($course['id']);
?> ?>
<option value="<?php echo $course['id']; ?>"><?php echo $course['title'].' ('.$courseInfo['code'].')'; ?></option> <option value="<?php echo $course['id']; ?>"><?php echo $course['title'].' ('.$courseInfo['code'].')'; ?></option>
@ -258,7 +258,7 @@ $url_list = UrlManager::get_url_data();
<td colspan="3" align="center"> <td colspan="3" align="center">
<br /> <br />
<?php <?php
if(isset($_GET['add'])) if (isset($_GET['add']))
echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('AddCoursesToURL').'</button>'; echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('AddCoursesToURL').'</button>';
else else
echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('EditCoursesToURL').'</button>'; echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('EditCoursesToURL').'</button>';

@ -16,7 +16,7 @@ $this_section = SECTION_PLATFORM_ADMIN;
api_protect_admin_script(true); api_protect_admin_script(true);
// setting breadcrumbs // setting breadcrumbs
$interbreadcrumb[] = array('url' => 'index.php','name' => get_lang('PlatformAdmin')); $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
$form = new FormValidator('archive_cleanup_form', 'post', '', '', array(), FormValidator::LAYOUT_BOX); $form = new FormValidator('archive_cleanup_form', 'post', '', '', array(), FormValidator::LAYOUT_BOX);
$form->addButtonSend(get_lang('ArchiveDirCleanupProceedButton')); $form->addButtonSend(get_lang('ArchiveDirCleanupProceedButton'));

@ -26,7 +26,7 @@ if (isset($_POST['activeExtension'])) {
$rs = Database::query($sql); $rs = Database::query($sql);
if (Database::affected_rows($rs)>0){ if (Database::affected_rows($rs) > 0) {
$message = get_lang('ServiceActivated'); $message = get_lang('ServiceActivated');
} }
@ -76,18 +76,18 @@ $sql = 'SELECT variable FROM '.$tbl_settings_current.'
WHERE variable LIKE "service_%" AND subkey="active" and selected_value="true"'; WHERE variable LIKE "service_%" AND subkey="active" and selected_value="true"';
$rs = Database::query($sql); $rs = Database::query($sql);
while($row = Database::fetch_array($rs)){ while ($row = Database::fetch_array($rs)) {
$listActiveServices[] = $row['variable']; $listActiveServices[] = $row['variable'];
} }
// javascript to handle accordion behaviour // javascript to handle accordion behaviour
$javascript_message = ''; $javascript_message = '';
if(!empty($message)){ if (!empty($message)) {
$javascript_message = ' $javascript_message = '
document.getElementById("message").style.display = "block"; document.getElementById("message").style.display = "block";
var timer = setTimeout(hideMessage, 5000);'; var timer = setTimeout(hideMessage, 5000);';
} }
$htmlHeadXtra[]= '<script> $htmlHeadXtra[] = '<script>
var listeDiv; var listeDiv;
var extensionsHeader = new Array(); var extensionsHeader = new Array();
var extensionsContent = new Array(); var extensionsContent = new Array();
@ -135,7 +135,7 @@ Display::display_header($nameTool);
?> ?>
<div id="message" style="display: none"> <div id="message" style="display: none">
<?php <?php
if(!empty($message)) if (!empty($message))
Display::display_normal_message($message) Display::display_normal_message($message)
?> ?>
</div> </div>

@ -89,26 +89,26 @@ function import_pdfs($file, $subDir = '/')
{ {
$baseDir = api_get_path(SYS_ARCHIVE_PATH); $baseDir = api_get_path(SYS_ARCHIVE_PATH);
$uploadPath = 'pdfimport/'; $uploadPath = 'pdfimport/';
$errors = array (); $errors = array();
if (!is_dir($baseDir.$uploadPath)) { if (!is_dir($baseDir.$uploadPath)) {
@mkdir($baseDir.$uploadPath); @mkdir($baseDir.$uploadPath);
} }
if (!unzip_uploaded_file($_FILES['import_file'], $uploadPath, $baseDir, 1024*1024*1024)) { if (!unzip_uploaded_file($_FILES['import_file'], $uploadPath, $baseDir, 1024 * 1024 * 1024)) {
error_log('Could not unzip uploaded file in '.__FILE__.', line '.__LINE__); error_log('Could not unzip uploaded file in '.__FILE__.', line '.__LINE__);
return $errors; return $errors;
} }
$list = scandir($baseDir.$uploadPath); $list = scandir($baseDir.$uploadPath);
$i = 0; $i = 0;
foreach ($list as $file) { foreach ($list as $file) {
if (substr($file,0,1) == '.' or !is_file($baseDir.$uploadPath.$file)) { if (substr($file, 0, 1) == '.' or !is_file($baseDir.$uploadPath.$file)) {
continue; continue;
} }
$parts = preg_split('/_/',$file); $parts = preg_split('/_/', $file);
$course = api_get_course_info($parts[0]); $course = api_get_course_info($parts[0]);
if (count($course) > 0) { if (count($course) > 0) {
// Build file info because handle_uploaded_document() needs it (name, type, size, tmp_name) // Build file info because handle_uploaded_document() needs it (name, type, size, tmp_name)
$fileSize = filesize($baseDir.$uploadPath.$file); $fileSize = filesize($baseDir.$uploadPath.$file);
$docId = add_document($course, $subDir.'/'.$file, 'file', $fileSize, $parts[1].' '.substr($parts[2],0,-4)); $docId = add_document($course, $subDir.'/'.$file, 'file', $fileSize, $parts[1].' '.substr($parts[2], 0, -4));
if ($docId > 0) { if ($docId > 0) {
if (!is_file($baseDir.$uploadPath.$file)) { if (!is_file($baseDir.$uploadPath.$file)) {
error_log($baseDir.$uploadPath.$file.' does not exists in '.__FILE__); error_log($baseDir.$uploadPath.$file.' does not exists in '.__FILE__);

@ -26,7 +26,7 @@ function get_number_of_courses()
api_is_multiple_url_enabled() && api_get_current_access_url_id() != -1 api_is_multiple_url_enabled() && api_get_current_access_url_id() != -1
) { ) {
$access_url_rel_course_table = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE); $access_url_rel_course_table = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
$sql.= " INNER JOIN $access_url_rel_course_table url_rel_course $sql .= " INNER JOIN $access_url_rel_course_table url_rel_course
ON (c.id = url_rel_course.c_id)"; ON (c.id = url_rel_course.c_id)";
} }
@ -62,7 +62,7 @@ function get_number_of_courses()
if ((api_is_platform_admin() || api_is_session_admin()) && if ((api_is_platform_admin() || api_is_session_admin()) &&
api_is_multiple_url_enabled() && api_get_current_access_url_id() != -1 api_is_multiple_url_enabled() && api_get_current_access_url_id() != -1
) { ) {
$sql.= " AND url_rel_course.access_url_id = ".api_get_current_access_url_id(); $sql .= " AND url_rel_course.access_url_id = ".api_get_current_access_url_id();
} }
$res = Database::query($sql); $res = Database::query($sql);
@ -101,7 +101,7 @@ function get_course_data($from, $number_of_items, $column, $direction)
api_is_multiple_url_enabled() && api_get_current_access_url_id() != -1 api_is_multiple_url_enabled() && api_get_current_access_url_id() != -1
) { ) {
$access_url_rel_course_table = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE); $access_url_rel_course_table = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
$sql.= " INNER JOIN $access_url_rel_course_table url_rel_course $sql .= " INNER JOIN $access_url_rel_course_table url_rel_course
ON (course.id = url_rel_course.c_id)"; ON (course.id = url_rel_course.c_id)";
} }
@ -136,7 +136,7 @@ function get_course_data($from, $number_of_items, $column, $direction)
if ((api_is_platform_admin() || api_is_session_admin()) && if ((api_is_platform_admin() || api_is_session_admin()) &&
api_is_multiple_url_enabled() && api_get_current_access_url_id() != -1 api_is_multiple_url_enabled() && api_get_current_access_url_id() != -1
) { ) {
$sql.= " AND url_rel_course.access_url_id=".api_get_current_access_url_id(); $sql .= " AND url_rel_course.access_url_id=".api_get_current_access_url_id();
} }
$sql .= " ORDER BY col$column $direction "; $sql .= " ORDER BY col$column $direction ";
@ -206,13 +206,13 @@ function get_course_data_by_session($from, $number_of_items, $column, $direction
if (isset($_GET['session_id']) && !empty($_GET['session_id'])) { if (isset($_GET['session_id']) && !empty($_GET['session_id'])) {
$sessionId = intval($_GET['session_id']); $sessionId = intval($_GET['session_id']);
$sql.= " WHERE s.id = ".$sessionId; $sql .= " WHERE s.id = ".$sessionId;
} }
$sql .= " ORDER BY col$column $direction "; $sql .= " ORDER BY col$column $direction ";
$sql .= " LIMIT $from,$number_of_items"; $sql .= " LIMIT $from,$number_of_items";
$res = Database::query($sql); $res = Database::query($sql);
$courses = array (); $courses = array();
while ($course = Database::fetch_array($res)) { while ($course = Database::fetch_array($res)) {
// Place colour icons in front of courses. // Place colour icons in front of courses.
$show_visual_code = $course['visual_code'] != $course[2] ? Display::label($course['visual_code'], 'info') : null; $show_visual_code = $course['visual_code'] != $course[2] ? Display::label($course['visual_code'], 'info') : null;
@ -254,7 +254,7 @@ function modify_courses_filter($code)
*/ */
function get_course_visibility_icon($v) { function get_course_visibility_icon($v) {
$style = 'margin-bottom:0;margin-right:5px;'; $style = 'margin-bottom:0;margin-right:5px;';
switch($v) { switch ($v) {
case 0: case 0:
return Display::return_icon('bullet_red.png', get_lang('CourseVisibilityClosed'), array('style' => $style)); return Display::return_icon('bullet_red.png', get_lang('CourseVisibilityClosed'), array('style' => $style));
break; break;
@ -341,7 +341,7 @@ if (isset ($_GET['search']) && $_GET['search'] === 'advanced') {
$form->setDefaults($defaults); $form->setDefaults($defaults);
$content .= $form->returnForm(); $content .= $form->returnForm();
} else { } else {
$interbreadcrumb[] = array ('url' => 'index.php', "name" => get_lang('PlatformAdmin')); $interbreadcrumb[] = array('url' => 'index.php', "name" => get_lang('PlatformAdmin'));
$tool_name = get_lang('CourseList'); $tool_name = get_lang('CourseList');
if (isset($_GET['delete_course'])) { if (isset($_GET['delete_course'])) {
CourseManager::delete_course($_GET['delete_course']); CourseManager::delete_course($_GET['delete_course']);
@ -353,7 +353,7 @@ if (isset ($_GET['search']) && $_GET['search'] === 'advanced') {
$form = new FormValidator('search_simple', 'get', '', '', array(), FormValidator::LAYOUT_INLINE); $form = new FormValidator('search_simple', 'get', '', '', array(), FormValidator::LAYOUT_INLINE);
$form->addElement('text', 'keyword', null, array('id' => 'course-search-keyword')); $form->addElement('text', 'keyword', null, array('id' => 'course-search-keyword'));
$form->addButtonSearch(get_lang('SearchCourse')); $form->addButtonSearch(get_lang('SearchCourse'));
$advanced = '<a class="btn btn-default" href="'. api_get_path(WEB_CODE_PATH).'admin/course_list.php?search=advanced"><em class="fa fa-search"></em> '.get_lang('AdvancedSearch').'</a>'; $advanced = '<a class="btn btn-default" href="'.api_get_path(WEB_CODE_PATH).'admin/course_list.php?search=advanced"><em class="fa fa-search"></em> '.get_lang('AdvancedSearch').'</a>';
// Create a filter by session // Create a filter by session
$sessionFilter = new FormValidator('course_filter', 'get', '', '', array(), FormValidator::LAYOUT_INLINE); $sessionFilter = new FormValidator('course_filter', 'get', '', '', array(), FormValidator::LAYOUT_INLINE);
@ -374,10 +374,10 @@ if (isset ($_GET['search']) && $_GET['search'] === 'advanced') {
$courseListUrl = api_get_self(); $courseListUrl = api_get_self();
$actions .= '<div class="row">'; $actions .= '<div class="row">';
$actions .= '<div class="col-md-2">'; $actions .= '<div class="col-md-2">';
$actions .= '<a href="course_add.php">'.Display::return_icon('new_course.png', get_lang('AddCourse'),'',ICON_SIZE_MEDIUM).'</a> '; $actions .= '<a href="course_add.php">'.Display::return_icon('new_course.png', get_lang('AddCourse'), '', ICON_SIZE_MEDIUM).'</a> ';
if (api_get_setting('course_validation') === 'true') { if (api_get_setting('course_validation') === 'true') {
$actions .= '<a href="course_request_review.php">'. $actions .= '<a href="course_request_review.php">'.
Display::return_icon('course_request_pending.png', get_lang('ReviewCourseRequests'),'',ICON_SIZE_MEDIUM).'</a>'; Display::return_icon('course_request_pending.png', get_lang('ReviewCourseRequests'), '', ICON_SIZE_MEDIUM).'</a>';
} }
$actions .= '</div>'; $actions .= '</div>';
$actions .= '<div class="col-md-4">'; $actions .= '<div class="col-md-4">';
@ -415,10 +415,10 @@ if (isset ($_GET['search']) && $_GET['search'] === 'advanced') {
$table = new SortableTable('courses', 'get_number_of_courses', 'get_course_data', 2, 20, 'ASC', 'course-list'); $table = new SortableTable('courses', 'get_number_of_courses', 'get_course_data', 2, 20, 'ASC', 'course-list');
} }
$parameters=array(); $parameters = array();
if (isset ($_GET['keyword'])) { if (isset ($_GET['keyword'])) {
$parameters = array ('keyword' => Security::remove_XSS($_GET['keyword'])); $parameters = array('keyword' => Security::remove_XSS($_GET['keyword']));
} elseif (isset ($_GET['keyword_code'])) { } elseif (isset ($_GET['keyword_code'])) {
$parameters['keyword_code'] = Security::remove_XSS($_GET['keyword_code']); $parameters['keyword_code'] = Security::remove_XSS($_GET['keyword_code']);
$parameters['keyword_title'] = Security::remove_XSS($_GET['keyword_title']); $parameters['keyword_title'] = Security::remove_XSS($_GET['keyword_title']);

@ -87,7 +87,7 @@ function get_request_data($from, $number_of_items, $column, $direction)
$from = intval($from); $from = intval($from);
$number_of_items = intval($number_of_items); $number_of_items = intval($number_of_items);
$column = intval($column); $column = intval($column);
$direction = !in_array(strtolower(trim($direction)), ['asc','desc']) ? 'asc' : $direction; $direction = !in_array(strtolower(trim($direction)), ['asc', 'desc']) ? 'asc' : $direction;
$sql = "SELECT $sql = "SELECT
id AS col0, id AS col0,

@ -18,7 +18,7 @@ api_protect_admin_script();
$htmlHeadXtra[] = api_get_jqgrid_js(); $htmlHeadXtra[] = api_get_jqgrid_js();
// setting breadcrumbs // setting breadcrumbs
$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin')); $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
$tool_name = null; $tool_name = null;
@ -39,23 +39,23 @@ $check = Security::check_token('request');
$token = Security::get_token(); $token = Security::get_token();
if ($action == 'add') { if ($action == 'add') {
$interbreadcrumb[]=array('url' => 'extra_fields.php?type='.$extra_field->type,'name' => $extra_field->pageName); $interbreadcrumb[] = array('url' => 'extra_fields.php?type='.$extra_field->type, 'name' => $extra_field->pageName);
$interbreadcrumb[]=array('url' => 'extra_fields.php?type='.$extra_field->type.'&action=edit&id='.$extra_field_info['id'],'name' => $extra_field_info['display_text']); $interbreadcrumb[] = array('url' => 'extra_fields.php?type='.$extra_field->type.'&action=edit&id='.$extra_field_info['id'], 'name' => $extra_field_info['display_text']);
$interbreadcrumb[]=array('url' => 'extra_field_options.php?type='.$extra_field->type.'&field_id='.$extra_field_info['id'], 'name' => get_lang('EditExtraFieldOptions')); $interbreadcrumb[] = array('url' => 'extra_field_options.php?type='.$extra_field->type.'&field_id='.$extra_field_info['id'], 'name' => get_lang('EditExtraFieldOptions'));
$interbreadcrumb[]=array('url' => '#','name' => get_lang('Add')); $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Add'));
} elseif ($action == 'edit') { } elseif ($action == 'edit') {
$interbreadcrumb[]=array('url' => 'extra_fields.php?type='.$extra_field->type,'name' => $extra_field->pageName); $interbreadcrumb[] = array('url' => 'extra_fields.php?type='.$extra_field->type, 'name' => $extra_field->pageName);
$interbreadcrumb[]=array('url' => 'extra_fields.php?type='.$extra_field->type.'&action=edit&id='.$extra_field_info['id'],'name' => $extra_field_info['display_text']); $interbreadcrumb[] = array('url' => 'extra_fields.php?type='.$extra_field->type.'&action=edit&id='.$extra_field_info['id'], 'name' => $extra_field_info['display_text']);
$interbreadcrumb[]=array('url' => 'extra_field_options.php?type='.$extra_field->type.'&field_id='.$extra_field_info['id'], 'name' => get_lang('EditExtraFieldOptions')); $interbreadcrumb[] = array('url' => 'extra_field_options.php?type='.$extra_field->type.'&field_id='.$extra_field_info['id'], 'name' => get_lang('EditExtraFieldOptions'));
$interbreadcrumb[]=array('url' => '#','name' => get_lang('Edit')); $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Edit'));
} else { } else {
$interbreadcrumb[]=array('url' => 'extra_fields.php?type='.$extra_field->type,'name' => $extra_field->pageName); $interbreadcrumb[] = array('url' => 'extra_fields.php?type='.$extra_field->type, 'name' => $extra_field->pageName);
$interbreadcrumb[]=array( $interbreadcrumb[] = array(
'url' => 'extra_fields.php?type='.$extra_field->type.'&action=edit&id='.$extra_field_info['id'], 'url' => 'extra_fields.php?type='.$extra_field->type.'&action=edit&id='.$extra_field_info['id'],
'name' => $extra_field_info['display_text'] 'name' => $extra_field_info['display_text']
); );
$interbreadcrumb[]=array('url' => '#','name' => get_lang('EditExtraFieldOptions')); $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('EditExtraFieldOptions'));
} }
//jqgrid will use this URL to do the selects //jqgrid will use this URL to do the selects
@ -108,12 +108,12 @@ $extra_params['height'] = 'auto';
//With this function we can add actions to the jgrid (edit, delete, etc) //With this function we can add actions to the jgrid (edit, delete, etc)
$action_links = 'function action_formatter(cellvalue, options, rowObject) { $action_links = 'function action_formatter(cellvalue, options, rowObject) {
return \'<a href="?action=edit&'.$params.'&id=\'+options.rowId+\'">'.Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>'. return \'<a href="?action=edit&'.$params.'&id=\'+options.rowId+\'">'.Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>'.
'&nbsp;<a onclick="javascript:if(!confirm('."\'".addslashes(get_lang("ConfirmYourChoice"))."\'".')) return false;" href="?sec_token='.$token.'&action=delete&'.$params.'&id=\'+options.rowId+\'">'.Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'. '&nbsp;<a onclick="javascript:if(!confirm('."\'".addslashes(get_lang("ConfirmYourChoice"))."\'".')) return false;" href="?sec_token='.$token.'&action=delete&'.$params.'&id=\'+options.rowId+\'">'.Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'.
'\'; '\';
}'; }';
$htmlHeadXtra[]='<script> $htmlHeadXtra[] = '<script>
$(function() { $(function() {
// grid definition see the $obj->display() function // grid definition see the $obj->display() function
'.Display::grid_js( '.Display::grid_js(

@ -9,7 +9,7 @@
* Code * Code
*/ */
// resetting the course id // resetting the course id
$cidReset=true; $cidReset = true;
require_once('../inc/global.inc.php'); require_once('../inc/global.inc.php');
// setting the section (for the tabs) // setting the section (for the tabs)
$this_section = SECTION_PLATFORM_ADMIN; $this_section = SECTION_PLATFORM_ADMIN;
@ -17,11 +17,11 @@ $this_section = SECTION_PLATFORM_ADMIN;
api_protect_admin_script(); api_protect_admin_script();
require('../auth/ldap/authldap.php'); require('../auth/ldap/authldap.php');
$annee_base=date('Y'); $annee_base = date('Y');
$tool_name = get_lang('LDAPImport'); $tool_name = get_lang('LDAPImport');
// setting breadcrumbs // setting breadcrumbs
$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin')); $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
$htmlHeadXtra[] = '<script language="JavaScript" type="text/javascript"> $htmlHeadXtra[] = '<script language="JavaScript" type="text/javascript">
var buttoncheck = 1; var buttoncheck = 1;
@ -64,7 +64,7 @@ if (empty($annee) && empty($id_session))
echo '</div>'; echo '</div>';
} }
elseif(!empty($annee) && empty($id_session)) elseif (!empty($annee) && empty($id_session))
{ {
Display::display_header($tool_name); Display::display_header($tool_name);
echo '<div style="align:center">'; echo '<div style="align:center">';
@ -75,14 +75,14 @@ elseif(!empty($annee) && empty($id_session))
echo '<select name="id_session">'; echo '<select name="id_session">';
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION); $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$sql = "SELECT id,name,nbr_courses,access_start_date,access_end_date " . $sql = "SELECT id,name,nbr_courses,access_start_date,access_end_date ".
" FROM $tbl_session ". " FROM $tbl_session ".
" ORDER BY name"; " ORDER BY name";
$result = Database::query($sql); $result = Database::query($sql);
$sessions=Database::store_result($result); $sessions = Database::store_result($result);
$nbr_results=count($sessions); $nbr_results = count($sessions);
foreach($sessions as $row) { foreach ($sessions as $row) {
echo '<option value="'.$row['id'].'">'.api_htmlentities($row['name']).' ('.$row['access_start_date'].' - '.$row['access_end_date'].')</option>'; echo '<option value="'.$row['id'].'">'.api_htmlentities($row['name']).' ('.$row['access_start_date'].' - '.$row['access_end_date'].')</option>';
} }
echo '</select>'; echo '</select>';
@ -114,7 +114,7 @@ elseif (!empty($annee) && !empty($id_session) && empty($_POST['confirmed']))
$info = ldap_get_entries($ds, $sr); $info = ldap_get_entries($ds, $sr);
for ($key = 0; $key < $info["count"]; $key ++) { for ($key = 0; $key < $info["count"]; $key++) {
$nom_form[] = $info[$key]["sn"][0]; $nom_form[] = $info[$key]["sn"][0];
$prenom_form[] = $info[$key]["givenname"][0]; $prenom_form[] = $info[$key]["givenname"][0];
$email_form[] = $info[$key]["mail"][0]; $email_form[] = $info[$key]["mail"][0];
@ -134,7 +134,7 @@ elseif (!empty($annee) && !empty($id_session) && empty($_POST['confirmed']))
asort($nom_form); asort($nom_form);
reset($nom_form); reset($nom_form);
$statut=5; $statut = 5;
include ('ldap_form_add_users_group.php'); include ('ldap_form_add_users_group.php');
} else { } else {
echo '<h4>'.get_lang('UnableToConnectTo').' '.$host.'</h4>'; echo '<h4>'.get_lang('UnableToConnectTo').' '.$host.'</h4>';
@ -145,17 +145,17 @@ elseif (!empty($annee) && !empty($id_session) && empty($_POST['confirmed']))
echo '</div>'; echo '</div>';
} }
elseif (!empty($annee) && !empty($id_session) && ($_POST['confirmed']=='yes')) elseif (!empty($annee) && !empty($id_session) && ($_POST['confirmed'] == 'yes'))
{ {
$id=$_POST['username_form']; $id = $_POST['username_form'];
$UserList=array(); $UserList = array();
$userid_match_login = array(); $userid_match_login = array();
foreach ($id as $form_index=>$user_id) foreach ($id as $form_index=>$user_id)
{ {
if(is_array($_POST['checkboxes']) && in_array($form_index,array_values($_POST['checkboxes']))) if (is_array($_POST['checkboxes']) && in_array($form_index, array_values($_POST['checkboxes'])))
{ {
$tmp = ldap_add_user($user_id); $tmp = ldap_add_user($user_id);
$UserList[]= $tmp; $UserList[] = $tmp;
$userid_match_login[$tmp] = $user_id; $userid_match_login[$tmp] = $user_id;
} }
} }
@ -177,7 +177,7 @@ elseif (!empty($annee) && !empty($id_session) && ($_POST['confirmed']=='yes'))
} }
} }
if($num>0) { if ($num > 0) {
$sql = 'UPDATE '.$tbl_session.' SET nbr_users = (nbr_users + '.$num.') WHERE id = '.intval($id_session); $sql = 'UPDATE '.$tbl_session.' SET nbr_users = (nbr_users + '.$num.') WHERE id = '.intval($id_session);
$res = Database::query($sql); $res = Database::query($sql);
} }
@ -205,8 +205,8 @@ elseif (!empty($annee) && !empty($id_session) && ($_POST['confirmed']=='yes'))
else else
{ {
Display::display_header($tool_name); Display::display_header($tool_name);
$message=get_lang('NoUserAdded'); $message = get_lang('NoUserAdded');
Display :: display_normal_message($message,false); Display :: display_normal_message($message, false);
} }
echo '<br /><br />'; echo '<br /><br />';
echo '<a href="ldap_import_students.php?annee=&composante=&etape=">'.get_lang('BackToNewSearch').'</a>'; echo '<a href="ldap_import_students.php?annee=&composante=&etape=">'.get_lang('BackToNewSearch').'</a>';

@ -11,7 +11,7 @@ require_once __DIR__.'/../inc/global.inc.php';
$this_section = SECTION_PLATFORM_ADMIN; $this_section = SECTION_PLATFORM_ADMIN;
// User permissions // User permissions
api_protect_admin_script(); api_protect_admin_script();
$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
Display :: display_header(get_lang('SystemStatus')); Display :: display_header(get_lang('SystemStatus'));
$diag = new Diagnoser(); $diag = new Diagnoser();
$diag->show_html(); $diag->show_html();

@ -13,8 +13,8 @@ api_protect_admin_script();
$tool_name = get_lang('Export'); $tool_name = get_lang('Export');
$interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin')); $interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array ('url' => 'usergroups.php', 'name' => get_lang('Classes')); $interbreadcrumb[] = array('url' => 'usergroups.php', 'name' => get_lang('Classes'));
set_time_limit(0); set_time_limit(0);

@ -12,7 +12,7 @@ api_protect_course_script(true);
// error messages // error messages
if (isset($error)) { if (isset($error)) {
Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'),false); Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'), false);
} }
if (!isset($error)) { if (!isset($error)) {
@ -49,18 +49,18 @@ $form->addHtmlEditor(
if (Gradebook::is_active()) { if (Gradebook::is_active()) {
if (!empty($attendance_qualify_title) || !empty($attendance_weight)) { if (!empty($attendance_qualify_title) || !empty($attendance_weight)) {
$form->addButtonAdvancedSettings('id_qualify'); $form->addButtonAdvancedSettings('id_qualify');
$form->addElement('html','<div id="id_qualify_options" style="display:block">'); $form->addElement('html', '<div id="id_qualify_options" style="display:block">');
$form->addElement( $form->addElement(
'checkbox', 'checkbox',
'attendance_qualify_gradebook', 'attendance_qualify_gradebook',
'', '',
get_lang('QualifyAttendanceGradebook'), get_lang('QualifyAttendanceGradebook'),
array('checked'=>'true','onclick'=>'javascript: if(this.checked){document.getElementById(\'options_field\').style.display = \'block\';}else{document.getElementById(\'options_field\').style.display = \'none\';}') array('checked'=>'true', 'onclick'=>'javascript: if(this.checked){document.getElementById(\'options_field\').style.display = \'block\';}else{document.getElementById(\'options_field\').style.display = \'none\';}')
); );
$form->addElement('html','<div id="options_field" style="display:block">'); $form->addElement('html', '<div id="options_field" style="display:block">');
} else { } else {
$form->addButtonAdvancedSettings('id_qualify'); $form->addButtonAdvancedSettings('id_qualify');
$form->addElement('html','<div id="id_qualify_options" style="display:none">'); $form->addElement('html', '<div id="id_qualify_options" style="display:none">');
$form->addElement( $form->addElement(
'checkbox', 'checkbox',
'attendance_qualify_gradebook', 'attendance_qualify_gradebook',
@ -68,7 +68,7 @@ if (Gradebook::is_active()) {
get_lang('QualifyAttendanceGradebook'), get_lang('QualifyAttendanceGradebook'),
'onclick="javascript: if(this.checked){document.getElementById(\'options_field\').style.display = \'block\';}else{document.getElementById(\'options_field\').style.display = \'none\';}"' 'onclick="javascript: if(this.checked){document.getElementById(\'options_field\').style.display = \'block\';}else{document.getElementById(\'options_field\').style.display = \'none\';}"'
); );
$form->addElement('html','<div id="options_field" style="display:none">'); $form->addElement('html', '<div id="options_field" style="display:none">');
} }
GradebookUtils::load_gradebook_select_in_tool($form); GradebookUtils::load_gradebook_select_in_tool($form);
$form->addElement('text', 'attendance_qualify_title', get_lang('TitleColumnGradebook')); $form->addElement('text', 'attendance_qualify_title', get_lang('TitleColumnGradebook'));

@ -205,7 +205,7 @@ class ShibbolethTest
$message = "Assert failed $message <br/>"; $message = "Assert failed $message <br/>";
echo $message; echo $message;
// Dump variable for debug // Dump variable for debug
error_log(print_r(debug_backtrace(),1)); error_log(print_r(debug_backtrace(), 1));
die; die;
} }
else else

@ -134,7 +134,7 @@ if (!empty($_POST['new_task_execution_submit'])) {
$safe_comment_title, $safe_comment_title,
$safe_comment_text, $safe_comment_text,
$blog_id, $blog_id,
(int)$_GET['post_id'], (int) $_GET['post_id'],
$_POST['comment_parent_id'], $_POST['comment_parent_id'],
$_POST['task_id'] $_POST['task_id']
); );
@ -146,29 +146,29 @@ if (!empty($_POST['new_task_execution_submit'])) {
if (!empty($_POST['register'])) { if (!empty($_POST['register'])) {
if (is_array($_POST['user'])) { if (is_array($_POST['user'])) {
foreach ($_POST['user'] as $index => $user_id) { foreach ($_POST['user'] as $index => $user_id) {
Blog :: set_user_subscribed((int)$_GET['blog_id'], $user_id); Blog :: set_user_subscribed((int) $_GET['blog_id'], $user_id);
} }
} }
} }
if (!empty($_POST['unregister'])) { if (!empty($_POST['unregister'])) {
if (is_array($_POST['user'])) { if (is_array($_POST['user'])) {
foreach ($_POST['user'] as $index => $user_id) { foreach ($_POST['user'] as $index => $user_id) {
Blog :: set_user_unsubscribed((int)$_GET['blog_id'], $user_id); Blog :: set_user_unsubscribed((int) $_GET['blog_id'], $user_id);
} }
} }
} }
if (!empty($_GET['register'])) { if (!empty($_GET['register'])) {
Blog :: set_user_subscribed((int)$_GET['blog_id'], (int)$_GET['user_id']); Blog :: set_user_subscribed((int) $_GET['blog_id'], (int) $_GET['user_id']);
$return_message = array('type' => 'confirmation', 'message' => get_lang('UserRegistered')); $return_message = array('type' => 'confirmation', 'message' => get_lang('UserRegistered'));
$flag = 1; $flag = 1;
} }
if (!empty($_GET['unregister'])) { if (!empty($_GET['unregister'])) {
Blog :: set_user_unsubscribed((int)$_GET['blog_id'], (int)$_GET['user_id']); Blog :: set_user_unsubscribed((int) $_GET['blog_id'], (int) $_GET['user_id']);
} }
if (isset($_GET['action']) && $_GET['action'] == 'manage_tasks') { if (isset($_GET['action']) && $_GET['action'] == 'manage_tasks') {
if (isset($_GET['do']) && $_GET['do'] == 'delete') { if (isset($_GET['do']) && $_GET['do'] == 'delete') {
Blog :: delete_task($blog_id, (int)$_GET['task_id']); Blog :: delete_task($blog_id, (int) $_GET['task_id']);
$return_message = array('type' => 'confirmation', 'message' => get_lang('TaskDeleted')); $return_message = array('type' => 'confirmation', 'message' => get_lang('TaskDeleted'));
} }
@ -183,7 +183,7 @@ if (isset($_GET['action']) && $_GET['action'] == 'view_post') {
if (isset($_GET['do']) && $_GET['do'] == 'delete_comment') { if (isset($_GET['do']) && $_GET['do'] == 'delete_comment') {
if (api_is_allowed('BLOG_'.$blog_id, 'article_comments_delete', $task_id)) { if (api_is_allowed('BLOG_'.$blog_id, 'article_comments_delete', $task_id)) {
Blog :: delete_comment($blog_id, (int)$_GET['post_id'],(int)$_GET['comment_id']); Blog :: delete_comment($blog_id, (int) $_GET['post_id'], (int) $_GET['comment_id']);
$return_message = array('type' => 'confirmation', 'message' => get_lang('CommentDeleted')); $return_message = array('type' => 'confirmation', 'message' => get_lang('CommentDeleted'));
} else { } else {
$error = true; $error = true;
@ -193,7 +193,7 @@ if (isset($_GET['action']) && $_GET['action'] == 'view_post') {
if (isset($_GET['do']) && $_GET['do'] == 'delete_article') { if (isset($_GET['do']) && $_GET['do'] == 'delete_article') {
if (api_is_allowed('BLOG_'.$blog_id, 'article_delete', $task_id)) { if (api_is_allowed('BLOG_'.$blog_id, 'article_delete', $task_id)) {
Blog :: delete_post($blog_id, (int)$_GET['article_id']); Blog :: delete_post($blog_id, (int) $_GET['article_id']);
$action = ''; // Article is gone, go to blog home $action = ''; // Article is gone, go to blog home
$return_message = array('type' => 'confirmation', 'message' => get_lang('BlogDeleted')); $return_message = array('type' => 'confirmation', 'message' => get_lang('BlogDeleted'));
} else { } else {
@ -204,13 +204,13 @@ if (isset($_GET['action']) && $_GET['action'] == 'view_post') {
if (isset($_GET['do']) && $_GET['do'] == 'rate') { if (isset($_GET['do']) && $_GET['do'] == 'rate') {
if (isset($_GET['type']) && $_GET['type'] == 'post') { if (isset($_GET['type']) && $_GET['type'] == 'post') {
if (api_is_allowed('BLOG_'.$blog_id, 'article_rate')) { if (api_is_allowed('BLOG_'.$blog_id, 'article_rate')) {
Blog :: add_rating('post', $blog_id, (int)$_GET['post_id'], (int)$_GET['rating']); Blog :: add_rating('post', $blog_id, (int) $_GET['post_id'], (int) $_GET['rating']);
$return_message = array('type' => 'confirmation', 'message' => get_lang('RatingAdded')); $return_message = array('type' => 'confirmation', 'message' => get_lang('RatingAdded'));
} }
} }
if (isset($_GET['type']) && $_GET['type'] == 'comment') { if (isset($_GET['type']) && $_GET['type'] == 'comment') {
if (api_is_allowed('BLOG_'.$blog_id, 'article_comments_add')) { if (api_is_allowed('BLOG_'.$blog_id, 'article_comments_add')) {
Blog :: add_rating('comment', $blog_id, (int)$_GET['comment_id'], (int)$_GET['rating']); Blog :: add_rating('comment', $blog_id, (int) $_GET['comment_id'], (int) $_GET['rating']);
$return_message = array('type' => 'confirmation', 'message' => get_lang('RatingAdded')); $return_message = array('type' => 'confirmation', 'message' => get_lang('RatingAdded'));
} }
} }
@ -289,16 +289,16 @@ if (!empty($return_message)) {
echo '<div class=actions>'; echo '<div class=actions>';
?> ?>
<a href="<?php echo api_get_self(); ?>?blog_id=<?php echo $blog_id ?>&<?php echo api_get_cidreq(); ?>" title="<?php echo get_lang('Home') ?>"> <a href="<?php echo api_get_self(); ?>?blog_id=<?php echo $blog_id ?>&<?php echo api_get_cidreq(); ?>" title="<?php echo get_lang('Home') ?>">
<?php echo Display::return_icon('blog.png', get_lang('Home'),'',ICON_SIZE_MEDIUM); ?></a> <?php echo Display::return_icon('blog.png', get_lang('Home'), '', ICON_SIZE_MEDIUM); ?></a>
<?php if(api_is_allowed('BLOG_'.$blog_id, 'article_add')) { ?> <?php if (api_is_allowed('BLOG_'.$blog_id, 'article_add')) { ?>
<a href="<?php echo api_get_self(); ?>?action=new_post&amp;blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('NewPost') ?>"> <a href="<?php echo api_get_self(); ?>?action=new_post&amp;blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('NewPost') ?>">
<?php echo Display::return_icon('new_article.png', get_lang('NewPost'),'',ICON_SIZE_MEDIUM); ?></a><?php } ?> <?php echo Display::return_icon('new_article.png', get_lang('NewPost'), '', ICON_SIZE_MEDIUM); ?></a><?php } ?>
<?php if(api_is_allowed('BLOG_'.$blog_id, 'task_management')) { ?> <?php if (api_is_allowed('BLOG_'.$blog_id, 'task_management')) { ?>
<a href="<?php echo api_get_self(); ?>?action=manage_tasks&amp;blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('ManageTasks') ?>"> <a href="<?php echo api_get_self(); ?>?action=manage_tasks&amp;blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('ManageTasks') ?>">
<?php echo Display::return_icon('blog_tasks.png', get_lang('TaskManager'),'',ICON_SIZE_MEDIUM); ?></a><?php } ?> <?php echo Display::return_icon('blog_tasks.png', get_lang('TaskManager'), '', ICON_SIZE_MEDIUM); ?></a><?php } ?>
<?php if(api_is_allowed('BLOG_'.$blog_id, 'member_management')) { ?> <?php if (api_is_allowed('BLOG_'.$blog_id, 'member_management')) { ?>
<a href="<?php echo api_get_self(); ?>?action=manage_members&amp;blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('ManageMembers') ?>"> <a href="<?php echo api_get_self(); ?>?action=manage_members&amp;blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('ManageMembers') ?>">
<?php echo Display::return_icon('blog_admin_users.png', get_lang('MemberManager'),'',ICON_SIZE_MEDIUM); ?></a><?php } ?> <?php echo Display::return_icon('blog_admin_users.png', get_lang('MemberManager'), '', ICON_SIZE_MEDIUM); ?></a><?php } ?>
<?php <?php
echo '</div>'; echo '</div>';
@ -315,8 +315,8 @@ Display::display_introduction_section(TOOL_BLOGS);
<div class="panel-heading"><?php echo get_lang('Calendar') ?></div> <div class="panel-heading"><?php echo get_lang('Calendar') ?></div>
<div class="panel-body"> <div class="panel-body">
<?php <?php
$month = isset($_GET['month']) ? (int)$_GET['month'] : (int) date('m'); $month = isset($_GET['month']) ? (int) $_GET['month'] : (int) date('m');
$year = isset($_GET['year']) ? (int)$_GET['year'] : date('Y'); $year = isset($_GET['year']) ? (int) $_GET['year'] : date('Y');
Blog::display_minimonthcalendar($month, $year, $blog_id); Blog::display_minimonthcalendar($month, $year, $blog_id);
?> ?>
</div> </div>
@ -362,7 +362,7 @@ $user_task = false;
$course_id = api_get_course_int_id(); $course_id = api_get_course_int_id();
if (isset ($_GET['task_id']) && is_numeric($_GET['task_id'])) { if (isset ($_GET['task_id']) && is_numeric($_GET['task_id'])) {
$task_id = (int)$_GET['task_id']; $task_id = (int) $_GET['task_id'];
} else { } else {
$task_id = 0; $task_id = 0;
$tbl_blogs_tasks_rel_user = Database :: get_course_table(TABLE_BLOGS_TASKS_REL_USER); $tbl_blogs_tasks_rel_user = Database :: get_course_table(TABLE_BLOGS_TASKS_REL_USER);

@ -45,9 +45,9 @@ if (!empty($event)) {
define('ICAL_LANG', api_get_language_isocode()); define('ICAL_LANG', api_get_language_isocode());
$ical = new vcalendar(); $ical = new vcalendar();
$ical->setConfig('unique_id',api_get_path(WEB_PATH)); $ical->setConfig('unique_id', api_get_path(WEB_PATH));
$ical->setProperty( 'method', 'PUBLISH' ); $ical->setProperty('method', 'PUBLISH');
$ical->setConfig('url',api_get_path(WEB_PATH)); $ical->setConfig('url', api_get_path(WEB_PATH));
$vevent = new vevent(); $vevent = new vevent();
switch ($_GET['class']) { switch ($_GET['class']) {

@ -11,26 +11,26 @@
api_protect_course_script(true); api_protect_course_script(true);
// display categories // display categories
$categories = array (); $categories = array();
foreach ($default_description_titles as $id => $title) { foreach ($default_description_titles as $id => $title) {
$categories[$id] = $title; $categories[$id] = $title;
} }
$categories[ADD_BLOCK] = get_lang('NewBloc'); $categories[ADD_BLOCK] = get_lang('NewBloc');
$i=1; $i = 1;
echo '<div class="actions" style="margin-bottom:30px">'; echo '<div class="actions" style="margin-bottom:30px">';
echo '<a href="index.php?'.api_get_cidreq().'">'. echo '<a href="index.php?'.api_get_cidreq().'">'.
Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('ToolCourseDescription'),'',ICON_SIZE_MEDIUM). Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('ToolCourseDescription'), '', ICON_SIZE_MEDIUM).
'</a>'; '</a>';
ksort($categories); ksort($categories);
foreach ($categories as $id => $title) { foreach ($categories as $id => $title) {
if ($i == ADD_BLOCK) { if ($i == ADD_BLOCK) {
echo '<a href="index.php?'.api_get_cidreq().'&action=add">'. echo '<a href="index.php?'.api_get_cidreq().'&action=add">'.
Display::return_icon($default_description_icon[$id], $title, '',ICON_SIZE_MEDIUM).'</a>'; Display::return_icon($default_description_icon[$id], $title, '', ICON_SIZE_MEDIUM).'</a>';
break; break;
} else { } else {
echo '<a href="index.php?action=edit&'.api_get_cidreq().'&description_type='.$id.'">'. echo '<a href="index.php?action=edit&'.api_get_cidreq().'&description_type='.$id.'">'.
Display::return_icon($default_description_icon[$id], $title,'',ICON_SIZE_MEDIUM).'</a>'; Display::return_icon($default_description_icon[$id], $title, '', ICON_SIZE_MEDIUM).'</a>';
$i++; $i++;
} }
} }

@ -34,21 +34,21 @@ foreach ($default_description_titles as $id => $title) {
} }
$categories[ADD_BLOCK] = get_lang('NewBloc'); $categories[ADD_BLOCK] = get_lang('NewBloc');
$i=1; $i = 1;
echo '<div class="actions" style="margin-bottom:30px">'; echo '<div class="actions" style="margin-bottom:30px">';
echo '<a href="index.php?'.api_get_cidreq().'">'. echo '<a href="index.php?'.api_get_cidreq().'">'.
Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('ToolCourseDescription'),'',ICON_SIZE_MEDIUM). Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('ToolCourseDescription'), '', ICON_SIZE_MEDIUM).
'</a>'; '</a>';
ksort($categories); ksort($categories);
foreach ($categories as $id => $title) { foreach ($categories as $id => $title) {
if ($i==ADD_BLOCK) { if ($i == ADD_BLOCK) {
echo '<a href="index.php?'.api_get_cidreq().'&action=add">'. echo '<a href="index.php?'.api_get_cidreq().'&action=add">'.
Display::return_icon($default_description_icon[$id], $title,'',ICON_SIZE_MEDIUM).'</a>'; Display::return_icon($default_description_icon[$id], $title, '', ICON_SIZE_MEDIUM).'</a>';
break; break;
} else { } else {
echo '<a href="index.php?action=edit&'.api_get_cidreq().'&description_type='.$id.'">'. echo '<a href="index.php?action=edit&'.api_get_cidreq().'&description_type='.$id.'">'.
Display::return_icon($default_description_icon[$id], $title,'',ICON_SIZE_MEDIUM).'</a>'; Display::return_icon($default_description_icon[$id], $title, '', ICON_SIZE_MEDIUM).'</a>';
$i++; $i++;
} }
} }
@ -56,7 +56,7 @@ echo '</div>';
// error messages // error messages
if (isset($error) && intval($error) == 1) { if (isset($error) && intval($error) == 1) {
Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'),false); Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'), false);
} }
// default header title form // default header title form

@ -11,18 +11,18 @@
api_protect_course_script(true); api_protect_course_script(true);
// display actions menu // display actions menu
if (api_is_allowed_to_edit(null,true)) { if (api_is_allowed_to_edit(null, true)) {
$categories = array(); $categories = array();
foreach ($default_description_titles as $id => $title) { foreach ($default_description_titles as $id => $title) {
$categories[$id] = $title; $categories[$id] = $title;
} }
$categories[ADD_BLOCK] = get_lang('NewBloc'); $categories[ADD_BLOCK] = get_lang('NewBloc');
$i=1; $i = 1;
echo '<div class="actions" style="margin-bottom:30px">'; echo '<div class="actions" style="margin-bottom:30px">';
ksort($categories); ksort($categories);
foreach ($categories as $id => $title) { foreach ($categories as $id => $title) {
if ($i==ADD_BLOCK) { if ($i == ADD_BLOCK) {
echo '<a href="index.php?'.api_get_cidreq().'&action=add">'. echo '<a href="index.php?'.api_get_cidreq().'&action=add">'.
Display::return_icon($default_description_icon[$id], $title, '', ICON_SIZE_MEDIUM).'</a>'; Display::return_icon($default_description_icon[$id], $title, '', ICON_SIZE_MEDIUM).'</a>';
break; break;
@ -43,7 +43,7 @@ if ($history) {
<tr> <tr>
<td><h3>'.get_lang('ThematicAdvanceHistory').'</h3></td> <td><h3>'.get_lang('ThematicAdvanceHistory').'</h3></td>
<td align="right"><a href="index.php?action=listing">'. <td align="right"><a href="index.php?action=listing">'.
Display::return_icon('info.png',get_lang('BackToCourseDesriptionList'), array('style'=>'vertical-align:middle;'),ICON_SIZE_SMALL).' '.get_lang('BackToCourseDesriptionList').'</a></td></tr></table></div>'; Display::return_icon('info.png', get_lang('BackToCourseDesriptionList'), array('style'=>'vertical-align:middle;'), ICON_SIZE_SMALL).' '.get_lang('BackToCourseDesriptionList').'</a></td></tr></table></div>';
} }
$user_info = api_get_user_info(); $user_info = api_get_user_info();
@ -52,21 +52,21 @@ if (isset($descriptions) && count($descriptions) > 0) {
foreach ($descriptions as $id => $description) { foreach ($descriptions as $id => $description) {
if (!empty($description)) { if (!empty($description)) {
$actions = ''; $actions = '';
if (api_is_allowed_to_edit(null,true) && !$history) { if (api_is_allowed_to_edit(null, true) && !$history) {
if (api_get_session_id() == $description['session_id']) { if (api_get_session_id() == $description['session_id']) {
$description['title'] = $description['title'].' '.api_get_session_image(api_get_session_id(), $user_info['status']); $description['title'] = $description['title'].' '.api_get_session_image(api_get_session_id(), $user_info['status']);
// delete // delete
$actions .= '<a href="'.api_get_self().'?id='.$description['id'].'&'.api_get_cidreq_params(api_get_course_id(), $description['session_id']).'&action=delete&description_type='.$description['description_type'].'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,api_get_system_encoding())).'\')) return false;">'; $actions .= '<a href="'.api_get_self().'?id='.$description['id'].'&'.api_get_cidreq_params(api_get_course_id(), $description['session_id']).'&action=delete&description_type='.$description['description_type'].'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, api_get_system_encoding())).'\')) return false;">';
$actions .= Display::return_icon('delete.png', get_lang('Delete'), array('style' => 'vertical-align:middle;float:right;'),ICON_SIZE_SMALL); $actions .= Display::return_icon('delete.png', get_lang('Delete'), array('style' => 'vertical-align:middle;float:right;'), ICON_SIZE_SMALL);
$actions .= '</a> '; $actions .= '</a> ';
// edit // edit
$actions .= '<a href="'.api_get_self().'?id='.$description['id'].'&'.api_get_cidreq_params(api_get_course_id(), $description['session_id']).'&action=edit&description_type='.$description['description_type'].'">'; $actions .= '<a href="'.api_get_self().'?id='.$description['id'].'&'.api_get_cidreq_params(api_get_course_id(), $description['session_id']).'&action=edit&description_type='.$description['description_type'].'">';
$actions .= Display::return_icon('edit.png', get_lang('Edit'), array('style' => 'vertical-align:middle;float:right; padding-right:4px;'),ICON_SIZE_SMALL); $actions .= Display::return_icon('edit.png', get_lang('Edit'), array('style' => 'vertical-align:middle;float:right; padding-right:4px;'), ICON_SIZE_SMALL);
$actions .= '</a> '; $actions .= '</a> ';
} else { } else {
$actions .= Display::return_icon('edit_na.png', get_lang('EditionNotAvailableFromSession'), array('style' => 'vertical-align:middle;float:right;'),ICON_SIZE_SMALL); $actions .= Display::return_icon('edit_na.png', get_lang('EditionNotAvailableFromSession'), array('style' => 'vertical-align:middle;float:right;'), ICON_SIZE_SMALL);
} }
} }
echo Display::panel( echo Display::panel(

@ -10,7 +10,7 @@
// actions menu // actions menu
$new_thematic_plan_data = array(); $new_thematic_plan_data = array();
if (!empty($thematic_plan_data)) if (!empty($thematic_plan_data))
foreach($thematic_plan_data as $thematic_item) { foreach ($thematic_plan_data as $thematic_item) {
$thematic_simple_list[] = $thematic_item['description_type']; $thematic_simple_list[] = $thematic_item['description_type'];
$new_thematic_plan_data[$thematic_item['description_type']] = $thematic_item; $new_thematic_plan_data[$thematic_item['description_type']] = $thematic_item;
} }
@ -25,7 +25,7 @@ if (!empty($thematic_simple_list)) {
} }
} }
$i=1; $i = 1;
echo Display::tag('h2', $thematic_data['title']); echo Display::tag('h2', $thematic_data['title']);
echo $thematic_data['content']; echo $thematic_data['content'];
@ -76,7 +76,7 @@ if ($action === 'thematic_plan_list') {
} else { } else {
$thematic_plan = null; $thematic_plan = null;
$default['title['.$id.']'] = $title; $default['title['.$id.']'] = $title;
$default['description['.$id.']']= ''; $default['description['.$id.']'] = '';
} }
$form->setDefaults($default); $form->setDefaults($default);
} }

@ -51,12 +51,12 @@ $current_forum_category = get_forumcategory_information($current_forum['forum_ca
/* Breadcrumbs */ /* Breadcrumbs */
if (isset($_SESSION['gradebook'])){ if (isset($_SESSION['gradebook'])) {
$gradebook = Security::remove_XSS($_SESSION['gradebook']); $gradebook = Security::remove_XSS($_SESSION['gradebook']);
} }
if (!empty($gradebook) && $gradebook == 'view') { if (!empty($gradebook) && $gradebook == 'view') {
$interbreadcrumb[] = array ( $interbreadcrumb[] = array(
'url' => '../gradebook/'.Security::remove_XSS($_SESSION['gradebook_dest']), 'url' => '../gradebook/'.Security::remove_XSS($_SESSION['gradebook_dest']),
'name' => get_lang('ToolGradebook') 'name' => get_lang('ToolGradebook')
); );
@ -114,7 +114,7 @@ if (!empty($groupId)) {
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.$cidreq, 'name' => get_lang('Groups')); $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.$cidreq, 'name' => get_lang('Groups'));
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.$cidreq, 'name' => get_lang('GroupSpace').' '.$groupProperties['name']); $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.$cidreq, 'name' => get_lang('GroupSpace').' '.$groupProperties['name']);
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.$cidreq.'&forum='.intval($_GET['forum']), 'name' => $current_forum['forum_title']); $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.$cidreq.'&forum='.intval($_GET['forum']), 'name' => $current_forum['forum_title']);
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/newthread.php?'.$cidreq.'&forum='.intval($_GET['forum']),'name' => get_lang('NewTopic')); $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/newthread.php?'.$cidreq.'&forum='.intval($_GET['forum']), 'name' => get_lang('NewTopic'));
} else { } else {
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.$cidreq, 'name' => $nameTools); $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.$cidreq, 'name' => $nameTools);
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforumcategory.php?'.$cidreq.'&forumcategory='.$current_forum_category['cat_id'], 'name' => $current_forum_category['cat_title']); $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforumcategory.php?'.$cidreq.'&forumcategory='.$current_forum_category['cat_id'], 'name' => $current_forum_category['cat_title']);

@ -58,7 +58,7 @@ class LinkFactory
* @param string $name_mask search string * @param string $name_mask search string
* @return array link objects matching the search criterium * @return array link objects matching the search criterium
*/ */
public function find_links($name_mask,$selectcat) public function find_links($name_mask, $selectcat)
{ {
return AbstractLink::find_links($name_mask, $selectcat); return AbstractLink::find_links($name_mask, $selectcat);
} }
@ -98,7 +98,7 @@ class LinkFactory
public static function get_all_types() public static function get_all_types()
{ {
//LINK_DROPBOX, //LINK_DROPBOX,
return array ( return array(
LINK_EXERCISE, LINK_EXERCISE,
//LINK_DROPBOX, //LINK_DROPBOX,
LINK_HOTPOTATOES, LINK_HOTPOTATOES,

@ -87,8 +87,8 @@ class UserTable extends SortableTable
// generate the data to display // generate the data to display
$sortable_data = array(); $sortable_data = array();
foreach ($data_array as $data) { foreach ($data_array as $data) {
if ($data[2]!="") {//filter by course removed if ($data[2] != "") {//filter by course removed
$row = array (); $row = array();
$row[] = $this->build_type_column($data[0]); $row[] = $this->build_type_column($data[0]);
$row[] = $this->build_name_link($data[0]); $row[] = $this->build_name_link($data[0]);
$row[] = $data[2]; $row[] = $data[2];
@ -124,15 +124,15 @@ class UserTable extends SortableTable
// evaluation // evaluation
case 'E': case 'E':
return '&nbsp;' return '&nbsp;'
. '<a href="gradebook_view_result.php?selecteval=' . $item->get_id() . '">' . '<a href="gradebook_view_result.php?selecteval='.$item->get_id().'">'
. $item->get_name() . $item->get_name()
. '</a>'; . '</a>';
// link // link
case 'L': case 'L':
return '&nbsp;<a href="' . $item->get_link() . '">' return '&nbsp;<a href="'.$item->get_link().'">'
. $item->get_name() . $item->get_name()
. '</a>' . '</a>'
. '&nbsp;[' . $item->get_type_name() . ']'; . '&nbsp;['.$item->get_type_name().']';
} }
} }
} }

@ -15,7 +15,7 @@ switch ($action) {
$list_sessions = SessionManager::get_sessions_by_user($user_id, true); $list_sessions = SessionManager::get_sessions_by_user($user_id, true);
if (!empty($list_sessions)) { if (!empty($list_sessions)) {
foreach ($list_sessions as $session_item) { foreach ($list_sessions as $session_item) {
echo $session_item['session_name'] . '<br />'; echo $session_item['session_name'].'<br />';
} }
} else { } else {
echo get_lang('NoSessionsForThisUser'); echo get_lang('NoSessionsForThisUser');
@ -29,7 +29,7 @@ switch ($action) {
[ [
's.name' => [ 's.name' => [
'operator' => 'LIKE', 'operator' => 'LIKE',
'value' => "%" . $_REQUEST['q'] . "%" 'value' => "%".$_REQUEST['q']."%"
] ]
] ]
); );

@ -21,7 +21,7 @@ class AddCourseToSession
$course_title = null; $course_title = null;
$xajax_response = new xajaxResponse(); $xajax_response = new xajaxResponse();
$return = ''; $return = '';
if(!empty($needle) && !empty($type)) { if (!empty($needle) && !empty($type)) {
// xajax send utf8 datas... datas in db can be non-utf8 datas // xajax send utf8 datas... datas in db can be non-utf8 datas
$charset = api_get_system_encoding(); $charset = api_get_system_encoding();
$needle = api_convert_encoding($needle, $charset, 'utf-8'); $needle = api_convert_encoding($needle, $charset, 'utf-8');
@ -38,7 +38,7 @@ class AddCourseToSession
while ($row = Database::fetch_row($res)) { while ($row = Database::fetch_row($res)) {
$course_codes .= '\''.$row[0].'\','; $course_codes .= '\''.$row[0].'\',';
} }
$course_codes = substr($course_codes,0,(strlen($course_codes)-1)); $course_codes = substr($course_codes, 0, (strlen($course_codes) - 1));
$cond_course_code = ' AND course.id NOT IN('.$course_codes.') '; $cond_course_code = ' AND course.id NOT IN('.$course_codes.') ';
} }
@ -69,9 +69,9 @@ class AddCourseToSession
if (api_is_multiple_url_enabled()) { if (api_is_multiple_url_enabled()) {
$tbl_course_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE); $tbl_course_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
$access_url_id = api_get_current_access_url_id(); $access_url_id = api_get_current_access_url_id();
if ($access_url_id != -1){ if ($access_url_id != -1) {
if ($type=='single') { if ($type == 'single') {
$sql = 'SELECT $sql = 'SELECT
course.id, course.id,
course.visual_code, course.visual_code,
@ -104,19 +104,19 @@ class AddCourseToSession
if ($type == 'single') { if ($type == 'single') {
while ($course = Database :: fetch_array($rs)) { while ($course = Database :: fetch_array($rs)) {
$course_list[] = $course['code']; $course_list[] = $course['code'];
$course_title=str_replace("'","\'",$course_title); $course_title = str_replace("'", "\'", $course_title);
$return .= '<a href="javascript: void(0);" onclick="javascript: add_course_to_session(\''.$course['id'].'\',\''.$course_title.' ('.$course['visual_code'].')'.'\')">'.$course['title'].' ('.$course['visual_code'].')</a><br />'; $return .= '<a href="javascript: void(0);" onclick="javascript: add_course_to_session(\''.$course['id'].'\',\''.$course_title.' ('.$course['visual_code'].')'.'\')">'.$course['title'].' ('.$course['visual_code'].')</a><br />';
} }
$xajax_response -> addAssign('ajax_list_courses_single','innerHTML',api_utf8_encode($return)); $xajax_response -> addAssign('ajax_list_courses_single', 'innerHTML', api_utf8_encode($return));
} else { } else {
$return .= '<select id="origin" name="NoSessionCoursesList[]" multiple="multiple" size="20" style="width:340px;">'; $return .= '<select id="origin" name="NoSessionCoursesList[]" multiple="multiple" size="20" style="width:340px;">';
while($course = Database :: fetch_array($rs)) { while ($course = Database :: fetch_array($rs)) {
$course_list[] = $course['code']; $course_list[] = $course['code'];
$course_title=str_replace("'","\'",$course_title); $course_title = str_replace("'", "\'", $course_title);
$return .= '<option value="'.$course['id'].'" title="'.htmlspecialchars($course['title'].' ('.$course['visual_code'].')',ENT_QUOTES).'">'.$course['title'].' ('.$course['visual_code'].')</option>'; $return .= '<option value="'.$course['id'].'" title="'.htmlspecialchars($course['title'].' ('.$course['visual_code'].')', ENT_QUOTES).'">'.$course['title'].' ('.$course['visual_code'].')</option>';
} }
$return .= '</select>'; $return .= '</select>';
$xajax_response -> addAssign('ajax_list_courses_multiple','innerHTML',api_utf8_encode($return)); $xajax_response -> addAssign('ajax_list_courses_multiple', 'innerHTML', api_utf8_encode($return));
} }
} }
$_SESSION['course_list'] = $course_list; $_SESSION['course_list'] = $course_list;

@ -660,7 +660,7 @@ class ExtraFieldOption extends Model
$form->addElement('hidden', 'field_id', $this->field_id); $form->addElement('hidden', 'field_id', $this->field_id);
if ($action == 'edit') { if ($action == 'edit') {
$translateUrl = api_get_path(WEB_CODE_PATH) . 'extrafield/translate.php?' . http_build_query([ $translateUrl = api_get_path(WEB_CODE_PATH).'extrafield/translate.php?'.http_build_query([
'extra_field_option' => $id 'extra_field_option' => $id
]); ]);
$translateButton = Display::toolbarButton(get_lang('TranslateThisTerm'), $translateUrl, 'language', 'link'); $translateButton = Display::toolbarButton(get_lang('TranslateThisTerm'), $translateUrl, 'language', 'link');

@ -36,7 +36,7 @@ class LpItem
public function __construct($in_c_id = 0, $in_id = 0) public function __construct($in_c_id = 0, $in_id = 0)
{ {
if ($in_c_id > 0 && $in_id >0) { if ($in_c_id > 0 && $in_id > 0) {
$item_view_table = Database::get_course_table(TABLE_LP_ITEM); $item_view_table = Database::get_course_table(TABLE_LP_ITEM);
$sql = "SELECT * FROM $item_view_table $sql = "SELECT * FROM $item_view_table
WHERE WHERE

@ -93,7 +93,7 @@ class Security
$rel_path = '/'.$rel_path; $rel_path = '/'.$rel_path;
} }
$abs_path = $current_path.$rel_path; $abs_path = $current_path.$rel_path;
$true_path=str_replace("\\", '/', realpath($abs_path)); $true_path = str_replace("\\", '/', realpath($abs_path));
$found = strpos($true_path.'/', $checker_path); $found = strpos($true_path.'/', $checker_path);
if ($found === 0) { if ($found === 0) {
return true; return true;
@ -301,7 +301,7 @@ class Security
} }
// Shows _target attribute in anchors // Shows _target attribute in anchors
$config->set('Attr.AllowedFrameTargets', array('_blank','_top','_self', '_parent')); $config->set('Attr.AllowedFrameTargets', array('_blank', '_top', '_self', '_parent'));
if ($user_status == STUDENT) { if ($user_status == STUDENT) {
global $allowed_html_student; global $allowed_html_student;

@ -117,7 +117,7 @@ class aiccItem extends learnpathItem
$abs_order++; $abs_order++;
$i = 1; $i = 1;
foreach ($this->sub_items as $id => $dummy) { foreach ($this->sub_items as $id => $dummy) {
$oSubitem =& $this->sub_items[$id]; $oSubitem = & $this->sub_items[$id];
$oSubitem->get_flat_list($list, $abs_order, $i, $level + 1); $oSubitem->get_flat_list($list, $abs_order, $i, $level + 1);
$i++; $i++;
} }

@ -19,7 +19,7 @@ body { background: none;}
Display::display_reduced_header(); Display::display_reduced_header();
if (isset($_GET['error'])) { if (isset($_GET['error'])) {
switch ($_GET['error']){ switch ($_GET['error']) {
case 'document_deleted': case 'document_deleted':
echo '<br /><br />'; echo '<br /><br />';
Display::display_error_message(get_lang('DocumentHasBeenDeleted')); Display::display_error_message(get_lang('DocumentHasBeenDeleted'));

@ -163,7 +163,7 @@ function save_item(
// Set status to completed for hotpotatoes if score > 80%. // Set status to completed for hotpotatoes if score > 80%.
if ($my_type == 'hotpotatoes') { if ($my_type == 'hotpotatoes') {
if ((empty($status) || $status == 'undefined' || $status == 'not attempted') && $max > 0) { if ((empty($status) || $status == 'undefined' || $status == 'not attempted') && $max > 0) {
if (($score/$max) > 0.8) { if (($score / $max) > 0.8) {
$myStatus = 'completed'; $myStatus = 'completed';
if ($debug > 1) { if ($debug > 1) {
error_log('Calling set_status('.$myStatus.') for hotpotatoes', 0); error_log('Calling set_status('.$myStatus.') for hotpotatoes', 0);
@ -174,7 +174,7 @@ function save_item(
error_log('Done calling set_status for hotpotatoes - now '.$myLPI->get_status(false), 0); error_log('Done calling set_status for hotpotatoes - now '.$myLPI->get_status(false), 0);
} }
} }
} elseif ($status == 'completed' && $max > 0 && ($score/$max) < 0.8) { } elseif ($status == 'completed' && $max > 0 && ($score / $max) < 0.8) {
$myStatus = 'failed'; $myStatus = 'failed';
if ($debug > 1) { if ($debug > 1) {
error_log('Calling set_status('.$myStatus.') for hotpotatoes', 0); error_log('Calling set_status('.$myStatus.') for hotpotatoes', 0);
@ -367,7 +367,7 @@ function save_item(
$myLPI->current_data = $suspend; $myLPI->current_data = $suspend;
} }
if (isset($location) && $location != '' && $location!='undefined') { if (isset($location) && $location != '' && $location != 'undefined') {
$myLPI->set_lesson_location($location); $myLPI->set_lesson_location($location);
} }

@ -89,7 +89,7 @@ if (isset($_SESSION['gradebook'])) {
} }
if (!empty($gradebook) && $gradebook == 'view') { if (!empty($gradebook) && $gradebook == 'view') {
$interbreadcrumb[] = array ( $interbreadcrumb[] = array(
'url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'name' => get_lang('ToolGradebook') 'name' => get_lang('ToolGradebook')
); );
@ -108,7 +108,7 @@ $interbreadcrumb[] = array(
$show_learn_path = true; $show_learn_path = true;
$lp_theme_css = $_SESSION['oLP']->get_theme(); $lp_theme_css = $_SESSION['oLP']->get_theme();
Display::display_header(get_lang('Edit'),'Path'); Display::display_header(get_lang('Edit'), 'Path');
$suredel = trim(get_lang('AreYouSureToDeleteJS')); $suredel = trim(get_lang('AreYouSureToDeleteJS'));
?> ?>
@ -166,8 +166,8 @@ echo '<div id="lp_sidebar" class="col-md-4">';
$path_item = isset($_GET['path_item']) ? $_GET['path_item'] : 0; $path_item = isset($_GET['path_item']) ? $_GET['path_item'] : 0;
$path_item = Database::escape_string($path_item); $path_item = Database::escape_string($path_item);
$tbl_doc = Database :: get_course_table(TABLE_DOCUMENT); $tbl_doc = Database :: get_course_table(TABLE_DOCUMENT);
$sql_doc = "SELECT path FROM " . $tbl_doc . " $sql_doc = "SELECT path FROM ".$tbl_doc."
WHERE c_id = $course_id AND id = '". $path_item."' "; WHERE c_id = $course_id AND id = '".$path_item."' ";
$res_doc = Database::query($sql_doc); $res_doc = Database::query($sql_doc);
$path_file = Database::result($res_doc, 0, 0); $path_file = Database::result($res_doc, 0, 0);

@ -168,7 +168,7 @@ if ($form->validate()) {
exit; exit;
} else { } else {
$headers = [get_lang('SubscribeUsersToLp'), get_lang('SubscribeGroupsToLp')]; $headers = [get_lang('SubscribeUsersToLp'), get_lang('SubscribeGroupsToLp')];
$tabs = Display::tabs($headers, [$formUsers->toHtml(),$form->toHtml()]); $tabs = Display::tabs($headers, [$formUsers->toHtml(), $form->toHtml()]);
$tpl->assign('tabs', $tabs); $tpl->assign('tabs', $tabs);
} }

@ -15,7 +15,7 @@ $this_section = SECTION_TRACKING;
$sessionId = isset($_GET['session_id']) ? intval($_GET['session_id']) : null; $sessionId = isset($_GET['session_id']) ? intval($_GET['session_id']) : null;
api_block_anonymous_users(); api_block_anonymous_users();
$interbreadcrumb[] = array ("url" => "index.php", "name" => get_lang('MySpace')); $interbreadcrumb[] = array("url" => "index.php", "name" => get_lang('MySpace'));
if (isset($_GET["id_session"]) && $_GET["id_session"] != "") { if (isset($_GET["id_session"]) && $_GET["id_session"] != "") {
$interbreadcrumb[] = array("url" => "session.php", "name" => get_lang('Sessions')); $interbreadcrumb[] = array("url" => "session.php", "name" => get_lang('Sessions'));
@ -78,7 +78,7 @@ if (api_is_drh() || api_is_session_admin() || api_is_platform_admin()) {
if (!api_is_session_admin()) { if (!api_is_session_admin()) {
$menu_items[] = Display::url( $menu_items[] = Display::url(
Display::return_icon('stats.png', get_lang('MyStats'),'',ICON_SIZE_MEDIUM), 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( $menu_items[] = Display::url(

@ -20,14 +20,14 @@ api_block_anonymous_users();
$this_section = SECTION_TRACKING; $this_section = SECTION_TRACKING;
$interbreadcrumb[] = array ("url" => "index.php", "name" => get_lang('MySpace')); $interbreadcrumb[] = array("url" => "index.php", "name" => get_lang('MySpace'));
if (isset($_GET["user_id"]) && $_GET["user_id"] != "" && !isset($_GET["type"])) { if (isset($_GET["user_id"]) && $_GET["user_id"] != "" && !isset($_GET["type"])) {
$interbreadcrumb[] = array ("url" => "teachers.php", "name" => get_lang('Teachers')); $interbreadcrumb[] = array("url" => "teachers.php", "name" => get_lang('Teachers'));
} }
if (isset($_GET["user_id"]) && $_GET["user_id"]!="" && isset($_GET["type"]) && $_GET["type"] == "coach") { if (isset($_GET["user_id"]) && $_GET["user_id"] != "" && isset($_GET["type"]) && $_GET["type"] == "coach") {
$interbreadcrumb[] = array ("url" => "coaches.php", "name" => get_lang('Tutors')); $interbreadcrumb[] = array("url" => "coaches.php", "name" => get_lang('Tutors'));
} }
function get_count_users() function get_count_users()
@ -184,7 +184,7 @@ $actionsLeft = '';
if (api_is_drh()) { if (api_is_drh()) {
$menu_items = array( $menu_items = array(
Display::url(Display::return_icon('stats.png', get_lang('MyStats'), '', ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH)."auth/my_progress.php" ), Display::url(Display::return_icon('stats.png', get_lang('MyStats'), '', ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH)."auth/my_progress.php"),
Display::url(Display::return_icon('user_na.png', get_lang('Students'), array(), ICON_SIZE_MEDIUM), '#'), Display::url(Display::return_icon('user_na.png', get_lang('Students'), array(), ICON_SIZE_MEDIUM), '#'),
Display::url(Display::return_icon('teacher.png', get_lang('Trainers'), array(), ICON_SIZE_MEDIUM), 'teachers.php'), Display::url(Display::return_icon('teacher.png', get_lang('Trainers'), array(), ICON_SIZE_MEDIUM), 'teachers.php'),
Display::url(Display::return_icon('course.png', get_lang('Courses'), array(), ICON_SIZE_MEDIUM), 'course.php'), Display::url(Display::return_icon('course.png', get_lang('Courses'), array(), ICON_SIZE_MEDIUM), 'course.php'),
@ -240,14 +240,14 @@ $table->set_header(4, get_lang('Details'), false);
if ($export_csv) { if ($export_csv) {
if ($is_western_name_order) { if ($is_western_name_order) {
$csv_header[] = array ( $csv_header[] = array(
get_lang('FirstName'), get_lang('FirstName'),
get_lang('LastName'), get_lang('LastName'),
get_lang('FirstLogin'), get_lang('FirstLogin'),
get_lang('LastConnexion') get_lang('LastConnexion')
); );
} else { } else {
$csv_header[] = array ( $csv_header[] = array(
get_lang('LastName'), get_lang('LastName'),
get_lang('FirstName'), get_lang('FirstName'),
get_lang('FirstLogin'), get_lang('FirstLogin'),

@ -16,7 +16,7 @@ $form_sent = 0;
$tool_name = get_lang('ImportSessionDrhList'); $tool_name = get_lang('ImportSessionDrhList');
//$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); //$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
$interbreadcrumb[]=array('url' => 'session_list.php','name' => get_lang('SessionList')); $interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList'));
set_time_limit(0); set_time_limit(0);
@ -27,7 +27,7 @@ Display::display_header($tool_name);
echo '<div class="actions">'; echo '<div class="actions">';
echo '<a href="../session/session_list.php">'. echo '<a href="../session/session_list.php">'.
Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('PlatformAdmin'),'',ICON_SIZE_MEDIUM).'</a>'; Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('PlatformAdmin'), '', ICON_SIZE_MEDIUM).'</a>';
echo '</div>'; echo '</div>';
if (!empty($error_message)) { if (!empty($error_message)) {

@ -38,9 +38,9 @@ if ($form->validate()) {
$nameTools = get_lang('AddGroup'); $nameTools = get_lang('AddGroup');
$this_section = SECTION_SOCIAL; $this_section = SECTION_SOCIAL;
$interbreadcrumb[]= array ('url' =>'home.php','name' => get_lang('Social')); $interbreadcrumb[] = array('url' =>'home.php', 'name' => get_lang('Social'));
$interbreadcrumb[]= array ('url' =>'groups.php','name' => get_lang('Groups')); $interbreadcrumb[] = array('url' =>'groups.php', 'name' => get_lang('Groups'));
$interbreadcrumb[]= array ('url' =>'#','name' => $nameTools); $interbreadcrumb[] = array('url' =>'#', 'name' => $nameTools);
$social_avatar_block = SocialManager::show_social_avatar_block('group_add'); $social_avatar_block = SocialManager::show_social_avatar_block('group_add');
$social_menu_block = SocialManager::show_social_menu('group_add'); $social_menu_block = SocialManager::show_social_menu('group_add');

@ -40,7 +40,7 @@ if (empty($group_id)) {
} }
} }
$interbreadcrumb[] = array('url' =>'groups.php','name' => get_lang('Groups')); $interbreadcrumb[] = array('url' =>'groups.php', 'name' => get_lang('Groups'));
$interbreadcrumb[] = array('url' => 'group_view.php?id='.$group_id, 'name' => $group_info['name']); $interbreadcrumb[] = array('url' => 'group_view.php?id='.$group_id, 'name' => $group_info['name']);
$interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('SubscribeUsersToGroup')); $interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('SubscribeUsersToGroup'));
@ -74,7 +74,7 @@ if (isset($_POST['form_sent']) && $_POST['form_sent']) {
if (is_array($user_list) && count($user_list) > 0) { if (is_array($user_list) && count($user_list) > 0) {
//send invitation message //send invitation message
foreach ($user_list as $user_id){ foreach ($user_list as $user_id) {
$result = MessageManager::send_message( $result = MessageManager::send_message(
$user_id, $user_id,
$title, $title,
@ -110,8 +110,8 @@ if (!$friends) {
if (!isset($group_friend_list[$group_id]) || if (!isset($group_friend_list[$group_id]) ||
isset($group_friend_list[$group_id]) && isset($group_friend_list[$group_id]) &&
$group_friend_list[$group_id]['relation_type'] == '' ) { $group_friend_list[$group_id]['relation_type'] == '') {
$Users[$friend['friend_user_id']]= array( $Users[$friend['friend_user_id']] = array(
'user_id' => $friend['friend_user_id'], 'user_id' => $friend['friend_user_id'],
'firstname' => $friend['firstName'], 'firstname' => $friend['firstName'],
'lastname' => $friend['lastName'], 'lastname' => $friend['lastName'],
@ -120,7 +120,7 @@ if (!$friends) {
); );
} }
} else { } else {
$Users[$friend['friend_user_id']]= array( $Users[$friend['friend_user_id']] = array(
'user_id' => $friend['friend_user_id'], 'user_id' => $friend['friend_user_id'],
'firstname' =>$friend['firstName'], 'firstname' =>$friend['firstName'],
'lastname' => $friend['lastName'], 'lastname' => $friend['lastName'],
@ -131,7 +131,7 @@ if (!$friends) {
} }
} }
if (is_array($Users) && count($Users) > 0 ) { if (is_array($Users) && count($Users) > 0) {
foreach ($Users as $user) { foreach ($Users as $user) {
if ($user['group_id'] != $group_id) { if ($user['group_id'] != $group_id) {
$nosessionUsersList[$user['user_id']] = api_get_person_name( $nosessionUsersList[$user['user_id']] = api_get_person_name(
@ -179,7 +179,7 @@ $members = $usergroup->get_users_by_group(
array(GROUP_USER_PERMISSION_PENDING_INVITATION) array(GROUP_USER_PERMISSION_PENDING_INVITATION)
); );
if (is_array($members) && count($members)>0) { if (is_array($members) && count($members) > 0) {
foreach ($members as &$member) { foreach ($members as &$member) {
$image = UserManager::getUserPicture($member['id']); $image = UserManager::getUserPicture($member['id']);
$member['image'] = '<img class="img-circle" src="'.$image.'" width="50px" height="50px" />'; $member['image'] = '<img class="img-circle" src="'.$image.'" width="50px" height="50px" />';

@ -31,7 +31,7 @@ class ch_multiplechoice extends survey_question
foreach ($formData['answers'] as $key => $value) { foreach ($formData['answers'] as $key => $value) {
$this->getForm()->addHtmlEditor('answers['.$key.']', null, false, false, $config); $this->getForm()->addHtmlEditor('answers['.$key.']', null, false, false, $config);
if ($key < $total-1) { if ($key < $total - 1) {
//$this->getForm()->addButton("move_down[$key]", get_lang('Down')); //$this->getForm()->addButton("move_down[$key]", get_lang('Down'));
} }
@ -39,7 +39,7 @@ class ch_multiplechoice extends survey_question
//$this->getForm()->addButton("move_up[$key]", get_lang('Up')); //$this->getForm()->addButton("move_up[$key]", get_lang('Up'));
} }
if ($total> 2) { if ($total > 2) {
$this->getForm()->addButton("delete_answer[$key]", get_lang('Delete'), 'trash', 'danger'); $this->getForm()->addButton("delete_answer[$key]", get_lang('Delete'), 'trash', 'danger');
} }
} }

@ -38,7 +38,7 @@ class ch_score extends survey_question
$options = array( $options = array(
'--' => '--' '--' => '--'
); );
for ($i=1; $i <= $questionData['maximum_score']; $i++) { for ($i = 1; $i <= $questionData['maximum_score']; $i++) {
$options[$i] = $i; $options[$i] = $i;
} }

@ -43,7 +43,7 @@ class ch_yesno extends survey_question
$class = 'radio-inline'; $class = 'radio-inline';
} }
$name = 'question' . $questionData['question_id']; $name = 'question'.$questionData['question_id'];
$form->addRadio( $form->addRadio(
$name, $name,

@ -89,7 +89,7 @@ switch ($action) {
$form = TicketManager::getCategoryForm($url, $projectId); $form = TicketManager::getCategoryForm($url, $projectId);
$formToString = $form->returnForm(); $formToString = $form->returnForm();
if ($form->validate()) { if ($form->validate()) {
$values =$form->getSubmitValues(); $values = $form->getSubmitValues();
$params = [ $params = [
'name' => $values['name'], 'name' => $values['name'],
@ -125,7 +125,7 @@ switch ($action) {
$form->setDefaults($cat); $form->setDefaults($cat);
$formToString = $form->returnForm(); $formToString = $form->returnForm();
if ($form->validate()) { if ($form->validate()) {
$values =$form->getSubmitValues(); $values = $form->getSubmitValues();
$params = [ $params = [
'name' => $values['name'], 'name' => $values['name'],

@ -21,7 +21,7 @@ $export_to_xls = false;
if (isset($_GET['export'])) { if (isset($_GET['export'])) {
$export_to_xls = true; $export_to_xls = true;
} }
if (api_is_platform_admin() ) { if (api_is_platform_admin()) {
$global = true; $global = true;
} else { } else {
$global = false; $global = false;
@ -33,12 +33,12 @@ if (empty($session_id)) {
$session_id = 1; $session_id = 1;
} }
$form = new FormValidator('search_simple','POST','','',null,false); $form = new FormValidator('search_simple', 'POST', '', '', null, false);
//Get session list //Get session list
$session_list = SessionManager::get_sessions_list(array(), array('name')); $session_list = SessionManager::get_sessions_list(array(), array('name'));
$my_session_list = array(); $my_session_list = array();
foreach($session_list as $sesion_item) { foreach ($session_list as $sesion_item) {
$my_session_list[$sesion_item['id']] = $sesion_item['name']; $my_session_list[$sesion_item['id']] = $sesion_item['name'];
} }
if (count($session_list) == 0) { if (count($session_list) == 0) {
@ -85,7 +85,7 @@ $course_average = $course_average_counter = array();
$counter = 0; $counter = 0;
$main_result = array(); $main_result = array();
//Getting course list //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_info = api_get_course_info($current_course['code']);
$_course = $course_info; $_course = $course_info;
$attempt_result = array(); $attempt_result = array();
@ -121,7 +121,7 @@ if (!empty($users) && is_array($users)) {
$html_result .= '<table class="data_table">'; $html_result .= '<table class="data_table">';
$html_result .= '<tr><th>'.get_lang('User').'</th>'; $html_result .= '<tr><th>'.get_lang('User').'</th>';
foreach($course_list as $item ) { foreach ($course_list as $item) {
$html_result .= '<th>'.$item['title'].'<br /> '.get_lang('AverageScore').' %</th>'; $html_result .= '<th>'.$item['title'].'<br /> '.get_lang('AverageScore').' %</th>';
} }
$html_result .= '<th>'.get_lang('AverageScore').' %</th>'; $html_result .= '<th>'.get_lang('AverageScore').' %</th>';
@ -129,9 +129,9 @@ if (!empty($users) && is_array($users)) {
foreach ($users as $user) { foreach ($users as $user) {
$total_student = 0; $total_student = 0;
$counter ++; $counter++;
$s_css_class = 'row_even'; $s_css_class = 'row_even';
if ($counter % 2 ==0 ) { if ($counter % 2 == 0) {
$s_css_class = 'row_odd'; $s_css_class = 'row_odd';
} }
$html_result .= "<tr class='$s_css_class'> $html_result .= "<tr class='$s_css_class'>
@ -143,7 +143,7 @@ if (!empty($users) && is_array($users)) {
$counter = 0; $counter = 0;
$total_result_by_user = 0; $total_result_by_user = 0;
foreach ($course_list as $current_course ) { foreach ($course_list as $current_course) {
$total_course = 0; $total_course = 0;
$html_result .= "<td>"; $html_result .= "<td>";
@ -160,9 +160,9 @@ if (!empty($users) && is_array($users)) {
$total_result_by_user += $result; $total_result_by_user += $result;
$course_average[$current_course['code']] += $total_course; $course_average[$current_course['code']] += $total_course;
$course_average_counter[$current_course['code']]++; $course_average_counter[$current_course['code']]++;
$result = $result . ' (' . $user_info_stat['attempts'] . ' ' . get_lang( $result = $result.' ('.$user_info_stat['attempts'].' '.get_lang(
'Attempts' 'Attempts'
) . ')'; ).')';
$counter++; $counter++;
} }
} }
@ -173,21 +173,21 @@ if (!empty($users) && is_array($users)) {
if (empty($counter)) { if (empty($counter)) {
$total_student = '-'; $total_student = '-';
} else { } else {
$total_student = $total_result_by_user/$counter; $total_student = $total_result_by_user / $counter;
$total_average_score+=$total_student; $total_average_score += $total_student;
$total_average_score_count++; $total_average_score_count++;
} }
$string_date=Tracking :: get_last_connection_date($user['user_id'],true); $string_date = Tracking :: get_last_connection_date($user['user_id'], true);
$html_result .="<td>$total_student</td><td>$string_date</td></tr>"; $html_result .= "<td>$total_student</td><td>$string_date</td></tr>";
} }
$html_result .="<tr><th>".get_lang('AverageScore')."</th>"; $html_result .= "<tr><th>".get_lang('AverageScore')."</th>";
$total_average = 0; $total_average = 0;
$counter = 0; $counter = 0;
foreach($course_list as $course_item) { foreach ($course_list as $course_item) {
if (!empty($course_average_counter[$course_item['code']])) { if (!empty($course_average_counter[$course_item['code']])) {
$average_per_course = round( $average_per_course = round(
$course_average[$course_item['code']]/($course_average_counter[$course_item['code']]*100)*100, $course_average[$course_item['code']] / ($course_average_counter[$course_item['code']] * 100) * 100,
2 2
); );
} else { } else {
@ -197,17 +197,17 @@ if (!empty($users) && is_array($users)) {
$counter++; $counter++;
} }
$total_average = $total_average + $average_per_course; $total_average = $total_average + $average_per_course;
$html_result .="<td>$average_per_course</td>"; $html_result .= "<td>$average_per_course</td>";
} }
if (!empty($total_average_score_count)) { if (!empty($total_average_score_count)) {
$total_average = round($total_average_score/($total_average_score_count*100)*100,2); $total_average = round($total_average_score / ($total_average_score_count * 100) * 100, 2);
} else { } else {
$total_average = '-'; $total_average = '-';
} }
$html_result .='<td>'.$total_average.'</td>'; $html_result .= '<td>'.$total_average.'</td>';
$html_result .="<td>-</td>"; $html_result .= "<td>-</td>";
$html_result .="</tr>"; $html_result .= "</tr>";
$html_result .= '</table>'; $html_result .= '</table>';
} else { } else {
Display::display_warning_message(get_lang('NoResults')); Display::display_warning_message(get_lang('NoResults'));

@ -12,9 +12,9 @@ api_block_anonymous_users();
$this_section = SECTION_COURSES; $this_section = SECTION_COURSES;
$interbreadcrumb[]= array ('url' =>'classes.php','name' => get_lang('Classes')); $interbreadcrumb[] = array('url' =>'classes.php', 'name' => get_lang('Classes'));
if (isset($_GET['id'])) { if (isset($_GET['id'])) {
$interbreadcrumb[]= array ('url' =>'#','name' => get_lang('Groups')); $interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('Groups'));
} }
Display :: display_header($tool_name, 'Classes'); Display :: display_header($tool_name, 'Classes');

@ -18,7 +18,7 @@ class CourseSession extends Resource
* @param int $id * @param int $id
* @param string $title * @param string $title
*/ */
public function __construct($id,$title) public function __construct($id, $title)
{ {
parent::__construct($id, RESOURCE_SESSION_COURSE); parent::__construct($id, RESOURCE_SESSION_COURSE);
$this->title = $title; $this->title = $title;

@ -22,9 +22,9 @@ class Glossary extends Resource
* @param string $description * @param string $description
* @param int $display_order * @param int $display_order
*/ */
public function __construct($id,$name,$description,$display_order) public function __construct($id, $name, $description, $display_order)
{ {
parent::__construct($id,RESOURCE_GLOSSARY); parent::__construct($id, RESOURCE_GLOSSARY);
$this->glossary_id = $id; $this->glossary_id = $id;
$this->name = $name; $this->name = $name;
$this->description = $description; $this->description = $description;

@ -46,7 +46,7 @@ class Link extends Resource
$category_id, $category_id,
$on_homepage $on_homepage
) { ) {
parent::__construct($id,RESOURCE_LINK); parent::__construct($id, RESOURCE_LINK);
$this->title = $title; $this->title = $title;
$this->url = $url; $this->url = $url;
$this->description = $description; $this->description = $description;

@ -29,9 +29,9 @@ class LinkCategory extends Resource
* @param string $title * @param string $title
* @param string $description * @param string $description
*/ */
public function __construct($id,$title,$description,$display_order) public function __construct($id, $title, $description, $display_order)
{ {
parent::__construct($id,RESOURCE_LINKCATEGORY); parent::__construct($id, RESOURCE_LINKCATEGORY);
$this->title = $title; $this->title = $title;
$this->description = $description; $this->description = $description;
$this->display_order = $display_order; $this->display_order = $display_order;

Loading…
Cancel
Save