Scrutinizer Auto-Fixes

This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
remotes/angel/1.11.x
Scrutinizer Auto-Fixer 8 years ago
parent 981560ab35
commit 2dce14872e
  1. 12
      main/admin/access_url_edit_course_category_to_url.php
  2. 28
      main/admin/add_sessions_to_promotion.php
  3. 30
      main/admin/dashboard_add_sessions_to_user.php
  4. 2
      main/admin/skills_import.php
  5. 24
      main/auth/inscription.php
  6. 26
      main/cron/import_csv.php
  7. 2
      main/dropbox/update.php
  8. 24
      main/exercise/Hpdownload.php
  9. 38
      main/exercise/export/qti2/qti2_export.php
  10. 2
      main/exercise/hotspot_actionscript.as.php
  11. 2
      main/exercise/upload_exercise.php
  12. 6
      main/forum/forumsearch.php
  13. 72
      main/forum/index.php
  14. 48
      main/forum/viewthread_flat.inc.php
  15. 8
      main/inc/lib/access_url_edit_users_to_url_functions.lib.php
  16. 28
      main/inc/lib/course_request.lib.php
  17. 139
      main/inc/lib/display.lib.php
  18. 4
      main/inc/lib/formvalidator/Rule/HTML.php
  19. 50
      main/inc/lib/groupmanager.lib.php
  20. 4
      main/inc/lib/search/xapian/XapianIndexer.class.php
  21. 4
      main/inc/lib/search/xapian/XapianQuery.php
  22. 50
      main/inc/lib/sub_language.class.php
  23. 12
      main/inc/lib/tracking.lib.php
  24. 76
      main/inc/lib/usermanager.lib.php
  25. 38
      main/lp/scorm.class.php
  26. 158
      main/reports/modules/scorm.php
  27. 28
      main/reports/templates/courseTime.reports.php
  28. 30
      main/reports/templates/generic.reports.php
  29. 12
      main/search/search_suggestions.php
  30. 62
      main/session/index.php
  31. 28
      main/ticket/tickets.php
  32. 6
      plugin/azure_active_directory/src/callback.php
  33. 2
      plugin/bbb/cron.php
  34. 6
      plugin/jcapture/applet.php
  35. 8
      plugin/olpc_peru_filter/lib/olpc_peru_filter_plugin.class.php
  36. 2
      plugin/vchamilo/cli/cron.php
  37. 2
      src/Chamilo/CourseBundle/Component/CourseCopy/Resources/ScormDocument.php

