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. 12
      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. 38
      main/admin/ldap_import_students_to_session.php
  11. 2
      main/admin/skills_wheel.php
  12. 2
      main/admin/system_status.php
  13. 4
      main/admin/usergroup_export.php
  14. 12
      main/attendance/attendance_edit.php
  15. 2
      main/auth/shibboleth/test/shibboleth_test.class.php
  16. 46
      main/blog/blog.php
  17. 6
      main/calendar/ical_export.php
  18. 10
      main/course_description/add.php
  19. 12
      main/course_description/edit.php
  20. 18
      main/course_description/listing.php
  21. 8
      main/course_progress/thematic_plan.php
  22. 6
      main/forum/newthread.php
  23. 2
      main/gradebook/gradebook_add_link.php
  24. 4
      main/gradebook/lib/be/linkfactory.class.php
  25. 10
      main/gradebook/lib/fe/usertable.class.php
  26. 2
      main/inc/ajax/link.ajax.php
  27. 4
      main/inc/ajax/session.ajax.php
  28. 2
      main/inc/lib/AnnouncementEmail.php
  29. 20
      main/inc/lib/add_courses_to_session_functions.lib.php
  30. 4
      main/inc/lib/extra_field_option.lib.php
  31. 2
      main/inc/lib/lp_item.lib.php
  32. 6
      main/inc/lib/security.lib.php
  33. 2
      main/lp/aiccItem.class.php
  34. 2
      main/lp/blank.php
  35. 6
      main/lp/lp_ajax_save_item.php
  36. 8
      main/lp/lp_edit_item.php
  37. 2
      main/lp/lp_subscribe_users.php
  38. 6
      main/mySpace/course.php
  39. 16
      main/mySpace/users.php
  40. 4
      main/session/session_import_drh.php
  41. 6
      main/social/group_add.php
  42. 18
      main/social/group_invitation.php
  43. 4
      main/survey/ch_multiplechoice.php
  44. 2
      main/survey/ch_score.php
  45. 2
      main/survey/ch_yesno.php
  46. 2
      main/survey/link.php
  47. 4
      main/ticket/categories.php
  48. 50
      main/tracking/course_session_report.php
  49. 2
      main/user/class.php
  50. 4
      main/user/classes.php
  51. 2
      src/Chamilo/CourseBundle/Component/CourseCopy/CourseBuilder.php
  52. 2
      src/Chamilo/CourseBundle/Component/CourseCopy/Resources/CourseSession.php
  53. 4
      src/Chamilo/CourseBundle/Component/CourseCopy/Resources/Glossary.php
  54. 2
      src/Chamilo/CourseBundle/Component/CourseCopy/Resources/Link.php
  55. 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);
