Merge remote-tracking branch 'origin/1.11.x' into 1.11.x

remotes/angel/1.11.x
Yannick Warnier 8 years ago
commit 710781e49d
  1. 16
      main/attendance/attendance_calendar.php
  2. 18
      main/auth/sso/sso.class.php
  3. 6
      main/course_description/index.php
  4. 4
      main/course_info/maintenance.php
  5. 22
      main/create_course/add_course.php
  6. 58
      main/document/create_document.php
  7. 26
      main/document/document_quota.php
  8. 6
      main/document/remote.php
  9. 18
      main/document/webcam_clip.php
  10. 56
      main/dropbox/dropbox_class.inc.php
  11. 8
      main/dropbox/dropbox_init.inc.php
  12. 18
      main/exercise/overview.php
  13. 12
      main/exercise/showinframes.php
  14. 14
      main/extrafield/translate.php
  15. 28
      main/group/group_category.php
  16. 16
      main/group/group_creation.php
  17. 20
      main/group/group_overview.php
  18. 10
      main/group/group_space.php
  19. 2
      main/group/import.php
  20. 4
      main/group/member_settings.php
  21. 16
      main/group/settings.php
  22. 6
      main/group/tutor_settings.php
  23. 28
      main/inc/ajax/admin.ajax.php
  24. 10
      main/inc/ajax/forum.ajax.php
  25. 6
      main/inc/ajax/myspace.ajax.php
  26. 2
      main/inc/ajax/online.ajax.php
  27. 18
      main/inc/ajax/skill.ajax.php
  28. 14
      main/inc/lib/plugin.class.php
  29. 12
      main/inc/lib/search/get_terms.php
  30. 6
      main/inc/lib/search/tool_processors/document_processor.class.php
  31. 14
      main/inc/lib/search/tool_processors/learnpath_processor.class.php
  32. 8
      main/inc/lib/search/tool_processors/link_processor.class.php
  33. 6
      main/inc/lib/search/tool_processors/quiz_processor.class.php
  34. 6
      main/link/link.php
  35. 24
      main/mySpace/index.php
  36. 16
      main/mySpace/teachers.php
  37. 6
      main/reports/reports.lib.php
  38. 2
      main/search/index.php
  39. 2
      main/survey/ch_dropdown.php
  40. 2
      main/survey/copy_survey.php
  41. 12
      main/survey/reporting.php
  42. 4
      main/ticket/projects.php
  43. 4
      main/ticket/status.php
  44. 2
      main/ticket/update_report.php
  45. 6
      main/timeline/view.php
  46. 2
      main/upload/upload.scorm.php
  47. 94
      main/user/subscribe_user.php
  48. 8
      main/wiki/index.php
  49. 8
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Basic.php
  50. 32
      src/Chamilo/CourseBundle/Component/CourseCopy/CourseSelectForm.php