@ -113,7 +113,7 @@ if ($ajax_search) {
foreach ($userGroups as $item) {
if ($item['access_url_id'] == $access_url_id) {
$userGroupList[$item['id']] = $item ;
$userGroupList[$item['id']] = $item;
}
}
$noUserGroupList = CourseCategory::getCourseCategoryNotInList(array_keys($userGroupList));
@ -151,11 +151,11 @@ $url_list = UrlManager::get_url_data();
if (!empty($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) { ?>
<option <?php echo $checked;?> value="<?php echo $url_obj[0]; ?>"> <?php echo $url_obj[1]; ?>
if ($url_obj['active'] == 1) { ?>
<option <?php echo $checked; ?> value="<?php echo $url_obj[0]; ?>"> <?php echo $url_obj[1]; ?>
</option>
<?php
}
@ -171,7 +171,7 @@ $url_list = UrlManager::get_url_data();
<td align="center"><b><?php echo get_lang('CourseCategoryInPlatform') ?> :</b>
</td>
<td></td>
<td align="center"><b><?php printf(get_lang('CourseCategoryListInX'),$url_selected); ?></b></td>
<td align="center"><b><?php printf(get_lang('CourseCategoryListInX'), $url_selected); ?></b></td>
</tr>
<tr>
@ -208,7 +208,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($userGroupList as $item) {
foreach ($userGroupList as $item) {
?>
<option value="<?php echo $item['id']; ?>">
<?php echo $item['name']; ?>

@ -10,7 +10,7 @@ $cidReset = true;
require_once __DIR__.'/../inc/global.inc.php';
$xajax = new xajax();
$xajax->registerFunction ('search_sessions');
$xajax->registerFunction('search_sessions');
// setting the section (for the tabs)
$this_section = SECTION_PLATFORM_ADMIN;
@ -19,13 +19,13 @@ $this_section = SECTION_PLATFORM_ADMIN;
api_protect_admin_script(true);
// setting breadcrumbs
$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
$interbreadcrumb[]=array('url' => 'career_dashboard.php','name' => get_lang('CareersAndPromotions'));
$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array('url' => 'career_dashboard.php', 'name' => get_lang('CareersAndPromotions'));
// Setting the name of the tool
$tool_name = get_lang('SubscribeSessionsToPromotions');
$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']);
}
@ -74,7 +74,7 @@ if (isset($_POST['form_sent']) && $_POST['form_sent']) {
$form_sent = $_POST['form_sent'];
$session_in_promotion_posted = $_POST['session_in_promotion_name'];
if (!is_array($session_in_promotion_posted)) {
$session_in_promotion_posted=array($session_in_promotion_posted);
$session_in_promotion_posted = array($session_in_promotion_posted);
}
if ($form_sent == 1) {
// Added a parameter to send emails when registering a user
@ -119,15 +119,15 @@ if ($add_type == 'multiple') {
}
echo '<div class="actions">';
echo '<a href="promotions.php">'.Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>';
echo '<a href="promotions.php">'.Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
echo '</div>';
?>
<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>>
<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if (!empty($_GET['add'])) echo '&add=true'; ?>" style="margin:0px;" <?php if ($ajax_search) {echo ' onsubmit="valide();"'; }?>>
<?php echo '<legend>'.$tool_name.' '.$promotion_data['name'].'</legend>';
if ($add_type=='multiple') {
if ($add_type == 'multiple') {
$extraField = new \ExtraField('session');
$extra_field_list = $extraField->get_all_extra_field_by_type(ExtraField::FIELD_TYPE_SELECT);
$new_field_list = array();
@ -139,7 +139,7 @@ if ($add_type=='multiple') {
echo '&nbsp;<select name="'.$varname.'">';
echo '<option value="0">--'.get_lang('Select').'--</option>';
foreach ($new_field['data'] as $option) {
$checked='';
$checked = '';
if (isset($_POST[$varname])) {
if ($_POST[$varname] == $option[1]) {
$checked = 'selected="true"';
@ -170,7 +170,7 @@ if (!empty($errorMsg)) {
<td align="center"><b><?php echo get_lang('SessionsInPromotion') ?> :</b></td>
</tr>
<?php if ($add_type=='multiple') { ?>
<?php if ($add_type == 'multiple') { ?>
<tr>
<td align="center">
<?php echo get_lang('FirstLetterSessions'); ?> :
@ -188,7 +188,7 @@ if (!empty($errorMsg)) {
<td align="center">
<div id="content_source">
<?php
if (!($add_type=='multiple')) {
if (!($add_type == 'multiple')) {
?>
<input type="text" id="user_to_add" onkeyup="xajax_search_users(this.value,'single')" />
<div id="ajax_list_users_single"></div>
@ -196,7 +196,7 @@ if (!empty($errorMsg)) {
} else {
?>
<div id="ajax_list_multiple">
<?php echo Display::select('session_not_in_promotion_name',$session_not_in_promotion, '',array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'session_not_in_promotion','size'=>'15px'),false); ?>
<?php echo Display::select('session_not_in_promotion_name', $session_not_in_promotion, '', array('style'=>'width:360px', 'multiple'=>'multiple', 'id'=>'session_not_in_promotion', 'size'=>'15px'), false); ?>
</div>
<?php
}
@ -231,7 +231,7 @@ if (!empty($errorMsg)) {
'session_in_promotion_name[]',
$session_in_promotion,
'',
array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'session_in_promotion','size'=>'15px'),
array('style'=>'width:360px', 'multiple'=>'multiple', 'id'=>'session_in_promotion', 'size'=>'15px'),
false
);
unset($sessionUsersList);
@ -341,7 +341,7 @@ function search_sessions($needle, $type)
}
}
$return .= '</select>';
$xajax_response -> addAssign('ajax_list_multiple','innerHTML',api_utf8_encode($return));
$xajax_response -> addAssign('ajax_list_multiple', 'innerHTML', api_utf8_encode($return));
}
return $xajax_response;

@ -46,7 +46,7 @@ if (UserManager::is_admin($user_id)) {
}
$add_type = 'multiple';
if (isset($_GET['add_type']) && $_GET['add_type']!='') {
if (isset($_GET['add_type']) && $_GET['add_type'] != '') {
$add_type = Security::remove_XSS($_REQUEST['add_type']);
}
@ -82,10 +82,10 @@ function search_sessions($needle, $type)
$sql = "SELECT s.id, s.name FROM $tbl_session s
WHERE s.name LIKE '$needle%' $without_assigned_sessions ";
}
$rs = Database::query($sql);
$rs = Database::query($sql);
$return .= '<select class="form-control" id="origin" name="NoAssignedSessionsList[]" multiple="multiple" size="20">';
while($session = Database :: fetch_array($rs)) {
$return .= '<option value="'.$session['id'].'" title="'.htmlspecialchars($session['name'],ENT_QUOTES).'">'.$session['name'].'</option>';
while ($session = Database :: fetch_array($rs)) {
$return .= '<option value="'.$session['id'].'" title="'.htmlspecialchars($session['name'], ENT_QUOTES).'">'.$session['name'].'</option>';
}
$return .= '</select>';
$xajax_response->addAssign(
@ -174,10 +174,10 @@ Display::display_header($tool_name);
// Actions
if ($user_info['status'] != SESSIONADMIN) {
$actionsLeft = '<a href="dashboard_add_users_to_user.php?user='.$user_id.'">' .
Display::return_icon('add-user.png', get_lang('AssignUsers'), null, ICON_SIZE_MEDIUM ) . '</a>';
$actionsLeft .= '<a href="dashboard_add_courses_to_user.php?user='.$user_id.'">' .
Display::return_icon('course-add.png', get_lang('AssignCourses'), null, ICON_SIZE_MEDIUM) . '</a>';
$actionsLeft = '<a href="dashboard_add_users_to_user.php?user='.$user_id.'">'.
Display::return_icon('add-user.png', get_lang('AssignUsers'), null, ICON_SIZE_MEDIUM).'</a>';
$actionsLeft .= '<a href="dashboard_add_courses_to_user.php?user='.$user_id.'">'.
Display::return_icon('course-add.png', get_lang('AssignCourses'), null, ICON_SIZE_MEDIUM).'</a>';
echo Display::toolbarAction('toolbar-dashboard', array($actionsLeft));
}
@ -193,7 +193,7 @@ $assigned_sessions_id = array_keys($assigned_sessions_to_hrm);
$without_assigned_sessions = '';
if (count($assigned_sessions_id) > 0) {
$without_assigned_sessions = " AND s.id NOT IN (".implode(',',$assigned_sessions_id).") ";
$without_assigned_sessions = " AND s.id NOT IN (".implode(',', $assigned_sessions_id).") ";
}
$needle = '%';
@ -214,9 +214,9 @@ if (api_is_multiple_url_enabled()) {
WHERE s.name LIKE '$needle%' $without_assigned_sessions
ORDER BY s.name";
}
$result = Database::query($sql);
$result = Database::query($sql);
?>
<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?user=<?php echo $user_id ?>" style="margin:0px;" <?php if($ajax_search){ echo ' onsubmit="valide();"';}?>>
<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?user=<?php echo $user_id ?>" style="margin:0px;" <?php if ($ajax_search) { echo ' onsubmit="valide();"'; }?>>
<input type="hidden" name="formSent" value="1" />
<div class="row">
@ -227,7 +227,7 @@ $result = Database::query($sql);
<?php
while ($enreg = Database::fetch_array($result)) {
?>
<option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['name'],ENT_QUOTES).'"';?>>
<option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['name'], ENT_QUOTES).'"'; ?>>
<?php echo $enreg['name']; ?>
</option>
<?php } ?>
@ -237,7 +237,7 @@ $result = Database::query($sql);
<div class="col-md-4">
<div class="code-course">
<?php if ($add_type == 'multiple') { ?>
<p><?php echo get_lang('FirstLetterSession');?> :</p>
<p><?php echo get_lang('FirstLetterSession'); ?> :</p>
<select class="selectpicker form-control" name="firstLetterSession" onchange = "xajax_search_sessions(this.value, 'multiple')">
<option value="%">--</option>
<?php echo Display :: get_alphabet_options($firstLetterSession); ?>
@ -286,9 +286,9 @@ $result = Database::query($sql);
<select id='destination' name="SessionsList[]" multiple="multiple" size="20" style="width:320px;">
<?php
if (is_array($assigned_sessions_to_hrm)) {
foreach($assigned_sessions_to_hrm as $enreg) {
foreach ($assigned_sessions_to_hrm as $enreg) {
?>
<option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['name'],ENT_QUOTES).'"'; ?>>
<option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['name'], ENT_QUOTES).'"'; ?>>
<?php echo $enreg['name'] ?>
</option>
<?php }

@ -277,7 +277,7 @@ $toolbar .= Display::url(
);
$actions = '<div class="actions">' . $toolbar . '</div>';
$actions = '<div class="actions">'.$toolbar.'</div>';
echo $actions;

@ -34,7 +34,7 @@ $geolocalization = $gMapsPlugin->get('enable_api') === 'true';
if ($geolocalization) {
$gmapsApiKey = $gMapsPlugin->get('api_key');
$htmlHeadXtra[] = '<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=true&key='. $gmapsApiKey . '" ></script>';
$htmlHeadXtra[] = '<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=true&key='.$gmapsApiKey.'" ></script>';
}
$htmlHeadXtra[] = api_get_password_checker_js('#username', '#pass1');
@ -109,7 +109,7 @@ if ($user_already_registered_show_terms === false) {
if (api_get_setting('registration', 'email') != 'true') {
$form->addRule('email', get_lang('ThisFieldIsRequired'), 'required');
}
$form->addRule('email', sprintf(get_lang('UsernameMaxXCharacters'), (string)USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
$form->addRule('email', sprintf(get_lang('UsernameMaxXCharacters'), (string) USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
$form->addRule('email', get_lang('UserTaken'), 'username_available');
}
@ -151,7 +151,7 @@ if ($user_already_registered_show_terms === false) {
);
$form->applyFilter('username', 'trim');
$form->addRule('username', get_lang('ThisFieldIsRequired'), 'required');
$form->addRule('username', sprintf(get_lang('UsernameMaxXCharacters'), (string)USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
$form->addRule('username', sprintf(get_lang('UsernameMaxXCharacters'), (string) USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
$form->addRule('username', get_lang('UsernameWrong'), 'username');
$form->addRule('username', get_lang('UserTaken'), 'username_available');
}
@ -399,7 +399,7 @@ if (!CustomPages::enabled()) {
}
}
$tool_name = get_lang('Registration', null, (!empty($_POST['language'])?$_POST['language']: $_user['language']));
$tool_name = get_lang('Registration', null, (!empty($_POST['language']) ? $_POST['language'] : $_user['language']));
if (api_get_setting('allow_terms_conditions') === 'true' && $user_already_registered_show_terms) {
$tool_name = get_lang('TermsAndConditions');
@ -420,7 +420,7 @@ if (!CustomPages::enabled()) {
}
if (file_exists($home.'register_top_'.$user_selected_language.'.html')) {
$home_top_temp = @(string)file_get_contents($home.'register_top_'.$user_selected_language.'.html');
$home_top_temp = @(string) file_get_contents($home.'register_top_'.$user_selected_language.'.html');
$open = str_replace('{rel_path}', api_get_path(REL_PATH), $home_top_temp);
$open = api_to_system_encoding($open, api_detect_encoding(strip_tags($open)));
if (!empty($open)) {
@ -449,7 +449,7 @@ if (api_get_setting('allow_terms_conditions') == 'true') {
if (api_get_setting('show_terms_if_profile_completed') === 'true') {
$userInfo = api_get_user_info();
if ($userInfo && $userInfo['status'] != ANONYMOUS) {
if ((int)$userInfo['profile_completed'] !== 1) {
if ((int) $userInfo['profile_completed'] !== 1) {
api_not_allowed(true);
}
}
@ -676,7 +676,7 @@ if ($form->validate()) {
Database::query($sql);
// 2. Send mail to all platform admin
$emailsubject = get_lang('ApprovalForNewAccount', null, $values['language']).': '.$values['username'];
$emailsubject = get_lang('ApprovalForNewAccount', null, $values['language']).': '.$values['username'];
$emailbody = get_lang('ApprovalForNewAccount', null, $values['language'])."\n";
$emailbody .= get_lang('UserName', null, $values['language']).': '.$values['username']."\n";
@ -820,14 +820,14 @@ if ($form->validate()) {
}
} else {
if (!empty($values['email'])) {
$text_after_registration.= '<p>'.get_lang('MailHasBeenSent', null, $_user['language']).'.</p>';
$text_after_registration .= '<p>'.get_lang('MailHasBeenSent', null, $_user['language']).'.</p>';
}
if ($is_allowedCreateCourse) {
if ($usersCanCreateCourse) {
$form_data['message'] = '<p>'. get_lang('NowGoCreateYourCourse', null, $_user['language']). "</p>";
$form_data['message'] = '<p>'.get_lang('NowGoCreateYourCourse', null, $_user['language'])."</p>";
}
$form_data['action'] = api_get_path(WEB_CODE_PATH).'create_course/add_course.php';
$form_data['action'] = api_get_path(WEB_CODE_PATH).'create_course/add_course.php';
if (api_get_setting('course_validation') === 'true') {
$form_data['button'] = Display::button(
@ -850,7 +850,7 @@ if ($form->validate()) {
} else {
if (api_get_setting('allow_students_to_browse_courses') == 'true') {
$form_data['action'] = 'courses.php?action=subscribe';
$form_data['message'] = '<p>'. get_lang('NowGoChooseYourCourses', null, $_user['language']). ".</p>";
$form_data['message'] = '<p>'.get_lang('NowGoChooseYourCourses', null, $_user['language']).".</p>";
} else {
$form_data['action'] = api_get_path(WEB_PATH).'user_portal.php';
}
@ -863,7 +863,7 @@ if ($form->validate()) {
}
if ($sessionPremiumChecker && $sessionId) {
header('Location:' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/process.php?i=' . $sessionId . '&t=2');
header('Location:'.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/process.php?i='.$sessionId.'&t=2');
Session::erase('SessionIsPremium');
Session::erase('sessionId');
exit;

@ -478,7 +478,7 @@ class ImportCsv
$result = UserManager::update_user(
$userInfo['user_id'],
$row['firstname'], // <<-- changed
$row['lastname'], // <<-- changed
$row['lastname'], // <<-- changed
$userInfo['username'],
null, //$password = null,
$row['auth_source'],
@ -636,7 +636,7 @@ class ImportCsv
if (isset($row['action']) && $row['action'] === 'delete') {
// Inactive one year later
$userInfo['expiration_date'] = api_get_utc_datetime(api_strtotime(time() + 365*24*60*60));
$userInfo['expiration_date'] = api_get_utc_datetime(api_strtotime(time() + 365 * 24 * 60 * 60));
}
$password = $row['password']; // change password
@ -698,8 +698,8 @@ class ImportCsv
$result = UserManager::update_user(
$userInfo['user_id'],
$row['firstname'], // <<-- changed
$row['lastname'], // <<-- changed
$row['username'], // <<-- changed
$row['lastname'], // <<-- changed
$row['username'], // <<-- changed
$password, //$password = null,
$row['auth_source'],
$email,
@ -750,7 +750,7 @@ class ImportCsv
}
$timeEnd = microtime(true);
$executionTime = round(($timeEnd - $timeStart)/60, 2);
$executionTime = round(($timeEnd - $timeStart) / 60, 2);
$this->logger->addInfo("Execution Time for process students: $executionTime Min");
if ($moveFile) {
@ -1088,7 +1088,7 @@ class ImportCsv
api_format_date($start, TIME_NO_SEC_FORMAT).' '.
api_format_date($end, TIME_NO_SEC_FORMAT).')';
} else {
$date = api_format_date($start,DATE_TIME_FORMAT_LONG_24H).' - '.
$date = api_format_date($start, DATE_TIME_FORMAT_LONG_24H).' - '.
api_format_date($end, DATE_TIME_FORMAT_LONG_24H);
}
@ -1147,7 +1147,7 @@ class ImportCsv
if ($announcementId) {
$this->logger->addInfo(
"Announcement added: ".(int)($announcementId)." in $info"
"Announcement added: ".(int) ($announcementId)." in $info"
);
$this->logger->addInfo(
"<<--SENDING MAIL-->>"
@ -1535,7 +1535,7 @@ class ImportCsv
);
$this->logger->addError(
"User '$chamiloUserName' was remove from Session: #$chamiloSessionId - Course: " . $courseInfo['code']
"User '$chamiloUserName' was remove from Session: #$chamiloSessionId - Course: ".$courseInfo['code']
);
}
@ -1609,7 +1609,7 @@ class ImportCsv
}
$this->logger->addError(
"User '$chamiloUserName' with status $type was added to session: #$chamiloSessionId - Course: " . $courseInfo['code']
"User '$chamiloUserName' with status $type was added to session: #$chamiloSessionId - Course: ".$courseInfo['code']
);
}
}
@ -1647,7 +1647,7 @@ class ImportCsv
);
}
if (!in_array('SessionName', $tag_names) ||
!in_array('DateStart',$tag_names) || !in_array('DateEnd', $tag_names)
!in_array('DateStart', $tag_names) || !in_array('DateEnd', $tag_names)
) {
$error_message = get_lang('NoNeededData');
break;
@ -1944,7 +1944,7 @@ class ImportCsv
$data = Import::csv_reader($file);
if (!empty($data)) {
$this->logger->addInfo(count($data) . " records found.");
$this->logger->addInfo(count($data)." records found.");
foreach ($data as $row) {
$chamiloUserName = $row['UserName'];
$chamiloCourseCode = $row['CourseCode'];
@ -1991,7 +1991,7 @@ class ImportCsv
}
$this->logger->addError(
"User '$chamiloUserName' with status $type was added to session: #$chamiloSessionId - Course: " . $courseInfo['code']
"User '$chamiloUserName' with status $type was added to session: #$chamiloSessionId - Course: ".$courseInfo['code']
);
}
}
@ -2010,7 +2010,7 @@ class ImportCsv
$data = Import::csv_reader($file);
if (!empty($data)) {
$this->logger->addInfo(count($data) . " records found.");
$this->logger->addInfo(count($data)." records found.");
foreach ($data as $row) {
$chamiloUserName = $row['UserName'];
$chamiloCourseCode = $row['CourseCode'];

@ -8,7 +8,7 @@ if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
api_not_allowed(true);
}
$id = isset($_GET['id']) ? (int)$_GET['id'] : 0;
$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
if (empty($id)) {
api_not_allowed(true);
}

@ -16,7 +16,7 @@ $this_section = SECTION_COURSES;
$tbl_document = Database::get_course_table(TABLE_DOCUMENT);
$doc_url = str_replace(array('../','\\..','\\0','..\\'),array('','','',''),urldecode($_GET['doc_url']));
$doc_url = str_replace(array('../', '\\..', '\\0', '..\\'), array('', '', '', ''), urldecode($_GET['doc_url']));
$filename = basename($doc_url);
// launch event
@ -33,14 +33,14 @@ if (!is_file($full_file_name)) {
exit;
}
if (!Security::check_abs_path($full_file_name, $course_path . '/')) {
if (!Security::check_abs_path($full_file_name, $course_path.'/')) {
exit;
}
$extension = explode('.', $filename);
$extension = strtolower($extension[sizeof($extension) - 1]);
switch($extension) {
switch ($extension) {
case 'gz':
$content_type = 'application/x-gzip';
break;
@ -73,10 +73,10 @@ switch($extension) {
break;
}
header('Content-disposition: filename=' . $filename);
header('Content-Type: ' . $content_type);
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 10) . ' GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s', time() + 10) . ' GMT');
header('Content-disposition: filename='.$filename);
header('Content-Type: '.$content_type);
header('Expires: '.gmdate('D, d M Y H:i:s', time() + 10).' GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s', time() + 10).' GMT');
/*
Dynamic parsing section
@ -90,21 +90,21 @@ header('Last-Modified: ' . gmdate('D, d M Y H:i:s', time() + 10) . ' GMT');
if ($content_type == 'text/html') {
$directory_name = dirname($full_file_name);
$coursePath = api_get_path(SYS_COURSE_PATH);
$dir=str_replace(array('\\', $coursePath . $_course['path'] . '/document'), array('/', ''), $directory_name);
$dir = str_replace(array('\\', $coursePath.$_course['path'].'/document'), array('/', ''), $directory_name);
if ($dir[strlen($dir)-1] != '/') {
if ($dir[strlen($dir) - 1] != '/') {
$dir .= '/';
}
//Parse whole file at one
$fp = fopen($full_file_name, "r");
$file_content = fread ($fp, filesize ($full_file_name));
$file_content = fread($fp, filesize($full_file_name));
fclose($fp);
$exercisePath = api_get_self();
$exfile = explode('/', $exercisePath);
$exfile = $exfile[sizeof($exfile) - 1];
$exercisePath = substr($exercisePath,0,strpos($exercisePath, $exfile));
$exercisePath = substr($exercisePath, 0, strpos($exercisePath, $exfile));
$content = $file_content;
$mit = "function Finish(){";
@ -131,7 +131,7 @@ if ($content_type == 'text/html') {
$newcontent = str_replace($mit, $js_content, $content);
$prehref = "javascript:void(0);";
$posthref = api_get_path(WEB_CODE_PATH) . "main/exercise/Hpdownload.php?doc_url=" . $doc_url . "&cid=" . $cid . "&uid=" . $uid;
$posthref = api_get_path(WEB_CODE_PATH)."main/exercise/Hpdownload.php?doc_url=".$doc_url."&cid=".$cid."&uid=".$uid;
$newcontent = str_replace($prehref, $posthref, $newcontent);

@ -80,7 +80,7 @@ class ImsAssessmentItem
*/
function start_item_body()
{
return ' <itemBody>' . "\n";
return ' <itemBody>'."\n";
}
/**
@ -98,7 +98,7 @@ class ImsAssessmentItem
*/
function add_response_processing()
{
return ' <responseProcessing template="http://www.imsglobal.org/question/qti_v2p1/rptemplates/map_correct"/>' . "\n";
return ' <responseProcessing template="http://www.imsglobal.org/question/qti_v2p1/rptemplates/map_correct"/>'."\n";
}
/**
@ -114,7 +114,7 @@ class ImsAssessmentItem
$head = $foot = '';
if ($standalone) {
$head = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>' . "\n";
$head = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'."\n";
}
//TODO understand why answer might be a non-object sometimes
@ -172,8 +172,8 @@ class ImsSection
function start_section()
{
$out = '<section
ident = "EXO_' . $this->exercise->selectId() . '"
title = "' .cleanAttribute(formatExerciseQtiDescription($this->exercise->selectTitle())) . '"
ident = "EXO_' . $this->exercise->selectId().'"
title = "' .cleanAttribute(formatExerciseQtiDescription($this->exercise->selectTitle())).'"
>' . "\n";
return $out;
}
@ -189,7 +189,7 @@ class ImsSection
// return exercise duration in ISO8601 format.
$minutes = floor($max_time / 60);
$seconds = $max_time % 60;
return '<duration>PT' . $minutes . 'M' . $seconds . "S</duration>\n";
return '<duration>PT'.$minutes.'M'.$seconds."S</duration>\n";
} else {
return '';
}
@ -202,7 +202,7 @@ class ImsSection
function export_presentation()
{
$out = "<presentation_material><flow_mat><material>\n"
. " <mattext><![CDATA[" . formatExerciseQtiDescription($this->exercise->selectDescription()) . "]]></mattext>\n"
. " <mattext><![CDATA[".formatExerciseQtiDescription($this->exercise->selectDescription())."]]></mattext>\n"
. "</material></flow_mat></presentation_material>\n";
return $out;
}
@ -216,14 +216,14 @@ class ImsSection
{
$out = '';
if ($n = $this->exercise->getShuffle()) {
$out.= "<selection_ordering>"
$out .= "<selection_ordering>"
. " <selection>\n"
. " <selection_number>" . $n . "</selection_number>\n"
. " <selection_number>".$n."</selection_number>\n"
. " </selection>\n"
. ' <order order_type="Random" />'
. "\n</selection_ordering>\n";
} else {
$out.= '<selection_ordering sequence_type="Normal">' . "\n"
$out .= '<selection_ordering sequence_type="Normal">'."\n"
. " <selection />\n"
. "</selection_ordering>\n";
}
@ -255,8 +255,8 @@ class ImsSection
{
$head = $foot = '';
if ($standalone) {
$head = '<?xml version = "1.0" encoding = "UTF-8" standalone = "no"?>' . "\n"
. '<!DOCTYPE questestinterop SYSTEM "ims_qtiasiv2p1.dtd">' . "\n"
$head = '<?xml version = "1.0" encoding = "UTF-8" standalone = "no"?>'."\n"
. '<!DOCTYPE questestinterop SYSTEM "ims_qtiasiv2p1.dtd">'."\n"
. "<questestinterop>\n";
$foot = "</questestinterop>\n";
}
@ -317,7 +317,7 @@ class ImsItem
{
$this->question = $question;
$this->answer = $question->answer;
$this->questionIdent = "QST_" . $question->selectId();
$this->questionIdent = "QST_".$question->selectId();
}
/**
@ -329,7 +329,7 @@ class ImsItem
*/
function start_item()
{
return '<item title="' . cleanAttribute(formatExerciseQtiDescription($this->question->selectTitle())) . '" ident="' . $this->questionIdent . '">' . "\n";
return '<item title="'.cleanAttribute(formatExerciseQtiDescription($this->question->selectTitle())).'" ident="'.$this->questionIdent.'">'."\n";
}
/**
@ -352,8 +352,8 @@ class ImsItem
*/
function start_presentation()
{
return '<presentation label="' . $this->questionIdent . '"><flow>' . "\n"
. '<material><mattext>' . formatExerciseQtiDescription($this->question->selectDescription()) . "</mattext></material>\n";
return '<presentation label="'.$this->questionIdent.'"><flow>'."\n"
. '<material><mattext>'.formatExerciseQtiDescription($this->question->selectDescription())."</mattext></material>\n";
}
/**
@ -373,7 +373,7 @@ class ImsItem
*/
function start_processing()
{
return '<resprocessing><outcomes><decvar vartype="Integer" defaultval="0" /></outcomes>' . "\n";
return '<resprocessing><outcomes><decvar vartype="Integer" defaultval="0" /></outcomes>'."\n";
}
/**
@ -401,8 +401,8 @@ class ImsItem
$head = $foot = "";
if ($standalone) {
$head = '<?xml version = "1.0" encoding = "'.$charset.'" standalone = "no"?>' . "\n"
. '<!DOCTYPE questestinterop SYSTEM "ims_qtiasiv2p1.dtd">' . "\n"
$head = '<?xml version = "1.0" encoding = "'.$charset.'" standalone = "no"?>'."\n"
. '<!DOCTYPE questestinterop SYSTEM "ims_qtiasiv2p1.dtd">'."\n"
. "<questestinterop>\n";
$foot = "</questestinterop>\n";
}

@ -13,7 +13,7 @@ use ChamiloSession as Session;
session_cache_limiter("none");
require_once __DIR__.'/../inc/global.inc.php';
require api_get_path(LIBRARY_PATH) . 'geometry.lib.php';
require api_get_path(LIBRARY_PATH).'geometry.lib.php';
// set vars
$questionId = intval($_GET['modifyAnswers']);

@ -388,7 +388,7 @@ function lp_upload_quiz_action_handling()
$comment = isset($feedbackTrueList[$i]) ? $feedbackTrueList[$i] : '';
} else {
$comment = isset($feedbackFalseList[$i]) ? $feedbackFalseList[$i] : '';
$floatVal = (float)$answer_data['extra'];
$floatVal = (float) $answer_data['extra'];
if (is_numeric($floatVal)) {
$score = $answer_data['extra'];
}

@ -41,12 +41,12 @@ $nameTools = get_lang('ToolForum');
// Breadcrumbs
if (isset($_SESSION['gradebook'])){
if (isset($_SESSION['gradebook'])) {
$gradebook = $_SESSION['gradebook'];
}
if (!empty($gradebook) && $gradebook == 'view') {
$interbreadcrumb[] = array (
$interbreadcrumb[] = array(
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'name' => get_lang('ToolGradebook')
);
@ -59,7 +59,7 @@ if ($origin == 'group') {
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.api_get_cidreq(), 'name' => get_lang('Groups'));
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(), 'name' => get_lang('GroupSpace').' ('.$group_properties['name'].')');
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?origin='.$origin.'&forum='.intval($_GET['forum']).'&'.api_get_cidreq(), 'name' => prepare4display($current_forum['forum_title']));
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/forumsearch.php?'.api_get_cidreq(),'name' => get_lang('ForumSearch'));
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/forumsearch.php?'.api_get_cidreq(), 'name' => get_lang('ForumSearch'));
} else {
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.api_get_cidreq(), 'name' => $nameTools);
$nameTools = get_lang('ForumSearch');

@ -64,7 +64,7 @@ if (!empty($_GET['gradebook']) && $_GET['gradebook'] == 'view') {
if (!empty($gradebook) && $gradebook == 'view') {
$interbreadcrumb[] = array(
'url' => '../gradebook/' . $_SESSION['gradebook_dest'],
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'name' => get_lang('ToolGradebook'),
);
}
@ -79,7 +79,7 @@ if ($actions === 'add') {
switch ($_GET['content']) {
case 'forum':
$interbreadcrumb[] = array(
'url' => 'index.php?search=' . $search_forum . '&' . api_get_cidreq(),
'url' => 'index.php?search='.$search_forum.'&'.api_get_cidreq(),
'name' => get_lang('Forum'),
);
$interbreadcrumb[] = array(
@ -89,7 +89,7 @@ if ($actions === 'add') {
break;
case 'forumcategory':
$interbreadcrumb[] = array(
'url' => 'index.php?search=' . $search_forum . '&' . api_get_cidreq(),
'url' => 'index.php?search='.$search_forum.'&'.api_get_cidreq(),
'name' => get_lang('Forum'),
);
$interbreadcrumb[] = array(
@ -182,7 +182,7 @@ if (!empty($_GET['lp_id']) || !empty($_POST['lp_id'])) {
. "&gradebook=&action=add_item&type=step&lp_id=$lp_id#resource_tab-5\">"
. Display::return_icon(
'back.png',
get_lang("BackTo") . ' ' . get_lang("LearningPaths"),
get_lang("BackTo").' '.get_lang("LearningPaths"),
'',
ICON_SIZE_MEDIUM
)
@ -194,8 +194,8 @@ if (!empty($forum_list)) {
if (api_is_allowed_to_edit(false, true)) {
echo '<a href="'
. api_get_self() . '?' . api_get_cidreq()
. '&action=add&content=forumcategory&lp_id=' . $lp_id . '"> ' .
. api_get_self().'?'.api_get_cidreq()
. '&action=add&content=forumcategory&lp_id='.$lp_id.'"> '.
Display::return_icon(
'new_folder.png', get_lang('AddForumCategory'), '', ICON_SIZE_MEDIUM
)
@ -245,7 +245,7 @@ if (is_array($forumCategories)) {
);
if (empty($sessionId) && !empty($forumCategory['session_name'])) {
$session_displayed = ' (' . Security::remove_XSS($forumCategory['session_name']) . ')';
$session_displayed = ' ('.Security::remove_XSS($forumCategory['session_name']).')';
} else {
$session_displayed = '';
}
@ -257,7 +257,7 @@ if (is_array($forumCategories)) {
$html = '';
$iconsEdit = '';
$idCategory = $forumCategory['cat_id'];
$urlCategory = 'viewforumcategory.php?' . api_get_cidreq() . '&forumcategory=' . intval($idCategory);
$urlCategory = 'viewforumcategory.php?'.api_get_cidreq().'&forumcategory='.intval($idCategory);
$titleCategory = Display::tag(
'a',
$forumCategory['cat_title'],
@ -275,9 +275,9 @@ if (is_array($forumCategories)) {
!($forumCategory['session_id'] == 0 &&
intval($sessionId) != 0)
) {
$iconsEdit .= '<a href="' . api_get_self() . '?' . api_get_cidreq()
. '&action=edit&content=forumcategory&id=' . intval($idCategory)
. '">' . Display::return_icon(
$iconsEdit .= '<a href="'.api_get_self().'?'.api_get_cidreq()
. '&action=edit&content=forumcategory&id='.intval($idCategory)
. '">'.Display::return_icon(
'edit.png',
get_lang('Edit'),
array(),
@ -285,8 +285,8 @@ if (is_array($forumCategories)) {
)
. '</a>';
$iconsEdit .='<a href="' . api_get_self() . '?' . api_get_cidreq()
. '&action=delete&content=forumcategory&id=' . intval($idCategory)
$iconsEdit .= '<a href="'.api_get_self().'?'.api_get_cidreq()
. '&action=delete&content=forumcategory&id='.intval($idCategory)
. "\" onclick=\"javascript:if(!confirm('"
. addslashes(api_htmlentities(
get_lang('DeleteForumCategory'),
@ -300,7 +300,7 @@ if (is_array($forumCategories)) {
ICON_SIZE_SMALL
)
. '</a>';
$iconsEdit .= return_visible_invisible_icon(
$iconsEdit .= return_visible_invisible_icon(
'forumcategory',
strval(intval($idCategory)),
strval(intval($forumCategory['visibility']))
@ -334,7 +334,7 @@ if (is_array($forumCategories)) {
array(),
ICON_SIZE_MEDIUM
);
$html .= '<h3>' . $icoCategory . $titleCategory . '</h3>';
$html .= '<h3>'.$icoCategory.$titleCategory.'</h3>';
if ($descriptionCategory != '' && trim($descriptionCategory) != '&nbsp;') {
$html .= '<div class="forum-description">'.$descriptionCategory.'</div>';
@ -405,7 +405,7 @@ if (is_array($forumCategories)) {
$imgForum = '';
// Showing the image
if (!empty($forum['forum_image'])) {
$image_path = api_get_path(WEB_COURSE_PATH). api_get_course_path(). '/upload/forum/images/'. $forum['forum_image'];
$image_path = api_get_path(WEB_COURSE_PATH).api_get_course_path().'/upload/forum/images/'.$forum['forum_image'];
$image_size = api_getimagesize($image_path);
$img_attributes = '';
if (!empty($image_size)) {
@ -452,15 +452,15 @@ if (is_array($forumCategories)) {
30
);
$forum_title_group_addition = ' (<a href="../group/group_space.php?'
. api_get_cidreq() . '&gidReq=' . $forum['forum_of_group']
. '" class="forum_group_link">' . get_lang('GoTo') . ' ' . $group_title . '</a>)'
. api_get_cidreq().'&gidReq='.$forum['forum_of_group']
. '" class="forum_group_link">'.get_lang('GoTo').' '.$group_title.'</a>)'
. $session_img;
} else {
$forum_title_group_addition = '';
}
if (empty($sessionId) && !empty($forum['session_name'])) {
$session_displayed = ' (' . $forum['session_name'] . ')';
$session_displayed = ' ('.$forum['session_name'].')';
} else {
$session_displayed = '';
}
@ -475,7 +475,7 @@ if (is_array($forumCategories)) {
$html .= '<div class="col-md-6">';
$html .= '<div class="col-md-3">';
$html .= '<div class="number-post">'.Display::url($forum_image, $linkForum);
$html .= '<p>'.$number_threads.' ' . get_lang('ForumThreads') . '</p>'
$html .= '<p>'.$number_threads.' '.get_lang('ForumThreads').'</p>'
. '</div>';
$html .= '</div>';
@ -491,7 +491,7 @@ if (is_array($forumCategories)) {
'a',
$forum['forum_title'],
[
'href' => $linkForum ,
'href' => $linkForum,
'class' => empty($forum['visibility']) ? 'text-muted' : null
]
);
@ -503,7 +503,7 @@ if (is_array($forumCategories)) {
}
}
$html .= '<h3 class="title">' . $iconForum . $linkForum . '</h3>';
$html .= '<h3 class="title">'.$iconForum.$linkForum.'</h3>';
$html .= Display::tag(
'p',
Security::remove_XSS($forum['forum_comment']),
@ -519,7 +519,7 @@ if (is_array($forumCategories)) {
);
if (!empty($waitingCount)) {
$html .= Display::label(
get_lang('PostsPendingModeration'). ': '.$waitingCount,
get_lang('PostsPendingModeration').': '.$waitingCount,
'warning'
);
}
@ -532,9 +532,9 @@ if (is_array($forumCategories)) {
// The number of topics and posts.
if ($forum['forum_of_group'] !== '0') {
$newPost='';
$newPost = '';
if (is_array($mywhatsnew_post_info) && !empty($mywhatsnew_post_info)) {
$newPost = ' ' . Display::return_icon(
$newPost = ' '.Display::return_icon(
'alert.png',
get_lang('Forum'),
null,
@ -545,7 +545,7 @@ if (is_array($forumCategories)) {
}
} else {
if (is_array($mywhatsnew_post_info) && !empty($mywhatsnew_post_info)) {
$newPost = ' ' . Display::return_icon(
$newPost = ' '.Display::return_icon(
'alert.png',
get_lang('Forum'),
null,
@ -589,9 +589,9 @@ if (is_array($forumCategories)) {
null,
ICON_SIZE_TINY
)
. ' ' .
. ' '.
api_convert_and_format_date($forum['last_post_date'])
. '<br /> ' . get_lang('By') . ' ' .
. '<br /> '.get_lang('By').' '.
display_user_link(
$poster_id,
$name,
@ -605,13 +605,13 @@ if (is_array($forumCategories)) {
if (api_is_allowed_to_edit(false, true) &&
!($forum['session_id'] == 0 && intval($sessionId) != 0)
) {
$html .= '<a href="'.api_get_self() . '?' . api_get_cidreq()
. '&action=edit&content=forum&id=' . $forum['forum_id'] . '">'
$html .= '<a href="'.api_get_self().'?'.api_get_cidreq()
. '&action=edit&content=forum&id='.$forum['forum_id'].'">'
. Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL)
. '</a>';
$html .= '<a href="' . api_get_self() . '?' . api_get_cidreq()
. '&action=delete&content=forum&id=' . $forum['forum_id']
. "\" onclick=\"javascript:if(!confirm('" . addslashes(
$html .= '<a href="'.api_get_self().'?'.api_get_cidreq()
. '&action=delete&content=forum&id='.$forum['forum_id']
. "\" onclick=\"javascript:if(!confirm('".addslashes(
api_htmlentities(get_lang('DeleteForum'), ENT_QUOTES)
)
. "')) return false;\">"
@ -652,8 +652,8 @@ if (is_array($forumCategories)) {
!api_is_anonymous() &&
api_is_allowed_to_session_edit(false, true)
) {
$html .= '<a href="' . api_get_self() . '?' . api_get_cidreq()
. '&action=notify&content=forum&id=' . $forum['forum_id'] . '">'
$html .= '<a href="'.api_get_self().'?'.api_get_cidreq()
. '&action=notify&content=forum&id='.$forum['forum_id'].'">'
. Display::return_icon($iconnotify, get_lang('NotifyMe'), null, ICON_SIZE_SMALL)
. '</a>';
}
@ -670,7 +670,7 @@ if (is_array($forumCategories)) {
}
}
} else {
echo '<div class="alert alert-warning">' . get_lang('NoForumInThisCategory') . '</div>'
echo '<div class="alert alert-warning">'.get_lang('NoForumInThisCategory').'</div>'
. (api_is_allowed_to_edit(false, true) ? '<div>' : '</div>')
. '</div>';
}

@ -56,7 +56,7 @@ if (isset($current_thread['thread_id'])) {
if (!api_is_anonymous() && api_is_allowed_to_session_edit(false, true)) {
$buttonReply = Display::toolbarButton(
get_lang('ReplyToMessage'),
'reply.php?' . api_get_cidreq() . '&' . http_build_query([
'reply.php?'.api_get_cidreq().'&'.http_build_query([
'forum' => $clean_forum_id,
'thread' => $clean_thread_id,
'post' => $row['post_id'],
@ -69,7 +69,7 @@ if (isset($current_thread['thread_id'])) {
$buttonQuote = Display::toolbarButton(
get_lang('QuoteMessage'),
'reply.php?' . api_get_cidreq() . '&' . http_build_query([
'reply.php?'.api_get_cidreq().'&'.http_build_query([
'forum' => $clean_forum_id,
'thread' => $clean_thread_id,
'post' => $row['post_id'],
@ -85,21 +85,21 @@ if (isset($current_thread['thread_id'])) {
if (($current_forum_category && $current_forum_category['locked'] == 1)) {
$closedPost = Display::tag(
'div',
'<em class="fa fa-exclamation-triangle"></em> ' . get_lang('ForumcategoryLocked'),
'<em class="fa fa-exclamation-triangle"></em> '.get_lang('ForumcategoryLocked'),
array('class' => 'alert alert-warning post-closed')
);
}
if ($current_forum['locked'] == 1) {
$closedPost = Display::tag(
'div',
'<em class="fa fa-exclamation-triangle"></em> ' . get_lang('ForumLocked'),
'<em class="fa fa-exclamation-triangle"></em> '.get_lang('ForumLocked'),
array('class' => 'alert alert-warning post-closed')
);
}
if ($current_thread['locked'] == 1) {
$closedPost = Display::tag(
'div',
'<em class="fa fa-exclamation-triangle"></em> ' . get_lang('ThreadLocked'),
'<em class="fa fa-exclamation-triangle"></em> '.get_lang('ThreadLocked'),
array('class' => 'alert alert-warning post-closed')
);
}
@ -113,7 +113,7 @@ if (isset($current_thread['thread_id'])) {
if ($origin != 'learnpath') {
if (api_get_course_setting('allow_user_image_forum')) {
$html .= '<div class="thumbnail">' . display_user_image($row['user_id'], $name, $origin) . '</div>';
$html .= '<div class="thumbnail">'.display_user_image($row['user_id'], $name, $origin).'</div>';
}
$html .= Display::tag(
'h4',
@ -122,9 +122,9 @@ if (isset($current_thread['thread_id'])) {
);
} else {
if (api_get_course_setting('allow_user_image_forum')) {
$html .= '<div class="thumbnail">' . display_user_image($row['user_id'], $name, $origin) . '</div>';
$html .= '<div class="thumbnail">'.display_user_image($row['user_id'], $name, $origin).'</div>';
}
$name = Display::tag('strong', "#" . $postCount--, ['class' => 'text-info']) . " | $name";
$name = Display::tag('strong', "#".$postCount--, ['class' => 'text-info'])." | $name";
$html .= Display::tag(
'p',
$name,
@ -167,10 +167,10 @@ if (isset($current_thread['thread_id'])) {
) {
if (api_is_allowed_to_session_edit(false, true)) {
if ($locked == false && postIsEditableByStudent($current_forum, $row)) {
$iconEdit .= "<a href=\"editpost.php?" . api_get_cidreq() . "&forum=" . $clean_forum_id
. "&thread=" . $clean_thread_id . "&post=" . $row['post_id']
. "&edit=edition&id_attach=" . $id_attach . "\">"
. Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) . "</a>";
$iconEdit .= "<a href=\"editpost.php?".api_get_cidreq()."&forum=".$clean_forum_id
. "&thread=".$clean_thread_id."&post=".$row['post_id']
. "&edit=edition&id_attach=".$id_attach."\">"
. Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL)."</a>";
}
}
}
@ -181,7 +181,7 @@ if (isset($current_thread['thread_id'])) {
!(api_is_course_coach() && $current_forum['session_id'] != $sessionId)
) {
if ($locked === false) {
$deleteUrl = api_get_self() . '?' . api_get_cidreq() . '&' . http_build_query([
$deleteUrl = api_get_self().'?'.api_get_cidreq().'&'.http_build_query([
'forum' => $clean_forum_id,
'thread' => $clean_thread_id,
'action' => 'delete',
@ -220,8 +220,8 @@ if (isset($current_thread['thread_id'])) {
);
if ($increment > 0) {
$iconEdit .= "<a href=\"viewthread.php?" . api_get_cidreq() . "&forum=" . $clean_forum_id
. "&thread=" . $clean_thread_id . "&action=move&post=" . $row['post_id']."\">"
$iconEdit .= "<a href=\"viewthread.php?".api_get_cidreq()."&forum=".$clean_forum_id
. "&thread=".$clean_thread_id."&action=move&post=".$row['post_id']."\">"
. Display::return_icon('move.png', get_lang('MovePost'), array(), ICON_SIZE_SMALL)
. "</a>";
}
@ -247,10 +247,10 @@ if (isset($current_thread['thread_id'])) {
}
if ($increment > 0 && $locked == false && $userCanEdit) {
$iconEdit .= "<a href=\"forumqualify.php?" . api_get_cidreq() . "&forum=" . $my_forum_id
. "&thread=" . $clean_thread_id . "&action=list&post=" . $row['post_id']
. "&user=" . $row['poster_id'] . "&user_id=" . $row['poster_id']
. "&idtextqualify=" . $current_qualify_thread . "\" >"
$iconEdit .= "<a href=\"forumqualify.php?".api_get_cidreq()."&forum=".$my_forum_id
. "&thread=".$clean_thread_id."&action=list&post=".$row['post_id']
. "&user=".$row['poster_id']."&user_id=".$row['poster_id']
. "&idtextqualify=".$current_qualify_thread."\" >"
. Display::return_icon('quiz.png', get_lang('Qualify'))
. "</a> ";
}
@ -315,26 +315,26 @@ if (isset($current_thread['thread_id'])) {
$realname = $attachment['path'];
$user_filename = $attachment['filename'];
$html .= Display::return_icon('attachment.gif', get_lang('Attachment'));
$html .= '<a href="download.php?file=' . $realname . '"> ' . $user_filename . ' </a>';
$html .= '<a href="download.php?file='.$realname.'"> '.$user_filename.' </a>';
if (($current_forum['allow_edit'] == 1 && $row['user_id'] == $_user['user_id']) ||
(api_is_allowed_to_edit(false, true) && !(api_is_course_coach() && $current_forum['session_id'] != $sessionId))
) {
$html .= '&nbsp;&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=delete_attach&id_attach='
. $attachment['iid'] . '&forum=' . $clean_forum_id . '&thread=' . $clean_thread_id
$html .= '&nbsp;&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&action=delete_attach&id_attach='
. $attachment['iid'].'&forum='.$clean_forum_id.'&thread='.$clean_thread_id
. '" onclick="javascript:if(!confirm(\''
. addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))
. '\')) return false;">'
. Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL)
. '</a><br />';
}
$html .= '<span class="forum_attach_comment" >' . $attachment['comment'] . '</span>';
$html .= '<span class="forum_attach_comment" >'.$attachment['comment'].'</span>';
}
}
$html .= '</div>';
$html .= '<div class="col-md-5 text-right">';
$html .= $buttonReply . ' ' . $buttonQuote;
$html .= $buttonReply.' '.$buttonQuote;
$html .= '</div>';
$html .= '</div>';

@ -43,22 +43,22 @@ class Accessurledituserstourl
' WHERE (username LIKE "'.$needle.'%" '.
' OR firstname LIKE "'.$needle.'%" '.
' OR lastname LIKE "'.$needle.'%") '.
$order_clause .
$order_clause.
' LIMIT 11';
$rs = Database::query($sql);
$i=0;
$i = 0;
while ($user = Database::fetch_array($rs)) {
$i++;
if ($i<=10) {
if ($i <= 10) {
$return .= '<a href="javascript: void(0);" onclick="javascript: add_user_to_url(\''.addslashes($user['user_id']).'\',\''.api_get_person_name(addslashes($user['firstname']), addslashes($user['lastname'])).' ('.addslashes($user['username']).')'.'\')">'.api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].')</a><br />';
} else {
$return .= '...<br />';
}
}
}
$xajax_response -> addAssign('ajax_list_users','innerHTML',api_utf8_encode($return));
$xajax_response -> addAssign('ajax_list_users', 'innerHTML', api_utf8_encode($return));
return $xajax_response;
}
}

@ -65,8 +65,8 @@ class CourseRequestManager
$exemplary_content
) {
$wanted_code = trim($wanted_code);
$user_id = (int)$user_id;
$exemplary_content = (bool)$exemplary_content ? 1 : 0;
$user_id = (int) $user_id;
$exemplary_content = (bool) $exemplary_content ? 1 : 0;
if ($wanted_code == '') {
return false;
@ -252,10 +252,10 @@ class CourseRequestManager
$user_id,
$exemplary_content
) {
$id = (int)$id;
$id = (int) $id;
$wanted_code = trim($wanted_code);
$user_id = (int)$user_id;
$exemplary_content = (bool)$exemplary_content ? 1 : 0;
$user_id = (int) $user_id;
$exemplary_content = (bool) $exemplary_content ? 1 : 0;
if ($wanted_code == '') {
return false;
@ -358,7 +358,7 @@ class CourseRequestManager
*/
public static function delete_course_request($id)
{
$id = (int)$id;
$id = (int) $id;
$sql = "DELETE FROM ".Database::get_main_table(TABLE_MAIN_COURSE_REQUEST)."
WHERE id = ".$id;
$result = Database::query($sql);
@ -376,7 +376,7 @@ class CourseRequestManager
if (is_null($status)) {
$sql = "SELECT COUNT(id) AS number FROM ".$course_table;
} else {
$status = (int)$status;
$status = (int) $status;
$sql = "SELECT COUNT(id) AS number FROM ".$course_table."
WHERE status = ".$status;
}
@ -395,7 +395,7 @@ class CourseRequestManager
*/
public static function get_course_request_info($id)
{
$id = (int)$id;
$id = (int) $id;
$sql = "SELECT *
FROM ".Database::get_main_table(TABLE_MAIN_COURSE_REQUEST)."
WHERE id = ".$id;
@ -413,7 +413,7 @@ class CourseRequestManager
*/
public static function get_course_request_code($id)
{
$id = (int)$id;
$id = (int) $id;
$sql = "SELECT code
FROM ".Database::get_main_table(TABLE_MAIN_COURSE_REQUEST)."
WHERE id = ".$id;
@ -434,7 +434,7 @@ class CourseRequestManager
*/
public static function accept_course_request($id)
{
$id = (int)$id;
$id = (int) $id;
// Retrieve request's data
$course_request_info = self::get_course_request_info($id);
@ -447,7 +447,7 @@ class CourseRequestManager
return false;
}*/
$user_id = (int)$course_request_info['user_id'];
$user_id = (int) $course_request_info['user_id'];
if ($user_id <= 0) {
return false;
}
@ -538,7 +538,7 @@ class CourseRequestManager
*/
public static function reject_course_request($id)
{
$id = (int)$id;
$id = (int) $id;
// Retrieve request's data
$course_request_info = self::get_course_request_info($id);
if (!is_array($course_request_info)) {
@ -616,7 +616,7 @@ class CourseRequestManager
*/
public static function ask_for_additional_info($id)
{
$id = (int)$id;
$id = (int) $id;
// Retrieve request's data
$course_request_info = self::get_course_request_info($id);
@ -707,7 +707,7 @@ class CourseRequestManager
*/
public static function additional_info_asked($id)
{
$id = (int)$id;
$id = (int) $id;
$sql = "SELECT id FROM ".Database::get_main_table(TABLE_MAIN_COURSE_REQUEST)."
WHERE (id = ".$id." AND info > 0)";
$result = Database::num_rows(Database::query($sql));

@ -56,7 +56,7 @@ class Display
* @param string Optional help file name
* @param string $page_header
*/
public static function display_header($tool_name ='', $help = null, $page_header = null)
public static function display_header($tool_name = '', $help = null, $page_header = null)
{
$origin = api_get_origin();
$showHeader = true;
@ -345,7 +345,7 @@ class Display
$grid_class = array(),
$elementCount = 0
) {
$column = 0;
$column = 0;
$default_items_per_page = isset($paging_options['per_page']) ? $paging_options['per_page'] : 20;
$table = new SortableTableFromArray($content, $column, $default_items_per_page, $name);
@ -507,7 +507,7 @@ class Display
* @param string $type
* @param bool $filter
*/
public static function return_message_and_translate($message, $type='normal', $filter = true)
public static function return_message_and_translate($message, $type = 'normal', $filter = true)
{
$message = get_lang($message);
echo self::return_message($message, $type, $filter);
@ -574,14 +574,14 @@ class Display
}
// Encrypt email
$hmail = '';
for ($i = 0; $i < strlen($email); $i ++) {
for ($i = 0; $i < strlen($email); $i++) {
$hmail .= '&#'.ord($email {
$i }).';';
}
$hclickable_text = null;
// Encrypt clickable text if @ is present
if (strpos($clickable_text, '@')) {
for ($i = 0; $i < strlen($clickable_text); $i ++) {
for ($i = 0; $i < strlen($clickable_text); $i++) {
$hclickable_text .= '&#'.ord($clickable_text {
$i }).';';
}
@ -613,7 +613,7 @@ class Display
}
// Encrypt email
$hmail = '';
for ($i = 0; $i < strlen($email); $i ++) {
for ($i = 0; $i < strlen($email); $i++) {
$hmail .= '&#'.ord($email {
$i }).';';
}
@ -633,7 +633,7 @@ class Display
public static function get_alphabet_options($selected_letter = '')
{
$result = '';
for ($i = 65; $i <= 90; $i ++) {
for ($i = 65; $i <= 90; $i++) {
$letter = chr($i);
$result .= '<option value="'.$letter.'"';
if ($selected_letter == $letter) {
@ -654,7 +654,7 @@ class Display
public static function get_numeric_options($min, $max, $selected_num = 0)
{
$result = '';
for ($i = $min; $i <= $max; $i ++) {
for ($i = $min; $i <= $max; $i++) {
$result .= '<option value="'.$i.'"';
if (is_int($selected_num)) {
if ($selected_num == $i) {
@ -725,8 +725,8 @@ class Display
// important to use the public path (i.e. web/css/) rather than the
// internal path (/app/Resource/public/css/) because the path used
// in the end must be the public path
$alternateCssPath = api_get_path(SYS_PUBLIC_PATH) . 'css/';
$alternateWebCssPath = api_get_path(WEB_PUBLIC_PATH) . 'css/';
$alternateCssPath = api_get_path(SYS_PUBLIC_PATH).'css/';
$alternateWebCssPath = api_get_path(WEB_PUBLIC_PATH).'css/';
$image = trim($image);
@ -736,7 +736,7 @@ class Display
$size = ICON_SIZE_SMALL;
}
$size_extra = $size . '/';
$size_extra = $size.'/';
// Checking the img/ folder
$icon = $w_code_path.'img/'.$image;
@ -744,7 +744,7 @@ class Display
$theme = 'themes/chamilo/icons/';
if ($loadThemeIcon) {
$theme = 'themes/' . api_get_visual_theme() . '/icons/';
$theme = 'themes/'.api_get_visual_theme().'/icons/';
// Checking the theme icons folder example: app/Resources/public/css/themes/chamilo/icons/XXX
if (is_file($alternateCssPath.$theme.$size_extra.$image)) {
$icon = $alternateWebCssPath.$theme.$size_extra.$image;
@ -766,11 +766,11 @@ class Display
// ask for the SVG version directly
$svgIcons = api_get_setting('icons_mode_svg');
if ($svgIcons == 'true' && $return_only_path == false) {
$svgImage = substr($image, 0, -3) . 'svg';
if (is_file($code_path . $theme . 'svg/' . $svgImage)) {
$icon = $w_code_path . $theme . 'svg/' . $svgImage;
} elseif (is_file($code_path . 'img/icons/svg/' . $svgImage)) {
$icon = $w_code_path . 'img/icons/svg/' . $svgImage;
$svgImage = substr($image, 0, -3).'svg';
if (is_file($code_path.$theme.'svg/'.$svgImage)) {
$icon = $w_code_path.$theme.'svg/'.$svgImage;
} elseif (is_file($code_path.'img/icons/svg/'.$svgImage)) {
$icon = $w_code_path.'img/icons/svg/'.$svgImage;
}
if (empty($additional_attributes['height'])) {
@ -862,7 +862,7 @@ class Display
}
}
//some tags don't have this </XXX>
if (in_array($tag, array('img','input','br'))) {
if (in_array($tag, array('img', 'input', 'br'))) {
$return_value = '<'.$tag.' '.$attribute_list.' />';
} else {
$return_value = '<'.$tag.' '.$attribute_list.' >'.$content.'</'.$tag.'>';
@ -915,13 +915,13 @@ class Display
public static function input($type, $name, $value, $attributes = array())
{
if (isset($type)) {
$attributes['type']= $type;
$attributes['type'] = $type;
}
if (isset($name)) {
$attributes['name']= $name;
$attributes['name'] = $name;
}
if (isset($value)) {
$attributes['value']= $value;
$attributes['value'] = $value;
}
return self::tag('input', '', $attributes);
}
@ -954,14 +954,14 @@ class Display
) {
$html = '';
$extra = '';
$default_id = 'id="' . $name . '" ';
$default_id = 'id="'.$name.'" ';
foreach ($extra_attributes as $key => $parameter) {
if ($key == 'id') {
$default_id = '';
}
$extra .= $key . '="' . $parameter . '" ';
$extra .= $key.'="'.$parameter.'" ';
}
$html .= '<select name="' . $name . '" ' . $default_id . ' ' . $extra . '>';
$html .= '<select name="'.$name.'" '.$default_id.' '.$extra.'>';
if ($show_blank_item) {
if (empty($blank_item_text)) {
@ -969,14 +969,14 @@ class Display
} else {
$blank_item_text = Security::remove_XSS($blank_item_text);
}
$html .= self::tag('option', '-- ' . $blank_item_text . ' --', array('value' => '-1'));
$html .= self::tag('option', '-- '.$blank_item_text.' --', array('value' => '-1'));
}
if ($values) {
foreach ($values as $key => $value) {
if (is_array($value) && isset($value['name'])) {
$value = $value['name'];
}
$html .= '<option value="' . $key . '"';
$html .= '<option value="'.$key.'"';
if (is_array($default)) {
foreach ($default as $item) {
@ -991,7 +991,7 @@ class Display
}
}
$html .= '>' . $value . '</option>';
$html .= '>'.$value.'</option>';
}
}
$html .= '</select>';
@ -1019,7 +1019,7 @@ class Display
*/
public static function tabs($headers, $items, $id = 'tabs', $attributes = array(), $ul_attributes = array())
{
if (empty($headers) || count($headers) == 0 ) {
if (empty($headers) || count($headers) == 0) {
return '';
}
@ -1072,7 +1072,7 @@ class Display
$attributes
);
return $main_div ;
return $main_div;
}
/**
@ -1120,8 +1120,8 @@ class Display
*/
public static function grid_html($div_id)
{
$table = self::tag('table','', array('id' => $div_id));
$table .= self::tag('div','', array('id' => $div_id.'_pager'));
$table = self::tag('table', '', array('id' => $div_id));
$table .= self::tag('div', '', array('id' => $div_id.'_pager'));
return $table;
}
@ -1182,7 +1182,7 @@ class Display
$obj->colNames = $column_names;
$obj->colModel = $column_model;
$obj->pager = '#'.$div_id.'_pager';
$obj->datatype = 'json';
$obj->datatype = 'json';
$obj->viewrecords = 'true';
$all_value = 10000000;
@ -1243,10 +1243,10 @@ class Display
// Adding static data.
if (!empty($data)) {
$data_var = $div_id.'_data';
$json.=' var '.$data_var.' = '.json_encode($data).';';
$json .= ' var '.$data_var.' = '.json_encode($data).';';
$obj->data = $data_var;
$obj->datatype = 'local';
$json.="\n";
$json .= "\n";
}
$obj->end = 'end';
@ -1260,12 +1260,12 @@ class Display
}
// Fixing true/false js values that doesn't need the ""
$json_encode = str_replace(':"true"',':true',$json_encode);
$json_encode = str_replace(':"true"', ':true', $json_encode);
// wrap_cell is not a valid jqgrid attributes is a hack to wrap a text
$json_encode = str_replace('"wrap_cell":true', 'cellattr : function(rowId, value, rowObject, colModel, arrData) { return \'class = "jqgrid_whitespace"\'; }', $json_encode);
$json_encode = str_replace(':"false"',':false',$json_encode);
$json_encode = str_replace(':"false"', ':false', $json_encode);
$json_encode = str_replace('"formatter":"action_formatter"', 'formatter:action_formatter', $json_encode);
$json_encode = str_replace(array('{"first":"first",','"end":"end"}'), '', $json_encode);
$json_encode = str_replace(array('{"first":"first",', '"end":"end"}'), '', $json_encode);
// Creating the jqgrid element.
$json .= '$("#'.$div_id.'").jqGrid({';
@ -1280,22 +1280,22 @@ class Display
$groups = '';
foreach ($extra_params['groupHeaders'] as $group) {
//{ "startColumnName" : "courses", "numberOfColumns" : 1, "titleText" : "Order Info" },
$groups .= '{ "startColumnName" : "' . $group['startColumnName'] . '", "numberOfColumns" : ' . $group['numberOfColumns'] . ', "titleText" : "' . $group['titleText'] . '" },';
$groups .= '{ "startColumnName" : "'.$group['startColumnName'].'", "numberOfColumns" : '.$group['numberOfColumns'].', "titleText" : "'.$group['titleText'].'" },';
}
$json .= '$("#'.$div_id.'").jqGrid("setGroupHeaders", {
"useColSpanStyle" : false,
"groupHeaders" : [
' . $groups . '
' . $groups.'
]
});';
}
$all_text = addslashes(get_lang('All'));
$json .= '$("'.$obj->pager.' option[value='.$all_value.']").text("'.$all_text.'");';
$json.= "\n";
$json .= "\n";
// Adding edit/delete icons.
$json.= $formatter;
$json .= $formatter;
return $json;
}
@ -1326,7 +1326,7 @@ class Display
}
if (!empty($rows)) {
foreach($rows as $content) {
foreach ($rows as $content) {
$table->setCellContents($row, $column, $content);
$row++;
}
@ -1439,7 +1439,7 @@ class Display
lastedit_user_id != $user_id $sessionCondition AND
visibility != 2 AND
(to_user_id IN ('$user_id', '0') OR to_user_id IS NULL) AND
(to_group_id IN ('".implode("','",$group_ids)."') OR to_group_id IS NULL)
(to_group_id IN ('".implode("','", $group_ids)."') OR to_group_id IS NULL)
ORDER BY lastedit_date DESC
LIMIT 1";
$result = Database::query($sql);
@ -1457,9 +1457,8 @@ class Display
$return = '&nbsp;';
foreach ($notifications as $notification) {
$toolName = $notification['tool'];
if (!
(
$notification['visibility'] == '1' ||
if (!(
$notification['visibility'] == '1' ||
($status == '1' && $notification['visibility'] == '0') ||
!isset($notification['visibility'])
)
@ -1543,9 +1542,9 @@ class Display
$main_user_table = Database::get_main_table(TABLE_MAIN_USER);
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
// Request for the name of the general coach
$sql ='SELECT tu.lastname, tu.firstname, ts.*
$sql = 'SELECT tu.lastname, tu.firstname, ts.*
FROM '.$tbl_session.' ts
LEFT JOIN '.$main_user_table .' tu
LEFT JOIN '.$main_user_table.' tu
ON ts.id_coach = tu.user_id
WHERE ts.id = '.intval($session_id);
$rs = Database::query($sql);
@ -1557,7 +1556,7 @@ class Display
$session['title'] = $session_info['name'];
$session['id_coach'] = $session_info['id_coach'];
$session['coach'] = '';
$session['dates'] = '';
$session['dates'] = '';
if (api_get_setting('show_session_coach') === 'true') {
$session['coach'] = get_lang('GeneralCoach').': '.api_get_person_name($session_info['firstname'], $session_info['lastname']);
@ -1617,7 +1616,7 @@ class Display
$session['dates'] = $dates['access'];
if (api_get_setting('show_session_coach') === 'true' ) {
if (api_get_setting('show_session_coach') === 'true') {
$session['coach'] = api_get_person_name(
$session_info['firstname'],
$session_info['lastname']
@ -1675,9 +1674,9 @@ class Display
$percentage = isset($point_info['point_average']) ? $point_info['point_average'] : 0;
if (!empty($percentage)) {
$percentage = $percentage*125/100;
$percentage = $percentage * 125 / 100;
}
$accesses = isset($point_info['accesses']) ? $point_info['accesses'] : 0;
$accesses = isset($point_info['accesses']) ? $point_info['accesses'] : 0;
$star_label = sprintf(get_lang('XStarsOutOf5'), $point_info['point_average_star']);
$html = '<ul id="'.$id.'" class="star-rating">
@ -1691,15 +1690,15 @@ class Display
$labels = array();
$labels[]= $number_of_users_who_voted == 1 ? $number_of_users_who_voted.' '.get_lang('Vote') : $number_of_users_who_voted.' '.get_lang('Votes');
$labels[]= $accesses == 1 ? $accesses.' '.get_lang('Visit') : $accesses.' '.get_lang('Visits');
$labels[]= $point_info['user_vote'] ? get_lang('YourVote').' ['.$point_info['user_vote'].']' : get_lang('YourVote'). ' [?] ';
$labels[] = $number_of_users_who_voted == 1 ? $number_of_users_who_voted.' '.get_lang('Vote') : $number_of_users_who_voted.' '.get_lang('Votes');
$labels[] = $accesses == 1 ? $accesses.' '.get_lang('Visit') : $accesses.' '.get_lang('Visits');
$labels[] = $point_info['user_vote'] ? get_lang('YourVote').' ['.$point_info['user_vote'].']' : get_lang('YourVote').' [?] ';
if (!$add_div_wrapper && api_is_anonymous()) {
$labels[]= self::tag('span', get_lang('LoginToVote'), array('class' => 'error'));
$labels[] = self::tag('span', get_lang('LoginToVote'), array('class' => 'error'));
}
$html .= self::div(implode(' | ', $labels) , array('id' => 'vote_label_'.$id, 'class' => 'vote_label_info'));
$html .= self::div(implode(' | ', $labels), array('id' => 'vote_label_'.$id, 'class' => 'vote_label_info'));
$html .= ' '.self::span(' ', array('id' => 'vote_label2_'.$id));
if ($add_div_wrapper) {
@ -1772,8 +1771,8 @@ class Display
if (!empty($list)) {
$html = '<dl class="dl-horizontal">';
foreach ($list as $item) {
$html .= '<dt>' . $item['title'] . '</dt>';
$html .= '<dd>' . $item['content'] . '</dd>';
$html .= '<dt>'.$item['title'].'</dt>';
$html .= '<dd>'.$item['content'].'</dd>';
}
$html .= '</dl>';
}
@ -1815,7 +1814,7 @@ class Display
* @param string $type
* @return null|string
*/
public static function badge($count, $type ="warning")
public static function badge($count, $type = "warning")
{
$class = '';
@ -1891,7 +1890,7 @@ class Display
if (!empty($content)) {
$html = '<span class="label '.$class.'">';
$html .= $content;
$html .='</span>';
$html .= '</span>';
}
return $html;
@ -1912,7 +1911,7 @@ class Display
$class = 'class ="active"';
}
if (basename($_SERVER['REQUEST_URI']) == basename($value['url']) ) {
if (basename($_SERVER['REQUEST_URI']) == basename($value['url'])) {
$class = 'class ="active"';
}
$html .= "<li $class >";
@ -2010,7 +2009,7 @@ class Display
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
'.$title.'
<span class="caret"></span></button>
<ul class="dropdown-menu ' . ($alignToRight ? 'dropdown-menu-right' : '') . '">';
<ul class="dropdown-menu ' . ($alignToRight ? 'dropdown-menu-right' : '').'">';
foreach ($elements as $item) {
$html .= self::tag('li', self::url($item['title'], $item['href']));
}
@ -2189,7 +2188,7 @@ class Display
}
$label = $nextValue + $localCounter + 1;
if ($isMedia) {
$label = ($fixedValue + 1) .' '.chr(97 + $localCounter);
$label = ($fixedValue + 1).' '.chr(97 + $localCounter);
$link_to_show = $link.$fixedValue.'#questionanchor'.$itemId;
}
$link = self::url($label.' ', $link_to_show, $linkAttributes);
@ -2373,7 +2372,7 @@ class Display
$attributes['title'] = isset($attributes['title']) ? $attributes['title'] : $text;
if (!$includeText) {
$text = '<span class="sr-only">' . $text . '</span>';
$text = '<span class="sr-only">'.$text.'</span>';
}
return self::url("$icon $text", $url, $attributes);
@ -2392,7 +2391,7 @@ class Display
if (!$colsWidth) {
$width = 12 / $col;
array_walk($content, function () use ($width, &$colsWidth) {
array_walk($content, function() use ($width, &$colsWidth) {
$colsWidth[] = $width;
});
}
@ -2404,7 +2403,7 @@ class Display
$class = 'col-sm-'.$colsWidth[$i];
if ($col > 1) {
if ($i > 0 && $i < count($content) -1) {
if ($i > 0 && $i < count($content) - 1) {
$class .= ' text-center';
} elseif ($i === count($content) - 1) {
$class .= ' text-right';
@ -2515,9 +2514,9 @@ HTML;
$params['class'] = 'panel panel-default';
$html = null;
if (!empty($title)) {
$html .= '<div class="panel-heading">'.$title.'</div>' . PHP_EOL;
$html .= '<div class="panel-heading">'.$title.'</div>'.PHP_EOL;
}
$html.= '<div class="panel-body">'.$content.'</div>' . PHP_EOL;
$html .= '<div class="panel-body">'.$content.'</div>'.PHP_EOL;
$html = self::div($html, $params);
}
return $html;
@ -2552,7 +2551,7 @@ HTML;
*
* @return string
*/
public static function getUserCard($userInfo, $status= '', $toolbar = '')
public static function getUserCard($userInfo, $status = '', $toolbar = '')
{
if (empty($userInfo)) {
return '';

@ -16,7 +16,7 @@ class HTML_QuickForm_Rule_HTML extends HTML_QuickForm_Rule
*/
function validate($html, $mode = NO_HTML)
{
$allowed_tags = self::get_allowed_tags ($mode, $fullpage);
$allowed_tags = self::get_allowed_tags($mode, $fullpage);
$cleaned_html = kses($html, $allowed_tags);
return $html == $cleaned_html;
}
@ -33,7 +33,7 @@ class HTML_QuickForm_Rule_HTML extends HTML_QuickForm_Rule
// Include the allowed tags.
//include __DIR__.'/allowed_tags.inc.php';
global $allowed_tags_student, $allowed_tags_student_full_page, $allowed_tags_teacher, $allowed_tags_teacher_full_page;
switch($mode)
switch ($mode)
{
case NO_HTML:
return array();

@ -217,8 +217,8 @@ class GroupManager
$sql = "UPDATE $table_group SET id = iid WHERE iid = $lastId";
Database::query($sql);
$desired_dir_name= '/'.api_replace_dangerous_char($name).'_groupdocs';
$my_path = api_get_path(SYS_COURSE_PATH) . $currentCourseRepository . '/document';
$desired_dir_name = '/'.api_replace_dangerous_char($name).'_groupdocs';
$my_path = api_get_path(SYS_COURSE_PATH).$currentCourseRepository.'/document';
$newFolderData = create_unexisting_directory(
$_course,
@ -281,11 +281,11 @@ class GroupManager
$values['default_view_type_group']['default_view_type'] = api_get_setting('default_forum_view');
$values['group_forum'] = $lastId;
if ($forumState == '1') {
$values['public_private_group_forum_group']['public_private_group_forum']='public';
$values['public_private_group_forum_group']['public_private_group_forum'] = 'public';
} elseif ($forumState == '2') {
$values['public_private_group_forum_group']['public_private_group_forum']='private';
$values['public_private_group_forum_group']['public_private_group_forum'] = 'private';
} elseif ($forumState == '0') {
$values['public_private_group_forum_group']['public_private_group_forum']='unavailable';
$values['public_private_group_forum_group']['public_private_group_forum'] = 'unavailable';
}
store_forum($values);
}
@ -317,9 +317,9 @@ class GroupManager
1
);
$users = self::get_users($group_id);
$group_ids = array ();
$group_ids = array();
for ($group_nr = 1; $group_nr <= $number_of_groups; $group_nr ++) {
for ($group_nr = 1; $group_nr <= $number_of_groups; $group_nr++) {
$group_ids[] = self::create_group(
get_lang('Subgroup').' '.$group_nr,
$category_id,
@ -624,7 +624,7 @@ class GroupManager
} elseif ($forum_state === 0) {
$sql2 .= " forum_group_public_private='unavailable' ";
}
$sql2 .=" WHERE c_id = $course_id AND forum_of_group=".$group_id;
$sql2 .= " WHERE c_id = $course_id AND forum_of_group=".$group_id;
Database::query($sql2);
return $result;
}
@ -654,13 +654,13 @@ class GroupManager
public static function get_categories($course_code = null)
{
$course_info = api_get_course_info($course_code);
$course_id = $course_info['real_id'];
$course_id = $course_info['real_id'];
$table_group_cat = Database::get_course_table(TABLE_GROUP_CATEGORY);
$sql = "SELECT * FROM $table_group_cat
WHERE c_id = $course_id
ORDER BY display_order";
$res = Database::query($sql);
$cats = array ();
$cats = array();
while ($cat = Database::fetch_array($res)) {
$cats[] = $cat;
}
@ -1265,7 +1265,7 @@ class GroupManager
* Retrieve course users (reverse) ordered by the number
* of group they are already enrolled
*/
for ($i = 0; $i < count($complete_user_list); $i ++) {
for ($i = 0; $i < count($complete_user_list); $i++) {
//find # of groups the user is enrolled in
$number_of_groups = self::user_in_number_of_groups(
$complete_user_list[$i]["user_id"],
@ -1283,7 +1283,7 @@ class GroupManager
//now sort by # of group left
$complete_user_list = TableSort::sort_table($complete_user_list, 'number_groups_left', SORT_DESC);
$userToken = array ();
$userToken = array();
foreach ($complete_user_list as $this_user) {
if ($this_user['number_groups_left'] > 0) {
$userToken[$this_user['user_id']] = $this_user['number_groups_left'];
@ -1605,7 +1605,7 @@ class GroupManager
$order_clause
";
$db_result = Database::query($sql);
$users = array ();
$users = array();
while ($user = Database::fetch_object($db_result)) {
if (!$id_only) {
$member['user_id'] = $user->user_id;
@ -1670,8 +1670,8 @@ class GroupManager
foreach ($user_ids as $user_id) {
$user_id = intval($user_id);
if (self::can_user_subscribe($user_id, $groupInfo, false)) {
$sql = "INSERT INTO " . $table_group_tutor . " (c_id, user_id, group_id)
VALUES ('$course_id', '" . $user_id . "', '" . $groupId . "')";
$sql = "INSERT INTO ".$table_group_tutor." (c_id, user_id, group_id)
VALUES ('$course_id', '".$user_id."', '".$groupId."')";
$result = Database::query($sql);
}
}
@ -1687,7 +1687,7 @@ class GroupManager
*/
public static function unsubscribe_users($user_ids, $groupInfo)
{
$user_ids = is_array($user_ids) ? $user_ids : array ($user_ids);
$user_ids = is_array($user_ids) ? $user_ids : array($user_ids);
$table_group_user = Database::get_course_table(TABLE_GROUP_USER);
$group_id = intval($groupInfo['id']);
$course_id = api_get_course_int_id();
@ -2128,7 +2128,7 @@ class GroupManager
* Retrieve course users (reverse) ordered by the number
* of group they are already enrolled
*/
for ($i = 0; $i < count($complete_user_list); $i ++) {
for ($i = 0; $i < count($complete_user_list); $i++) {
// find # of groups the user is enrolled in
$number_of_groups = self:: user_in_number_of_groups(
$complete_user_list[$i]['user_id'],
@ -2264,14 +2264,14 @@ class GroupManager
!(api_is_course_coach() && intval($this_group['session_id']) != $session_id)
) {
$edit_actions = '<a href="'.$url.'settings.php?'.api_get_cidreq(true, false).'&gidReq='.$this_group['id'].'" title="'.get_lang('Edit').'">'.
Display::return_icon('edit.png', get_lang('EditGroup'),'',ICON_SIZE_SMALL).'</a>&nbsp;';
Display::return_icon('edit.png', get_lang('EditGroup'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
if ($this_group['status'] == 1) {
$edit_actions .= '<a href="' . api_get_self() . '?' . api_get_cidreq(true,false) . '&category=' . $category_id . '&action=set_invisible&id=' . $this_group['id'] . '" title="' . get_lang('Hide') . '">' .
Display::return_icon('visible.png', get_lang('Hide'), '', ICON_SIZE_SMALL) . '</a>&nbsp;';
$edit_actions .= '<a href="'.api_get_self().'?'.api_get_cidreq(true, false).'&category='.$category_id.'&action=set_invisible&id='.$this_group['id'].'" title="'.get_lang('Hide').'">'.
Display::return_icon('visible.png', get_lang('Hide'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
} else {
$edit_actions .= '<a href="' . api_get_self() . '?' . api_get_cidreq(true, false) . '&category=' . $category_id . '&action=set_visible&id=' . $this_group['id'] . '" title="' . get_lang('Show') . '">' .
Display::return_icon('invisible.png', get_lang('Show'), '', ICON_SIZE_SMALL) . '</a>&nbsp;';
$edit_actions .= '<a href="'.api_get_self().'?'.api_get_cidreq(true, false).'&category='.$category_id.'&action=set_visible&id='.$this_group['id'].'" title="'.get_lang('Show').'">'.
Display::return_icon('invisible.png', get_lang('Show'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
}
$edit_actions .= '<a href="'.$url.'member_settings.php?'.api_get_cidreq(true, false).'&gidReq='.$this_group['id'].'" title="'.get_lang('GroupMembers').'">'.
@ -2281,10 +2281,10 @@ class GroupManager
Display::return_icon('export_excel.png', get_lang('Export'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
$edit_actions .= '<a href="'.api_get_self().'?'.api_get_cidreq(true, false).'&category='.$category_id.'&action=fill_one&id='.$this_group['id'].'" onclick="javascript: if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))."'".')) return false;" title="'.get_lang('FillGroup').'">'.
Display::return_icon('fill.png',get_lang('FillGroup'),'',ICON_SIZE_SMALL).'</a>&nbsp;';
Display::return_icon('fill.png', get_lang('FillGroup'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
$edit_actions .= '<a href="'.api_get_self().'?'.api_get_cidreq(true, false).'&category='.$category_id.'&action=delete_one&id='.$this_group['id'].'" onclick="javascript: if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))."'".')) return false;" title="'.get_lang('Delete').'">'.
Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>&nbsp;';
Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
$row[] = $edit_actions;
}
@ -2708,7 +2708,7 @@ class GroupManager
$activeTutor = null;
$activeMember = null;
switch($default) {
switch ($default) {
case 'settings':
$activeSettings = 'active';
break;

@ -130,7 +130,7 @@ abstract class XapianIndexer
if (!empty($chunk->terms)) {
foreach ($chunk->terms as $term) {
/* FIXME: think of getting weight */
$doc->add_term($term['flag'] . $term['name'], 1);
$doc->add_term($term['flag'].$term['name'], 1);
}
}
@ -215,7 +215,7 @@ abstract class XapianIndexer
$doc->clear_terms();
foreach ($terms as $term) {
//add directly
$doc->add_term($prefix . $term, 1);
$doc->add_term($prefix.$term, 1);
}
$this->db->replace_document($did, $doc);
$this->db->flush();

@ -95,7 +95,7 @@ function xapian_query($query_string, $db = NULL, $start = 0, $length = 10, $extr
// process each specific field prefix
foreach ($specific_fields as $specific_field) {
$results[$count]['sf-' . $specific_field['code']] = xapian_get_doc_terms($document, $specific_field['code']);
$results[$count]['sf-'.$specific_field['code']] = xapian_get_doc_terms($document, $specific_field['code']);
}
// rest of data
@ -264,6 +264,6 @@ function display_xapian_error($xapian_error_message) {
} else {
$message_error = get_lang('SearchOtherXapianError');
}
$display_message = get_lang('Error') . ' : ' . $message_error;
$display_message = get_lang('Error').' : '.$message_error;
Display::display_error_message($display_message);
}

@ -23,7 +23,7 @@ class SubLanguageManager
public static function getAllLanguages($onlyActive = false)
{
$table = Database::get_main_table(TABLE_MAIN_LANGUAGE);
$sql = 'SELECT * FROM ' . $table;
$sql = 'SELECT * FROM '.$table;
if ($onlyActive) {
$sql .= ' WHERE available = 1';
}
@ -98,7 +98,7 @@ class SubLanguageManager
public static function get_all_information_of_language($parent_id)
{
$table = Database::get_main_table(TABLE_MAIN_LANGUAGE);
$sql = 'SELECT * FROM ' . $table . ' WHERE id = "' . intval($parent_id) . '"';
$sql = 'SELECT * FROM '.$table.' WHERE id = "'.intval($parent_id).'"';
$rs = Database::query($sql);
$all_information = array();
while ($row = Database::fetch_array($rs, 'ASSOC')) {
@ -145,7 +145,7 @@ class SubLanguageManager
*/
public static function add_file_in_language_directory($system_path_file)
{
$return_value = @file_put_contents($system_path_file, '<?php' . PHP_EOL);
$return_value = @file_put_contents($system_path_file, '<?php'.PHP_EOL);
return $return_value;
}
@ -160,10 +160,10 @@ class SubLanguageManager
public static function write_data_in_file($path_file, $new_term, $new_variable)
{
$return_value = false;
$new_data = $new_variable . '=' . $new_term;
$new_data = $new_variable.'='.$new_term;
$resource = @fopen($path_file, "a");
if (file_exists($path_file) && $resource) {
if (fwrite($resource, $new_data . PHP_EOL) === false) {
if (fwrite($resource, $new_data.PHP_EOL) === false) {
//not allow to write
$return_value = false;
} else {
@ -185,7 +185,7 @@ class SubLanguageManager
if (empty($sub_language_dir)) {
return false;
}
$dir = api_get_path(SYS_LANG_PATH) . $sub_language_dir;
$dir = api_get_path(SYS_LANG_PATH).$sub_language_dir;
if (is_dir($dir)) {
return true;
} //even if the dir already exists, we reach the objective of having the directory there
@ -210,8 +210,8 @@ class SubLanguageManager
return false;
}
$table = Database::get_main_table(TABLE_MAIN_LANGUAGE);
$sql = 'SELECT dokeos_folder FROM ' . $table . '
WHERE parent_id = ' . $parent_id . ' and id = ' . $sub_language_id;
$sql = 'SELECT dokeos_folder FROM '.$table.'
WHERE parent_id = ' . $parent_id.' and id = '.$sub_language_id;
$res = Database::query($sql);
if ($res === false or Database::num_rows($res) < 1) {
return false;
@ -221,7 +221,7 @@ class SubLanguageManager
if ($res === false) {
return false;
} //can't delete dir, so do not delete language record
$sql = 'DELETE FROM ' . $table . '
$sql = 'DELETE FROM '.$table.'
WHERE id= ' . intval($sub_language_id);
$res = Database::query($sql);
@ -238,7 +238,7 @@ class SubLanguageManager
if (empty($sub_language_dir)) {
return false;
}
$dir = api_get_path(SYS_LANG_PATH) . $sub_language_dir;
$dir = api_get_path(SYS_LANG_PATH).$sub_language_dir;
if (!is_dir($dir)) {
return true;
} //even if the dir does not exist, we reach the objective of not having the directory there
@ -246,7 +246,7 @@ class SubLanguageManager
if (count($content) > 0) {
foreach ($content as $value_content) {
$path_file = $dir . '/' . $value_content;
$path_file = $dir.'/'.$value_content;
unlink($path_file);
}
return @rmdir($dir);
@ -264,8 +264,8 @@ class SubLanguageManager
{
$table = Database::get_main_table(TABLE_MAIN_LANGUAGE);
$sql = 'SELECT count(*) as count
FROM ' . $table . '
WHERE id="' . intval($language_id) . '"';
FROM ' . $table.'
WHERE id="' . intval($language_id).'"';
$rs = Database::query($sql);
if (Database::num_rows($rs) > 0) {
if (Database::result($rs, 0, 'count') == 1) {
@ -307,8 +307,8 @@ class SubLanguageManager
public static function check_if_language_is_sub_language($language_id)
{
$table = Database::get_main_table(TABLE_MAIN_LANGUAGE);
$sql = 'SELECT count(*) AS count FROM ' . $table . '
WHERE id = ' . intval($language_id) . ' AND NOT ISNULL(parent_id)';
$sql = 'SELECT count(*) AS count FROM '.$table.'
WHERE id = ' . intval($language_id).' AND NOT ISNULL(parent_id)';
$rs = Database::query($sql);
if (Database::num_rows($rs) > 0 && Database::result($rs, '0', 'count') == 1) {
@ -326,7 +326,7 @@ class SubLanguageManager
{
$language_info = self::get_all_information_of_language($language_id);
$table = Database::get_main_table(TABLE_MAIN_USER);
$sql = 'SELECT count(*) AS count FROM ' . $table . '
$sql = 'SELECT count(*) AS count FROM '.$table.'
WHERE language ="' . Database::escape_string($language_info['english_name']).'"';
$rs = Database::query($sql);
if (Database::num_rows($rs) > 0 && Database::result($rs, '0', 'count') >= 1) {
@ -344,8 +344,8 @@ class SubLanguageManager
public static function check_if_language_is_father($language_id)
{
$table = Database::get_main_table(TABLE_MAIN_LANGUAGE);
$sql = 'SELECT count(*) AS count FROM ' . $table . '
WHERE parent_id= ' . intval($language_id) . ' AND NOT ISNULL(parent_id);';
$sql = 'SELECT count(*) AS count FROM '.$table.'
WHERE parent_id= ' . intval($language_id).' AND NOT ISNULL(parent_id);';
$rs = Database::query($sql);
if (Database::num_rows($rs) > 0 && Database::result($rs, '0', 'count') == 1) {
@ -364,7 +364,7 @@ class SubLanguageManager
{
$tbl_admin_languages = Database::get_main_table(TABLE_MAIN_LANGUAGE);
$sql = "UPDATE $tbl_admin_languages SET available='0'
WHERE id = " . intval($language_id) . "";
WHERE id = ".intval($language_id)."";
$result = Database::query($sql);
return $result !== false; //only return false on sql error
@ -379,7 +379,7 @@ class SubLanguageManager
{
$tbl_admin_languages = Database::get_main_table(TABLE_MAIN_LANGUAGE);
$sql = "UPDATE $tbl_admin_languages SET available='1'
WHERE id = " . intval($language_id) . "";
WHERE id = ".intval($language_id)."";
$result = Database::query($sql);
return $result !== false; //only return false on sql error
@ -402,7 +402,7 @@ class SubLanguageManager
WHERE id = $language_id";
$result = Database::query($sql);
$lang = Database::fetch_array($result);
$sql_update_2 = "UPDATE $tbl_settings_current SET selected_value = '" . $lang['english_name'] . "'
$sql_update_2 = "UPDATE $tbl_settings_current SET selected_value = '".$lang['english_name']."'
WHERE variable='platformLanguage'";
$result_2 = Database::query($sql_update_2);
Event::addEvent(
@ -441,10 +441,10 @@ class SubLanguageManager
{
$tbl_admin_languages = Database::get_main_table(TABLE_MAIN_LANGUAGE);
$sql = "SELECT dokeos_folder
FROM " . $tbl_admin_languages . "
FROM " . $tbl_admin_languages."
WHERE id = (
SELECT parent_id FROM " . $tbl_admin_languages . "
WHERE dokeos_folder = '" . Database::escape_string($language_path) . "'
SELECT parent_id FROM " . $tbl_admin_languages."
WHERE dokeos_folder = '" . Database::escape_string($language_path)."'
)
";
$result = Database::query($sql);
@ -466,7 +466,7 @@ class SubLanguageManager
$adminLanguagesTable = Database::get_main_table(TABLE_MAIN_LANGUAGE);
// select language - if case several languages match, get the last (more recent) one
$sql = "SELECT english_name
FROM " . $adminLanguagesTable . "
FROM " . $adminLanguagesTable."
WHERE
isocode ='$isocode' AND
available = 1

@ -1590,7 +1590,7 @@ class Tracking
//If the last connection is > than 7 days, the text is red
//345600 = 7 days in seconds
if ($currentTimestamp - $timestamp > 604800) {
return '<span style="color: #F00;">' . api_format_date($last_login_date, DATE_FORMAT_SHORT) . '</span>';
return '<span style="color: #F00;">'.api_format_date($last_login_date, DATE_FORMAT_SHORT).'</span>';
} else {
return api_format_date($last_login_date, DATE_FORMAT_SHORT);
}
@ -1730,7 +1730,7 @@ class Tracking
'.Display::return_icon('messagebox_warning.gif').'
</a>'
: null;
return $icon. Display::label($last_login_date, 'warning');
return $icon.Display::label($last_login_date, 'warning');
} else {
return $last_login_date;
}
@ -1826,14 +1826,14 @@ class Tracking
$tbl_session_course_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
$sql = 'SELECT DISTINCT c_id
FROM ' . $tbl_course_rel_user . '
FROM ' . $tbl_course_rel_user.'
WHERE user_id = ' . $user_id.' AND relation_type<>'.COURSE_RELATION_TYPE_RRHH;
$rs = Database::query($sql);
$nb_courses = Database::num_rows($rs);
if ($include_sessions) {
$sql = 'SELECT DISTINCT c_id
FROM ' . $tbl_session_course_rel_user . '
FROM ' . $tbl_session_course_rel_user.'
WHERE user_id = ' . $user_id;
$rs = Database::query($sql);
$nb_courses += Database::num_rows($rs);
@ -1880,7 +1880,7 @@ class Tracking
$condition_quiz = "";
if (!empty($exercise_id)) {
$exercise_id = intval($exercise_id);
$condition_quiz =" AND id = $exercise_id ";
$condition_quiz = " AND id = $exercise_id ";
}
// Compose a filter based on optional session id given
@ -7777,7 +7777,7 @@ class TrackingUserLogCSV
public function display_document_tracking_info($view, $user_id, $courseCode, $session_id = 0)
{
// protect data
$user_id = intval($user_id);
$user_id = intval($user_id);
$courseId = api_get_course_int_id($courseCode);
$session_id = intval($session_id);

@ -34,7 +34,7 @@ class UserManager
const USER_FIELD_TYPE_TIMEZONE = 11;
const USER_FIELD_TYPE_SOCIAL_PROFILE = 12;
const USER_FIELD_TYPE_FILE = 13;
const USER_FIELD_TYPE_MOBILE_PHONE_NUMBER = 14;
const USER_FIELD_TYPE_MOBILE_PHONE_NUMBER = 14;
private static $encryptionMethod;
@ -562,7 +562,7 @@ class UserManager
$res = Database::query($sql);
while ($course = Database::fetch_object($res)) {
$sql = "SELECT id FROM $table_course_user
WHERE status=1 AND c_id = " . intval($course->c_id);
WHERE status=1 AND c_id = ".intval($course->c_id);
$res2 = Database::query($sql);
if (Database::num_rows($res2) == 1) {
return false;
@ -769,7 +769,7 @@ class UserManager
);
$cacheAvailable = api_get_configuration_value('apc');
if ($cacheAvailable === true) {
$apcVar = api_get_configuration_value('apc_prefix') . 'userinfo_' . $user_id;
$apcVar = api_get_configuration_value('apc_prefix').'userinfo_'.$user_id;
if (apcu_exists($apcVar)) {
apcu_delete($apcVar);
}
@ -1096,7 +1096,7 @@ class UserManager
$cacheAvailable = api_get_configuration_value('apc');
if ($cacheAvailable === true) {
$apcVar = api_get_configuration_value('apc_prefix') . 'userinfo_' . $user_id;
$apcVar = api_get_configuration_value('apc_prefix').'userinfo_'.$user_id;
if (apcu_exists($apcVar)) {
apcu_delete($apcVar);
}
@ -1305,7 +1305,7 @@ class UserManager
// into ASCII letters in order they not to be totally removed.
// 2. Applying the strict purifier.
// 3. Length limitation.
$return = api_get_setting('login_is_email') === 'true' ? substr(preg_replace(USERNAME_PURIFIER_MAIL, '', $username), 0, USERNAME_MAX_LENGTH) : substr(preg_replace(USERNAME_PURIFIER, '', $username), 0, USERNAME_MAX_LENGTH);
$return = api_get_setting('login_is_email') === 'true' ? substr(preg_replace(USERNAME_PURIFIER_MAIL, '', $username), 0, USERNAME_MAX_LENGTH) : substr(preg_replace(USERNAME_PURIFIER, '', $username), 0, USERNAME_MAX_LENGTH);
$return = URLify::transliterate($return);
return $return;
@ -1398,12 +1398,12 @@ class UserManager
if (!is_null($order)) {
$order = Database::escape_string($order);
$sql .= ' ORDER BY ' . $order;
$sql .= ' ORDER BY '.$order;
}
if (!is_null($limit)) {
$limit = Database::escape_string($limit);
$sql .= ' LIMIT ' . $limit;
$sql .= ' LIMIT '.$limit;
}
$rs = Database::query($sql);
@ -1505,11 +1505,11 @@ class UserManager
}
if (api_is_multiple_url_enabled()) {
$sql_query .= ' AND auru.access_url_id = ' . api_get_current_access_url_id();
$sql_query .= ' AND auru.access_url_id = '.api_get_current_access_url_id();
}
} else {
if (api_is_multiple_url_enabled()) {
$sql_query .= ' WHERE auru.access_url_id = ' . api_get_current_access_url_id();
$sql_query .= ' WHERE auru.access_url_id = '.api_get_current_access_url_id();
}
}
if (count($order_by) > 0) {
@ -1682,7 +1682,7 @@ class UserManager
// directory might not have been created. Make sure it is before
// going further.
$rootPath = api_get_path(SYS_UPLOAD_PATH) . 'users/' . substr((string) $id, 0, 1);
$rootPath = api_get_path(SYS_UPLOAD_PATH).'users/'.substr((string) $id, 0, 1);
if (!is_dir($rootPath)) {
$perm = api_get_permissions_for_new_directories();
try {
@ -1944,7 +1944,7 @@ class UserManager
$path_info = self::get_user_picture_path_by_id($user_id, 'system');
$path = $path_info['dir'];
if (!empty($extra_field)) {
$path .= $extra_field . '/';
$path .= $extra_field.'/';
}
// If this directory does not exist - we create it.
if (!file_exists($path)) {
@ -2208,10 +2208,10 @@ class UserManager
if (count($extra_files) > 0) {
$extra_file_list = '<div class="files-production"><ul id="productions">';
foreach ($extra_files as $file) {
$filename = substr($file,strlen($extra_field)+1);
$filename = substr($file, strlen($extra_field) + 1);
$extra_file_list .= '<li>'.Display::return_icon('archive.png').'<a href="'.$path.$extra_field.'/'.urlencode($filename).'" target="_blank">'.htmlentities($filename).'</a> ';
if ($showDelete) {
$extra_file_list .= '<input style="width:16px;" type="image" name="remove_extra_' . $extra_field . '['.urlencode($file).']" src="'.$del_image.'" alt="'.$del_text.'" title="'.$del_text.' '.htmlentities($filename).'" onclick="javascript: return confirmation(\''.htmlentities($filename).'\');" /></li>';
$extra_file_list .= '<input style="width:16px;" type="image" name="remove_extra_'.$extra_field.'['.urlencode($file).']" src="'.$del_image.'" alt="'.$del_text.'" title="'.$del_text.' '.htmlentities($filename).'" onclick="javascript: return confirmation(\''.htmlentities($filename).'\');" /></li>';
}
}
$extra_file_list .= '</ul></div>';
@ -2861,7 +2861,7 @@ class UserManager
// Getting sessions that are related to a coach in the session_rel_course_rel_user table
if (api_is_allowed_to_create_course()) {
$sessionListFromCourseCoach = array();
$sql =" SELECT DISTINCT session_id
$sql = " SELECT DISTINCT session_id
FROM $tbl_session_course_user
WHERE user_id = $user_id AND status = 2 ";
@ -2869,7 +2869,7 @@ class UserManager
if (Database::num_rows($result)) {
$result = Database::store_result($result);
foreach ($result as $session) {
$sessionListFromCourseCoach[]= $session['session_id'];
$sessionListFromCourseCoach[] = $session['session_id'];
}
}
if (!empty($sessionListFromCourseCoach)) {
@ -2901,7 +2901,7 @@ class UserManager
";
$result = Database::query($sql);
if (Database::num_rows($result)>0) {
if (Database::num_rows($result) > 0) {
while ($row = Database::fetch_assoc($result)) {
$sessions[$row['id']] = $row;
}
@ -2917,7 +2917,7 @@ class UserManager
ORDER BY access_start_date, access_end_date, name";
$result = Database::query($sql);
if (Database::num_rows($result)>0) {
if (Database::num_rows($result) > 0) {
while ($row = Database::fetch_assoc($result)) {
if (empty($sessions[$row['id']])) {
$sessions[$row['id']] = $row;
@ -3922,13 +3922,13 @@ class UserManager
$useExtraFields = false;
$extraFields = self::get_extra_filtrable_fields();
$extraFieldResult = array();
if (is_array($extraFields) && count($extraFields)>0 ) {
if (is_array($extraFields) && count($extraFields) > 0) {
foreach ($extraFields as $extraField) {
$varName = 'field_'.$extraField['variable'];
if (self::is_extra_field_available($extraField['variable'])) {
if (isset($_GET[$varName]) && $_GET[$varName]!='0') {
if (isset($_GET[$varName]) && $_GET[$varName] != '0') {
$useExtraFields = true;
$extraFieldResult[]= self::get_extra_user_data_by_value(
$extraFieldResult[] = self::get_extra_user_data_by_value(
$extraField['variable'],
$_GET[$varName]
);
@ -3939,17 +3939,17 @@ class UserManager
if ($useExtraFields) {
$finalResult = array();
if (count($extraFieldResult)>1) {
for ($i=0; $i < count($extraFieldResult) -1; $i++) {
if (is_array($extraFieldResult[$i]) && is_array($extraFieldResult[$i+1])) {
$finalResult = array_intersect($extraFieldResult[$i], $extraFieldResult[$i+1]);
if (count($extraFieldResult) > 1) {
for ($i = 0; $i < count($extraFieldResult) - 1; $i++) {
if (is_array($extraFieldResult[$i]) && is_array($extraFieldResult[$i + 1])) {
$finalResult = array_intersect($extraFieldResult[$i], $extraFieldResult[$i + 1]);
}
}
} else {
$finalResult = $extraFieldResult[0];
}
if (is_array($finalResult) && count($finalResult)>0) {
if (is_array($finalResult) && count($finalResult) > 0) {
$whereFilter = " AND u.id IN ('".implode("','", $finalResult)."') ";
} else {
//no results
@ -4128,7 +4128,7 @@ class UserManager
$sql = 'DELETE FROM '.$tbl_my_friend.'
WHERE relation_type <> '.USER_RELATION_TYPE_RRHH.' AND friend_user_id='.$friend_id.' '.$extra_condition;
Database::query($sql);
$sql= 'DELETE FROM '.$tbl_my_friend.'
$sql = 'DELETE FROM '.$tbl_my_friend.'
WHERE relation_type <> '.USER_RELATION_TYPE_RRHH.' AND user_id='.$friend_id.' '.$extra_condition;
Database::query($sql);
} else {
@ -4329,7 +4329,7 @@ class UserManager
if (!empty($lastConnectionDate)) {
$lastConnectionDate = Database::escape_string($lastConnectionDate);
$userConditions .= " AND u.last_login <= '$lastConnectionDate' ";
$userConditions .= " AND u.last_login <= '$lastConnectionDate' ";
}
$courseConditions = null;
@ -4397,7 +4397,7 @@ class UserManager
;
break;
case STUDENT_BOSS:
$drhConditions = " AND friend_user_id = $userId AND relation_type = " . USER_RELATION_TYPE_BOSS;
$drhConditions = " AND friend_user_id = $userId AND relation_type = ".USER_RELATION_TYPE_BOSS;
break;
}
@ -4492,7 +4492,7 @@ class UserManager
WHERE
friend_user_id = $userId AND
relation_type = $relationType AND
access_url_id = " . api_get_current_access_url_id();
access_url_id = ".api_get_current_access_url_id();
} else {
$sql = "SELECT user_id FROM $userRelUserTable
WHERE friend_user_id = $userId
@ -4777,7 +4777,7 @@ class UserManager
if (empty($years)) {
$years = 1;
}
$inactive_time = $years * 31536000; //1 year
$inactive_time = $years * 31536000; //1 year
$rs = Database::query($sql);
if (Database::num_rows($rs) > 0) {
if ($last_login_date = Database::result($rs, 0, 0)) {
@ -4911,7 +4911,7 @@ class UserManager
'extra_'.$field_details[1],
$field_details[3],
$options,
array('id' => 'extra_' . $field_details[1])
array('id' => 'extra_'.$field_details[1])
);
if (!$admin_permissions) {
@ -5065,7 +5065,7 @@ EOF;
$extra_field = 'extra_'.$field_details[1];
$form->addElement('file', $extra_field, $field_details[3], null, '');
if ($extra_file_list = self::build_user_extra_file_list($user_id, $field_details[1], '', true)) {
$form->addElement('static', $extra_field . '_list', null, $extra_file_list);
$form->addElement('static', $extra_field.'_list', null, $extra_file_list);
}
if ($field_details[7] == 0) {
$form->freeze($extra_field);
@ -5237,7 +5237,7 @@ EOF;
$direction = null,
$active = null,
$lastConnectionDate = null
){
) {
return self::getUsersFollowedByUser(
$userId,
$userStatus,
@ -5464,12 +5464,12 @@ EOF;
if (!empty($_SERVER['HTTPS'])) {
$url = 'https://secure.gravatar.com/avatar/';
}
$url .= md5( strtolower( trim( $email ) ) );
$url .= md5(strtolower(trim($email)));
$url .= "?s=$s&d=$d&r=$r";
if ( $img ) {
$url = '<img src="' . $url . '"';
foreach ( $atts as $key => $val )
$url .= ' ' . $key . '="' . $val . '"';
if ($img) {
$url = '<img src="'.$url.'"';
foreach ($atts as $key => $val)
$url .= ' '.$key.'="'.$val.'"';
$url .= ' />';
}
return $url;

@ -393,7 +393,7 @@ class scorm extends learnpath
$path = '';
$type = 'dir';
if (isset($this->resources[$item['identifierref']])) {
$oRes =& $this->resources[$item['identifierref']];
$oRes = & $this->resources[$item['identifierref']];
$path = @$oRes->get_path();
if (!empty($path)) {
$temptype = $oRes->get_scorm_type();
@ -444,7 +444,7 @@ class scorm extends learnpath
$item['parameters'] = Database::escape_string($item['parameters']);
$sql = "INSERT INTO $new_lp_item (c_id, lp_id,item_type,ref,title, path,min_score,max_score, $field_add parent_item_id,previous_item_id,next_item_id, prerequisite,display_order,launch_data, parameters)
VALUES ($courseId, $lp_id, '$type', '$identifier', '$title', '$path' , 0, $max_score, $value_add $parent, $previous, 0, '$prereq', ".$item['rel_order'] .", '".$item['datafromlms']."', '".$item['parameters']."' )";
VALUES ($courseId, $lp_id, '$type', '$identifier', '$title', '$path' , 0, $max_score, $value_add $parent, $previous, 0, '$prereq', ".$item['rel_order'].", '".$item['datafromlms']."', '".$item['parameters']."' )";
Database::query($sql);
if ($this->debug > 1) { error_log('New LP - In import_manifest(), inserting item : '.$sql, 0); }
@ -478,7 +478,7 @@ class scorm extends learnpath
foreach ($specific_fields as $specific_field) {
if (isset($_REQUEST[$specific_field['code']])) {
$sterms = trim($_REQUEST[$specific_field['code']]);
$all_specific_terms .= ' '. $sterms;
$all_specific_terms .= ' '.$sterms;
if (!empty($sterms)) {
$sterms = explode(',', $sterms);
foreach ($sterms as $sterm) {
@ -487,7 +487,7 @@ class scorm extends learnpath
}
}
}
$body_to_index = $all_specific_terms .' '. $title;
$body_to_index = $all_specific_terms.' '.$title;
$ic_slide->addValue("content", $body_to_index);
// TODO: Add a comment to say terms separated by commas.
$courseid = api_get_course_id();
@ -497,7 +497,7 @@ class scorm extends learnpath
SE_COURSE_ID => $courseid,
SE_TOOL_ID => TOOL_LEARNPATH,
SE_DATA => array('lp_id' => $lp_id, 'lp_item'=> $previous, 'document_id' => ''), // TODO: Unify with other lp types.
SE_USER => (int)api_get_user_id(),
SE_USER => (int) api_get_user_id(),
);
$ic_slide->xapian_data = serialize($xapian_data);
$di->addChunk($ic_slide);
@ -543,7 +543,7 @@ class scorm extends learnpath
public function import_package($zip_file_info, $current_dir = '', $courseInfo = array())
{
if ($this->debug > 0) {
error_log('In scorm::import_package('.print_r($zip_file_info,true).',"'.$current_dir.'") method', 0);
error_log('In scorm::import_package('.print_r($zip_file_info, true).',"'.$current_dir.'") method', 0);
}
$courseInfo = empty($courseInfo) ? api_get_course_info() : $courseInfo;
@ -554,7 +554,7 @@ class scorm extends learnpath
$zip_file_name = $zip_file_info['name'];
if ($this->debug > 1) {
error_log('New LP - import_package() - zip file path = ' . $zip_file_path . ', zip file name = ' . $zip_file_name, 0);
error_log('New LP - import_package() - zip file path = '.$zip_file_path.', zip file name = '.$zip_file_name, 0);
}
$course_rel_dir = api_get_course_path($courseInfo['code']).'/scorm'; // scorm dir web path starting from /courses
@ -562,7 +562,7 @@ class scorm extends learnpath
$current_dir = api_replace_dangerous_char(trim($current_dir)); // Current dir we are in, inside scorm/
if ($this->debug > 1) {
error_log( 'New LP - import_package() - current_dir = ' . $current_dir, 0);
error_log('New LP - import_package() - current_dir = '.$current_dir, 0);
}
// Get name of the zip file without the extension.
@ -570,7 +570,7 @@ class scorm extends learnpath
$file_info = pathinfo($zip_file_name);
$filename = $file_info['basename'];
$extension = $file_info['extension'];
$file_base_name = str_replace('.'.$extension,'',$filename); // Filename without its extension.
$file_base_name = str_replace('.'.$extension, '', $filename); // Filename without its extension.
$this->zipname = $file_base_name; // Save for later in case we don't have a title.
if ($this->debug > 1) { error_log("New LP - base file name is : ".$file_base_name, 0); }
@ -616,7 +616,7 @@ class scorm extends learnpath
$slash_count = substr_count($shortest_path, '/');
foreach ($manifest_list as $manifest_path) {
$tmp_slash_count = substr_count($manifest_path, '/');
if ($tmp_slash_count<$slash_count) {
if ($tmp_slash_count < $slash_count) {
$shortest_path = $manifest_path;
$slash_count = $tmp_slash_count;
}
@ -625,7 +625,7 @@ class scorm extends learnpath
$this->subdir .= '/'.dirname($shortest_path); // Do not concatenate because already done above.
$manifest = $shortest_path;
if ($this->debug > 1) { error_log('New LP - Package type is now '.$package_type, 0); }
if ($package_type== '') {
if ($package_type == '') {
// && defined('CHECK_FOR_SCORM') && CHECK_FOR_SCORM)
if ($this->debug > 1) { error_log('New LP - Package type is empty', 0); }
@ -650,8 +650,8 @@ class scorm extends learnpath
$new_dir = '/'.$new_dir;
}
if ($new_dir[strlen($new_dir)-1] == '/') {
$new_dir = substr($new_dir,0,-1);
if ($new_dir[strlen($new_dir) - 1] == '/') {
$new_dir = substr($new_dir, 0, -1);
}
/* Uncompressing phase */
@ -692,7 +692,7 @@ class scorm extends learnpath
if ($file != '.' && $file != '..') {
$filetype = 'file';
if (is_dir($course_sys_dir . $new_dir . $file)) {
if (is_dir($course_sys_dir.$new_dir.$file)) {
$filetype = 'folder';
}
@ -721,7 +721,7 @@ class scorm extends learnpath
}
}
}
@rename($course_sys_dir.$new_dir.$file,$course_sys_dir.$new_dir.$safe_file);
@rename($course_sys_dir.$new_dir.$file, $course_sys_dir.$new_dir.$safe_file);
if ($this->debug >= 1) { error_log('New LP - Renaming '.$course_sys_dir.$new_dir.$file.' to '.$course_sys_dir.$new_dir.$safe_file, 0); }
}
}
@ -908,7 +908,7 @@ class scorm extends learnpath
if ($this->debug > 0) { error_log('In scorm::get_res_path('.$id.') method', 0); }
$path = '';
if (isset($this->resources[$id])) {
$oRes =& $this->resources[$id];
$oRes = & $this->resources[$id];
$path = @$oRes->get_path();
}
return $path;
@ -924,7 +924,7 @@ class scorm extends learnpath
if ($this->debug > 0) { error_log('In scorm::get_res_type('.$id.') method', 0); }
$type = '';
if (isset($this->resources[$id])) {
$oRes =& $this->resources[$id];
$oRes = & $this->resources[$id];
$temptype = $oRes->get_scorm_type();
if (!empty($temptype)) {
$type = $temptype;
@ -943,9 +943,9 @@ class scorm extends learnpath
$title = '';
if (isset($this->manifest['organizations']['default'])) {
$title = $this->organizations[$this->manifest['organizations']['default']]->get_name();
} elseif (count($this->organizations)==1) {
} elseif (count($this->organizations) == 1) {
// This will only get one title but so we don't need to know the index.
foreach($this->organizations as $id => $value) {
foreach ($this->organizations as $id => $value) {
$title = $this->organizations[$id]->get_name();
break;
}

@ -17,11 +17,11 @@ function reports_modules_scorm_init_forEachCourses($course_code, $course_id, $co
array_push($reports_modules['scorm'],
array(
'keys_query' =>
'select ' . $course_id . ' as course_id, ' .
$reports_modules_scorm_toolid . ' as tool_id, ' .
'lp.id as child_id, lp.name as child_name, ' .
"'" . $course_db . "'" . ' as course_db from ' .
Database::get_course_table(TABLE_LP_MAIN) . ' lp',
'select '.$course_id.' as course_id, '.
$reports_modules_scorm_toolid.' as tool_id, '.
'lp.id as child_id, lp.name as child_name, '.
"'".$course_db."'".' as course_db from '.
Database::get_course_table(TABLE_LP_MAIN).' lp',
'values_query_function' => 'reports_modules_scorm_packageVal'
));
@ -29,14 +29,14 @@ function reports_modules_scorm_init_forEachCourses($course_code, $course_id, $co
array_push($reports_modules['scorm'],
array(
'keys_query' =>
'select ' . $course_id . ' as course_id, ' .
$reports_modules_scorm_toolid . ' as tool_id, ' .
'lp.id as child_id, lp.name as child_name, ' .
'lpi.id as subchild_id, lpi.title as subchild_name, ' .
"'" . $course_db . "'" . ' as course_db from ' .
Database::get_course_table(TABLE_LP_MAIN, $course_db) .
' lp,' .
Database::get_course_table(TABLE_LP_ITEM, $course_db) .
'select '.$course_id.' as course_id, '.
$reports_modules_scorm_toolid.' as tool_id, '.
'lp.id as child_id, lp.name as child_name, '.
'lpi.id as subchild_id, lpi.title as subchild_name, '.
"'".$course_db."'".' as course_db from '.
Database::get_course_table(TABLE_LP_MAIN, $course_db).
' lp,'.
Database::get_course_table(TABLE_LP_ITEM, $course_db).
' lpi where lp.id = lpi.lp_id',
'values_query_function' => 'reports_modules_scorm_scoVal'
));
@ -45,24 +45,24 @@ function reports_modules_scorm_init_forEachCourses($course_code, $course_id, $co
array_push($reports_modules['scorm'],
array(
'keys_query' =>
'select distinct ' . $course_id . ' as course_id, ' .
$reports_modules_scorm_toolid . ' as tool_id, ' .
'lp.id as child_id, lp.name as child_name, ' .
'lpi.id as subchild_id, ' .
'lpi.title as subchild_name, ' .
'null as subsubchild_id, ' .
'lpivo.objective_id as subsubchild_name, ' .
"'" . $course_db . "'" . ' as course_db from ' .
Database::get_course_table(TABLE_LP_MAIN, $course_db) .
' lp,' .
Database::get_course_table(TABLE_LP_ITEM, $course_db) .
' lpi, ' .
Database::get_course_table(TABLE_LP_ITEM_VIEW, $course_db) .
' lpiv, ' .
Database::get_course_table(TABLE_LP_IV_OBJECTIVE, $course_db) .
' lpivo ' .
'where lp.id = lpi.lp_id ' .
'and lpi.id = lpiv.lp_item_id ' .
'select distinct '.$course_id.' as course_id, '.
$reports_modules_scorm_toolid.' as tool_id, '.
'lp.id as child_id, lp.name as child_name, '.
'lpi.id as subchild_id, '.
'lpi.title as subchild_name, '.
'null as subsubchild_id, '.
'lpivo.objective_id as subsubchild_name, '.
"'".$course_db."'".' as course_db from '.
Database::get_course_table(TABLE_LP_MAIN, $course_db).
' lp,'.
Database::get_course_table(TABLE_LP_ITEM, $course_db).
' lpi, '.
Database::get_course_table(TABLE_LP_ITEM_VIEW, $course_db).
' lpiv, '.
Database::get_course_table(TABLE_LP_IV_OBJECTIVE, $course_db).
' lpivo '.
'where lp.id = lpi.lp_id '.
'and lpi.id = lpiv.lp_item_id '.
'and lpiv.id = lpivo.lp_iv_id ',
'values_query_function' => 'reports_modules_scorm_objVal'
));
@ -73,12 +73,12 @@ function reports_modules_scorm_packageVal($scorm, $key_id)
return array(
'type' => 'sql',
'sql' =>
'select ' . $key_id . ', user_id as uid, ' .
'session_id, view_count as attempt, null as score, ' .
'progress as progress, ' .
'null as time, null as ts from ' .
Database::get_course_table(TABLE_LP_VIEW, $scorm['course_db']) .
' where lp_id = ' . $scorm['child_id']
'select '.$key_id.', user_id as uid, '.
'session_id, view_count as attempt, null as score, '.
'progress as progress, '.
'null as time, null as ts from '.
Database::get_course_table(TABLE_LP_VIEW, $scorm['course_db']).
' where lp_id = '.$scorm['child_id']
);
}
@ -87,25 +87,25 @@ function reports_modules_scorm_scoVal($scorm, $key_id)
return array(
'type' => 'sql',
'sql' =>
'select ' . $key_id . ', lpv.user_id as uid, ' .
'lpv.session_id, lpiv.view_count as attempt, ' .
'lpiv.score as score, ' .
'(case lpiv.status ' .
'when "incomplete" then 0 ' .
'when "completed" then 1 ' .
'when "passed" then 2 ' .
'when "failed" then 3 ' .
'when "browsed" then 4 ' .
'when "not attempted" then 5 ' .
'else 6 ' .
'end) as progress, ' .
'lpiv.total_time as time, null as ts from ' .
Database::get_course_table(TABLE_LP_VIEW, $scorm['course_db']) .
' lpv, ' .
Database::get_course_table(TABLE_LP_ITEM_VIEW, $scorm['course_db']) .
' lpiv ' .
' where lpv.lp_id = ' . $scorm['child_id'] .
' and lpiv.lp_item_id = ' . $scorm['subchild_id'] .
'select '.$key_id.', lpv.user_id as uid, '.
'lpv.session_id, lpiv.view_count as attempt, '.
'lpiv.score as score, '.
'(case lpiv.status '.
'when "incomplete" then 0 '.
'when "completed" then 1 '.
'when "passed" then 2 '.
'when "failed" then 3 '.
'when "browsed" then 4 '.
'when "not attempted" then 5 '.
'else 6 '.
'end) as progress, '.
'lpiv.total_time as time, null as ts from '.
Database::get_course_table(TABLE_LP_VIEW, $scorm['course_db']).
' lpv, '.
Database::get_course_table(TABLE_LP_ITEM_VIEW, $scorm['course_db']).
' lpiv '.
' where lpv.lp_id = '.$scorm['child_id'].
' and lpiv.lp_item_id = '.$scorm['subchild_id'].
' and lpiv.lp_view_id = lpv.id'
);
}
@ -115,29 +115,29 @@ function reports_modules_scorm_objVal($scorm, $key_id)
return array(
'type' => 'sql',
'sql' =>
'select ' . $key_id . ', lpv.user_id as uid, ' .
'lpv.session_id, lpiv.view_count as attempt, ' .
'lpivo.score_raw as score, ' .
'(case lpivo.status ' .
'when "incomplete" then 0 ' .
'when "completed" then 1 ' .
'when "passed" then 2 ' .
'when "failed" then 3 ' .
'when "browsed" then 4 ' .
'when "not attempted" then 5 ' .
'else 6 ' .
'end) as progress, ' .
'null as time, null as ts from ' .
Database::get_course_table(TABLE_LP_VIEW, $scorm['course_db']) .
' lpv, ' .
Database::get_course_table(TABLE_LP_ITEM_VIEW, $scorm['course_db']) .
' lpiv, ' .
Database::get_course_table(TABLE_LP_IV_OBJECTIVE, $scorm['course_db']) .
' lpivo ' .
' where lpv.lp_id = ' . $scorm['child_id'] .
' and lpiv.lp_item_id = ' . $scorm['subchild_id'] .
' and lpivo.objective_id = "' . $scorm['subsubchild_name'] . '" ' .
' and lpiv.lp_view_id = lpv.id' .
'select '.$key_id.', lpv.user_id as uid, '.
'lpv.session_id, lpiv.view_count as attempt, '.
'lpivo.score_raw as score, '.
'(case lpivo.status '.
'when "incomplete" then 0 '.
'when "completed" then 1 '.
'when "passed" then 2 '.
'when "failed" then 3 '.
'when "browsed" then 4 '.
'when "not attempted" then 5 '.
'else 6 '.
'end) as progress, '.
'null as time, null as ts from '.
Database::get_course_table(TABLE_LP_VIEW, $scorm['course_db']).
' lpv, '.
Database::get_course_table(TABLE_LP_ITEM_VIEW, $scorm['course_db']).
' lpiv, '.
Database::get_course_table(TABLE_LP_IV_OBJECTIVE, $scorm['course_db']).
' lpivo '.
' where lpv.lp_id = '.$scorm['child_id'].
' and lpiv.lp_item_id = '.$scorm['subchild_id'].
' and lpivo.objective_id = "'.$scorm['subsubchild_name'].'" '.
' and lpiv.lp_view_id = lpv.id'.
' and lpivo.lp_iv_id=lpiv.id'
);
}

@ -15,32 +15,32 @@ function reports_template_courseTime_getSQL()
{
// fetch columns
$result = array();
$query = 'select r.id as kid, c.title as course ' .
'from ' .
Database::get_main_table(TABLE_MAIN_REPORTS_KEYS) . ' r, ' .
Database::get_main_table(TABLE_MAIN_COURSE) . ' c ' .
'where r.course_id=c.id and r.tool_id is null and r.child_id is null' .
$query = 'select r.id as kid, c.title as course '.
'from '.
Database::get_main_table(TABLE_MAIN_REPORTS_KEYS).' r, '.
Database::get_main_table(TABLE_MAIN_COURSE).' c '.
'where r.course_id=c.id and r.tool_id is null and r.child_id is null'.
' order by c.title';
$columns = Database::query($query);
if (Database::num_rows($columns) == 0) {
die('<b>' . get_lang('no data found: ' . $query) . '</b>');
die('<b>'.get_lang('no data found: '.$query).'</b>');
}
$columns = Database::store_result($columns);
// fetch data
$query = 'select u.lastname Name, u.firstname Firstname';
foreach ($columns as $key => $column) {
$query .= ', sec_to_time(k' . $key . '.report_time) as `' .
$column['course'] . '` ';
$query .= ', sec_to_time(k'.$key.'.report_time) as `'.
$column['course'].'` ';
}
$query .= ' from ' . Database::get_main_table(TABLE_MAIN_USER) . ' u ';
$query .= ' from '.Database::get_main_table(TABLE_MAIN_USER).' u ';
foreach ($columns as $key => $column) // fixme sessions
{
$query .= 'left outer join ' .
Database::get_main_table(TABLE_MAIN_REPORTS_VALUES) .
' k' . $key .
' on k' . $key . '.key_id = ' . $column['kid'] .
' and k' . $key . '.user_id = u.user_id ';
$query .= 'left outer join '.
Database::get_main_table(TABLE_MAIN_REPORTS_VALUES).
' k'.$key.
' on k'.$key.'.key_id = '.$column['kid'].
' and k'.$key.'.user_id = u.user_id ';
}
return $query;
}

@ -19,18 +19,18 @@ function reports_template_Generic_getSQL()
// Nom, prenom
$query = 'select u.lastname as "Last name", u.firstname as "First name" ';
$query .= 'from ' . Database::get_main_table(TABLE_MAIN_USER) . ' u ';
$query .= ' where u.user_id in (' . reports_getVisibilitySQL() . ') ';
$query .= 'from '.Database::get_main_table(TABLE_MAIN_USER).' u ';
$query .= ' where u.user_id in ('.reports_getVisibilitySQL().') ';
$query .= ' order by u.user_id ';
$queries[0] = $query;
// Custom Field
foreach (array(10 => "description") as $k => $v) {
$query = 'select ufv.value as "' . $v . '" ';
$query .= 'from ' . Database::get_main_table(TABLE_MAIN_USER) . ' u ';
$query .= 'left outer join ' . Database::get_main_table(TABLE_EXTRA_FIELD_VALUES) . ' ufv ';
$query .= ' on ufv.item_id = u.user_id and ufv.field_id = ' . $k;
$query .= ' where u.user_id in (' . reports_getVisibilitySQL() . ') ';
$query = 'select ufv.value as "'.$v.'" ';
$query .= 'from '.Database::get_main_table(TABLE_MAIN_USER).' u ';
$query .= 'left outer join '.Database::get_main_table(TABLE_EXTRA_FIELD_VALUES).' ufv ';
$query .= ' on ufv.item_id = u.user_id and ufv.field_id = '.$k;
$query .= ' where u.user_id in ('.reports_getVisibilitySQL().') ';
$query .= ' order by u.user_id ';
$queries[] = $query;
}
@ -38,21 +38,21 @@ function reports_template_Generic_getSQL()
// Stored Value
$sv = array();
foreach ($sv as $k => $v) {
$query = 'select sec_to_time(sv.sv_value) as "' . $v . '" ';
$query .= 'from ' . Database::get_main_table(TABLE_MAIN_USER) . ' u ';
$query .= ' left outer join ' . Database::get_main_table(TABLE_TRACK_STORED_VALUES) . ' sv ';
$query .= 'on sv.user_id = u.user_id and sv_key = "' . $k . '" ';
$query .= ' where u.user_id in (' . reports_getVisibilitySQL() . ') ';
$query = 'select sec_to_time(sv.sv_value) as "'.$v.'" ';
$query .= 'from '.Database::get_main_table(TABLE_MAIN_USER).' u ';
$query .= ' left outer join '.Database::get_main_table(TABLE_TRACK_STORED_VALUES).' sv ';
$query .= 'on sv.user_id = u.user_id and sv_key = "'.$k.'" ';
$query .= ' where u.user_id in ('.reports_getVisibilitySQL().') ';
$query .= ' order by u.user_id ';
$queries[] = $query;
}
// premiere connexion
$query = 'select min(tel.login_date) as "First connection", max(tel.logout_date) as "Latest connection" ';
$query .= 'from ' . Database::get_main_table(TABLE_MAIN_USER) . ' u ';
$query .= 'left outer join ' . Database::get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN) . ' tel ';
$query .= 'from '.Database::get_main_table(TABLE_MAIN_USER).' u ';
$query .= 'left outer join '.Database::get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN).' tel ';
$query .= ' on tel.login_user_id = u.user_id ';
$query .= ' where u.user_id in (' . reports_getVisibilitySQL() . ') ';
$query .= ' where u.user_id in ('.reports_getVisibilitySQL().') ';
$query .= ' group by u.user_id ';
$query .= ' order by u.user_id ';
$queries[] = $query;

@ -27,13 +27,13 @@ function get_suggestions_from_search_engine($q)
$i = 0;
while ($row = Database::fetch_array($sql_result)) {
$json[] = [
'id' => api_convert_encoding($row['value'],'UTF-8',$charset),
'value' => api_convert_encoding($row['value'],'UTF-8',$charset),
'label' => api_convert_encoding($row['value'],'UTF-8',$charset)
'id' => api_convert_encoding($row['value'], 'UTF-8', $charset),
'value' => api_convert_encoding($row['value'], 'UTF-8', $charset),
'label' => api_convert_encoding($row['value'], 'UTF-8', $charset)
];
if ($i<20) {
$data[ $row['course_code'] ] [ $row['tool_id'] ] [ $row['ref_id'] ] = 1;
if ($i < 20) {
$data[$row['course_code']] [$row['tool_id']] [$row['ref_id']] = 1;
}
$i++;
}
@ -95,7 +95,7 @@ function get_suggestions_from_search_engine($q)
}
}
foreach ($output as $i=>$out) {
if (api_stristr($out,$q) === false) {continue;}
if (api_stristr($out, $q) === false) {continue; }
$s = api_convert_encoding(substr($out, 0, -3), 'UTF-8', $charset);
if (!in_array($s, $more_sugg)) {
$more_sugg[] = $s;

@ -16,7 +16,7 @@ if (empty($_GET['session_id'])) {
api_not_allowed();
}
$session_id = isset($_GET['session_id']) ? intval($_GET['session_id']): null;
$session_id = isset($_GET['session_id']) ? intval($_GET['session_id']) : null;
$sessionField = new ExtraFieldValue('session');
$valueAllowVisitors = $sessionField->get_values_by_handler_and_field_variable(
$session_id,
@ -31,7 +31,7 @@ if (!$allowVisitors) {
$this_section = SECTION_COURSES;
$htmlHeadXtra[] = api_get_jqgrid_js();
$course_id = isset($_GET['course_id']) ? intval($_GET['course_id']) : null;
$course_id = isset($_GET['course_id']) ? intval($_GET['course_id']) : null;
Session::write('id_session', $session_id);
// Clear the exercise session just in case
@ -176,12 +176,12 @@ $sessionTitleLink = api_get_configuration_value('courses_list_session_title_link
if ($sessionTitleLink == 2 && $session->getNbrCourses() === 1) {
$sessionCourses = $session->getCourses();
$sessionCourse = $sessionCourses[0]->getCourse();
$courseUrl = $sessionCourse->getDirectory() . '/index.php?';
$courseUrl = $sessionCourse->getDirectory().'/index.php?';
$courseUrl .= http_build_query([
'id_session' => $session->getId()
]);
header('Location: ' . api_get_path(WEB_COURSE_PATH) . $courseUrl);
header('Location: '.api_get_path(WEB_COURSE_PATH).$courseUrl);
exit;
}
@ -189,7 +189,7 @@ Display::display_header(get_lang('Session'));
$session_select = array();
foreach ($session_list as $item) {
$session_select[$item['id']] = $item['name'];
$session_select[$item['id']] = $item['name'];
}
// Session list form
@ -243,7 +243,7 @@ if (!empty($courseList)) {
$exerciseId = $exerciseInfo['id'];
if ($exerciseInfo['start_time'] == '0000-00-00 00:00:00') {
$start_date = '-';
$start_date = '-';
} else {
$start_date = $exerciseInfo['start_time'];
}
@ -280,7 +280,7 @@ if (!empty($courseList)) {
$name = Display::url(
$exerciseInfo['title'],
api_get_path(WEB_CODE_PATH) . "exercise/overview.php?cidReq=$courseCode&exerciseId={$exerciseId}&id_session=$session_id",
api_get_path(WEB_CODE_PATH)."exercise/overview.php?cidReq=$courseCode&exerciseId={$exerciseId}&id_session=$session_id",
array('target' => SESSION_LINK_TARGET)
);
@ -312,7 +312,7 @@ if (!empty($courseList)) {
if (!empty($result['exe_weighting']) &&
intval($result['exe_weighting']) != 0
) {
$my_score = $result['exe_result']/$result['exe_weighting'];
$my_score = $result['exe_result'] / $result['exe_weighting'];
}
$position = ExerciseLib::get_exercise_result_ranking(
$my_score,
@ -325,7 +325,7 @@ if (!empty($courseList)) {
$name = Display::url(
$exerciseInfo['title'],
api_get_path(WEB_CODE_PATH) . "exercise/result.php?cidReq=$courseCode&id={$result['exe_id']}&id_session=$session_id&show_headers=1",
api_get_path(WEB_CODE_PATH)."exercise/result.php?cidReq=$courseCode&id={$result['exe_id']}&id_session=$session_id&show_headers=1",
array('target' => SESSION_LINK_TARGET, 'class'=>'exercise-result-link')
);
@ -358,7 +358,7 @@ if (!empty($new_exercises)) {
$my_real_array = array_merge($new_exercises, $my_real_array);
}
$start = $end = $start_only = $end_only ='';
$start = $end = $start_only = $end_only = '';
if (!empty($session_info['access_start_date'])) {
$start = api_convert_and_format_date($session_info['access_start_date'], DATE_FORMAT_SHORT);
@ -397,11 +397,11 @@ $columns_courses = array(
get_lang('NumberOfPublishedLps'),
);
$column_model_courses = array(
array('name'=>'title', 'index'=>'title', 'width'=>'400px', 'align'=>'left', 'sortable'=>'true'),
array('name'=>'title', 'index'=>'title', 'width'=>'400px', 'align'=>'left', 'sortable'=>'true'),
//array('name'=>'recent_lps', 'index'=>'recent_lps', 'width'=>'10px', 'align'=>'left', 'sortable'=>'false'),
// array('name'=>'max_mutation_date', 'index'=>'max_mutation_date', 'width'=>'120px', 'align'=>'left', 'sortable'=>'true'),
array('name'=>'exercise_count', 'index'=>'exercise_count', 'width'=>'180px', 'align'=>'left', 'sortable'=>'true'),
array('name'=>'lp_count', 'index'=>'lp_count', 'width'=>'180px', 'align'=>'left', 'sortable'=>'true')
array('name'=>'exercise_count', 'index'=>'exercise_count', 'width'=>'180px', 'align'=>'left', 'sortable'=>'true'),
array('name'=>'lp_count', 'index'=>'lp_count', 'width'=>'180px', 'align'=>'left', 'sortable'=>'true')
);
$extra_params_courses['height'] = '100%';
@ -425,10 +425,10 @@ $columns = array(
get_lang('LearningPaths')
);
$column_model = array(
array('name'=>'date', 'index'=>'date', 'width'=>'120', 'align'=>'left', 'sortable'=>'true'),
$column_model = array(
array('name'=>'date', 'index'=>'date', 'width'=>'120', 'align'=>'left', 'sortable'=>'true'),
array('name'=>'course', 'index'=>'course', 'width'=>'300', 'align'=>'left', 'sortable'=>'true', 'wrap_cell' => 'true'),
array('name'=>'lp', 'index'=>'lp', 'width'=>'440', 'align'=>'left', 'sortable'=>'true')
array('name'=>'lp', 'index'=>'lp', 'width'=>'440', 'align'=>'left', 'sortable'=>'true')
);
$extra_params = array();
@ -474,11 +474,11 @@ $column_week = array(
get_lang('LearningPaths')
);
$column_week_model = array(
array('name'=>'week', 'index'=>'week', 'width'=>'40', 'align'=>'left', 'sortable'=>'false'),
array('name'=>'date', 'index'=>'date', 'width'=>'120', 'align'=>'left', 'sortable'=>'false'),
array('name'=>'course', 'index'=>'course', 'width'=>'300', 'align'=>'left', 'sortable'=>'true', 'wrap_cell' => 'true'),
array('name'=>'lp', 'index'=>'lp', 'width'=>'440', 'align'=>'left', 'sortable'=>'true')
$column_week_model = array(
array('name'=>'week', 'index'=>'week', 'width'=>'40', 'align'=>'left', 'sortable'=>'false'),
array('name'=>'date', 'index'=>'date', 'width'=>'120', 'align'=>'left', 'sortable'=>'false'),
array('name'=>'course', 'index'=>'course', 'width'=>'300', 'align'=>'left', 'sortable'=>'true', 'wrap_cell' => 'true'),
array('name'=>'lp', 'index'=>'lp', 'width'=>'440', 'align'=>'left', 'sortable'=>'true')
);
$extra_params_week = array();
@ -490,7 +490,7 @@ $extra_params_week['groupingView'] = array(
'groupField' => array('week'),
'groupOrder' => array('desc'),
'groupColumnShow' => 'false',
'groupText' => array('<b>' . get_lang('PeriodWeek') . ' {0}</b>')
'groupText' => array('<b>'.get_lang('PeriodWeek').' {0}</b>')
);
$extra_params_week['autowidth'] = 'true'; //use the width of the parent
$extra_params_week['height'] = '100%';
@ -507,15 +507,15 @@ if (!api_is_anonymous()) {
get_lang('BestResultInCourse'),
get_lang('Ranking')
);
$column_exercise_model = array(
array('name'=>'status', 'index'=>'status', 'width'=>'40', 'align'=>'left', 'sortable'=>'false'),
array('name'=>'date', 'index'=>'date', 'width'=>'130','align'=>'left', 'sortable'=>'true'),
array('name'=>'course', 'index'=>'course', 'width'=>'200','align'=>'left', 'sortable'=>'true', 'wrap_cell' => 'true'),
array('name'=>'exercise', 'index'=>'exercise', 'width'=>'200','align'=>'left', 'sortable'=>'false'),
array('name'=>'attempt', 'index'=>'attempt', 'width'=>'60', 'align'=>'center', 'sortable'=>'true'),
array('name'=>'result', 'index'=>'result', 'width'=>'120','align'=>'center', 'sortable'=>'true'),
array('name'=>'best_result','index'=>'best_result','width'=>'140','align'=>'center', 'sortable'=>'true'),
array('name'=>'position', 'index'=>'position', 'width'=>'55', 'align'=>'center', 'sortable'=>'true')
$column_exercise_model = array(
array('name'=>'status', 'index'=>'status', 'width'=>'40', 'align'=>'left', 'sortable'=>'false'),
array('name'=>'date', 'index'=>'date', 'width'=>'130', 'align'=>'left', 'sortable'=>'true'),
array('name'=>'course', 'index'=>'course', 'width'=>'200', 'align'=>'left', 'sortable'=>'true', 'wrap_cell' => 'true'),
array('name'=>'exercise', 'index'=>'exercise', 'width'=>'200', 'align'=>'left', 'sortable'=>'false'),
array('name'=>'attempt', 'index'=>'attempt', 'width'=>'60', 'align'=>'center', 'sortable'=>'true'),
array('name'=>'result', 'index'=>'result', 'width'=>'120', 'align'=>'center', 'sortable'=>'true'),
array('name'=>'best_result', 'index'=>'best_result', 'width'=>'140', 'align'=>'center', 'sortable'=>'true'),
array('name'=>'position', 'index'=>'position', 'width'=>'55', 'align'=>'center', 'sortable'=>'true')
);
$extra_params_exercise['height'] = '100%';
$extra_params_exercise['autowidth'] = 'true';

@ -19,7 +19,7 @@ function load_history_ticket(div_course, ticket_id) {
$.ajax({
contentType: "application/x-www-form-urlencoded",
beforeSend: function(object) {
$("div#"+div_course).html("<img src=\'' . $webLibPath . 'javascript/indicator.gif\' />"); },
$("div#"+div_course).html("<img src=\'' . $webLibPath.'javascript/indicator.gif\' />"); },
type: "POST",
url: "ticket_assign_log.php",
data: "ticket_id="+ticket_id,
@ -42,10 +42,10 @@ $(document).ready(function() {
function display_advanced_search_form () {
if ($("#advanced_search_form").css("display") == "none") {
$("#advanced_search_form").css("display","block");
$("#img_plus_and_minus").html(\'&nbsp;'. Display::returnFontAwesomeIcon('arrow-down') . ' '. get_lang('AdvancedSearch').'\');
$("#img_plus_and_minus").html(\'&nbsp;'. Display::returnFontAwesomeIcon('arrow-down').' '.get_lang('AdvancedSearch').'\');
} else {
$("#advanced_search_form").css("display","none");
$("#img_plus_and_minus").html(\'&nbsp;'. Display::returnFontAwesomeIcon('arrow-right') . ' '.get_lang('AdvancedSearch').'\');
$("#img_plus_and_minus").html(\'&nbsp;'. Display::returnFontAwesomeIcon('arrow-right').' '.get_lang('AdvancedSearch').'\');
}
}
</script>';
@ -219,7 +219,7 @@ if (!empty($projectId)) {
$form->addHidden('project_id', $projectId);
$advancedSearch = Display::url(
'<span id="img_plus_and_minus">&nbsp;'. Display::returnFontAwesomeIcon('arrow-right') .' '.get_lang('AdvancedSearch'),
'<span id="img_plus_and_minus">&nbsp;'.Display::returnFontAwesomeIcon('arrow-right').' '.get_lang('AdvancedSearch'),
'javascript://',
array(
'class' => 'btn btn-default advanced-parameters',
@ -235,10 +235,10 @@ if (!empty($projectId)) {
ICON_SIZE_MEDIUM
),
api_get_path(WEB_CODE_PATH).'ticket/new_ticket.php?project_id='.$projectId,
[ 'title' => get_lang('Add') ]
['title' => get_lang('Add')]
);
$actionRight.= Display::url(
$actionRight .= Display::url(
Display::return_icon(
'export_excel.png',
get_lang('Export'),
@ -246,10 +246,10 @@ if (!empty($projectId)) {
ICON_SIZE_MEDIUM
),
api_get_self().'?action=export'.$get_parameter.$get_parameter2.'&project_id='.$projectId,
[ 'title' => get_lang('Export') ]
['title' => get_lang('Export')]
);
$actionRight.= Display::url(
$actionRight .= Display::url(
Display::return_icon(
'settings.png',
get_lang('Categories'),
@ -257,12 +257,12 @@ if (!empty($projectId)) {
ICON_SIZE_MEDIUM
),
api_get_path(WEB_CODE_PATH).'ticket/settings.php',
[ 'title' => get_lang('Settings') ]
['title' => get_lang('Settings')]
);
}
echo Display::toolbarAction('toolbar-tickets', array( 0 => $form->return_form(), 1 => $advancedSearch, 2 => $actionRight));
echo Display::toolbarAction('toolbar-tickets', array(0 => $form->return_form(), 1 => $advancedSearch, 2 => $actionRight));
$advancedSearchForm = new FormValidator(
'advanced_search',
@ -313,8 +313,8 @@ if (!empty($projectId)) {
} else {
if (api_get_setting('ticket_allow_student_add') === 'true') {
echo '<div class="actions" >';
echo '<a href="' . api_get_path(WEB_CODE_PATH).'ticket/new_ticket.php?project_id='.$projectId.'">' .
Display::return_icon('add.png', get_lang('Add'), '', '32') .
echo '<a href="'.api_get_path(WEB_CODE_PATH).'ticket/new_ticket.php?project_id='.$projectId.'">'.
Display::return_icon('add.png', get_lang('Add'), '', '32').
'</a>';
echo '</div>';
}
@ -330,8 +330,8 @@ if ($isAdmin) {
$table->set_header(6, get_lang('AssignedTo'), true);
$table->set_header(7, get_lang('Message'), true);
} else {
echo '<center><h1>' . get_lang('MyTickets') . '</h1></center>';
echo '<center><p>' . get_lang('TicketMsgWelcome') . '</p></center>';
echo '<center><h1>'.get_lang('MyTickets').'</h1></center>';
echo '<center><p>'.get_lang('TicketMsgWelcome').'</p></center>';
$table->set_header(0, '#', true);
$table->set_header(1, get_lang('Status'), false);
$table->set_header(2, get_lang('Date'), true);

@ -5,7 +5,7 @@ require __DIR__.'/../../../main/inc/global.inc.php';
require_once __DIR__.'/../../../main/auth/external_login/functions.inc.php';
if (isset($_POST['error']) || empty($_REQUEST)) {
header('Location: ' . api_get_path(WEB_PATH) . 'index.php?logout=logout');
header('Location: '.api_get_path(WEB_PATH).'index.php?logout=logout');
exit;
}
@ -27,7 +27,7 @@ $u = array(
'username' => $jwtPayload->emails[0],
'language' => 'en',
'password' => 'azure_active_directory',
'auth_source' => 'azure_active_directory ' . $jwtPayload->idp,
'auth_source' => 'azure_active_directory '.$jwtPayload->idp,
'extra' => array()
);
@ -53,5 +53,5 @@ if ($userInfo === false) {
$_SESSION['_user'] = $_user;
}
header('Location: ' . api_get_path(WEB_PATH));
header('Location: '.api_get_path(WEB_PATH));
exit;

@ -22,7 +22,7 @@ if (file_exists(__DIR__.'/config.vm.php')) {
if (empty($activeSessions)) {
$vm->runCron();
} else {
echo "Can't run cron active sessions found: " . $activeSessions;
echo "Can't run cron active sessions found: ".$activeSessions;
}
}
}

@ -1,11 +1,11 @@
<?php
//fix for Opera XMLHttpRequests
if(!count($_POST) && $HTTP_RAW_POST_DATA){
if (!count($_POST) && $HTTP_RAW_POST_DATA) {
parse_str($HTTP_RAW_POST_DATA, $_POST);
}
if(!defined('DOKU_INC')) define('DOKU_INC',__DIR__.'/../../../');
if (!defined('DOKU_INC')) define('DOKU_INC', __DIR__.'/../../../');
require_once(DOKU_INC.'inc/init.php');
require_once(DOKU_INC.'inc/common.php');
require_once(DOKU_INC.'inc/pageutils.php');
@ -21,7 +21,7 @@
$cookies;
foreach (array_keys($_COOKIE) as $cookieName) {
$cookies.=bin2hex($cookieName)."=".bin2hex($_COOKIE[$cookieName]).";";
$cookies .= bin2hex($cookieName)."=".bin2hex($_COOKIE[$cookieName]).";";
}
$pageName = $_GET["pageName"];

@ -31,7 +31,7 @@ class OLPC_Peru_FilterPlugin extends Plugin
$list = $this->get_blacklist_options();
foreach ($list as $k => $v) {
$this->course_settings[] =
array('group'=> 'olpc_peru_filter_filter', 'name' => $k, 'type' => 'checkbox', 'init_value' => $v);
array('group'=> 'olpc_peru_filter_filter', 'name' => $k, 'type' => 'checkbox', 'init_value' => $v);
}
require_once __DIR__.'/../config.php';
if (!empty($blacklist_enabled_file)) {
@ -63,7 +63,7 @@ class OLPC_Peru_FilterPlugin extends Plugin
}
function course_settings_updated($values = array()) {
if (!is_array($values) or count($values)==0) {
if (!is_array($values) or count($values) == 0) {
return false;
}
$this->set_blacklist_options($values['olpc_peru_filter_filter']);
@ -84,7 +84,7 @@ class OLPC_Peru_FilterPlugin extends Plugin
}
$list = scandir($this->blacklists_dir);
foreach ($list as $file) {
if (substr($file,0,1) == '.' or $file == 'custom_blacklist' or is_dir($this->blacklists_dir.'/'.$file)) {
if (substr($file, 0, 1) == '.' or $file == 'custom_blacklist' or is_dir($this->blacklists_dir.'/'.$file)) {
continue;
}
$categories[] = $file;
@ -119,7 +119,7 @@ class OLPC_Peru_FilterPlugin extends Plugin
$new_blacklist .= $k."\n";
}
}
$r = @file_put_contents($this->blacklist_enabled_file,$new_blacklist);
$r = @file_put_contents($this->blacklist_enabled_file, $new_blacklist);
//todo check the value or $r in $php_errormsg
return true;
}

@ -24,7 +24,7 @@ global $CLI_VCHAMILO_PRECHECK;
$CLI_VCHAMILO_PRECHECK = true; // force first config to be minimal
require(dirname(dirname(dirname(__DIR__))).'/main/inc/conf/configuration.php'); // get boot config
require_once($_configuration['root_sys'].'plugin/vchamilo/cli/clilib.php'); // cli only functions
require_once($_configuration['root_sys'].'plugin/vchamilo/cli/clilib.php'); // cli only functions
// Ensure errors are well explained

@ -36,7 +36,7 @@ class ScormDocument extends Resource
echo $path;
if (!empty($this->title)) {
if (strpos($path, $this->title) === false) {
echo " - " . $this->title;
echo " - ".$this->title;
}
}
}

Loading…
Cancel
Save