$tool_name = get_lang('AddUserGroupToURL');
$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array ('url' => 'access_urls.php', 'name' => get_lang('MultipleAccessURLs'));
$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array('url' => 'access_urls.php', 'name' => get_lang('MultipleAccessURLs'));
Display::display_header($tool_name);
@ -46,8 +46,8 @@ api_display_tool_title($tool_name);
if (isset($_POST['form_sent']) && $_POST['form_sent']) {
$form_sent = $_POST['form_sent'];
$userGroups = is_array($_POST['user_group_list']) ? $_POST['user_group_list'] : array() ;
$urlList = is_array($_POST['url_list']) ? $_POST['url_list'] : array() ;
$userGroups = is_array($_POST['user_group_list']) ? $_POST['user_group_list'] : array();
$urlList = is_array($_POST['url_list']) ? $_POST['url_list'] : array();
$firstLetterUserGroup = $_POST['first_letter_user_group'];
if ($form_sent == 1) {

@ -15,18 +15,18 @@ api_protect_admin_script(true);
$tool_name = get_lang('SessionOverview');
$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
$interbreadcrumb[]=array('url' => 'session_list.php','name' => get_lang('SessionList'));
$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList'));
// Database Table Definitions
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_USER);
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_USER);
$table_access_url_user = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$url_id = api_get_current_access_url_id();
$action = $_GET['action'];
switch($action) {
switch ($action) {
case 'add_user_to_url':
$user_id = $_REQUEST['user_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'];
$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'));
$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']);
}
$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']);
}
@ -157,23 +157,23 @@ $url_list = UrlManager::get_url_data();
<?php echo $link_add_type_unique ?>&nbsp;|&nbsp;<?php echo $link_add_type_multiple ?>
</div>
<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').' : '; ?>
<select name="access_url_id" onchange="javascript:send();">
<option value="0">-- <?php echo get_lang('SelectUrl')?> -- </option>
<?php
$url_selected='';
$url_selected = '';
foreach ($url_list as $url_obj) {
$checked = '';
if (!empty($access_url_id)) {
if ($url_obj[0]==$access_url_id) {
if ($url_obj[0] == $access_url_id) {
$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
}
}
@ -196,7 +196,7 @@ $url_list = UrlManager::get_url_data();
<td align="center">
<div id="content_source">
<?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)" />
<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;">
<?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>
<?php
@ -220,7 +220,7 @@ $url_list = UrlManager::get_url_data();
</td>
<td width="10%" valign="middle" align="center">
<?php
if($ajax_search) {
if ($ajax_search) {
?>
<button class="btn btn-default" type="button" onclick="remove_item(document.getElementById('destination_users'))" >
<em class="fa fa-arrow-left"></em>
@ -243,7 +243,7 @@ $url_list = UrlManager::get_url_data();
<td align="center">
<select id="destination_users" name="course_list[]" multiple="multiple" size="15" style="width:380px;">
<?php
foreach($course_list as $course) {
foreach ($course_list as $course) {
$courseInfo = api_get_course_info_by_id($course['id']);
?>
<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">
<br />
<?php
if(isset($_GET['add']))
if (isset($_GET['add']))
echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('AddCoursesToURL').'</button>';
else
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);
// 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->addButtonSend(get_lang('ArchiveDirCleanupProceedButton'));

@ -26,7 +26,7 @@ if (isset($_POST['activeExtension'])) {
$rs = Database::query($sql);
if (Database::affected_rows($rs)>0){
if (Database::affected_rows($rs) > 0) {
$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"';
$rs = Database::query($sql);
while($row = Database::fetch_array($rs)){
while ($row = Database::fetch_array($rs)) {
$listActiveServices[] = $row['variable'];
}
// javascript to handle accordion behaviour
$javascript_message = '';
if(!empty($message)){
if (!empty($message)) {
$javascript_message = '
document.getElementById("message").style.display = "block";
var timer = setTimeout(hideMessage, 5000);';
}
$htmlHeadXtra[]= '<script>
$htmlHeadXtra[] = '<script>
var listeDiv;
var extensionsHeader = new Array();
var extensionsContent = new Array();
@ -135,7 +135,7 @@ Display::display_header($nameTool);
?>
<div id="message" style="display: none">
<?php
if(!empty($message))
if (!empty($message))
Display::display_normal_message($message)
?>
</div>

@ -89,26 +89,26 @@ function import_pdfs($file, $subDir = '/')
{
$baseDir = api_get_path(SYS_ARCHIVE_PATH);
$uploadPath = 'pdfimport/';
$errors = array ();
$errors = array();
if (!is_dir($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__);
return $errors;
}
$list = scandir($baseDir.$uploadPath);
$i = 0;
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;
}
$parts = preg_split('/_/',$file);
$parts = preg_split('/_/', $file);
$course = api_get_course_info($parts[0]);
if (count($course) > 0) {
// Build file info because handle_uploaded_document() needs it (name, type, size, tmp_name)
$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 (!is_file($baseDir.$uploadPath.$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
) {
$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)";
}
@ -62,7 +62,7 @@ function get_number_of_courses()
if ((api_is_platform_admin() || api_is_session_admin()) &&
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);
@ -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
) {
$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)";
}
@ -136,7 +136,7 @@ function get_course_data($from, $number_of_items, $column, $direction)
if ((api_is_platform_admin() || api_is_session_admin()) &&
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 ";
@ -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'])) {
$sessionId = intval($_GET['session_id']);
$sql.= " WHERE s.id = ".$sessionId;
$sql .= " WHERE s.id = ".$sessionId;
}
$sql .= " ORDER BY col$column $direction ";
$sql .= " LIMIT $from,$number_of_items";
$res = Database::query($sql);
$courses = array ();
$courses = array();
while ($course = Database::fetch_array($res)) {
// Place colour icons in front of courses.
$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) {
$style = 'margin-bottom:0;margin-right:5px;';
switch($v) {
switch ($v) {
case 0:
return Display::return_icon('bullet_red.png', get_lang('CourseVisibilityClosed'), array('style' => $style));
break;
@ -341,7 +341,7 @@ if (isset ($_GET['search']) && $_GET['search'] === 'advanced') {
$form->setDefaults($defaults);
$content .= $form->returnForm();
} else {
$interbreadcrumb[] = array ('url' => 'index.php', "name" => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array('url' => 'index.php', "name" => get_lang('PlatformAdmin'));
$tool_name = get_lang('CourseList');
if (isset($_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->addElement('text', 'keyword', null, array('id' => 'course-search-keyword'));
$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
$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();
$actions .= '<div class="row">';
$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') {
$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 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');
}
$parameters=array();
$parameters = array();
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'])) {
$parameters['keyword_code'] = Security::remove_XSS($_GET['keyword_code']);
$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);
$number_of_items = intval($number_of_items);
$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
id AS col0,

@ -18,7 +18,7 @@ api_protect_admin_script();
$htmlHeadXtra[] = api_get_jqgrid_js();
// setting breadcrumbs
$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
$tool_name = null;
@ -39,23 +39,23 @@ $check = Security::check_token('request');
$token = Security::get_token();
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.'&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' => '#','name' => get_lang('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.'&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' => '#', 'name' => get_lang('Add'));
} 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.'&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_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_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 {
$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, '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' => '#','name' => get_lang('EditExtraFieldOptions'));
$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('EditExtraFieldOptions'));
}
//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)
$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>'.
'&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>'.
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>'.
'\';
}';
$htmlHeadXtra[]='<script>
$htmlHeadXtra[] = '<script>
$(function() {
// grid definition see the $obj->display() function
'.Display::grid_js(

@ -9,7 +9,7 @@
* Code
*/
// resetting the course id
$cidReset=true;
$cidReset = true;
require_once('../inc/global.inc.php');
// setting the section (for the tabs)
$this_section = SECTION_PLATFORM_ADMIN;
@ -17,11 +17,11 @@ $this_section = SECTION_PLATFORM_ADMIN;
api_protect_admin_script();
require('../auth/ldap/authldap.php');
$annee_base=date('Y');
$annee_base = date('Y');
$tool_name = get_lang('LDAPImport');
// 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">
var buttoncheck = 1;
@ -64,7 +64,7 @@ if (empty($annee) && empty($id_session))
echo '</div>';
}
elseif(!empty($annee) && empty($id_session))
elseif (!empty($annee) && empty($id_session))
{
Display::display_header($tool_name);
echo '<div style="align:center">';
@ -75,14 +75,14 @@ elseif(!empty($annee) && empty($id_session))
echo '<select name="id_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 ".
" ORDER BY name";
$result = Database::query($sql);
$sessions=Database::store_result($result);
$nbr_results=count($sessions);
foreach($sessions as $row) {
$sessions = Database::store_result($result);
$nbr_results = count($sessions);
foreach ($sessions as $row) {
echo '<option value="'.$row['id'].'">'.api_htmlentities($row['name']).' ('.$row['access_start_date'].' - '.$row['access_end_date'].')</option>';
}
echo '</select>';
@ -114,7 +114,7 @@ elseif (!empty($annee) && !empty($id_session) && empty($_POST['confirmed']))
$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];
$prenom_form[] = $info[$key]["givenname"][0];
$email_form[] = $info[$key]["mail"][0];
@ -134,7 +134,7 @@ elseif (!empty($annee) && !empty($id_session) && empty($_POST['confirmed']))
asort($nom_form);
reset($nom_form);
$statut=5;
$statut = 5;
include ('ldap_form_add_users_group.php');
} else {
echo '<h4>'.get_lang('UnableToConnectTo').' '.$host.'</h4>';
@ -145,24 +145,24 @@ elseif (!empty($annee) && !empty($id_session) && empty($_POST['confirmed']))
echo '</div>';
}
elseif (!empty($annee) && !empty($id_session) && ($_POST['confirmed']=='yes'))
elseif (!empty($annee) && !empty($id_session) && ($_POST['confirmed'] == 'yes'))
{
$id=$_POST['username_form'];
$UserList=array();
$id = $_POST['username_form'];
$UserList = array();
$userid_match_login = array();
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);
$UserList[]= $tmp;
$UserList[] = $tmp;
$userid_match_login[$tmp] = $user_id;
}
}
if (!empty($_POST['id_session'])) {
$num = 0;
$tbl_session_user = Database::get_main_table(TABLE_MAIN_SESSION_USER);
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
foreach ($UserList as $user_id) {
$res_user = Database::insert(
$tbl_session_user,
@ -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);
$res = Database::query($sql);
}
@ -205,8 +205,8 @@ elseif (!empty($annee) && !empty($id_session) && ($_POST['confirmed']=='yes'))
else
{
Display::display_header($tool_name);
$message=get_lang('NoUserAdded');
Display :: display_normal_message($message,false);
$message = get_lang('NoUserAdded');
Display :: display_normal_message($message, false);
}
echo '<br /><br />';
echo '<a href="ldap_import_students.php?annee=&composante=&etape=">'.get_lang('BackToNewSearch').'</a>';

@ -37,7 +37,7 @@ if (isset($_GET['skill_id'])) {
$url = api_get_path(WEB_AJAX_PATH)."skill.ajax.php?a=get_skills_tree_json&load_user=$load_user";
$tpl->assign('wheel_url', $url);
$url = api_get_path(WEB_AJAX_PATH).'skill.ajax.php?1=1';
$url = api_get_path(WEB_AJAX_PATH).'skill.ajax.php?1=1';
$tpl->assign('url', $url);
$tpl->assign('isAdministration', true);

@ -11,7 +11,7 @@ require_once __DIR__.'/../inc/global.inc.php';
$this_section = SECTION_PLATFORM_ADMIN;
// User permissions
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'));
$diag = new Diagnoser();
$diag->show_html();

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

@ -12,7 +12,7 @@ api_protect_course_script(true);
// error messages
if (isset($error)) {
Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'),false);
Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'), false);
}
if (!isset($error)) {
@ -49,18 +49,18 @@ $form->addHtmlEditor(
if (Gradebook::is_active()) {
if (!empty($attendance_qualify_title) || !empty($attendance_weight)) {
$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(
'checkbox',
'attendance_qualify_gradebook',
'',
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 {
$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(
'checkbox',
'attendance_qualify_gradebook',
@ -68,7 +68,7 @@ if (Gradebook::is_active()) {
get_lang('QualifyAttendanceGradebook'),
'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);
$form->addElement('text', 'attendance_qualify_title', get_lang('TitleColumnGradebook'));

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

@ -21,7 +21,7 @@ $current_course_tool = TOOL_BLOGS;
api_protect_course_script(true);
$lib_path = api_get_path(LIBRARY_PATH);
$blog_table_attachment = Database::get_course_table(TABLE_BLOGS_ATTACHMENT);
$blog_table_attachment = Database::get_course_table(TABLE_BLOGS_ATTACHMENT);
$nameTools = get_lang('Blogs');
$DaysShort = api_get_week_days_short();
@ -134,7 +134,7 @@ if (!empty($_POST['new_task_execution_submit'])) {
$safe_comment_title,
$safe_comment_text,
$blog_id,
(int)$_GET['post_id'],
(int) $_GET['post_id'],
$_POST['comment_parent_id'],
$_POST['task_id']
);
@ -146,29 +146,29 @@ if (!empty($_POST['new_task_execution_submit'])) {
if (!empty($_POST['register'])) {
if (is_array($_POST['user'])) {
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 (is_array($_POST['user'])) {
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'])) {
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'));
$flag = 1;
}
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['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'));
}
@ -181,9 +181,9 @@ if (isset($_GET['action']) && $_GET['action'] == 'manage_tasks') {
if (isset($_GET['action']) && $_GET['action'] == 'view_post') {
$task_id = (isset ($_GET['task_id']) && is_numeric($_GET['task_id'])) ? $_GET['task_id'] : 0;
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)) {
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'));
} else {
$error = true;
@ -191,9 +191,9 @@ 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)) {
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
$return_message = array('type' => 'confirmation', 'message' => get_lang('BlogDeleted'));
} else {
@ -204,13 +204,13 @@ if (isset($_GET['action']) && $_GET['action'] == 'view_post') {
if (isset($_GET['do']) && $_GET['do'] == 'rate') {
if (isset($_GET['type']) && $_GET['type'] == 'post') {
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'));
}
}
if (isset($_GET['type']) && $_GET['type'] == 'comment') {
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'));
}
}
@ -289,16 +289,16 @@ if (!empty($return_message)) {
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') ?>">
<?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 echo Display::return_icon('blog.png', get_lang('Home'), '', ICON_SIZE_MEDIUM); ?></a>
<?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') ?>">
<?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 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')) { ?>
<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 if(api_is_allowed('BLOG_'.$blog_id, 'member_management')) { ?>
<?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')) { ?>
<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
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-body">
<?php
$month = isset($_GET['month']) ? (int)$_GET['month'] : (int) date('m');
$year = isset($_GET['year']) ? (int)$_GET['year'] : date('Y');
$month = isset($_GET['month']) ? (int) $_GET['month'] : (int) date('m');
$year = isset($_GET['year']) ? (int) $_GET['year'] : date('Y');
Blog::display_minimonthcalendar($month, $year, $blog_id);
?>
</div>
@ -362,7 +362,7 @@ $user_task = false;
$course_id = api_get_course_int_id();
if (isset ($_GET['task_id']) && is_numeric($_GET['task_id'])) {
$task_id = (int)$_GET['task_id'];
$task_id = (int) $_GET['task_id'];
} else {
$task_id = 0;
$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());
$ical = new vcalendar();
$ical->setConfig('unique_id',api_get_path(WEB_PATH));
$ical->setProperty( 'method', 'PUBLISH' );
$ical->setConfig('url',api_get_path(WEB_PATH));
$ical->setConfig('unique_id', api_get_path(WEB_PATH));
$ical->setProperty('method', 'PUBLISH');
$ical->setConfig('url', api_get_path(WEB_PATH));
$vevent = new vevent();
switch ($_GET['class']) {

@ -11,26 +11,26 @@
api_protect_course_script(true);
// display categories
$categories = array ();
$categories = array();
foreach ($default_description_titles as $id => $title) {
$categories[$id] = $title;
}
$categories[ADD_BLOCK] = get_lang('NewBloc');
$i=1;
$i = 1;
echo '<div class="actions" style="margin-bottom:30px">';
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>';
ksort($categories);
foreach ($categories as $id => $title) {
if ($i == ADD_BLOCK) {
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;
} else {
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++;
}
}

@ -34,21 +34,21 @@ foreach ($default_description_titles as $id => $title) {
}
$categories[ADD_BLOCK] = get_lang('NewBloc');
$i=1;
$i = 1;
echo '<div class="actions" style="margin-bottom:30px">';
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>';
ksort($categories);
foreach ($categories as $id => $title) {
if ($i==ADD_BLOCK) {
if ($i == ADD_BLOCK) {
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;
} else {
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++;
}
}
@ -56,7 +56,7 @@ echo '</div>';
// error messages
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

@ -11,18 +11,18 @@
api_protect_course_script(true);
// display actions menu
if (api_is_allowed_to_edit(null,true)) {
if (api_is_allowed_to_edit(null, true)) {
$categories = array();
foreach ($default_description_titles as $id => $title) {
$categories[$id] = $title;
}
$categories[ADD_BLOCK] = get_lang('NewBloc');
$i=1;
$i = 1;
echo '<div class="actions" style="margin-bottom:30px">';
ksort($categories);
foreach ($categories as $id => $title) {
if ($i==ADD_BLOCK) {
if ($i == ADD_BLOCK) {
echo '<a href="index.php?'.api_get_cidreq().'&action=add">'.
Display::return_icon($default_description_icon[$id], $title, '', ICON_SIZE_MEDIUM).'</a>';
break;
@ -43,7 +43,7 @@ if ($history) {
<tr>
<td><h3>'.get_lang('ThematicAdvanceHistory').'</h3></td>
<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();
@ -52,21 +52,21 @@ if (isset($descriptions) && count($descriptions) > 0) {
foreach ($descriptions as $id => $description) {
if (!empty($description)) {
$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']) {
$description['title'] = $description['title'].' '.api_get_session_image(api_get_session_id(), $user_info['status']);
// 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 .= Display::return_icon('delete.png', get_lang('Delete'), array('style' => 'vertical-align:middle;float:right;'),ICON_SIZE_SMALL);
$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 .= '</a> ';
// 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 .= 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> ';
} 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(

@ -10,7 +10,7 @@
// actions menu
$new_thematic_plan_data = array();
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'];
$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 $thematic_data['content'];
@ -75,8 +75,8 @@ if ($action === 'thematic_plan_list') {
$thematic_plan = null;
} else {
$thematic_plan = null;
$default['title['.$id.']'] = $title;
$default['description['.$id.']']= '';
$default['title['.$id.']'] = $title;
$default['description['.$id.']'] = '';
}
$form->setDefaults($default);
}

@ -51,12 +51,12 @@ $current_forum_category = get_forumcategory_information($current_forum['forum_ca
/* Breadcrumbs */
if (isset($_SESSION['gradebook'])){
if (isset($_SESSION['gradebook'])) {
$gradebook = Security::remove_XSS($_SESSION['gradebook']);
}
if (!empty($gradebook) && $gradebook == 'view') {
$interbreadcrumb[] = array (
$interbreadcrumb[] = array(
'url' => '../gradebook/'.Security::remove_XSS($_SESSION['gradebook_dest']),
'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_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/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 {
$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']);

@ -14,7 +14,7 @@ api_block_anonymous_users();
GradebookUtils::block_students();
$courseCode = isset($_GET['course_code']) ? Security::remove_XSS($_GET['course_code']) : null;
$selectCat = isset($_GET['selectcat']) ? (int) $_GET['selectcat'] : 0;
$selectCat = isset($_GET['selectcat']) ? (int) $_GET['selectcat'] : 0;
$course_info = api_get_course_info($courseCode);
$tbl_forum_thread = Database :: get_course_table(TABLE_FORUM_THREAD);

@ -58,7 +58,7 @@ class LinkFactory
* @param string $name_mask search string
* @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);
}
@ -98,7 +98,7 @@ class LinkFactory
public static function get_all_types()
{
//LINK_DROPBOX,
return array (
return array(
LINK_EXERCISE,
//LINK_DROPBOX,
LINK_HOTPOTATOES,

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

@ -24,7 +24,7 @@ switch ($action) {
// set URL and other appropriate options
$defaults = array(
CURLOPT_URL => $url,
CURLOPT_FOLLOWLOCATION => true, // follow redirects accept youtube.com
CURLOPT_FOLLOWLOCATION => true, // follow redirects accept youtube.com
CURLOPT_HEADER => 0,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 4

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

@ -203,7 +203,7 @@ class AnnouncementEmail
*
* @return array
*/
public function sender($key = '', $userId = '')
public function sender($key = '', $userId = '')
{
$_user = api_get_user_info($userId);

@ -21,7 +21,7 @@ class AddCourseToSession
$course_title = null;
$xajax_response = new xajaxResponse();
$return = '';
if(!empty($needle) && !empty($type)) {
if (!empty($needle) && !empty($type)) {
// xajax send utf8 datas... datas in db can be non-utf8 datas
$charset = api_get_system_encoding();
$needle = api_convert_encoding($needle, $charset, 'utf-8');
@ -38,7 +38,7 @@ class AddCourseToSession
while ($row = Database::fetch_row($res)) {
$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.') ';
}
@ -69,9 +69,9 @@ class AddCourseToSession
if (api_is_multiple_url_enabled()) {
$tbl_course_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
$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
course.id,
course.visual_code,
@ -104,19 +104,19 @@ class AddCourseToSession
if ($type == 'single') {
while ($course = Database :: fetch_array($rs)) {
$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 />';
}
$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 {
$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_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>';
$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 .= '</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;

@ -216,7 +216,7 @@ class ExtraFieldOption extends Model
foreach ($sub_options as $sub_option) {
if (!empty($sub_option)) {
$new_params = array(
$new_params = array(
'field_id' => $field_id,
'option_value' => $sub_id,
'display_text' => $sub_option,
@ -660,7 +660,7 @@ class ExtraFieldOption extends Model
$form->addElement('hidden', 'field_id', $this->field_id);
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
]);
$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)
{
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);
$sql = "SELECT * FROM $item_view_table
WHERE

@ -93,7 +93,7 @@ class Security
$rel_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);
if ($found === 0) {
return true;
@ -278,7 +278,7 @@ class Security
}
if ($user_status == COURSEMANAGERLOWSECURITY) {
return $var; // No filtering.
return $var; // No filtering.
}
static $purifier = array();
@ -301,7 +301,7 @@ class Security
}
// 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) {
global $allowed_html_student;

@ -117,7 +117,7 @@ class aiccItem extends learnpathItem
$abs_order++;
$i = 1;
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);
$i++;
}

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

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

@ -89,7 +89,7 @@ if (isset($_SESSION['gradebook'])) {
}
if (!empty($gradebook) && $gradebook == 'view') {
$interbreadcrumb[] = array (
$interbreadcrumb[] = array(
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'name' => get_lang('ToolGradebook')
);
@ -108,7 +108,7 @@ $interbreadcrumb[] = array(
$show_learn_path = true;
$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'));
?>
@ -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 = Database::escape_string($path_item);
$tbl_doc = Database :: get_course_table(TABLE_DOCUMENT);
$sql_doc = "SELECT path FROM " . $tbl_doc . "
WHERE c_id = $course_id AND id = '". $path_item."' ";
$sql_doc = "SELECT path FROM ".$tbl_doc."
WHERE c_id = $course_id AND id = '".$path_item."' ";
$res_doc = Database::query($sql_doc);
$path_file = Database::result($res_doc, 0, 0);

@ -168,7 +168,7 @@ if ($form->validate()) {
exit;
} else {
$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);
}

@ -15,7 +15,7 @@ $this_section = SECTION_TRACKING;
$sessionId = isset($_GET['session_id']) ? intval($_GET['session_id']) : null;
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"] != "") {
$interbreadcrumb[] = array("url" => "session.php", "name" => get_lang('Sessions'));
@ -63,7 +63,7 @@ if (api_is_drh() || api_is_session_admin() || api_is_platform_admin()) {
$user_id = intval($_GET['user_id']);
$user_info = api_get_user_info($user_id);
$title = get_lang('AssignedCoursesTo').' '.api_get_person_name($user_info['firstname'], $user_info['lastname']);
$courses = CourseManager::get_course_list_of_user_as_course_admin($user_id);
$courses = CourseManager::get_course_list_of_user_as_course_admin($user_id);
} else {
$title = get_lang('YourCourseList');
$courses = CourseManager::get_courses_followed_by_drh(api_get_user_id());
@ -78,7 +78,7 @@ if (api_is_drh() || api_is_session_admin() || api_is_platform_admin()) {
if (!api_is_session_admin()) {
$menu_items[] = Display::url(
Display::return_icon('stats.png', get_lang('MyStats'),'',ICON_SIZE_MEDIUM),
Display::return_icon('stats.png', get_lang('MyStats'), '', ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH)."auth/my_progress.php"
);
$menu_items[] = Display::url(

@ -20,14 +20,14 @@ api_block_anonymous_users();
$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"])) {
$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") {
$interbreadcrumb[] = array ("url" => "coaches.php", "name" => get_lang('Tutors'));
if (isset($_GET["user_id"]) && $_GET["user_id"] != "" && isset($_GET["type"]) && $_GET["type"] == "coach") {
$interbreadcrumb[] = array("url" => "coaches.php", "name" => get_lang('Tutors'));
}
function get_count_users()
@ -163,7 +163,7 @@ function get_users($from, $limit, $column, $direction)
$detailsLink = '<a href="myStudents.php?student='.$student_id.'&id_coach='.$coach_id.'&id_session='.$sessionId.'">
'.Display::return_icon('2rightarrow.png', get_lang('Details')).'</a>';
} else {
$detailsLink = '<a href="myStudents.php?student='.$student_id.'">
$detailsLink = '<a href="myStudents.php?student='.$student_id.'">
'.Display::return_icon('2rightarrow.png', get_lang('Details')).'</a>';
}
$row[] = $detailsLink;
@ -184,7 +184,7 @@ $actionsLeft = '';
if (api_is_drh()) {
$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('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'),
@ -240,14 +240,14 @@ $table->set_header(4, get_lang('Details'), false);
if ($export_csv) {
if ($is_western_name_order) {
$csv_header[] = array (
$csv_header[] = array(
get_lang('FirstName'),
get_lang('LastName'),
get_lang('FirstLogin'),
get_lang('LastConnexion')
);
} else {
$csv_header[] = array (
$csv_header[] = array(
get_lang('LastName'),
get_lang('FirstName'),
get_lang('FirstLogin'),

@ -16,7 +16,7 @@ $form_sent = 0;
$tool_name = get_lang('ImportSessionDrhList');
//$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);
@ -27,7 +27,7 @@ Display::display_header($tool_name);
echo '<div class="actions">';
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>';
if (!empty($error_message)) {

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

@ -18,7 +18,7 @@ $this_section = SECTION_SOCIAL;
// Database Table Definitions
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_group_rel_user = Database::get_main_table(TABLE_USERGROUP_REL_USER);
$tbl_group_rel_user = Database::get_main_table(TABLE_USERGROUP_REL_USER);
// setting the name of the tool
$tool_name = get_lang('SubscribeUsersToGroup');
@ -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' =>'#', '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) {
//send invitation message
foreach ($user_list as $user_id){
foreach ($user_list as $user_id) {
$result = MessageManager::send_message(
$user_id,
$title,
@ -110,8 +110,8 @@ if (!$friends) {
if (!isset($group_friend_list[$group_id]) ||
isset($group_friend_list[$group_id]) &&
$group_friend_list[$group_id]['relation_type'] == '' ) {
$Users[$friend['friend_user_id']]= array(
$group_friend_list[$group_id]['relation_type'] == '') {
$Users[$friend['friend_user_id']] = array(
'user_id' => $friend['friend_user_id'],
'firstname' => $friend['firstName'],
'lastname' => $friend['lastName'],
@ -120,7 +120,7 @@ if (!$friends) {
);
}
} else {
$Users[$friend['friend_user_id']]= array(
$Users[$friend['friend_user_id']] = array(
'user_id' => $friend['friend_user_id'],
'firstname' =>$friend['firstName'],
'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) {
if ($user['group_id'] != $group_id) {
$nosessionUsersList[$user['user_id']] = api_get_person_name(
@ -143,7 +143,7 @@ if (is_array($Users) && count($Users) > 0 ) {
}
$social_left_content = SocialManager::show_social_menu('invite_friends', $group_id);
$social_right_content = '<h3 class="group-title">'.Security::remove_XSS($group_info['name'], STUDENT, true).'</h3>';
$social_right_content = '<h3 class="group-title">'.Security::remove_XSS($group_info['name'], STUDENT, true).'</h3>';
if (count($nosessionUsersList) == 0) {
$friends = SocialManager::get_friends(api_get_user_id());
@ -179,7 +179,7 @@ $members = $usergroup->get_users_by_group(
array(GROUP_USER_PERMISSION_PENDING_INVITATION)
);
if (is_array($members) && count($members)>0) {
if (is_array($members) && count($members) > 0) {
foreach ($members as &$member) {
$image = UserManager::getUserPicture($member['id']);
$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) {
$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'));
}
@ -39,7 +39,7 @@ class ch_multiplechoice extends survey_question
//$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');
}
}

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

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

@ -11,7 +11,7 @@ if (empty($survey_id)) {
if (!SurveyManager::survey_generation_hash_available()) {
api_not_allowed(true);
}
$course_info = api_get_course_info_by_id($_REQUEST['c']);
$course_info = api_get_course_info_by_id($_REQUEST['c']);
$hash_is_valid = SurveyManager::validate_survey_hash(
$survey_id,

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

@ -21,7 +21,7 @@ $export_to_xls = false;
if (isset($_GET['export'])) {
$export_to_xls = true;
}
if (api_is_platform_admin() ) {
if (api_is_platform_admin()) {
$global = true;
} else {
$global = false;
@ -30,15 +30,15 @@ $global = true;
$session_id = isset($_GET['session_id']) ? intval($_GET['session_id']) : null;
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
$session_list = SessionManager::get_sessions_list(array(), array('name'));
$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'];
}
if (count($session_list) == 0) {
@ -70,7 +70,7 @@ if (!$export_to_xls) {
}
echo '</div>';
if (api_is_platform_admin()) {
if (api_is_platform_admin()) {
echo MySpace::getAdminActions();
}
@ -85,7 +85,7 @@ $course_average = $course_average_counter = array();
$counter = 0;
$main_result = array();
//Getting course list
foreach ($course_list as $current_course ) {
foreach ($course_list as $current_course) {
$course_info = api_get_course_info($current_course['code']);
$_course = $course_info;
$attempt_result = array();
@ -121,7 +121,7 @@ if (!empty($users) && is_array($users)) {
$html_result .= '<table class="data_table">';
$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>'.get_lang('AverageScore').' %</th>';
@ -129,9 +129,9 @@ if (!empty($users) && is_array($users)) {
foreach ($users as $user) {
$total_student = 0;
$counter ++;
$counter++;
$s_css_class = 'row_even';
if ($counter % 2 ==0 ) {
if ($counter % 2 == 0) {
$s_css_class = 'row_odd';
}
$html_result .= "<tr class='$s_css_class'>
@ -143,12 +143,12 @@ if (!empty($users) && is_array($users)) {
$counter = 0;
$total_result_by_user = 0;
foreach ($course_list as $current_course ) {
foreach ($course_list as $current_course) {
$total_course = 0;
$html_result .= "<td>";
$result = '-';
$result = '-';
if (isset($main_result[$current_course['code']][$user['user_id']])) {
$user_info_stat = $main_result[$current_course['code']][$user['user_id']];
if (!empty($user_info_stat['result']) && !empty($user_info_stat['attempts'])) {
@ -160,9 +160,9 @@ if (!empty($users) && is_array($users)) {
$total_result_by_user += $result;
$course_average[$current_course['code']] += $total_course;
$course_average_counter[$current_course['code']]++;
$result = $result . ' (' . $user_info_stat['attempts'] . ' ' . get_lang(
$result = $result.' ('.$user_info_stat['attempts'].' '.get_lang(
'Attempts'
) . ')';
).')';
$counter++;
}
}
@ -173,21 +173,21 @@ if (!empty($users) && is_array($users)) {
if (empty($counter)) {
$total_student = '-';
} else {
$total_student = $total_result_by_user/$counter;
$total_average_score+=$total_student;
$total_student = $total_result_by_user / $counter;
$total_average_score += $total_student;
$total_average_score_count++;
}
$string_date=Tracking :: get_last_connection_date($user['user_id'],true);
$html_result .="<td>$total_student</td><td>$string_date</td></tr>";
$string_date = Tracking :: get_last_connection_date($user['user_id'], true);
$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;
$counter = 0;
foreach($course_list as $course_item) {
foreach ($course_list as $course_item) {
if (!empty($course_average_counter[$course_item['code']])) {
$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
);
} else {
@ -197,17 +197,17 @@ if (!empty($users) && is_array($users)) {
$counter++;
}
$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)) {
$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 {
$total_average = '-';
}
$html_result .='<td>'.$total_average.'</td>';
$html_result .="<td>-</td>";
$html_result .="</tr>";
$html_result .= '<td>'.$total_average.'</td>';
$html_result .= "<td>-</td>";
$html_result .= "</tr>";
$html_result .= '</table>';
} else {
Display::display_warning_message(get_lang('NoResults'));

@ -146,7 +146,7 @@ Display :: display_header($tool_name, "User");
$(function() {
<?php
// grid definition see the $usergroup>display() function
echo Display::grid_js('usergroups', $url, $columns, $columnModel, $extraParams, array(), '', true);
echo Display::grid_js('usergroups', $url, $columns, $columnModel, $extraParams, array(), '', true);
?>
});
</script>

@ -12,9 +12,9 @@ api_block_anonymous_users();
$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'])) {
$interbreadcrumb[]= array ('url' =>'#','name' => get_lang('Groups'));
$interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('Groups'));
}
Display :: display_header($tool_name, 'Classes');

@ -569,7 +569,7 @@ class CourseBuilder
$table_doc = Database:: get_course_table(TABLE_DOCUMENT);
if (!empty($courseId) && !empty($session_id)) {
$session_id = intval($session_id);
$session_id = intval($session_id);
if ($with_base_content) {
$session_condition = api_get_session_condition(
$session_id,

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

@ -22,9 +22,9 @@ class Glossary extends Resource
* @param string $description
* @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->name = $name;
$this->description = $description;

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

@ -29,9 +29,9 @@ class LinkCategory extends Resource
* @param string $title
* @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->description = $description;
$this->display_order = $display_order;

Loading…
Cancel
Save