@ -14,15 +14,15 @@ if (!$is_locked_attendance || api_is_platform_admin()) {
echo '<div class="actions">';
if ($action == 'calendar_add') {
echo '<a href="index.php?'.api_get_cidreq().'&action=calendar_list&attendance_id='.$attendance_id.'">'.
Display::return_icon('back.png',get_lang('AttendanceCalendar'),'',ICON_SIZE_MEDIUM).'</a>';
Display::return_icon('back.png', get_lang('AttendanceCalendar'), '', ICON_SIZE_MEDIUM).'</a>';
} else {
echo '<a href="index.php?'.api_get_cidreq().'&action=attendance_sheet_list&attendance_id='.$attendance_id.'">'.
Display::return_icon('back.png',get_lang('AttendanceSheet'),'',ICON_SIZE_MEDIUM).'</a>';
Display::return_icon('back.png', get_lang('AttendanceSheet'), '', ICON_SIZE_MEDIUM).'</a>';
if (api_is_allowed_to_edit()) {
echo '<a href="index.php?'.api_get_cidreq().'&action=calendar_add&attendance_id='.$attendance_id.'">'.
Display::return_icon('add.png',get_lang('AddDateAndTime'),'',ICON_SIZE_MEDIUM).'</a>';
Display::return_icon('add.png', get_lang('AddDateAndTime'), '', ICON_SIZE_MEDIUM).'</a>';
echo '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDeleteAllDates').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=calendar_all_delete&attendance_id='.$attendance_id.'">'.
Display::return_icon('clean.png',get_lang('CleanCalendar'),'',ICON_SIZE_MEDIUM).'</a>';
Display::return_icon('clean.png', get_lang('CleanCalendar'), '', ICON_SIZE_MEDIUM).'</a>';
}
}
echo '</div>';
@ -57,7 +57,7 @@ if (isset($action) && $action == 'calendar_add') {
$form = new FormValidator(
'attendance_calendar_add',
'POST',
'index.php?action=calendar_add&attendance_id='.$attendance_id.'&' . api_get_cidreq(),
'index.php?action=calendar_add&attendance_id='.$attendance_id.'&'.api_get_cidreq(),
''
);
$form->addElement('header', get_lang('AddADateTime'));
@ -92,7 +92,7 @@ if (isset($action) && $action == 'calendar_add') {
'weekly' => get_lang('RepeatWeekly'),
'monthlyByDate' => get_lang('RepeatMonthlyByDate')
);
$form->addElement('select', 'repeat_type', get_lang('RepeatType') , $a_repeat_type);
$form->addElement('select', 'repeat_type', get_lang('RepeatType'), $a_repeat_type);
$form->addElement(
'date_picker',
@ -133,7 +133,7 @@ if (isset($action) && $action == 'calendar_add') {
$form = new FormValidator(
'attendance_calendar_edit',
'POST',
'index.php?action=calendar_edit&attendance_id=' . $attendance_id . '&calendar_id=' . $calendar_id . '&' . api_get_cidreq(),
'index.php?action=calendar_edit&attendance_id='.$attendance_id.'&calendar_id='.$calendar_id.'&'.api_get_cidreq(),
''
);
$form->addDateTimePicker(
@ -154,7 +154,7 @@ if (isset($action) && $action == 'calendar_add') {
get_lang('DateTime'),
null,
ICON_SIZE_MEDIUM
).' '.substr($calendar['date_time'], 0, strlen($calendar['date_time'])- 3) .'&nbsp;';
).' '.substr($calendar['date_time'], 0, strlen($calendar['date_time']) - 3).'&nbsp;';
if (isset($calendar['groups']) && !empty($calendar['groups'])) {
foreach ($calendar['groups'] as $group) {

@ -34,7 +34,7 @@ class sso
*/
public function __construct()
{
$this->protocol = api_get_setting('sso_authentication_protocol');
$this->protocol = api_get_setting('sso_authentication_protocol');
// There can be multiple domains, so make sure to take only the first
// This might be later extended with a decision process
$domains = explode(',', api_get_setting('sso_authentication_domain'));
@ -42,7 +42,7 @@ class sso
$this->auth_uri = api_get_setting('sso_authentication_auth_uri');
$this->deauth_uri = api_get_setting('sso_authentication_unauth_uri');
//cut the string to avoid recursive URL construction in case of failure
$this->referer = $this->protocol.$_SERVER['HTTP_HOST'].substr($_SERVER['REQUEST_URI'],0,strpos($_SERVER['REQUEST_URI'],'sso'));
$this->referer = $this->protocol.$_SERVER['HTTP_HOST'].substr($_SERVER['REQUEST_URI'], 0, strpos($_SERVER['REQUEST_URI'], 'sso'));
$this->deauth_url = $this->protocol.$this->domain.$this->deauth_uri;
$this->master_url = $this->protocol.$this->domain.$this->auth_uri;
$this->referrer_uri = base64_encode($_SERVER['REQUEST_URI']);
@ -130,11 +130,11 @@ class sso
) {
//error_log('user n password are ok');
//Check if the account is active (not locked)
if ($uData['active']=='1') {
if ($uData['active'] == '1') {
// check if the expiration date has not been reached
if (empty($uData['expiration_date'])
or $uData['expiration_date'] > date('Y-m-d H:i:s')
or $uData['expiration_date']=='0000-00-00 00:00:00') {
or $uData['expiration_date'] == '0000-00-00 00:00:00') {
//If Multiple URL is enabled
if (api_get_multiple_access_url()) {
@ -168,11 +168,11 @@ class sso
// the user credentials are OK, which
// should be protection enough
// against evil URL spoofing...
$sso_target = api_get_path(WEB_PATH) . base64_decode($sso['ruri']);
$sso_target = api_get_path(WEB_PATH).base64_decode($sso['ruri']);
} else {
$sso_target = isset($sso['target']) ? $sso['target'] : api_get_path(WEB_PATH) . 'index.php';
$sso_target = isset($sso['target']) ? $sso['target'] : api_get_path(WEB_PATH).'index.php';
}
header('Location: '. $sso_target);
header('Location: '.$sso_target);
exit;
} else {
// user does not have permission for this site
@ -286,9 +286,9 @@ class sso
$userId = intval($userId);
if ($asAdmin && api_is_platform_admin(true)) {
return api_get_path(WEB_CODE_PATH) . "admin/user_edit.php?user_id=$userId";
return api_get_path(WEB_CODE_PATH)."admin/user_edit.php?user_id=$userId";
}
return api_get_path(WEB_CODE_PATH) . 'auth/profile.php';
return api_get_path(WEB_CODE_PATH).'auth/profile.php';
}
}

@ -9,7 +9,7 @@
*/
require_once __DIR__.'/../inc/global.inc.php';
$current_course_tool = TOOL_COURSE_DESCRIPTION;
$current_course_tool = TOOL_COURSE_DESCRIPTION;
// defining constants
define('ADD_BLOCK', 8);
@ -23,7 +23,7 @@ api_protect_course_script(true);
// get actions
$actions = array('listing', 'add', 'edit', 'delete', 'history');
$action = 'listing';
if (isset($_GET['action']) && in_array($_GET['action'],$actions)) {
if (isset($_GET['action']) && in_array($_GET['action'], $actions)) {
$action = $_GET['action'];
}
@ -42,7 +42,7 @@ if (isset($_GET['isStudentView']) && $_GET['isStudentView'] == 'true') {
}
// interbreadcrumb
$interbreadcrumb[] = array ("url" => "index.php?".api_get_cidreq(), "name" => get_lang('CourseProgram'));
$interbreadcrumb[] = array("url" => "index.php?".api_get_cidreq(), "name" => get_lang('CourseProgram'));
if ($description_type == 1) {
$interbreadcrumb[] = array("url" => "#", "name" => get_lang('GeneralDescription'));
}

@ -6,7 +6,7 @@
*/
require_once __DIR__.'/../inc/global.inc.php';
$current_course_tool = TOOL_COURSE_MAINTENANCE;
$current_course_tool = TOOL_COURSE_MAINTENANCE;
$this_section = SECTION_COURSES;
$nameTools = get_lang('Maintenance');
@ -43,7 +43,7 @@ echo Display::page_header($nameTools);
<div class="sectioncomment"><?php echo get_lang('DescriptionRecycleCourse'); ?></div>
<div class="sectiontitle"><?php Display::display_icon('delete.gif', get_lang('DelCourse')); ?>&nbsp;&nbsp;<a href="../course_info/delete_course.php?<?php echo api_get_cidreq(); ?>"><?php echo get_lang('DelCourse'); ?></a></div>
<div class="sectioncomment"><?php echo get_lang('DescriptionDeleteCourse'); ?></div>
<div class="sectioncomment"><?php echo get_lang('DescriptionDeleteCourse'); ?></div>
<?php
// Footer

@ -44,7 +44,7 @@ $htmlHeadXtra[] = '<script>
</script>';
$interbreadcrumb[] = array(
'url' => api_get_path(WEB_PATH) . 'user_portal.php',
'url' => api_get_path(WEB_PATH).'user_portal.php',
'name' => get_lang('MyCourses')
);
@ -81,7 +81,7 @@ $form->addElement(
);
// Category category.
$url = api_get_path(WEB_AJAX_PATH) . 'course.ajax.php?a=search_category';
$url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=search_category';
$form->addElement(
'select_ajax',
@ -224,7 +224,7 @@ if (api_get_setting('teacher_can_select_course_template') === 'true') {
get_lang('PickACourseAsATemplateForThisNewCourse'),
],
null,
['url' => api_get_path(WEB_AJAX_PATH) . 'course.ajax.php?a=search_course']
['url' => api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=search_course']
);
}
@ -285,8 +285,8 @@ if ($form->validate()) {
$params['gradebook_model_id'] = isset($course_values['gradebook_model_id']) ? $course_values['gradebook_model_id'] : null;
$params['course_template'] = $course_values['course_template'];
include_once api_get_path(SYS_CODE_PATH) . 'lang/english/trad4all.inc.php';
$file_to_include = api_get_path(SYS_CODE_PATH) . 'lang/' . $course_language . '/trad4all.inc.php';
include_once api_get_path(SYS_CODE_PATH).'lang/english/trad4all.inc.php';
$file_to_include = api_get_path(SYS_CODE_PATH).'lang/'.$course_language.'/trad4all.inc.php';
if (file_exists($file_to_include)) {
include $file_to_include;
@ -311,13 +311,13 @@ if ($form->validate()) {
$splash = api_get_setting('course_creation_splash_screen');
if ($splash === 'true') {
$url = api_get_path(WEB_CODE_PATH);
$url .= 'course_info/start.php?' . api_get_cidreq_params($course_info['code']);
$url .= 'course_info/start.php?'.api_get_cidreq_params($course_info['code']);
$url .= '&first=1';
header('Location: ' . $url);
header('Location: '.$url);
exit;
} else {
$url = api_get_path(WEB_COURSE_PATH) . $course_info['directory'] . '/';
header('Location: ' . $url);
$url = api_get_path(WEB_COURSE_PATH).$course_info['directory'].'/';
header('Location: '.$url);
exit;
}
} else {
@ -345,7 +345,7 @@ if ($form->validate()) {
if ($request_id) {
$course_request_info = CourseRequestManager::get_course_request_info($request_id);
$message = (is_array($course_request_info) ? '<strong>' . $course_request_info['code'] . '</strong> : ' : '') . get_lang('CourseRequestCreated');
$message = (is_array($course_request_info) ? '<strong>'.$course_request_info['code'].'</strong> : ' : '').get_lang('CourseRequestCreated');
$message = Display::return_message(
$message,
'confirmation',
@ -355,7 +355,7 @@ if ($form->validate()) {
'div',
Display::url(
get_lang('Enter'),
api_get_path(WEB_PATH) . 'user_portal.php',
api_get_path(WEB_PATH).'user_portal.php',
['class' => 'btn btn-default']
),
['style' => 'float: left; margin:0px; padding: 0px;']

@ -39,7 +39,7 @@ $(document).on("change", ".selectpicker", function () {
$.ajax({
contentType: "application/x-www-form-urlencoded",
data: "dirValue="+dirValue,
url: "' . api_get_path(WEB_AJAX_PATH) . 'document.ajax.php?a=document_destination",
url: "' . api_get_path(WEB_AJAX_PATH).'document.ajax.php?a=document_destination",
type: "POST",
success: function(response) {
$("[name=\'dirValue\']").val(response)
@ -147,7 +147,7 @@ if ($is_certificate_mode) {
}
$doc_tree = explode('/', $dir);
$count_dir = count($doc_tree) -2; // "2" because at the begin and end there are 2 "/"
$count_dir = count($doc_tree) - 2; // "2" because at the begin and end there are 2 "/"
if (api_is_in_group()) {
$group_properties = GroupManager::get_group_properties(api_get_group_id());
@ -162,7 +162,7 @@ for ($i = 0; $i < ($count_dir); $i++) {
$relative_url .= '../';
}
if ($relative_url== '') {
if ($relative_url == '') {
$relative_url = '/';
}
@ -214,7 +214,7 @@ if (!$is_certificate_mode) {
"name" => get_lang('Documents'),
);
} else {
$interbreadcrumb[]= array('url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('Gradebook'));
$interbreadcrumb[] = array('url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('Gradebook'));
}
if (!api_is_allowed_in_course()) {
@ -253,9 +253,9 @@ $form = new FormValidator(
$form->addElement('header', $nameTools);
if ($is_certificate_mode) {//added condition for certicate in gradebook
$form->addElement('hidden','certificate','true',array('id'=>'certificate'));
$form->addElement('hidden', 'certificate', 'true', array('id'=>'certificate'));
if (isset($_GET['selectcat'])) {
$form->addElement('hidden','selectcat', $select_cat);
$form->addElement('hidden', 'selectcat', $select_cat);
}
}
@ -334,19 +334,19 @@ if (!$is_certificate_mode &&
$escaped_folders = array();
foreach ($folders as $key => & $val) {
// Hide some folders
if ($val=='/HotPotatoes_files' || $val=='/certificates' || basename($val)=='css'){
if ($val == '/HotPotatoes_files' || $val == '/certificates' || basename($val) == 'css') {
continue;
}
// Admin setting for Hide/Show the folders of all users
if (api_get_setting('show_users_folders') == 'false' && (strstr($val, '/shared_folder') || strstr($val, 'shared_folder_session_'))){
if (api_get_setting('show_users_folders') == 'false' && (strstr($val, '/shared_folder') || strstr($val, 'shared_folder_session_'))) {
continue;
}
// Admin setting for Hide/Show Default folders to all users
if (api_get_setting('show_default_folders') == 'false' && ($val=='/images' || $val=='/flash' || $val=='/audio' || $val=='/video' || strstr($val, '/images/gallery') || $val=='/video/flv')){
if (api_get_setting('show_default_folders') == 'false' && ($val == '/images' || $val == '/flash' || $val == '/audio' || $val == '/video' || strstr($val, '/images/gallery') || $val == '/video/flv')) {
continue;
}
// Admin setting for Hide/Show chat history folder
if (api_get_setting('show_chat_folder') == 'false' && $val=='/chat_files'){
if (api_get_setting('show_chat_folder') == 'false' && $val == '/chat_files') {
continue;
}
@ -371,13 +371,13 @@ if (!$is_certificate_mode &&
if (is_array($folders)) {
foreach ($folders as & $folder) {
//Hide some folders
if ($folder=='/HotPotatoes_files' || $folder=='/certificates' || basename($folder)=='css') {
if ($folder == '/HotPotatoes_files' || $folder == '/certificates' || basename($folder) == 'css') {
continue;
}
//Admin setting for Hide/Show the folders of all users
if (api_get_setting('show_users_folders') == 'false' &&
(strstr($folder, '/shared_folder') || strstr($folder, 'shared_folder_session_'))
){
) {
continue;
}
//Admin setting for Hide/Show Default folders to all users
@ -390,20 +390,20 @@ if (!$is_certificate_mode &&
strstr($folder, '/images/gallery') ||
$folder == '/video/flv'
)
){
) {
continue;
}
//Admin setting for Hide/Show chat history folder
if (api_get_setting('show_chat_folder') == 'false' &&
$folder=='/chat_files'
){
$folder == '/chat_files'
) {
continue;
}
$selected = (substr($dir,0,-1) == $folder) ? ' selected="selected"' : '';
$selected = (substr($dir, 0, -1) == $folder) ? ' selected="selected"' : '';
$path_parts = explode('/', $folder);
$folder_titles[$folder] = cut($folder_titles[$folder], 80);
$space_counter =count($path_parts) - 2;
$space_counter = count($path_parts) - 2;
if ($space_counter > 0) {
$label = str_repeat('&nbsp;&nbsp;&nbsp;', $space_counter).' &mdash; '.$folder_titles[$folder];
} else {
@ -421,11 +421,11 @@ if (!$is_certificate_mode &&
$selected = (substr($dir, 0, -1) == $folder) ? ' selected="selected"' : '';
$label = $folder_titles[$folder];
if ($folder == $group_dir) {
$label = '/ (' . get_lang('HomeDirectory') . ')';
$label = '/ ('.get_lang('HomeDirectory').')';
} else {
$path_parts = explode('/', str_replace($group_dir, '', $folder));
$label = cut($label, 80);
$label = str_repeat('&nbsp;&nbsp;&nbsp;', count($path_parts) - 2) . ' &mdash; ' . $label;
$label = str_repeat('&nbsp;&nbsp;&nbsp;', count($path_parts) - 2).' &mdash; '.$label;
}
$parent_select->addOption($label, $folder);
if ($selected != '') {
@ -555,7 +555,7 @@ if ($form->validate()) {
);
}
}
$dir= substr($dir,0,-1);
$dir = substr($dir, 0, -1);
$selectcat = '';
if (isset($_REQUEST['selectcat'])) {
$selectcat = "&selectcat=".intval($_REQUEST['selectcat']);
@ -564,7 +564,7 @@ if ($form->validate()) {
if ($is_certificate_mode) {
$df = DocumentManager::get_default_certificate_id($_course['code']);
if (!isset($df)) {
DocumentManager::attach_gradebook_certificate($_course['code'],$document_id);
DocumentManager::attach_gradebook_certificate($_course['code'], $document_id);
}
$certificate_condition = '&certificate=true&curdirpath=/certificates';
}
@ -608,16 +608,16 @@ if ($form->validate()) {
// link back to the documents overview
if ($is_certificate_mode) {
$actionsLeft = '<a href="document.php?certificate=true&id='.$folder_id.'&selectcat=' . Security::remove_XSS($_GET['selectcat']).'">'.
Display::return_icon('back.png',get_lang('Back').' '.get_lang('To').' '.get_lang('CertificateOverview'),'',ICON_SIZE_MEDIUM).'</a>';
$actionsLeft = '<a href="document.php?certificate=true&id='.$folder_id.'&selectcat='.Security::remove_XSS($_GET['selectcat']).'">'.
Display::return_icon('back.png', get_lang('Back').' '.get_lang('To').' '.get_lang('CertificateOverview'), '', ICON_SIZE_MEDIUM).'</a>';
$actionsLeft .= '<a id="hide_bar_template" href="#" role="button">'.
Display::return_icon('expand.png',get_lang('Back'),array('id'=>'expand'),ICON_SIZE_MEDIUM).Display::return_icon('contract.png',get_lang('Back'),array('id'=>'contract', 'class'=>'hide'),ICON_SIZE_MEDIUM).'</a>';
Display::return_icon('expand.png', get_lang('Back'), array('id'=>'expand'), ICON_SIZE_MEDIUM).Display::return_icon('contract.png', get_lang('Back'), array('id'=>'contract', 'class'=>'hide'), ICON_SIZE_MEDIUM).'</a>';
} else {
$actionsLeft = '<a href="document.php?curdirpath='.Security::remove_XSS($dir).'">'.
Display::return_icon('back.png',get_lang('Back').' '.get_lang('To').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
Display::return_icon('back.png', get_lang('Back').' '.get_lang('To').' '.get_lang('DocumentsOverview'), '', ICON_SIZE_MEDIUM).'</a>';
$actionsLeft .= '<a id="hide_bar_template" href="#" role="button">'.
Display::return_icon('expand.png',get_lang('Expand'),array('id'=>'expand'),ICON_SIZE_MEDIUM).
Display::return_icon('contract.png',get_lang('Collapse'),array('id'=>'contract', 'class'=>'hide'),ICON_SIZE_MEDIUM).'</a>';
Display::return_icon('expand.png', get_lang('Expand'), array('id'=>'expand'), ICON_SIZE_MEDIUM).
Display::return_icon('contract.png', get_lang('Collapse'), array('id'=>'contract', 'class'=>'hide'), ICON_SIZE_MEDIUM).'</a>';
}
echo $toolbar = Display::toolbarAction('actions-documents', array($actionsLeft));
@ -630,10 +630,10 @@ if ($form->validate()) {
$str_info = '';
foreach ($all_information_by_create_certificate[0] as $info_value) {
$str_info.=$info_value.'<br/>';
$str_info .= $info_value.'<br/>';
}
$create_certificate = get_lang('CreateCertificateWithTags');
Display::display_normal_message($create_certificate.': <br /><br/>'.$str_info,false);
Display::display_normal_message($create_certificate.': <br /><br/>'.$str_info, false);
}
// HTML-editor

@ -32,11 +32,11 @@ $user_info = api_get_user_info($user_id);
$session = array();
$user_name = $user_info['complete_name'];
$course_list = SessionManager::get_course_list_by_session_id ($session_id);
$course_list = SessionManager::get_course_list_by_session_id($session_id);
$session_list = SessionManager::get_session_by_course($course_id);
$total_quota_bytes = DocumentManager::get_course_quota();
$quota_bytes = DocumentManager::documents_total_space($course_id, 0 , 0);
$quota_percentage = round($quota_bytes/$total_quota_bytes, 2)*100;
$quota_bytes = DocumentManager::documents_total_space($course_id, 0, 0);
$quota_percentage = round($quota_bytes / $total_quota_bytes, 2) * 100;
$session[] = array(get_lang('Course').' ('.format_file_size($quota_bytes).')', $quota_percentage);
@ -46,11 +46,11 @@ if (!empty($session_list)) {
foreach ($session_list as $session_data) {
$quota_percentage = 0;
$quota_bytes = intval(DocumentManager::documents_total_space($course_id, null, $session_data['id']));
if (!empty($quota_bytes)) {
$quota_percentage = round($quota_bytes/$total_quota_bytes, 2)*100;
if (!empty($quota_bytes)) {
$quota_percentage = round($quota_bytes / $total_quota_bytes, 2) * 100;
}
if ($session_id == $session_data['id']) {
$session_data['name'] = $session_data['name'] . ' * ';
$session_data['name'] = $session_data['name'].' * ';
}
$used_quota_bytes += $quota_bytes;
$session[] = array(
@ -66,11 +66,11 @@ if (!empty($group_list)) {
$quota_percentage = 0;
$my_group_id = $group_data['id'];
$quota_bytes = intval(DocumentManager::documents_total_space($course_id, $my_group_id, 0));
if (!empty($quota_bytes)) {
$quota_percentage = round($quota_bytes/$total_quota_bytes, 2)*100;
if (!empty($quota_bytes)) {
$quota_percentage = round($quota_bytes / $total_quota_bytes, 2) * 100;
}
if ($group_id == $my_group_id) {
$group_data['name'] = $group_data['name'] . ' * ';
$group_data['name'] = $group_data['name'].' * ';
}
$used_quota_bytes += $quota_bytes;
$session[] = array(addslashes(get_lang('Group').': '.$group_data['name']).' ('.format_file_size($quota_bytes).')', $quota_percentage);
@ -85,7 +85,7 @@ if (is_array($document_list)) {
}
}
if ($quota_bytes != 0) {
$quota_percentage = round($quota_bytes/$total_quota_bytes, 2)*100;
$quota_percentage = round($quota_bytes / $total_quota_bytes, 2) * 100;
}
$session[] = array(addslashes(get_lang('Teacher').': '.$user_name).' ('.format_file_size($quota_bytes).')', $quota_percentage);
@ -100,15 +100,15 @@ if (is_array($document_list)) {
}
}
if ($quota_bytes != 0) {
$quota_percentage = round($quota_bytes/$total_quota_bytes, 2)*100;
$quota_percentage = round($quota_bytes / $total_quota_bytes, 2) * 100;
}
}
$session[] = array(addslashes(sprintf(get_lang('TeacherXInSession'),$user_name)), $quota_percentage);
$session[] = array(addslashes(sprintf(get_lang('TeacherXInSession'), $user_name)), $quota_percentage);
}
}
$quota_percentage = round(($total_quota_bytes - $used_quota_bytes)/$total_quota_bytes, 2)*100;
$quota_percentage = round(($total_quota_bytes - $used_quota_bytes) / $total_quota_bytes, 2) * 100;
$session[] = array(addslashes(get_lang('ShowCourseQuotaUse')).' ('.format_file_size($total_quota_bytes - $used_quota_bytes).') ', $quota_percentage);
$quota_data = json_encode($session);

@ -40,8 +40,8 @@ $cwd = $_REQUEST['cwd'];
$nParent = 0; // the number of /.. into the url
while (substr($cwd, -3, 3) == '/..') {
// go to parent directory
$cwd= substr($cwd, 0, -3);
if (strlen($cwd) == 0) { $cwd='/'; }
$cwd = substr($cwd, 0, -3);
if (strlen($cwd) == 0) { $cwd = '/'; }
$nParent++;
}
for (; $nParent > 0; $nParent--) {
@ -55,7 +55,7 @@ if (Security::check_abs_path($cwd, api_get_path(SYS_PATH))) {
}
if ($action == 'list') {
/*==== List files ====*/
if ($debug>0) { error_log("sending file list",0); }
if ($debug > 0) { error_log("sending file list", 0); }
// get files list
$files = DocumentManager::get_all_document_data($_course, $cwd, 0, null, false);

@ -35,9 +35,9 @@ $document_id = $document_data['id'];
$dir = $document_data['path'];
//make some vars
$webcamdir=$dir;
if($webcamdir=="/"){
$webcamdir="";
$webcamdir = $dir;
if ($webcamdir == "/") {
$webcamdir = "";
}
@ -71,7 +71,7 @@ if (!is_dir($filepath)) {
$groupId = api_get_group_id();
if (!empty($groupId)) {
$interbreadcrumb[] = array ("url" => "../group/group_space.php?".api_get_cidreq(), "name" => get_lang('GroupSpace'));
$interbreadcrumb[] = array("url" => "../group/group_space.php?".api_get_cidreq(), "name" => get_lang('GroupSpace'));
$noPHP_SELF = true;
$group = GroupManager :: get_group_properties($groupId);
$path = explode('/', $dir);
@ -80,14 +80,14 @@ if (!empty($groupId)) {
}
}
$interbreadcrumb[] = array ("url" => "./document.php?id=".$document_id."&".api_get_cidreq(), "name" => get_lang('Documents'));
$interbreadcrumb[] = array("url" => "./document.php?id=".$document_id."&".api_get_cidreq(), "name" => get_lang('Documents'));
if (!api_is_allowed_in_course()) {
api_not_allowed(true);
}
if (!($is_allowed_to_edit || $groupRights ||
DocumentManager::is_my_shared_folder(api_get_user_id(), Security::remove_XSS($dir),api_get_session_id()))) {
DocumentManager::is_my_shared_folder(api_get_user_id(), Security::remove_XSS($dir), api_get_session_id()))) {
api_not_allowed(true);
}
@ -105,7 +105,7 @@ if (isset ($group)) {
// Interbreadcrumb for the current directory root path
$counter = 0;
if (isset($document_data['parents'])) {
foreach($document_data['parents'] as $document_sub_data) {
foreach ($document_data['parents'] as $document_sub_data) {
//fixing double group folder in breadcrumb
if (api_get_group_id()) {
if ($counter == 0) {
@ -119,12 +119,12 @@ if (isset($document_data['parents'])) {
}
//make some vars
$webcamuserid=api_get_user_id();
$webcamuserid = api_get_user_id();
Display :: display_header($nameTools, 'Doc');
echo '<div class="actions">';
echo '<a href="document.php?id='.$document_id.'">'.
Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'), '', ICON_SIZE_MEDIUM).'</a>';
echo '</div>';
?>

@ -104,7 +104,7 @@ class Dropbox_Work
// Check if object exists already. If it does, the old object is used
// with updated information (authors, description, upload_date)
$this->isOldWork = false;
$sql = "SELECT id, upload_date FROM ". Database::get_course_table(TABLE_DROPBOX_FILE) ."
$sql = "SELECT id, upload_date FROM ".Database::get_course_table(TABLE_DROPBOX_FILE)."
WHERE c_id = $course_id AND filename = '".Database::escape_string($this->filename)."'";
$result = Database::query($sql);
$res = Database::fetch_array($result);
@ -148,20 +148,20 @@ class Dropbox_Work
$this->id = Database::insert(Database::get_course_table(TABLE_DROPBOX_FILE), $params);
if ($this->id) {
$sql = "UPDATE ". Database::get_course_table(TABLE_DROPBOX_FILE) ." SET id = iid WHERE iid = {$this->id}";
$sql = "UPDATE ".Database::get_course_table(TABLE_DROPBOX_FILE)." SET id = iid WHERE iid = {$this->id}";
Database::query($sql);
}
}
$sql = "SELECT count(file_id) as count
FROM ". Database::get_course_table(TABLE_DROPBOX_PERSON) ."
FROM ". Database::get_course_table(TABLE_DROPBOX_PERSON)."
WHERE c_id = $course_id AND file_id = ".intval($this->id)." AND user_id = ".$this->uploader_id;
$result = Database::query($sql);
$row = Database::fetch_array($result);
if ($row['count'] == 0) {
// Insert entries into person table
$sql = "INSERT INTO ". Database::get_course_table(TABLE_DROPBOX_PERSON) ." (c_id, file_id, user_id)
$sql = "INSERT INTO ".Database::get_course_table(TABLE_DROPBOX_PERSON)." (c_id, file_id, user_id)
VALUES ($course_id, ".intval($this->id)." , ".intval($this->uploader_id).")";
Database::query($sql);
}
@ -179,11 +179,11 @@ class Dropbox_Work
$action = isset($_GET['action']) ? $_GET['action'] : null;
// Do some sanity checks
$id = intval($id);
$id = intval($id);
// Get the data from DB
$sql = "SELECT uploader_id, filename, filesize, title, description, author, upload_date, last_upload_date, cat_id
FROM ". Database::get_course_table(TABLE_DROPBOX_FILE) ."
FROM ". Database::get_course_table(TABLE_DROPBOX_FILE)."
WHERE c_id = $course_id AND id = ".$id."";
$result = Database::query($sql);
$res = Database::fetch_array($result, 'ASSOC');
@ -212,7 +212,7 @@ class Dropbox_Work
// Getting the feedback on the work.
if ($action == 'viewfeedback' AND $this->id == $_GET['id']) {
$feedback2 = array();
$sql = "SELECT * FROM ". Database::get_course_table(TABLE_DROPBOX_FEEDBACK) ."
$sql = "SELECT * FROM ".Database::get_course_table(TABLE_DROPBOX_FEEDBACK)."
WHERE c_id = $course_id AND file_id='".$id."'
ORDER BY feedback_id ASC";
$result = Database::query($sql);
@ -220,14 +220,14 @@ class Dropbox_Work
$row_feedback['feedback'] = Security::remove_XSS($row_feedback['feedback']);
$feedback2[] = $row_feedback;
}
$this->feedback2= $feedback2;
$this->feedback2 = $feedback2;
}
}
}
class Dropbox_SentWork extends Dropbox_Work
{
public $recipients; //array of ['id']['name'] arrays
public $recipients; //array of ['id']['name'] arrays
/**
* Constructor calls private functions to create a new work or retreive an existing work from DB
@ -292,7 +292,7 @@ class Dropbox_SentWork extends Dropbox_Work
$recipient_ids = array($uploader_id);
}
if (! is_array($recipient_ids) || count($recipient_ids) == 0) {
if (!is_array($recipient_ids) || count($recipient_ids) == 0) {
die(get_lang('GeneralError').' (code 209)');
}
@ -308,14 +308,14 @@ class Dropbox_SentWork extends Dropbox_Work
$table_post = Database::get_course_table(TABLE_DROPBOX_POST);
$table_person = Database::get_course_table(TABLE_DROPBOX_PERSON);
$session_id = api_get_session_id();
$user = api_get_user_id();
$user = api_get_user_id();
$now = api_get_utc_datetime();
$mailId = get_mail_id_base();
// Insert data in dropbox_post and dropbox_person table for each recipient
foreach ($this->recipients as $rec) {
$file_id = (int)$this->id;
$user_id = (int)$rec['id'];
$file_id = (int) $this->id;
$user_id = (int) $rec['id'];
$sql = "INSERT INTO $table_post (c_id, file_id, dest_user_id, session_id, feedback_date, cat_id)
VALUES ($course_id, $file_id, $user_id, $session_id, '$now', 0)";
Database::query($sql);
@ -331,7 +331,7 @@ class Dropbox_SentWork extends Dropbox_Work
// Do not add recipient in person table if mailing zip or just upload.
if (!$justSubmit) {
Database::query($sql); // If work already exists no error is generated
Database::query($sql); // If work already exists no error is generated
}
}
@ -340,7 +340,7 @@ class Dropbox_SentWork extends Dropbox_Work
$ownerid = getUserOwningThisMailing($ownerid);
}
if (($recipid = $rec["id"]) > $mailId) {
$recipid = $ownerid; // mailing file recipient = mailing id, not a person
$recipid = $ownerid; // mailing file recipient = mailing id, not a person
}
api_item_property_update(
$_course,
@ -397,13 +397,13 @@ class Dropbox_SentWork extends Dropbox_Work
class Dropbox_Person
{
// The receivedWork and the sentWork arrays are sorted.
public $receivedWork; // an array of Dropbox_Work objects
public $sentWork; // an array of Dropbox_SentWork objects
public $receivedWork; // an array of Dropbox_Work objects
public $sentWork; // an array of Dropbox_SentWork objects
public $userId = 0;
public $isCourseAdmin = false;
public $isCourseTutor = false;
public $_orderBy = ''; // private property that determines by which field
public $_orderBy = ''; // private property that determines by which field
/**
* Constructor for recreating the Dropbox_Person object
@ -472,7 +472,7 @@ class Dropbox_Person
$course_id = api_get_course_int_id();
// Delete entries in person table concerning received works
foreach ($this->receivedWork as $w) {
$sql = "DELETE FROM ". Database::get_course_table(TABLE_DROPBOX_PERSON) ."
$sql = "DELETE FROM ".Database::get_course_table(TABLE_DROPBOX_PERSON)."
WHERE c_id = $course_id AND user_id='".$this->userId."' AND file_id='".$w->id."'";
Database::query($sql);
}
@ -489,10 +489,10 @@ class Dropbox_Person
$course_id = api_get_course_int_id();
$id = intval($id);
$sql = "DELETE FROM ". Database::get_course_table(TABLE_DROPBOX_FILE) ."
$sql = "DELETE FROM ".Database::get_course_table(TABLE_DROPBOX_FILE)."
WHERE c_id = $course_id AND cat_id = '".$id."' ";
if (!Database::query($sql)) return false;
$sql = "DELETE FROM ". Database::get_course_table(TABLE_DROPBOX_CATEGORY) ."
$sql = "DELETE FROM ".Database::get_course_table(TABLE_DROPBOX_CATEGORY)."
WHERE c_id = $course_id AND cat_id = '".$id."' ";
if (!Database::query($sql)) return false;
$sql = "DELETE FROM ".Database::get_course_table(TABLE_DROPBOX_POST)."
@ -526,10 +526,10 @@ class Dropbox_Person
}
}
// Delete entries in person table concerning received works
$sql = "DELETE FROM ". Database::get_course_table(TABLE_DROPBOX_PERSON) ."
$sql = "DELETE FROM ".Database::get_course_table(TABLE_DROPBOX_PERSON)."
WHERE c_id = $course_id AND user_id = '".$this->userId."' AND file_id ='".$id."'";
Database::query($sql);
removeUnusedFiles(); // Check for unused files
removeUnusedFiles(); // Check for unused files
}
/**
@ -540,12 +540,12 @@ class Dropbox_Person
$course_id = api_get_course_int_id();
//delete entries in person table concerning sent works
foreach ($this->sentWork as $w) {
$sql = "DELETE FROM ". Database::get_course_table(TABLE_DROPBOX_PERSON) ."
$sql = "DELETE FROM ".Database::get_course_table(TABLE_DROPBOX_PERSON)."
WHERE c_id = $course_id AND user_id='".$this->userId."' AND file_id='".$w->id."'";
Database::query($sql);
removeMoreIfMailing($w->id);
}
removeUnusedFiles(); // Check for unused files
removeUnusedFiles(); // Check for unused files
}
/**
@ -574,11 +574,11 @@ class Dropbox_Person
}
//$file_id = $this->sentWork[$index]->id;
// Delete entries in person table concerning sent works
$sql = "DELETE FROM ". Database::get_course_table(TABLE_DROPBOX_PERSON) ."
$sql = "DELETE FROM ".Database::get_course_table(TABLE_DROPBOX_PERSON)."
WHERE c_id = $course_id AND user_id='".$this->userId."' AND file_id='".$id."'";
Database::query($sql);
removeMoreIfMailing($id);
removeUnusedFiles(); // Check for unused files
removeUnusedFiles(); // Check for unused files
}
/**
@ -600,7 +600,7 @@ class Dropbox_Person
$wi = -1;
foreach ($this->receivedWork as $w) {
$wi++;
if ($w->id == $id){
if ($w->id == $id) {
$found = true;
break;
} // foreach (... as $wi -> $w) gives error 221! (no idea why...)

@ -118,7 +118,7 @@ $is_allowed_in_course = api_is_allowed_in_course();
$is_courseTutor = api_is_course_tutor();
$is_courseAdmin = api_is_course_admin();
$current_course_tool = TOOL_DROPBOX;
$current_course_tool = TOOL_DROPBOX;
// the dropbox file that contains additional functions
require_once 'dropbox_functions.inc.php';
@ -263,10 +263,10 @@ if ($allowOverwrite == 'true') {
$javascript .= "
</script>";
$htmlHeadXtra[] = $javascript;
$htmlHeadXtra[] ="<script>
$htmlHeadXtra[] = "<script>
function confirmation (name)
{
if (confirm(\" ". get_lang("AreYouSureToDeleteJS") ." \"+ name + \" ?\"))
if (confirm(\" ". get_lang("AreYouSureToDeleteJS")." \"+ name + \" ?\"))
{return true;}
else
{return false;}
@ -313,7 +313,7 @@ if (($postAction == 'download_received' || $postAction == 'download_sent') and !
if ((!$is_allowed_in_course || !$is_course_member) && !api_is_allowed_to_edit(null, true)) {
if ($origin != 'learnpath') {
api_not_allowed(true);//print headers/footers
api_not_allowed(true); //print headers/footers
} else {
api_not_allowed();
}

@ -12,7 +12,7 @@ use ChamiloSession as Session;
require_once __DIR__.'/../inc/global.inc.php';
$current_course_tool = TOOL_QUIZ;
$current_course_tool = TOOL_QUIZ;
// Clear the exercise session just in case
Session::erase('objExercise');
@ -70,7 +70,7 @@ if ($origin != 'learnpath') {
$html = '';
$message = '';
$html.= '<div class="exercise">';
$html .= '<div class="exercise">';
$is_allowed_to_edit = api_is_allowed_to_edit(null, true);
$edit_link = '';
if ($is_allowed_to_edit && $objExercise->sessionId == $sessionId) {
@ -116,7 +116,7 @@ if (isset($exercise_stat_info['exe_id'])) {
// 2. Exercise button
// Notice we not add there the lp_item_view_id because is not already generated
$exercise_url = api_get_path(WEB_CODE_PATH) . 'exercise/exercise_submit.php?'.api_get_cidreq().'&exerciseId='.$objExercise->id.'&origin='.$origin.'&learnpath_id='.$learnpath_id.'&learnpath_item_id='.$learnpath_item_id.'&learnpath_item_view_id='.$learnpathItemViewId.$extra_params;
$exercise_url = api_get_path(WEB_CODE_PATH).'exercise/exercise_submit.php?'.api_get_cidreq().'&exerciseId='.$objExercise->id.'&origin='.$origin.'&learnpath_id='.$learnpath_id.'&learnpath_item_id='.$learnpath_item_id.'&learnpath_item_view_id='.$learnpathItemViewId.$extra_params;
$exercise_url_button = Display::url(
$label,
$exercise_url,
@ -181,8 +181,8 @@ if (!empty($attempts)) {
$attempt_result['exe_result'],
$attempt_result['exe_weighting']
);
$attempt_url = api_get_path(WEB_CODE_PATH) . 'exercise/result.php?';
$attempt_url .= api_get_cidreq() . '&show_headers=1&';
$attempt_url = api_get_path(WEB_CODE_PATH).'exercise/result.php?';
$attempt_url .= api_get_cidreq().'&show_headers=1&';
$attempt_url .= http_build_query([
'id' => $attempt_result['exe_id']
]);
@ -192,7 +192,7 @@ if (!empty($attempts)) {
get_lang('Show'),
$attempt_url,
[
'class' => $btn_class . 'btn btn-default',
'class' => $btn_class.'btn btn-default',
'data-title' => get_lang('Show'),
'data-size' => 'lg'
]
@ -210,7 +210,7 @@ if (!empty($attempts)) {
),
'userIp' => $attempt_result['user_ip']
);
$attempt_link .= "&nbsp;&nbsp;&nbsp;" . $teacher_revised;
$attempt_link .= "&nbsp;&nbsp;&nbsp;".$teacher_revised;
if (in_array(
$objExercise->results_disabled,
@ -305,7 +305,7 @@ if ($objExercise->selectAttempts()) {
}
if ($time_control) {
$html.= $objExercise->return_time_left_div();
$html .= $objExercise->return_time_left_div();
}
$html .= $message;
@ -325,7 +325,7 @@ $html .= Display::tag(
$table_content,
['class' => 'table-responsive']
);
$html.= '</div>';
$html .= '</div>';
echo $html;
Display::display_footer();

@ -14,8 +14,8 @@ $_course = api_get_course_info();
$time = time();
$doc_url = str_replace(array('../', '\\', '\\0', '..'), array('', '', '', ''), urldecode($_GET['file']));
$cid = api_get_course_id();
$document_path = api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/document';
$document_web_path = api_get_path(WEB_COURSE_PATH) . $_course['path'] . '/document';
$document_path = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
$document_web_path = api_get_path(WEB_COURSE_PATH).$_course['path'].'/document';
$origin = isset($_REQUEST['origin']) ? $_REQUEST['origin'] : null;
$learnpath_id = isset($_REQUEST['learnpath_id']) ? $_REQUEST['learnpath_id'] : null;
$learnpath_item_id = isset($_REQUEST['learnpath_item_id']) ? $_REQUEST['learnpath_item_id'] : null;
@ -38,9 +38,9 @@ if ($content == '') {
if (SaveScoreVariable==0) {
SaveScoreVariable = 1;
if (C.ie) {
document.location.href = '" . api_get_path(WEB_CODE_PATH) . "exercise/savescores.php?lp_view_id=$lpViewId&origin=$origin&learnpath_id=$learnpath_id&learnpath_item_id=$learnpath_item_id&time=".Security::remove_XSS($time)."&test=".$doc_url."&uid=".$user_id."&cid=".$cid."&score='+Score;
document.location.href = '" . api_get_path(WEB_CODE_PATH)."exercise/savescores.php?lp_view_id=$lpViewId&origin=$origin&learnpath_id=$learnpath_id&learnpath_item_id=$learnpath_item_id&time=".Security::remove_XSS($time)."&test=".$doc_url."&uid=".$user_id."&cid=".$cid."&score='+Score;
} else {
window.location.href = '" . api_get_path(WEB_CODE_PATH) . "exercise/savescores.php?lp_view_id=$lpViewId&origin=$origin&learnpath_id=$learnpath_id&learnpath_item_id=$learnpath_item_id&time=".Security::remove_XSS($time)."&test=".$doc_url."&uid=".$user_id."&cid=".$cid."&score='+Score;
window.location.href = '" . api_get_path(WEB_CODE_PATH)."exercise/savescores.php?lp_view_id=$lpViewId&origin=$origin&learnpath_id=$learnpath_id&learnpath_item_id=$learnpath_item_id&time=".Security::remove_XSS($time)."&test=".$doc_url."&uid=".$user_id."&cid=".$cid."&score='+Score;
}
}
}
@ -69,7 +69,7 @@ $my_file = Security::remove_XSS($_GET['file']);
$my_file = str_replace(array('../', '\\..', '\\0', '..\\'), array('', '', '', ''), urldecode($my_file));
$title = GetQuizName($my_file, $documentPath);
if ($title =='') {
if ($title == '') {
$title = basename($my_file);
}
$nameTools = $title;
@ -87,7 +87,7 @@ $htmlHeadXtra[] = /** @lang HTML */<<<HTML
</script>
HTML;
$interbreadcrumb[]= array ("url"=>"./exercise.php", "name"=> get_lang('Exercises'));
$interbreadcrumb[] = array("url"=>"./exercise.php", "name"=> get_lang('Exercises'));
if ($origin == 'learnpath') {
Display::display_reduced_header($nameTools, "Exercise");
} else {

@ -18,12 +18,12 @@ $originalName = null;
if (isset($_GET['extra_field'])) {
$extraField = $em->find('ChamiloCoreBundle:ExtraField', intval($_GET['extra_field']));
$variableLanguage = '$' . api_underscore_to_camel_case($extraField->getVariable());
$variableLanguage = '$'.api_underscore_to_camel_case($extraField->getVariable());
$originalName = $extraField->getDisplayText(false);
} elseif (isset($_GET['extra_field_option'])) {
$extraFieldOption = $em->find('ChamiloCoreBundle:ExtraFieldOptions', intval($_GET['extra_field_option']));
$extraField = $extraFieldOption->getField();
$variableLanguage = '$' . ExtraFieldOption::getLanguageVariable($extraFieldOption->getDisplayText());
$variableLanguage = '$'.ExtraFieldOption::getLanguageVariable($extraFieldOption->getDisplayText());
$originalName = $extraFieldOption->getDisplayText(false);
}
@ -43,7 +43,7 @@ foreach ($languages as $language) {
$languagesOptions[$language->getId()] = $language->getOriginalName();
}
$translateUrl = api_get_path(WEB_CODE_PATH) . 'admin/sub_language_ajax.inc.php';
$translateUrl = api_get_path(WEB_CODE_PATH).'admin/sub_language_ajax.inc.php';
$form = new FormValidator('new_lang_variable', 'POST', $translateUrl);
$form->addHeader(get_lang('AddWordForTheSubLanguage'));
@ -72,24 +72,24 @@ $form->setDefaults([
$form->addRule('sub_language', get_lang('Required'), 'required');
$form->freeze(['variable_language', 'original_name']);
$interbreadcrumb[] = ['url' => api_get_path(WEB_CODE_PATH) . 'admin', 'name' => get_lang('Administration')];
$interbreadcrumb[] = ['url' => api_get_path(WEB_CODE_PATH).'admin', 'name' => get_lang('Administration')];
switch ($extraField->getExtraFieldType()) {
case ExtraField::USER_FIELD_TYPE:
$interbreadcrumb[] = [
'url' => api_get_path(WEB_CODE_PATH) . 'admin/extra_fields.php?type=user',
'url' => api_get_path(WEB_CODE_PATH).'admin/extra_fields.php?type=user',
'name' => get_lang('UserFields')
];
break;
case ExtraField::COURSE_FIELD_TYPE:
$interbreadcrumb[] = [
'url' => api_get_path(WEB_CODE_PATH) . 'admin/extra_fields.php?type=course',
'url' => api_get_path(WEB_CODE_PATH).'admin/extra_fields.php?type=course',
'name' => get_lang('CourseFields')
];
break;
case ExtraField::SESSION_FIELD_TYPE:
$interbreadcrumb[] = [
'url' => api_get_path(WEB_CODE_PATH) . 'admin/extra_fields.php?type=session',
'url' => api_get_path(WEB_CODE_PATH).'admin/extra_fields.php?type=session',
'name' => get_lang('SessionFields')
];
break;

@ -7,12 +7,12 @@
require_once __DIR__.'/../inc/global.inc.php';
$this_section = SECTION_COURSES;
$current_course_tool = TOOL_GROUP;
$current_course_tool = TOOL_GROUP;
// Notice for unauthorized people.
api_protect_course_script(true);
if (!api_is_allowed_to_edit(false,true) ||
if (!api_is_allowed_to_edit(false, true) ||
!(isset ($_GET['id']) ||
isset ($_POST['id']) ||
isset ($_GET['action']) ||
@ -59,7 +59,7 @@ if (api_get_setting('allow_group_categories') === 'true') {
'groups_per_user' => 1,
'doc_state' => GroupManager::TOOL_PRIVATE,
'work_state' => GroupManager::TOOL_PRIVATE,
'wiki_state' => GroupManager::TOOL_PRIVATE ,
'wiki_state' => GroupManager::TOOL_PRIVATE,
'chat_state' => GroupManager::TOOL_PRIVATE,
'calendar_state' => GroupManager::TOOL_PRIVATE,
'announcements_state'=> GroupManager::TOOL_PRIVATE,
@ -113,7 +113,7 @@ if (api_get_setting('allow_group_categories') == 'true') {
// Groups per user
$possible_values = array();
for ($i = 1; $i <= 10; $i ++) {
for ($i = 1; $i <= 10; $i++) {
$possible_values[$i] = $i;
}
$possible_values[GroupManager::GROUP_PER_MEMBER_NO_LIMIT] = get_lang('All');
@ -138,7 +138,7 @@ if (api_get_setting('allow_group_categories') == 'true') {
$form->addElement('html', '<div class="col-md-6">');
// Description
$form->addElement('textarea', 'description', get_lang('Description'), array ('rows' => 6));
$form->addElement('textarea', 'description', get_lang('Description'), array('rows' => 6));
$form->addElement('html', '</div>');
$form->addElement('html', '</div>');
} else {
@ -158,7 +158,7 @@ $group = array(
$form->addGroup(
$group,
'',
Display::return_icon('user.png', get_lang('GroupSelfRegistration')) . ' ' . get_lang('GroupSelfRegistration'),
Display::return_icon('user.png', get_lang('GroupSelfRegistration')).' '.get_lang('GroupSelfRegistration'),
null,
false
);
@ -172,7 +172,7 @@ $group = array(
$form->addGroup(
$group,
'',
Display::return_icon('folder.png', get_lang('GroupDocument')) . ' ' . get_lang('GroupDocument'),
Display::return_icon('folder.png', get_lang('GroupDocument')).' '.get_lang('GroupDocument'),
null,
false
);
@ -186,7 +186,7 @@ $group = array(
$form->addGroup(
$group,
'',
Display::return_icon('work.png', get_lang('GroupWork'), array(), ICON_SIZE_SMALL) . ' ' . get_lang('GroupWork'),
Display::return_icon('work.png', get_lang('GroupWork'), array(), ICON_SIZE_SMALL).' '.get_lang('GroupWork'),
'',
false
);
@ -200,7 +200,7 @@ $group = array(
$form->addGroup(
$group,
'',
Display::return_icon('agenda.png', get_lang('GroupCalendar')) . ' ' . get_lang('GroupCalendar'),
Display::return_icon('agenda.png', get_lang('GroupCalendar')).' '.get_lang('GroupCalendar'),
null,
false
);
@ -217,7 +217,7 @@ $group = array(
$form->addGroup(
$group,
'',
Display::return_icon('announce.png', get_lang('GroupAnnouncements')) . ' ' . get_lang('GroupAnnouncements'),
Display::return_icon('announce.png', get_lang('GroupAnnouncements')).' '.get_lang('GroupAnnouncements'),
null,
false
);
@ -231,7 +231,7 @@ $group = array(
$form->addGroup(
$group,
'',
Display::return_icon('forum.png', get_lang('GroupForum')) . ' ' . get_lang('GroupForum'),
Display::return_icon('forum.png', get_lang('GroupForum')).' '.get_lang('GroupForum'),
null,
false
);
@ -245,7 +245,7 @@ $group = array(
$form->addGroup(
$group,
'',
Display::return_icon('wiki.png', get_lang('GroupWiki')) . ' ' . get_lang('GroupWiki'),
Display::return_icon('wiki.png', get_lang('GroupWiki')).' '.get_lang('GroupWiki'),
null,
false
);
@ -259,7 +259,7 @@ $group = array(
$form->addGroup(
$group,
'',
Display::return_icon('chat.png', get_lang('Chat')) . ' ' . get_lang('Chat'),
Display::return_icon('chat.png', get_lang('Chat')).' '.get_lang('Chat'),
null,
false
);
@ -334,7 +334,7 @@ Display :: display_header($nameTools, 'Group');
// actions bar
echo '<div class="actions">';
echo '<a href="group.php">'.
Display::return_icon('back.png', get_lang('BackToGroupList'),'',ICON_SIZE_MEDIUM).'</a>';
Display::return_icon('back.png', get_lang('BackToGroupList'), '', ICON_SIZE_MEDIUM).'</a>';
echo '</div>';
$defaults = $category;

@ -24,7 +24,7 @@ if (isset($_POST['action'])) {
case 'create_groups':
$groups = array();
for ($i = 0; $i < $_POST['number_of_groups']; $i ++) {
for ($i = 0; $i < $_POST['number_of_groups']; $i++) {
$group1['name'] = empty($_POST['group_'.$i.'_name']) ? get_lang('Group').' '.$i : $_POST['group_'.$i.'_name'];
$group1['category'] = isset($_POST['group_'.$i.'_category']) ? $_POST['group_'.$i.'_category'] : null;
$group1['tutor'] = isset($_POST['group_'.$i.'_tutor']) ? $_POST['group_'.$i.'_tutor'] : null;
@ -162,7 +162,7 @@ EOT;
$form->addGroup($group_el, 'groups', null, "</td><td>", false);
// Checkboxes
if ($_POST['number_of_groups'] > 1) {
$group_el = array ();
$group_el = array();
$group_el[] = $form->createElement('static', null, null, ' ');
if (api_get_setting('allow_group_categories') === 'true') {
$group_el[] = $form->createElement(
@ -183,7 +183,7 @@ EOT;
$form->addGroup($group_el, 'groups', null, '</td><td>', false);
}
// Properties for all groups
for ($group_number = 0; $group_number < $_POST['number_of_groups']; $group_number ++) {
for ($group_number = 0; $group_number < $_POST['number_of_groups']; $group_number++) {
$group_el = array();
$group_el[] = $form->createElement('text', 'group_'.$group_number.'_name');
if (api_get_setting('allow_group_categories') === 'true') {
@ -210,14 +210,14 @@ EOT;
$prev = '000';
} elseif ($group_id < 100) {
$prev = '00';
} elseif ($group_id<1000) {
} elseif ($group_id < 1000) {
$prev = '0';
} else {
$prev = '';
}
}
$defaults['group_'.$group_number.'_name'] = get_lang('GroupSingle').' '.$prev.$group_id ++;
$defaults['group_'.$group_number.'_name'] = get_lang('GroupSingle').' '.$prev.$group_id++;
$form->addGroup($group_el, 'group_'.$group_number, null, '</td><td>', false);
}
$defaults['action'] = 'create_groups';
@ -232,8 +232,8 @@ EOT;
*/
$create_groups_form = new FormValidator('create_groups', 'post', api_get_self().'?'.api_get_cidreq());
$create_groups_form->addElement('header', $nameTools);
$create_groups_form->addText('number_of_groups',get_lang('NumberOfGroupsToCreate'),null,array('value'=>'1'));
$create_groups_form->addButton('submit', get_lang('ProceedToCreateGroup'),'plus','primary');
$create_groups_form->addText('number_of_groups', get_lang('NumberOfGroupsToCreate'), null, array('value'=>'1'));
$create_groups_form->addButton('submit', get_lang('ProceedToCreateGroup'), 'plus', 'primary');
$defaults = array();
$defaults['number_of_groups'] = 1;
$create_groups_form->setDefaults($defaults);
@ -243,7 +243,7 @@ EOT;
* Show form to generate subgroups
*/
if (api_get_setting('allow_group_categories') === 'true' && count(GroupManager :: get_group_list()) > 0) {
$base_group_options = array ();
$base_group_options = array();
$groups = GroupManager :: get_group_list();
foreach ($groups as $index => $group) {
$number_of_students = GroupManager :: number_of_students($group['iid']);

@ -15,7 +15,7 @@
*/
require_once __DIR__.'/../inc/global.inc.php';
$this_section = SECTION_COURSES;
$current_course_tool = TOOL_GROUP;
$current_course_tool = TOOL_GROUP;
// Notice for unauthorized people.
api_protect_course_script(true);
@ -86,29 +86,29 @@ $actions = '<a href="group_creation.php?'.api_get_cidreq().'">'.
Display::return_icon('add.png', get_lang('NewGroupCreate'), '', ICON_SIZE_MEDIUM).'</a>';
if (api_get_setting('allow_group_categories') === 'true') {
$actions.= '<a href="group_category.php?'.api_get_cidreq().'&action=add_category">'.
$actions .= '<a href="group_category.php?'.api_get_cidreq().'&action=add_category">'.
Display::return_icon('new_folder.png', get_lang('AddCategory'), '', ICON_SIZE_MEDIUM).'</a>';
} else {
$actions.= '<a href="group_category.php?'.api_get_cidreq().'&id=2">'.
$actions .= '<a href="group_category.php?'.api_get_cidreq().'&id=2">'.
Display::return_icon('settings.png', get_lang('PropModify'), '', ICON_SIZE_MEDIUM).'</a>';
}
$actions.= '<a href="import.php?'.api_get_cidreq().'&action=import">'.
$actions .= '<a href="import.php?'.api_get_cidreq().'&action=import">'.
Display::return_icon('import_csv.png', get_lang('Import'), '', ICON_SIZE_MEDIUM).'</a>';
$actions.= '<a href="group_overview.php?'.api_get_cidreq().'&action=export_all&type=csv">'.
$actions .= '<a href="group_overview.php?'.api_get_cidreq().'&action=export_all&type=csv">'.
Display::return_icon('export_csv.png', get_lang('Export'), '', ICON_SIZE_MEDIUM).'</a>';
$actions.= '<a href="group_overview.php?'.api_get_cidreq().'&action=export&type=xls">'.
$actions .= '<a href="group_overview.php?'.api_get_cidreq().'&action=export&type=xls">'.
Display::return_icon('export_excel.png', get_lang('ExportAsXLS'), '', ICON_SIZE_MEDIUM).'</a>';
$actions.= '<a href="group_overview.php?'.api_get_cidreq().'&action=export_pdf">'.
$actions .= '<a href="group_overview.php?'.api_get_cidreq().'&action=export_pdf">'.
Display::return_icon('pdf.png', get_lang('ExportToPDF'), '', ICON_SIZE_MEDIUM).'</a>';
$actions.= '<a href="group.php?'.api_get_cidreq().'">'.
Display::return_icon('group.png', get_lang('Groups'),'',ICON_SIZE_MEDIUM).'</a>';
$actions .= '<a href="group.php?'.api_get_cidreq().'">'.
Display::return_icon('group.png', get_lang('Groups'), '', ICON_SIZE_MEDIUM).'</a>';
$actions.= '<a href="../user/user.php?'.api_get_cidreq().'">'.
$actions .= '<a href="../user/user.php?'.api_get_cidreq().'">'.
Display::return_icon('user.png', get_lang('GoTo').' '.get_lang('Users'), '', ICON_SIZE_MEDIUM).'</a>';
// Action links

@ -10,7 +10,7 @@
*/
require_once __DIR__.'/../inc/global.inc.php';
$current_course_tool = TOOL_GROUP;
$current_course_tool = TOOL_GROUP;
// Notice for unauthorized people.
api_protect_course_script(true);
@ -68,7 +68,7 @@ if (!empty($_GET['selfUnReg']) &&
echo '<div class="actions">';
echo '<a href="group.php">'.
Display::return_icon('back.png',get_lang('BackToGroupList'),'',ICON_SIZE_MEDIUM).
Display::return_icon('back.png', get_lang('BackToGroupList'), '', ICON_SIZE_MEDIUM).
'</a>';
/*
@ -85,7 +85,7 @@ if (GroupManager :: is_self_registration_allowed($user_id, $current_group['iid']
*/
$unsubscribe_group = '';
if (GroupManager :: is_self_unregistration_allowed($user_id, $current_group['iid'])) {
$unsubscribe_group = '<a class="btn btn-default" href="'.api_get_self().'?selfUnReg=1" onclick="javascript: if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."'".')) return false;">'.
$unsubscribe_group = '<a class="btn btn-default" href="'.api_get_self().'?selfUnReg=1" onclick="javascript: if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES))."'".')) return false;">'.
get_lang("StudentUnsubscribe").'</a>';
}
echo '&nbsp;</div>';
@ -96,8 +96,8 @@ $edit_url = '';
if (api_is_allowed_to_edit(false, true) ||
GroupManager::is_tutor_of_group(api_get_user_id(), $current_group['iid'])
) {
$edit_url = '<a href="'.api_get_path(WEB_CODE_PATH).'group/settings.php?'.api_get_cidreq().'">'.
Display::return_icon('edit.png', get_lang('EditGroup'),'',ICON_SIZE_SMALL).'</a>';
$edit_url = '<a href="'.api_get_path(WEB_CODE_PATH).'group/settings.php?'.api_get_cidreq().'">'.
Display::return_icon('edit.png', get_lang('EditGroup'), '', ICON_SIZE_SMALL).'</a>';
}
echo Display::page_header(

@ -3,7 +3,7 @@
require_once __DIR__.'/../inc/global.inc.php';
$this_section = SECTION_COURSES;
$current_course_tool = TOOL_GROUP;
$current_course_tool = TOOL_GROUP;
// Notice for unauthorized people.
api_protect_course_script(true);

@ -13,7 +13,7 @@
require_once __DIR__.'/../inc/global.inc.php';
$this_section = SECTION_COURSES;
$current_course_tool = TOOL_GROUP;
$current_course_tool = TOOL_GROUP;
// Notice for unauthorized people.
api_protect_course_script(true);
@ -167,7 +167,7 @@ if (!empty($complete_user_list)) {
// Group members
$group_member_list = GroupManager::get_subscribed_users($current_group['iid']);
$selected_users = array ();
$selected_users = array();
if (!empty($group_member_list)) {
foreach ($group_member_list as $index => $user) {
$selected_users[] = $user['user_id'];

@ -12,7 +12,7 @@
require_once __DIR__.'/../inc/global.inc.php';
$this_section = SECTION_COURSES;
$current_course_tool = TOOL_GROUP;
$current_course_tool = TOOL_GROUP;
// Notice for unauthorized people.
api_protect_course_script(true);
@ -83,7 +83,7 @@ $group = array(
$form->addGroup(
$group,
'',
Display::return_icon('user.png', get_lang('GroupSelfRegistration')) . '<span>' . get_lang('GroupSelfRegistration') . '</span>',
Display::return_icon('user.png', get_lang('GroupSelfRegistration')).'<span>'.get_lang('GroupSelfRegistration').'</span>',
null,
false
);
@ -97,7 +97,7 @@ $group = array(
$form->addGroup(
$group,
'',
Display::return_icon('folder.png', get_lang('GroupDocument')) . '<span>' . get_lang('GroupDocument') . '</span>',
Display::return_icon('folder.png', get_lang('GroupDocument')).'<span>'.get_lang('GroupDocument').'</span>',
null,
false
);
@ -111,7 +111,7 @@ $group = array(
$form->addGroup(
$group,
'',
Display::return_icon('works.png', get_lang('GroupWork')) . '<span>' . get_lang('GroupWork') . '</span>',
Display::return_icon('works.png', get_lang('GroupWork')).'<span>'.get_lang('GroupWork').'</span>',
null,
false
);
@ -125,7 +125,7 @@ $group = array(
$form->addGroup(
$group,
'',
Display::return_icon('agenda.png', get_lang('GroupCalendar')) . '<span>' . get_lang('GroupCalendar') . '</span>',
Display::return_icon('agenda.png', get_lang('GroupCalendar')).'<span>'.get_lang('GroupCalendar').'</span>',
null,
false
);
@ -142,7 +142,7 @@ $group = array(
$form->addGroup(
$group,
'',
Display::return_icon('announce.png', get_lang('GroupAnnouncements')) . '<span>' . get_lang('GroupAnnouncements') . '</span>',
Display::return_icon('announce.png', get_lang('GroupAnnouncements')).'<span>'.get_lang('GroupAnnouncements').'</span>',
null,
false
);
@ -156,7 +156,7 @@ $group = array(
$form->addGroup(
$group,
'',
Display::return_icon('forum.png', get_lang('GroupForum')) . '<span>' . get_lang('GroupForum') . '</span>',
Display::return_icon('forum.png', get_lang('GroupForum')).'<span>'.get_lang('GroupForum').'</span>',
null,
false
);
@ -183,7 +183,7 @@ $group = array(
$form->addGroup(
$group,
'',
Display::return_icon('chat.png', get_lang('Chat')) . '<span>' . get_lang('Chat') . '</span>',
Display::return_icon('chat.png', get_lang('Chat')).'<span>'.get_lang('Chat').'</span>',
null,
false
);

@ -13,7 +13,7 @@
require_once __DIR__.'/../inc/global.inc.php';
$this_section = SECTION_COURSES;
$current_course_tool = TOOL_GROUP;
$current_course_tool = TOOL_GROUP;
// Notice for unauthorized people.
api_protect_course_script(true);
@ -22,8 +22,8 @@ $group_id = api_get_group_id();
$current_group = GroupManager::get_group_properties($group_id);
$nameTools = get_lang('EditGroup');
$interbreadcrumb[] = array ('url' => 'group.php?'.api_get_cidreq(), 'name' => get_lang('Groups'));
$interbreadcrumb[] = array ('url' => 'group_space.php?'.api_get_cidreq(), 'name' => $current_group['name']);
$interbreadcrumb[] = array('url' => 'group.php?'.api_get_cidreq(), 'name' => get_lang('Groups'));
$interbreadcrumb[] = array('url' => 'group_space.php?'.api_get_cidreq(), 'name' => $current_group['name']);
$is_group_member = GroupManager::is_tutor_of_group(api_get_user_id(), $current_group['iid']);

@ -48,9 +48,9 @@ switch ($action) {
$urlInfo = api_get_access_url($accessUrlId);
$url = api_remove_trailing_slash(preg_replace('/https?:\/\//i', '', $urlInfo['url']));
$cleanUrl = str_replace('/', '-', $url);
$newUrlDir = api_get_path(SYS_APP_PATH) . "home/$cleanUrl/admin/";
$newUrlDir = api_get_path(SYS_APP_PATH)."home/$cleanUrl/admin/";
} else {
$newUrlDir = api_get_path(SYS_APP_PATH) . "home/admin/";
$newUrlDir = api_get_path(SYS_APP_PATH)."home/admin/";
}
if (!file_exists($newUrlDir)) {
@ -173,17 +173,17 @@ function check_system_version()
}
if (version_compare($system_version, $version_info, '<')) {
$output = '<span style="color:red">' . get_lang('YourVersionNotUpToDate') .'<br />
$output = '<span style="color:red">'.get_lang('YourVersionNotUpToDate').'<br />
'.get_lang('LatestVersionIs').' <b>Chamilo '.$version_info.'</b>. <br />
'.get_lang('YourVersionIs').' <b>Chamilo '.$system_version. '</b>. <br />'.str_replace('http://www.chamilo.org', '<a href="http://www.chamilo.org">http://www.chamilo.org</a>', get_lang('PleaseVisitOurWebsite')).'</span>';
'.get_lang('YourVersionIs').' <b>Chamilo '.$system_version.'</b>. <br />'.str_replace('http://www.chamilo.org', '<a href="http://www.chamilo.org">http://www.chamilo.org</a>', get_lang('PleaseVisitOurWebsite')).'</span>';
} else {
$output = '<span style="color:green">'.get_lang('VersionUpToDate').': Chamilo '.$version_info.'</span>';
}
} else {
$output = '<span style="color:red">' . get_lang('ImpossibleToContactVersionServerPleaseTryAgain') . '</span>';
$output = '<span style="color:red">'.get_lang('ImpossibleToContactVersionServerPleaseTryAgain').'</span>';
}
} else {
$output = '<span style="color:red">' . get_lang('AllowurlfopenIsSetToOff') . '</span>';
$output = '<span style="color:red">'.get_lang('AllowurlfopenIsSetToOff').'</span>';
}
return $output;
}
@ -207,17 +207,17 @@ function _http_request($ip, $port = 80, $uri = '/', $getdata = array(), $timeout
$getdata_str = count($getdata) ? '?' : '';
foreach ($getdata as $k => $v) {
$getdata_str .= urlencode($k) .'='. urlencode($v) . '&';
$getdata_str .= urlencode($k).'='.urlencode($v).'&';
}
$crlf = "\r\n";
$req = $verb .' '. $uri . $getdata_str .' HTTP/1.1' . $crlf;
$req .= 'Host: '. $ip . $crlf;
$req .= 'User-Agent: Mozilla/5.0 Firefox/3.6.12' . $crlf;
$req .= 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' . $crlf;
$req .= 'Accept-Language: en-us,en;q=0.5' . $crlf;
$req .= 'Accept-Encoding: deflate' . $crlf;
$req .= 'Accept-Charset: utf-8;q=0.7,*;q=0.7' . $crlf;
$req = $verb.' '.$uri.$getdata_str.' HTTP/1.1'.$crlf;
$req .= 'Host: '.$ip.$crlf;
$req .= 'User-Agent: Mozilla/5.0 Firefox/3.6.12'.$crlf;
$req .= 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'.$crlf;
$req .= 'Accept-Language: en-us,en;q=0.5'.$crlf;
$req .= 'Accept-Encoding: deflate'.$crlf;
$req .= 'Accept-Charset: utf-8;q=0.7,*;q=0.7'.$crlf;
$req .= $crlf;

@ -10,7 +10,7 @@ use Chamilo\CourseBundle\Entity\CForumPost;
*/
require_once __DIR__.'/../global.inc.php';
require_once api_get_path(SYS_CODE_PATH) . 'forum/forumfunction.inc.php';
require_once api_get_path(SYS_CODE_PATH).'forum/forumfunction.inc.php';
// First, protect this script
api_protect_course_script(false);
@ -60,13 +60,13 @@ if (!empty($action)) {
break;
}
// If pass all previous control, user can edit post
$courseId = isset($_REQUEST['c_id'])? intval($_REQUEST['c_id']) : api_get_course_int_id();
$courseId = isset($_REQUEST['c_id']) ? intval($_REQUEST['c_id']) : api_get_course_int_id();
$json['courseId'] = $courseId;
$forumId = isset($_REQUEST['forum'])? intval($_REQUEST['forum']) : null;
$forumId = isset($_REQUEST['forum']) ? intval($_REQUEST['forum']) : null;
$json['forum'] = $forumId;
$threadId = isset($_REQUEST['thread'])? intval($_REQUEST['thread']) : null;
$threadId = isset($_REQUEST['thread']) ? intval($_REQUEST['thread']) : null;
$json['thread'] = $threadId;
$postId = isset($_REQUEST['postId'])? intval($_REQUEST['postId']) : null;
$postId = isset($_REQUEST['postId']) ? intval($_REQUEST['postId']) : null;
$json['postId'] = $postId;
if (!empty($courseId) &&

@ -58,9 +58,9 @@ switch ($action) {
$db['is_empty'] = false;
$db['result'] = convert_to_string($sql_result);
$rst = get_stats($user_id, $courseId, $start_date, $end_date);
$foo_stats = '<strong>' . get_lang('Total') . ': </strong>' . $rst['total'] . '<br />';
$foo_stats .= '<strong>' . get_lang('Average') . ': </strong>' . $rst['avg'] . '<br />';
$foo_stats .= '<strong>' . get_lang('Quantity') . ' : </strong>' . $rst['times'] . '<br />';
$foo_stats = '<strong>'.get_lang('Total').': </strong>'.$rst['total'].'<br />';
$foo_stats .= '<strong>'.get_lang('Average').': </strong>'.$rst['avg'].'<br />';
$foo_stats .= '<strong>'.get_lang('Quantity').' : </strong>'.$rst['times'].'<br />';
$db['stats'] = $foo_stats;
$db['graph_result'] = grapher($sql_result, $start_date, $end_date, $type);
} else {

@ -12,7 +12,7 @@ switch ($action) {
case 'load_online_user':
$images_to_show = MAX_ONLINE_USERS;
$page = intval($_REQUEST['online_page_nr']);
$max_page = ceil(who_is_online_count()/$images_to_show);
$max_page = ceil(who_is_online_count() / $images_to_show);
$page_rows = ($page - 1) * MAX_ONLINE_USERS;

@ -41,7 +41,7 @@ switch ($action) {
$return_skills = array();
foreach ($skills as $skill) {
$skill['key'] = $skill['name'];
$skill['value'] = $skill['id'];
$skill['value'] = $skill['id'];
$return_skills[] = $skill;
}
echo json_encode($return_skills);
@ -53,7 +53,7 @@ switch ($action) {
if (!empty($gradebooks)) {
foreach ($gradebooks as $gradebook) {
if ($gradebook['parent_id'] == 0 && !empty($gradebook['certif_min_score']) && !empty($gradebook['document_id'])) {
$gradebook_list[] = $gradebook;
$gradebook_list[] = $gradebook;
//$gradebook['name'] = $gradebook['name'];
//$gradebook_list[] = $gradebook;
} else {
@ -69,7 +69,7 @@ switch ($action) {
$return = array();
foreach ($gradebooks as $item) {
$item['key'] = $item['name'];
$item['value'] = $item['id'];
$item['value'] = $item['id'];
$return[] = $item;
}
echo json_encode($return);
@ -95,13 +95,13 @@ switch ($action) {
}
break;
case 'get_skills_by_profile':
$skill_rel_profile = new SkillRelProfile();
$skill_rel_profile = new SkillRelProfile();
$profile_id = isset($_REQUEST['profile_id']) ? $_REQUEST['profile_id'] : null;
$skills = $skill_rel_profile->get_skills_by_profile($profile_id);
echo json_encode($skills);
break;
case 'get_saved_profiles':
$skill_profile = new SkillProfile();
$skill_profile = new SkillProfile();
$profiles = $skill_profile->get_all();
Display::display_no_header();
Display::$global_template->assign('profiles', $profiles);
@ -190,7 +190,7 @@ switch ($action) {
$success = false;
}
$result = array (
$result = array(
'success' => $success,
'data' => $return
);
@ -201,7 +201,7 @@ switch ($action) {
$skills = $skill->get_direct_parents($id);
$return = array();
foreach ($skills as $skill) {
$return [$skill['data']['id']] = array (
$return [$skill['data']['id']] = array(
'id' => $skill['data']['id'],
'parent_id' => $skill['data']['parent_id'],
'name' => $skill['data']['name']
@ -210,8 +210,8 @@ switch ($action) {
echo json_encode($return);
break;
case 'profile_matches':
$skill_rel_user = new SkillRelUser();
$skills = (!empty($_REQUEST['skill_id'])?$_REQUEST['skill_id']:array());
$skill_rel_user = new SkillRelUser();
$skills = (!empty($_REQUEST['skill_id']) ? $_REQUEST['skill_id'] : array());
$total_skills_to_search = $skills;
$users = $skill_rel_user->get_user_by_skills($skills);

@ -63,7 +63,7 @@ class Plugin
$this->fields = $settings;
global $language_files;
$language_files[] = 'plugin_' . $this->get_name();
$language_files[] = 'plugin_'.$this->get_name();
}
/**
@ -272,7 +272,7 @@ class Plugin
{
$settings = $this->get_settings();
foreach ($settings as $setting) {
if ($setting['variable'] == $this->get_name() . '_' . $name) {
if ($setting['variable'] == $this->get_name().'_'.$name) {
return $setting['selected_value'];
}
}
@ -406,7 +406,7 @@ class Plugin
if (!empty($this->course_settings)) {
foreach ($this->course_settings as $setting) {
$variable = $setting['name'];
$value ='';
$value = '';
if (isset($setting['init_value'])) {
$value = $setting['init_value'];
}
@ -622,7 +622,7 @@ class Plugin
// Avoid Tab Name Spaces
$tabNameNoSpaces = preg_replace('/\s+/', '', $tabName);
$subkeytext = "Tabs" . $tabNameNoSpaces;
$subkeytext = "Tabs".$tabNameNoSpaces;
// Check if it is already added
$checkCondition = array(
@ -640,7 +640,7 @@ class Plugin
}
// End Check
$subkey = 'custom_tab_' . $tabNum;
$subkey = 'custom_tab_'.$tabNum;
$attributes = array(
'variable' => 'show_tabs',
'subkey' => $subkey,
@ -658,7 +658,7 @@ class Plugin
// Save the id
$settings = $this->get_settings();
$setData = array (
$setData = array(
'comment' => $subkey
);
$whereCondition = array(
@ -699,7 +699,7 @@ class Plugin
$i = 1;
foreach ($tabs as $row) {
$attributes = array(
'subkey' => 'custom_tab_' . $i
'subkey' => 'custom_tab_'.$i
);
$this->updateTab($row['subkey'], $attributes);
$i++;

@ -17,8 +17,8 @@ if (empty($_GET['term']) || empty($_GET['prefix']) || !in_array($_GET['operator'
return;
}
require_once dirname(__FILE__) . '../../../global.inc.php';
require_once api_get_path(LIBRARY_PATH) . 'search/ChamiloQuery.php';
require_once dirname(__FILE__).'../../../global.inc.php';
require_once api_get_path(LIBRARY_PATH).'search/ChamiloQuery.php';
/**
* Search with filter and build base array avoiding repeated terms
@ -33,7 +33,7 @@ function get_usual_sf_terms($filter, $specific_fields) {
if (is_array($dkterms) && is_array($dkterms[1])) {
foreach ($specific_fields as $specific_field) {
foreach ($dkterms[1] as $obj) {
foreach ($obj['sf-' . $specific_field['code']] as $raw_term) {
foreach ($obj['sf-'.$specific_field['code']] as $raw_term) {
if (count($raw_term['name']) > 1) {
$normal_term = substr($raw_term['name'], 1);
$sf_terms[$specific_field['code']][$normal_term] = $normal_term;
@ -54,10 +54,10 @@ $sf_terms = array();
if (($cid = api_get_course_id()) != -1) { // with cid
// course filter
$filter[] = chamilo_get_boolean_query(XAPIAN_PREFIX_COURSEID . $cid);
$filter[] = chamilo_get_boolean_query(XAPIAN_PREFIX_COURSEID.$cid);
// term filter
if ($term != '__all__') {
$filter[] = chamilo_get_boolean_query($prefix . $term);
$filter[] = chamilo_get_boolean_query($prefix.$term);
// always and between term and courseid
$filter = chamilo_join_queries($filter, null, 'and');
}
@ -65,7 +65,7 @@ if (($cid = api_get_course_id()) != -1) { // with cid
$sf_terms = get_usual_sf_terms($filter, $specific_fields);
} else { // without cid
if ($term != '__all__') {
$filter[] = chamilo_get_boolean_query($prefix . $term);
$filter[] = chamilo_get_boolean_query($prefix.$term);
$sf_terms = get_usual_sf_terms($filter, $specific_fields);
} else { // no cid and all/any terms

@ -5,8 +5,8 @@
*
* @package chamilo.include.search
*/
include_once dirname(__FILE__) . '/../../../global.inc.php';
require_once dirname(__FILE__) . '/search_processor.class.php';
include_once dirname(__FILE__).'/../../../global.inc.php';
require_once dirname(__FILE__).'/search_processor.class.php';
/**
* Process documents before pass it to search listing scripts
@ -82,7 +82,7 @@ class document_processor extends search_processor
$dk_result = Database::query($sql);
$sql = "SELECT insert_user_id FROM $item_property_table
WHERE ref = $doc_id AND tool = '" . TOOL_DOCUMENT . "' AND c_id = $course_id
WHERE ref = $doc_id AND tool = '".TOOL_DOCUMENT."' AND c_id = $course_id
LIMIT 1";
$name = '';
if ($row = Database::fetch_array($dk_result)) {

@ -5,9 +5,9 @@
*
* @package chamilo.include.search
*/
include_once dirname(__FILE__) . '/../../../global.inc.php';
require_once dirname(__FILE__) . '/search_processor.class.php';
require_once dirname(__FILE__) . '/../IndexableChunk.class.php';
include_once dirname(__FILE__).'/../../../global.inc.php';
require_once dirname(__FILE__).'/search_processor.class.php';
require_once dirname(__FILE__).'/../IndexableChunk.class.php';
/**
* Process learning paths before pass it to search listing scripts
@ -58,7 +58,7 @@ class learnpath_processor extends search_processor
);
if ($visibility) {
list($thumbnail, $image, $name, $author) = $this->get_information($courseid, $lp_id, $lp['has_document_id']);
$url = api_get_path(WEB_CODE_PATH) . 'lp/lp_controller.php?cidReq=%s&action=view&lp_id=%s';
$url = api_get_path(WEB_CODE_PATH).'lp/lp_controller.php?cidReq=%s&action=view&lp_id=%s';
$url = sprintf($url, $courseid, $lp_id);
$result = array(
'toolid' => TOOL_LEARNPATH,
@ -135,16 +135,16 @@ class learnpath_processor extends search_processor
$name = '';
if ($row = Database::fetch_array($dk_result)) {
// Get the image path
$img_location = api_get_path(WEB_COURSE_PATH) . $course_path . "/document/";
$img_location = api_get_path(WEB_COURSE_PATH).$course_path."/document/";
$thumbnail_path = str_replace('.png.html', '_thumb.png', $row['path']);
$big_img_path = str_replace('.png.html', '.png', $row['path']);
$thumbnail = '';
if (!empty($thumbnail_path)) {
$thumbnail = $img_location . $thumbnail_path;
$thumbnail = $img_location.$thumbnail_path;
}
$image = '';
if (!empty($big_img_path)) {
$image = $img_location . $big_img_path;
$image = $img_location.$big_img_path;
}
$name = $row['name'];
}

@ -5,8 +5,8 @@
*
* @package chamilo.include.search
*/
include_once dirname(__FILE__) . '/../../../global.inc.php';
require_once dirname(__FILE__) . '/search_processor.class.php';
include_once dirname(__FILE__).'/../../../global.inc.php';
require_once dirname(__FILE__).'/search_processor.class.php';
/**
* Process links before pass it to search listing scripts
@ -103,11 +103,11 @@ class link_processor extends search_processor
$link_id = intval($link_id);
$sql = "SELECT insert_user_id FROM $item_property_table
WHERE ref = $link_id AND tool = '" . TOOL_LINK . "' AND c_id = $course_id
WHERE ref = $link_id AND tool = '".TOOL_LINK."' AND c_id = $course_id
LIMIT 1";
$name = get_lang('Links');
$url = api_get_path(WEB_PATH) . 'main/link/link.php?cidReq=%s';
$url = api_get_path(WEB_PATH).'main/link/link.php?cidReq=%s';
$url = sprintf($url, $course_id_alpha);
// Get the image path
$thumbnail = Display::returnIconPath('link.png');

@ -5,8 +5,8 @@
*
* @package chamilo.include.search
*/
include_once dirname(__FILE__) . '/../../../global.inc.php';
require_once dirname(__FILE__) . '/search_processor.class.php';
include_once dirname(__FILE__).'/../../../global.inc.php';
require_once dirname(__FILE__).'/search_processor.class.php';
/**
* Process exercises before pass it to search listing scripts
@ -68,7 +68,7 @@ class quiz_processor extends search_processor
$visibility = api_get_item_visibility(api_get_course_info($courseid), TOOL_QUIZ, $exercise_id);
if ($visibility) {
list($thumbnail, $image, $name, $author) = $this->get_information($courseid, $exercise_id);
$url = api_get_path(WEB_CODE_PATH) . 'exercise/exercise_submit.php?cidReq=%s&exerciseId=%s';
$url = api_get_path(WEB_CODE_PATH).'exercise/exercise_submit.php?cidReq=%s&exerciseId=%s';
$url = sprintf($url, $courseid, $exercise_id);
$result = array(
'toolid' => TOOL_QUIZ,

@ -19,7 +19,7 @@
*/
require_once __DIR__.'/../inc/global.inc.php';
$current_course_tool = TOOL_LINK;
$current_course_tool = TOOL_LINK;
$this_section = SECTION_COURSES;
api_protect_course_script(true);
@ -187,12 +187,12 @@ switch ($action) {
break;
case 'move_link_up':
Link::moveLinkUp($id);
header('Location: ' . $linkListUrl);
header('Location: '.$linkListUrl);
exit;
break;
case 'move_link_down':
Link::moveLinkDown($id);
header('Location: ' . $linkListUrl);
header('Location: '.$linkListUrl);
exit;
break;
case 'list':

@ -27,13 +27,13 @@ $user_id = api_get_user_id();
$session_id = isset($_GET['session_id']) ? intval($_GET['session_id']) : 0;
$is_coach = api_is_coach($session_id);
$is_platform_admin = api_is_platform_admin();
$is_drh = api_is_drh();
$is_session_admin = api_is_session_admin();
$is_platform_admin = api_is_platform_admin();
$is_drh = api_is_drh();
$is_session_admin = api_is_session_admin();
$count_sessions = 0;
$count_courses = 0;
$title = null;
$count_sessions = 0;
$count_courses = 0;
$title = null;
// Access control
api_block_anonymous_users();
@ -142,7 +142,7 @@ echo '<a href="javascript: void(0);" onclick="javascript: window.print()">'.
echo '</span>';
if (!empty($session_id) &&
!in_array($display, array('accessoverview','lpprogressoverview','progressoverview','exerciseprogress', 'surveyoverview'))
!in_array($display, array('accessoverview', 'lpprogressoverview', 'progressoverview', 'exerciseprogress', 'surveyoverview'))
) {
echo '<a href="index.php">'.Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
if (!api_is_platform_admin()) {
@ -162,19 +162,19 @@ if (!empty($session_id) &&
}
} else {
echo Display::url(
Display::return_icon('stats.png', get_lang('MyStats'),'',ICON_SIZE_MEDIUM),
Display::return_icon('stats.png', get_lang('MyStats'), '', ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH)."auth/my_progress.php"
);
echo Display::url(
Display::return_icon("certificate_list.png", get_lang("GradebookSeeListOfStudentsCertificates"), array(), ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH) . "gradebook/certificate_report.php"
api_get_path(WEB_CODE_PATH)."gradebook/certificate_report.php"
);
}
// Actions menu
$nb_menu_items = count($menu_items);
if (empty($session_id) ||
in_array($display, array('accessoverview','lpprogressoverview', 'progressoverview', 'exerciseprogress', 'surveyoverview'))
in_array($display, array('accessoverview', 'lpprogressoverview', 'progressoverview', 'exerciseprogress', 'surveyoverview'))
) {
if ($nb_menu_items > 1) {
foreach ($menu_items as $key => $item) {
@ -185,7 +185,7 @@ if (empty($session_id) ||
echo '</div>';
$userId = api_get_user_id();
$userId = api_get_user_id();
$stats = Tracking::getStats($userId);
$students = $stats['students'];
@ -227,7 +227,7 @@ $avg_courses_per_student = null;
if (!empty($students)) {
// Students
$nb_students = count($students);
$progress = Tracking::get_avg_student_progress($studentIds);
$progress = Tracking::get_avg_student_progress($studentIds);
$countAssignments = Tracking::count_student_assignments($studentIds);
$studentIds = array_values($students);

@ -20,14 +20,14 @@ api_block_anonymous_users();
$this_section = SECTION_TRACKING;
$interbreadcrumb[] = array ("url" => "index.php", "name" => get_lang('MySpace'));
$interbreadcrumb[] = array("url" => "index.php", "name" => get_lang('MySpace'));
if (isset($_GET["user_id"]) && $_GET["user_id"] != "" && !isset($_GET["type"])) {
$interbreadcrumb[] = array ("url" => "teachers.php", "name" => get_lang('Teachers'));
$interbreadcrumb[] = array("url" => "teachers.php", "name" => get_lang('Teachers'));
}
if (isset($_GET["user_id"]) && $_GET["user_id"]!="" && isset($_GET["type"]) && $_GET["type"] == "coach") {
$interbreadcrumb[] = array ("url" => "coaches.php", "name" => get_lang('Tutors'));
if (isset($_GET["user_id"]) && $_GET["user_id"] != "" && isset($_GET["type"]) && $_GET["type"] == "coach") {
$interbreadcrumb[] = array("url" => "coaches.php", "name" => get_lang('Tutors'));
}
function get_count_users()
@ -123,8 +123,8 @@ function get_users($from, $limit, $column, $direction)
$courseInfo = api_get_course_info($course_code);
$courseId = $courseInfo['real_id'];
if (CourseManager :: is_user_subscribed_in_course($student_id, $course_code, true)) {
$avg_time_spent += Tracking :: get_time_spent_on_the_course($student_id, $courseId, $_GET['id_session']);
$my_average = Tracking :: get_avg_student_score($student_id, $course_code);
$avg_time_spent += Tracking :: get_time_spent_on_the_course($student_id, $courseId, $_GET['id_session']);
$my_average = Tracking :: get_avg_student_score($student_id, $course_code);
if (is_numeric($my_average)) {
$avg_student_score += $my_average;
}
@ -163,7 +163,7 @@ function get_users($from, $limit, $column, $direction)
$detailsLink = '<a href="myStudents.php?student='.$student_id.'&id_coach='.$coach_id.'&id_session='.$sessionId.'">
'.Display::return_icon('2rightarrow.png', get_lang('Details')).'</a>';
} else {
$detailsLink = '<a href="myStudents.php?student='.$student_id.'">
$detailsLink = '<a href="myStudents.php?student='.$student_id.'">
'.Display::return_icon('2rightarrow.png', get_lang('Details')).'</a>';
}
$row[] = $detailsLink;
@ -182,7 +182,7 @@ $sort_by_first_name = api_sort_by_first_name();
$actionsLeft = '';
if (api_is_drh()) {
$menu_items = array(
Display::url(Display::return_icon('stats.png', get_lang('MyStats'), '', ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH)."auth/my_progress.php" ),
Display::url(Display::return_icon('stats.png', get_lang('MyStats'), '', ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH)."auth/my_progress.php"),
Display::url(Display::return_icon('user.png', get_lang('Students'), array(), ICON_SIZE_MEDIUM), 'student.php'),
Display::url(Display::return_icon('teacher_na.png', get_lang('Trainers'), array(), ICON_SIZE_MEDIUM), 'teachers.php'),
Display::url(Display::return_icon('course.png', get_lang('Courses'), array(), ICON_SIZE_MEDIUM), 'course.php'),

@ -3,11 +3,11 @@
require_once __DIR__.'/../inc/global.inc.php';
define ('REPORTS_PROGRESS_COMPLETED', 1);
define('REPORTS_PROGRESS_COMPLETED', 1);
$reports_modules = array();
$reports_enabled_modules = array('quiz','course','scorm');
$reports_enabled_modules = array('quiz', 'course', 'scorm');
$reports_enabled_templates = array('exercicesMultiCourses', 'courseTime', 'courseArticulate');
@ -158,7 +158,7 @@ function reports_getToolId($tool) {
// return a sql clause returning triplet of (course, $session, $uid) the
// current user is authorized to reed
function reports_getVisibilitySQL () {
function reports_getVisibilitySQL() {
return "select cru.user_id from ".Database::get_main_table(TABLE_MAIN_COURSE_USER).' cru';
// fixme sessions
}

@ -7,7 +7,7 @@
*/
require_once __DIR__.'/../inc/global.inc.php';
$this_section = SECTION_COURSES;
$this_section = SECTION_COURSES;
if (extension_loaded('xapian')) {
require '../lp/lp_list_search.php';

@ -33,7 +33,7 @@ class ch_dropdown extends survey_question
*/
public function render(FormValidator $form, $questionData = array(), $answers = '')
{
$name = 'question' . $questionData['question_id'];
$name = 'question'.$questionData['question_id'];
$data = array(0 => '--') + $questionData['options'];
$form->addSelect($name, null, $data);
if (!empty($answers)) {

@ -6,7 +6,7 @@
// Setting the global file that gets the general configuration, the databases, the languages, ...
require_once __DIR__.'/../inc/global.inc.php';
$current_course_tool = TOOL_COURSE_MAINTENANCE;
$current_course_tool = TOOL_COURSE_MAINTENANCE;
api_protect_course_script(true);
// Notice for unauthorized people.

@ -144,7 +144,7 @@ SurveyUtil::handle_reporting_actions($survey_data, $people_filled);
// Actions bar
echo '<div class="actions">';
echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?survey_id='.$survey_id.'">'.
Display::return_icon('back.png', get_lang('BackToSurvey'),'',ICON_SIZE_MEDIUM).'</a>';
Display::return_icon('back.png', get_lang('BackToSurvey'), '', ICON_SIZE_MEDIUM).'</a>';
echo '</div>';
// Content
@ -154,15 +154,15 @@ if (!isset($_GET['action']) ||
) {
$myweb_survey_id = $survey_id;
echo '<div class="sectiontitle"><a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action=questionreport&survey_id='.$myweb_survey_id.'&'.$cidReq.'&single_page=1">'.
Display::return_icon('survey_reporting_overall.png',get_lang('QuestionsOverallReport')).' '.get_lang('QuestionsOverallReport').'</a></div><div class="sectioncomment">'.get_lang('QuestionsOverallReportDetail').' </div>';
Display::return_icon('survey_reporting_overall.png', get_lang('QuestionsOverallReport')).' '.get_lang('QuestionsOverallReport').'</a></div><div class="sectioncomment">'.get_lang('QuestionsOverallReportDetail').' </div>';
echo '<div class="sectiontitle"><a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action=questionreport&survey_id='.$myweb_survey_id.'&'.$cidReq.'">'.
Display::return_icon('survey_reporting_question.gif',get_lang('DetailedReportByQuestion')).' '.get_lang('DetailedReportByQuestion').'</a></div><div class="sectioncomment">'.get_lang('DetailedReportByQuestionDetail').' </div>';
Display::return_icon('survey_reporting_question.gif', get_lang('DetailedReportByQuestion')).' '.get_lang('DetailedReportByQuestion').'</a></div><div class="sectioncomment">'.get_lang('DetailedReportByQuestionDetail').' </div>';
echo '<div class="sectiontitle"><a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action=userreport&survey_id='.$myweb_survey_id.'&'.$cidReq.'">'.
Display::return_icon('survey_reporting_user.gif',get_lang('DetailedReportByUser')).' '.get_lang('DetailedReportByUser').'</a></div><div class="sectioncomment">'.get_lang('DetailedReportByUserDetail').'.</div>';
Display::return_icon('survey_reporting_user.gif', get_lang('DetailedReportByUser')).' '.get_lang('DetailedReportByUser').'</a></div><div class="sectioncomment">'.get_lang('DetailedReportByUserDetail').'.</div>';
echo '<div class="sectiontitle"><a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action=comparativereport&survey_id='.$myweb_survey_id.'&'.$cidReq.'">'.
Display::return_icon('survey_reporting_comparative.gif',get_lang('ComparativeReport')).' '.get_lang('ComparativeReport').'</a></div><div class="sectioncomment">'.get_lang('ComparativeReportDetail').'.</div>';
Display::return_icon('survey_reporting_comparative.gif', get_lang('ComparativeReport')).' '.get_lang('ComparativeReport').'</a></div><div class="sectioncomment">'.get_lang('ComparativeReportDetail').'.</div>';
echo '<div class="sectiontitle"><a href="reporting.php?action=completereport&survey_id='.$myweb_survey_id.'&'.$cidReq.'">'.
Display::return_icon('survey_reporting_complete.gif',get_lang('CompleteReport')).' '.get_lang('CompleteReport').'</a></div><div class="sectioncomment">'.get_lang('CompleteReportDetail').'</div>';
Display::return_icon('survey_reporting_complete.gif', get_lang('CompleteReport')).' '.get_lang('CompleteReport').'</a></div><div class="sectioncomment">'.get_lang('CompleteReportDetail').'</div>';
}
Display :: display_footer();

@ -65,7 +65,7 @@ switch ($action) {
$form = TicketManager::getProjectForm($url);
$formToString = $form->returnForm();
if ($form->validate()) {
$values =$form->getSubmitValues();
$values = $form->getSubmitValues();
$params = [
'name' => $values['name'],
@ -95,7 +95,7 @@ switch ($action) {
$formToString = $form->returnForm();
if ($form->validate()) {
$values =$form->getSubmitValues();
$values = $form->getSubmitValues();
$params = [
'name' => $values['name'],

@ -65,7 +65,7 @@ switch ($action) {
$form = TicketManager::getStatusForm($url);
$formToString = $form->returnForm();
if ($form->validate()) {
$values =$form->getSubmitValues();
$values = $form->getSubmitValues();
$params = [
'name' => $values['name'],
@ -94,7 +94,7 @@ switch ($action) {
]);
$formToString = $form->returnForm();
if ($form->validate()) {
$values =$form->getSubmitValues();
$values = $form->getSubmitValues();
$params = [
'name' => $values['name'],

@ -15,7 +15,7 @@ api_protect_course_script();
if (!api_is_allowed_to_edit()) {
Display::display_error_message(get_lang("DeniedAccess"));
} else {
$sql = "UPDATE " . Database::get_main_table('rp_reporte_semanas') . "
$sql = "UPDATE ".Database::get_main_table('rp_reporte_semanas')."
SET work_id = '$work_id', forum_id = '$forum_id'
WHERE id ='$rs_id'";
Database::query($sql);

@ -6,8 +6,8 @@
*/
require_once __DIR__.'/../inc/global.inc.php';
$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('Timeline'));
$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('Listing'));
$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('Timeline'));
$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('Listing'));
$timeline = new Timeline();
if (empty($_GET['id'])) {
@ -15,7 +15,7 @@ if (empty($_GET['id'])) {
}
$url = $timeline->get_url($_GET['id']);
$item = $timeline->get($_GET['id']);
$interbreadcrumb[]=array('url' => '#','name' => $item['headline']);
$interbreadcrumb[] = array('url' => '#', 'name' => $item['headline']);
$htmlHeadXtra[] = api_get_css(api_get_path(WEB_LIBRARY_PATH).'javascript/timeline/timeline.css');
$htmlHeadXtra[] = api_get_js('timeline/timeline-min.js');

@ -15,7 +15,7 @@ require_once '../lp/lp_upload.php';
chdir($cwdir);
if (api_get_setting('search_enabled') === 'true') {
require_once api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php';
require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php';
$specific_fields = get_specific_field_list();
foreach ($specific_fields as $specific_field) {

@ -11,7 +11,7 @@ use Chamilo\CoreBundle\Entity\ExtraField;
*/
require_once __DIR__.'/../inc/global.inc.php';
$current_course_tool = TOOL_USER;
$current_course_tool = TOOL_USER;
// the section (for the tabs)
$this_section = SECTION_COURSES;
@ -54,8 +54,8 @@ if ($keyword) {
}
$sessionId = api_get_session_id();
$list_register_user='';
$list_not_register_user='';
$list_register_user = '';
$list_not_register_user = '';
if (isset($_REQUEST['register'])) {
$userInfo = api_get_user_info($_REQUEST['user_id']);
@ -154,10 +154,10 @@ if (api_get_setting('show_email_addresses') == 'true') {
$table->set_column_filter($col - 1, 'email_filter');
}
$table->set_header($col++, get_lang('Active'), false);
$table->set_column_filter($col -1, 'active_filter');
$table->set_column_filter($col - 1, 'active_filter');
$table->set_header($col++, get_lang('Actions'), false);
$table->set_column_filter($col -1, 'reg_filter');
$table->set_form_actions(array ('subscribe' => get_lang('reg')), 'user');
$table->set_column_filter($col - 1, 'reg_filter');
$table->set_form_actions(array('subscribe' => get_lang('reg')), 'user');
if (!empty($_POST['keyword'])) {
$keyword_name = Security::remove_XSS($_POST['keyword']);
@ -245,7 +245,7 @@ function get_number_of_users()
if (api_is_multiple_url_enabled()) {
$url_access_id = api_get_current_access_url_id();
if ($url_access_id !=-1) {
if ($url_access_id != -1) {
$tbl_url_rel_user = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$sql = "SELECT COUNT(u.id)
FROM $user_table u
@ -272,7 +272,7 @@ function get_number_of_users()
if (api_is_multiple_url_enabled()) {
$url_access_id = api_get_current_access_url_id();
if ($url_access_id !=-1) {
if ($url_access_id != -1) {
$tbl_url_rel_user = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$sql = "SELECT COUNT(u.id)
@ -302,7 +302,7 @@ function get_number_of_users()
if (api_is_multiple_url_enabled()) {
$url_access_id = api_get_current_access_url_id();
if ($url_access_id !=-1) {
if ($url_access_id != -1) {
$tbl_url_rel_user = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$sql = "SELECT COUNT(u.id)
FROM $user_table u
@ -330,9 +330,9 @@ function get_number_of_users()
if (isset($_GET['subscribe_user_filter_value']) &&
!empty($_GET['subscribe_user_filter_value']) &&
api_get_setting('ProfilingFilterAddingUsers') === 'true'
){
$field_identification = explode('*',$_GET['subscribe_user_filter_value']);
$sql .= "
) {
$field_identification = explode('*', $_GET['subscribe_user_filter_value']);
$sql .= "
LEFT JOIN $table_user_field_values field_values
ON field_values.item_id = u.user_id
WHERE
@ -341,14 +341,14 @@ function get_number_of_users()
field_values.field_id = '".intval($field_identification[0])."' AND
field_values.value = '".Database::escape_string($field_identification[1])."'
";
} else {
$sql .= "WHERE cu.user_id IS NULL AND u.status <> ".DRH." ";
} else {
$sql .= "WHERE cu.user_id IS NULL AND u.status <> ".DRH." ";
}
if (api_is_multiple_url_enabled()) {
$url_access_id = api_get_current_access_url_id();
if ($url_access_id !=-1) {
if ($url_access_id != -1) {
$tbl_url_rel_user = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$sql = "SELECT COUNT(u.id)
FROM $user_table u
@ -394,7 +394,7 @@ function get_number_of_users()
$users_of_course[] = $course_user['user_id'];
}
}
$sql .=" AND u.status <> ".ANONYMOUS." ";
$sql .= " AND u.status <> ".ANONYMOUS." ";
$res = Database::query($sql);
$count_user = 0;
@ -465,8 +465,8 @@ function get_user_data($from, $number_of_items, $column, $direction)
!empty($_GET['subscribe_user_filter_value']) &&
api_get_setting('ProfilingFilterAddingUsers') == 'true'
) {
$field_identification = explode('*',$_GET['subscribe_user_filter_value']);
$sql .= "
$field_identification = explode('*', $_GET['subscribe_user_filter_value']);
$sql .= "
LEFT JOIN $table_user_field_values field_values
ON field_values.item_id = u.user_id
WHERE
@ -476,10 +476,10 @@ function get_user_data($from, $number_of_items, $column, $direction)
field_values.field_id = '".intval($field_identification[0])."' AND
field_values.value = '".Database::escape_string($field_identification[1])."'";
} else {
$sql .= "WHERE cu.user_id IS NULL AND u.status=1 AND (u.official_code <> 'ADMIN' OR u.official_code IS NULL) ";
$sql .= "WHERE cu.user_id IS NULL AND u.status=1 AND (u.official_code <> 'ADMIN' OR u.official_code IS NULL) ";
}
$sql .= " AND access_url_id = $url_access_id";
$sql .= " AND access_url_id = $url_access_id";
} else {
// adding a teacher NOT through a session
$sql = "SELECT $select_fields
@ -492,21 +492,21 @@ function get_user_data($from, $number_of_items, $column, $direction)
!empty($_GET['subscribe_user_filter_value']) &&
api_get_setting('ProfilingFilterAddingUsers') == 'true'
) {
$field_identification = explode('*',$_GET['subscribe_user_filter_value']);
$sql .= "
$field_identification = explode('*', $_GET['subscribe_user_filter_value']);
$sql .= "
LEFT JOIN $table_user_field_values field_values
ON field_values.item_id = u.user_id
WHERE
cu.user_id IS NULL AND u.status<>".DRH." AND
field_values.field_id = '".intval($field_identification[0])."' AND
field_values.value = '".Database::escape_string($field_identification[1])."'";
} else {
$sql .= "WHERE cu.user_id IS NULL AND u.status<>".DRH." ";
} else {
$sql .= "WHERE cu.user_id IS NULL AND u.status<>".DRH." ";
}
// adding a teacher NOT trough a session on a portal with multiple URLs
if (api_is_multiple_url_enabled()) {
if ($url_access_id !=-1) {
if ($url_access_id != -1) {
$sql = "SELECT $select_fields
FROM $user_table u
LEFT JOIN $course_user_table cu
@ -518,9 +518,9 @@ function get_user_data($from, $number_of_items, $column, $direction)
if (isset($_GET['subscribe_user_filter_value']) &&
!empty($_GET['subscribe_user_filter_value']) &&
api_get_setting('ProfilingFilterAddingUsers') == 'true'
){
) {
$field_identification = explode('*', $_GET['subscribe_user_filter_value']);
$sql .= "
$sql .= "
LEFT JOIN $table_user_field_values field_values
ON field_values.item_id = u.user_id
WHERE
@ -528,8 +528,8 @@ function get_user_data($from, $number_of_items, $column, $direction)
u.status<>".DRH." AND
field_values.field_id = '".intval($field_identification[0])."' AND
field_values.value = '".Database::escape_string($field_identification[1])."'";
} else {
$sql .= "WHERE cu.user_id IS NULL AND u.status<>".DRH." AND access_url_id= $url_access_id ";
} else {
$sql .= "WHERE cu.user_id IS NULL AND u.status<>".DRH." AND access_url_id= $url_access_id ";
}
}
}
@ -550,9 +550,9 @@ function get_user_data($from, $number_of_items, $column, $direction)
}
// applying the filter of the additional user profile fields
if (isset($_GET['subscribe_user_filter_value']) AND !empty($_GET['subscribe_user_filter_value'])){
$field_identification = explode('*',$_GET['subscribe_user_filter_value']);
$sql .= "
if (isset($_GET['subscribe_user_filter_value']) AND !empty($_GET['subscribe_user_filter_value'])) {
$field_identification = explode('*', $_GET['subscribe_user_filter_value']);
$sql .= "
LEFT JOIN $table_user_field_values field_values
ON field_values.item_id = u.user_id
WHERE
@ -561,15 +561,15 @@ function get_user_data($from, $number_of_items, $column, $direction)
(u.official_code <> 'ADMIN' OR u.official_code IS NULL) AND
field_values.field_id = '".intval($field_identification[0])."' AND
field_values.value = '".Database::escape_string($field_identification[1])."'";
} else {
$sql .= "WHERE
} else {
$sql .= "WHERE
cu.user_id IS NULL AND
u.status<>".DRH." AND
(u.official_code <> 'ADMIN' OR u.official_code IS NULL) ";
}
if (api_is_multiple_url_enabled()) {
$sql .= "AND access_url_id = $url_access_id";
$sql .= "AND access_url_id = $url_access_id";
}
} else {
@ -582,8 +582,8 @@ function get_user_data($from, $number_of_items, $column, $direction)
// applying the filter of the additional user profile fields
if (isset($_GET['subscribe_user_filter_value']) && !empty($_GET['subscribe_user_filter_value'])) {
$field_identification = explode('*',$_GET['subscribe_user_filter_value']);
$sql .= "
$field_identification = explode('*', $_GET['subscribe_user_filter_value']);
$sql .= "
LEFT JOIN $table_user_field_values field_values
ON field_values.item_id = u.user_id
WHERE
@ -591,14 +591,14 @@ function get_user_data($from, $number_of_items, $column, $direction)
u.status<>".DRH." AND
field_values.field_id = '".intval($field_identification[0])."' AND
field_values.value = '".Database::escape_string($field_identification[1])."'";
} else {
$sql .= "WHERE cu.user_id IS NULL AND u.status<>".DRH." ";
} else {
$sql .= "WHERE cu.user_id IS NULL AND u.status<>".DRH." ";
}
//showing only the courses of the current Chamilo access_url_id
if (api_is_multiple_url_enabled()) {
if ($url_access_id !=-1) {
if ($url_access_id != -1) {
$sql = "SELECT $select_fields
FROM $user_table u
LEFT JOIN $course_user_table cu
@ -610,9 +610,9 @@ function get_user_data($from, $number_of_items, $column, $direction)
if (isset($_GET['subscribe_user_filter_value']) &&
!empty($_GET['subscribe_user_filter_value']) &&
api_get_setting('ProfilingFilterAddingUsers') == 'true'
){
) {
$field_identification = explode('*', $_GET['subscribe_user_filter_value']);
$sql .= "
$sql .= "
LEFT JOIN $table_user_field_values field_values
ON field_values.item_id = u.user_id
WHERE
@ -622,8 +622,8 @@ function get_user_data($from, $number_of_items, $column, $direction)
field_values.value = '".Database::escape_string($field_identification[1])."' AND
access_url_id = $url_access_id
";
} else {
$sql .= "WHERE cu.user_id IS NULL AND u.status<>".DRH." AND access_url_id= $url_access_id ";
} else {
$sql .= "WHERE cu.user_id IS NULL AND u.status<>".DRH." AND access_url_id= $url_access_id ";
}
}
}
@ -660,7 +660,7 @@ function get_user_data($from, $number_of_items, $column, $direction)
}
}
$sql .=" AND u.status != ".ANONYMOUS." ";
$sql .= " AND u.status != ".ANONYMOUS." ";
// Sorting and pagination (used by the sortable table)
$sql .= " ORDER BY col$column $direction ";
@ -669,7 +669,7 @@ function get_user_data($from, $number_of_items, $column, $direction)
$sql .= " LIMIT $from, $number_of_items";
$res = Database::query($sql);
$users = array ();
$users = array();
while ($user = Database::fetch_row($res)) {
$users[] = $user;
}
@ -729,7 +729,7 @@ function active_filter($active, $url_params, $row)
if ($row['0'] <> $_user['user_id']) {
// you cannot lock yourself out otherwise you could disable all the accounts
// including your own => everybody is locked out and nobody can change it anymore.
$result = Display::return_icon($image.'.png', get_lang(ucfirst($action)), array() , ICON_SIZE_TINY);
$result = Display::return_icon($image.'.png', get_lang(ucfirst($action)), array(), ICON_SIZE_TINY);
}
return $result;

@ -18,7 +18,7 @@ $wiki->charset = $charset;
// section (for the tabs)
$this_section = SECTION_COURSES;
$current_course_tool = TOOL_WIKI;
$current_course_tool = TOOL_WIKI;
$course_id = api_get_course_int_id();
$session_id = api_get_session_id();
@ -27,7 +27,7 @@ $course_id = api_get_course_int_id();
$groupId = api_get_group_id();
// additional style information
$htmlHeadXtra[] ='<link rel="stylesheet" type="text/css" href="'.api_get_path(WEB_CODE_PATH).'wiki/css/default.css"/>';
$htmlHeadXtra[] = '<link rel="stylesheet" type="text/css" href="'.api_get_path(WEB_CODE_PATH).'wiki/css/default.css"/>';
// javascript for advanced parameters menu
$htmlHeadXtra[] = '<script>
@ -72,7 +72,7 @@ if ($groupId) {
//ensure this tool in groups whe it's private or deactivated
if ($group_properties['wiki_state'] == 0) {
api_not_allowed();
} elseif ($group_properties['wiki_state']==2) {
} elseif ($group_properties['wiki_state'] == 2) {
if (!api_is_allowed_to_edit(false, true) and
!GroupManager :: is_user_in_group(api_get_user_id(), $group_properties['iid'])
) {
@ -84,7 +84,7 @@ if ($groupId) {
$is_allowed_to_edit = api_is_allowed_to_edit(false, true);
// The page we are dealing with
$page = isset($_GET['title']) ? $_GET['title']: 'index';
$page = isset($_GET['title']) ? $_GET['title'] : 'index';
$action = isset($_GET['action']) ? Security::remove_XSS($_GET['action']) : 'showpage';
$view = isset($_GET['view']) ? Security::remove_XSS($_GET['view']) : null;

@ -147,8 +147,8 @@ class Basic extends Toolbar
$config['toolbar_maxToolbar'] = $this->getMaximizedToolbar();
}
$config['customConfig'] = api_get_path(WEB_LIBRARY_JS_PATH) . 'ckeditor/config_js.php';
$config['flash_flvPlayer'] = api_get_path(WEB_LIBRARY_JS_PATH) . 'ckeditor/plugins/flash/swf/player.swf';
$config['customConfig'] = api_get_path(WEB_LIBRARY_JS_PATH).'ckeditor/config_js.php';
$config['flash_flvPlayer'] = api_get_path(WEB_LIBRARY_JS_PATH).'ckeditor/plugins/flash/swf/player.swf';
/*filebrowserFlashBrowseUrl
filebrowserFlashUploadUrl
@ -173,7 +173,7 @@ class Basic extends Toolbar
'wordLimit' => 'unlimited'
);*/
$config['skin'] = 'bootstrapck,' . api_get_path(WEB_LIBRARY_JS_PATH) . 'ckeditor/skins/bootstrapck/';
$config['skin'] = 'bootstrapck,'.api_get_path(WEB_LIBRARY_JS_PATH).'ckeditor/skins/bootstrapck/';
//$config['skin'] = 'moono';
if (isset($this->config)) {
@ -205,7 +205,7 @@ class Basic extends Toolbar
return [
$this->getNewPageBlock(),
['Undo', 'Redo'],
['Link', 'Image', 'Video', 'Oembed','Flash', 'Youtube', 'Audio', 'Table', 'Asciimath', 'Asciisvg'],
['Link', 'Image', 'Video', 'Oembed', 'Flash', 'Youtube', 'Audio', 'Table', 'Asciimath', 'Asciisvg'],
['BulletedList', 'NumberedList', 'HorizontalRule'],
['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
['Styles', 'Format', 'Font', 'FontSize', 'Bold', 'Italic', 'Underline', 'TextColor', 'BGColor', 'Source'],

@ -143,10 +143,10 @@ class CourseSelectForm
<?php
// get destination course title
if (!empty($hidden_fields['destination_course'])) {
$sessionTitle = !empty($hidden_fields['destination_session']) ? ' (' . api_get_session_name($hidden_fields['destination_session']) . ')' : null;
$sessionTitle = !empty($hidden_fields['destination_session']) ? ' ('.api_get_session_name($hidden_fields['destination_session']).')' : null;
$course_infos = CourseManager::get_course_information($hidden_fields['destination_course']);
echo '<h3>';
echo get_lang('DestinationCourse').' : '.$course_infos['title'] . ' ('.$course_infos['code'].') '.$sessionTitle;
echo get_lang('DestinationCourse').' : '.$course_infos['title'].' ('.$course_infos['code'].') '.$sessionTitle;
echo '</h3>';
}
echo '<script src="'.api_get_path(WEB_CODE_PATH).'inc/lib/javascript/upload.js" type="text/javascript"></script>';
@ -305,7 +305,7 @@ class CourseSelectForm
/*Documents are avoided due the huge amount of memory that the serialize php function "eats"
(when there are directories with hundred/thousand of files) */
// this is a known issue of serialize
$course->resources['document']= null;
$course->resources['document'] = null;
}
echo '<input type="hidden" name="course" value="'.base64_encode(Course::serialize($course)).'"/>';
@ -322,7 +322,7 @@ class CourseSelectForm
Display::display_warning_message(get_lang('NoDataAvailable'));
} else {
if (!empty($hidden_fields['destination_session'])) {
echo '<br /><button class="save" type="submit" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES, $charset))."'".')) return false;" >'.
echo '<br /><button class="save" type="submit" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES, $charset))."'".')) return false;" >'.
get_lang('Ok').'</button>';
} else {
if ($recycleOption) {
@ -347,7 +347,7 @@ class CourseSelectForm
*/
public static function display_hidden_quiz_questions($course)
{
if(is_array($course->resources)){
if (is_array($course->resources)) {
foreach ($course->resources as $type => $resources) {
if (count($resources) > 0) {
switch ($type) {
@ -367,10 +367,10 @@ class CourseSelectForm
*/
public static function display_hidden_scorm_directories($course)
{
if (is_array($course->resources)){
if (is_array($course->resources)) {
foreach ($course->resources as $type => $resources) {
if (count($resources) > 0) {
switch($type) {
switch ($type) {
case RESOURCE_SCORM:
foreach ($resources as $id => $resource) {
echo '<input type="hidden" name="resource['.RESOURCE_SCORM.']['.$id.']" id="resource['.RESOURCE_SCORM.']['.$id.']" value="On" />';
@ -416,7 +416,7 @@ class CourseSelectForm
if (is_array($resource)) {
$resource = array_keys($resource);
foreach ($resource as $resource_item) {
foreach ($resource as $resource_item) {
$condition_session = '';
if (!empty($session_id)) {
@ -452,8 +452,8 @@ class CourseSelectForm
tool = '".RESOURCE_DOCUMENT."' AND
ref = $resource_item ";
$res = Database::query($sql);
$all_properties = array ();
while ($item_property = Database::fetch_array($res,'ASSOC')) {
$all_properties = array();
while ($item_property = Database::fetch_array($res, 'ASSOC')) {
$all_properties[] = $item_property;
}
$course->resources[RESOURCE_DOCUMENT][$resource_item]->item_properties = $all_properties;
@ -468,7 +468,7 @@ class CourseSelectForm
switch ($type) {
case RESOURCE_SURVEYQUESTION:
foreach($resources as $id => $obj) {
foreach ($resources as $id => $obj) {
if (isset($_POST['resource'][RESOURCE_SURVEY]) &&
is_array($_POST['resource'][RESOURCE_SURVEY]) &&
!in_array($obj->survey_id, array_keys($_POST['resource'][RESOURCE_SURVEY]))
@ -567,7 +567,7 @@ class CourseSelectForm
$resource_is_used_elsewhere = $course->is_linked_resource($obj);
// check if document is in a quiz (audio/video)
if ($type == RESOURCE_DOCUMENT && $course->has_resources(RESOURCE_QUIZ)) {
foreach($course->resources[RESOURCE_QUIZ] as $quiz) {
foreach ($course->resources[RESOURCE_QUIZ] as $quiz) {
$quiz = $quiz->obj;
if (isset($quiz->media) && $quiz->media == $id) {
$resource_is_used_elsewhere = true;
@ -639,15 +639,15 @@ class CourseSelectForm
<?php
//get destination course title
if(!empty($hidden_fields['destination_course'])) {
if (!empty($hidden_fields['destination_course'])) {
if (!empty($hidden_fields['destination_session'])) {
$sessionTitle = ' (' . api_get_session_name($hidden_fields['destination_session']) . ')';
$sessionTitle = ' ('.api_get_session_name($hidden_fields['destination_session']).')';
} else {
$sessionTitle = null;
}
$course_infos = CourseManager::get_course_information($hidden_fields['destination_course']);
echo '<h3>';
echo get_lang('DestinationCourse') . ' : ' . $course_infos['title'] . $sessionTitle;
echo get_lang('DestinationCourse').' : '.$course_infos['title'].$sessionTitle;
echo '</h3>';
}
@ -685,7 +685,7 @@ class CourseSelectForm
if ($avoid_serialize) {
//Documents are avoided due the huge amount of memory that the serialize php function "eats" (when there are directories with hundred/thousand of files)
// this is a known issue of serialize
$course->resources['document']= null;
$course->resources['document'] = null;
}
echo '<input type="hidden" name="course" value="'.base64_encode(Course::serialize($course)).'"/>';
if (is_array($hidden_fields)) {

Loading…
Cancel
Save