Minor - format code

pull/2476/head
jmontoyaa 8 years ago
parent 48eaf907e7
commit 3743e267cb
  1. 2
      main/inc/ajax/chat.ajax.php
  2. 8
      main/inc/ajax/model.ajax.php
  3. 3
      main/inc/lib/AnnouncementManager.php
  4. 1
      main/inc/lib/agenda.lib.php
  5. 7
      main/inc/lib/course.lib.php
  6. 6
      main/inc/lib/events.lib.php
  7. 1
      main/inc/lib/fileUpload.lib.php
  8. 6
      main/inc/lib/message.lib.php
  9. 1
      main/lp/lp_final_item.php
  10. 4
      main/lp/scorm_api.php
  11. 14
      main/webservices/webservice_user.php

@ -35,7 +35,6 @@ if (!isset($_SESSION['openChatBoxes'])) {
}
$chat = new Chat();
if (Chat::disableChat()) {
exit;
}
@ -44,7 +43,6 @@ if ($chat->isChatBlockedByExercises()) {
$chat->setUserStatus(0);
exit;
}
switch ($action) {
case 'chatheartbeat':
$chat->heartbeat();

@ -624,10 +624,6 @@ switch ($action) {
break;
case 'get_sessions':
$list_type = isset($_REQUEST['list_type']) ? $_REQUEST['list_type'] : 'simple';
/*$courseId = isset($_GET['course_id']) && !empty($_GET['course_id']) ? (int) $_GET['course_id'] : 0;
if (!empty($courseId)) {
$whereCondition .= " c.id = $courseId";
}*/
if ($list_type === 'simple') {
$count = SessionManager::get_sessions_admin(
['where' => $whereCondition, 'extra' => $extra_fields],
@ -2096,13 +2092,9 @@ switch ($action) {
if ($obj->usergroup_was_added_in_course($group['id'], $course_id)) {
$url = 'class.php?action=remove_class_from_course&id='.$group['id'].'&'.api_get_cidreq();
$icon = Display::return_icon('delete.png', get_lang('Remove'));
//$class = 'btn btn-danger';
//$text = get_lang('Remove');
} else {
$url = 'class.php?action=add_class_to_course&id='.$group['id'].'&'.api_get_cidreq().'&type=not_registered';
//$class = 'btn btn-primary';
$icon = Display::return_icon('add.png', get_lang('Add'));
//$text = get_lang('Add');
}
switch ($group['group_type']) {

@ -1586,7 +1586,6 @@ class AnnouncementManager
$extraGroupCondition
$groupBy
ORDER BY display_order DESC";
//GROUP BY ip.ref
} else {
// A.3 you are a course admin without any group or user filter
// A.3.a you are a course admin without user or group filter but WITH studentview
@ -1605,8 +1604,6 @@ class AnnouncementManager
$searchCondition
$groupBy
ORDER BY display_order DESC";
//GROUP BY ip.ref
} else {
// A.3.a you are a course admin without user or group filter and WTIHOUT studentview (= the normal course admin view)
// => see all the messages of all the users and groups with editing possibilities

@ -3922,7 +3922,6 @@ class Agenda
);
$result .= '</div>';
$html .= $result;
//echo Display::div($content, array('id'=>'main_'.$value['calendar_type'].'_'.$value['id'], 'class' => 'dialog'));
} else {
$html .= $result .= $icon.'</div>';
}

@ -84,16 +84,15 @@ class CourseManager
$params['wanted_code'] = self::generate_course_code($substring);
}
}
// Create the course keys
$keys = AddCourse::define_course_keys($params['wanted_code']);
$params['exemplary_content'] = isset($params['exemplary_content']) ? $params['exemplary_content'] : false;
if (count($keys)) {
$params['code'] = $keys['currentCourseCode'];
$params['visual_code'] = $keys['currentCourseId'];
$params['directory'] = $keys['currentCourseRepository'];
$course_info = api_get_course_info($params['code']);
if (empty($course_info)) {
$course_id = AddCourse::register_course($params);
@ -3820,7 +3819,7 @@ class CourseManager
course_rel_user.status status,
course.code as course_code,
user_course_cat,
course_rel_user.sort
course_rel_user.sort
FROM $TABLECOURS course
INNER JOIN $TABLECOURSUSER course_rel_user
ON (course.id = course_rel_user.c_id)
@ -5027,7 +5026,7 @@ class CourseManager
$my_course['is_registered'] = $userRegistered;
$my_course['title_cut'] = cut($course_info['title'], 45);
//Course visibility
// Course visibility
if ($access_link && in_array('register', $access_link)) {
$my_course['register_button'] = Display::url(
get_lang('Subscribe').' '.

@ -2091,17 +2091,11 @@ class Event
if (Database::num_rows($result) > 0) {
$row = Database::fetch_array($result, 'ASSOC');
$courseAccessId = $row['course_access_id'];
/*$logout = $row['logout_course_date'];
$now = time();
$logout = api_strtotime($logout, 'UTC');
*/
//if ($now - $logout < $sessionLifetime) {
$sql = "UPDATE $tableCourseAccess SET
logout_course_date = '$currentDate',
counter = counter + 1
WHERE course_access_id = $courseAccessId";
Database::query($sql);
//}
} else {
$insert = true;
}

@ -2055,6 +2055,7 @@ function add_all_documents_in_folder_to_database(
$whatIfFileExists
);
} else {
// Rename
$uploadedFile = [
'name' => $file,
'tmp_name' => $sysFolderPath,

@ -558,9 +558,9 @@ class MessageManager
if (!empty($drhList)) {
foreach ($drhList as $drhInfo) {
$message = sprintf(
get_lang('CopyOfMessageSentToXUser'),
$userInfo['complete_name']
).' <br />'.$message;
get_lang('CopyOfMessageSentToXUser'),
$userInfo['complete_name']
).' <br />'.$message;
self::send_message_simple(
$drhInfo['user_id'],

@ -117,7 +117,6 @@ if ($accessGranted == false) {
$downloadCertificateLink,
$badgeLink
);
// TODO: Missing validation of learning path completion
} else {
// A gradebook was found, proceed...
/** @var Category $category */

@ -2034,7 +2034,6 @@ function xajax_save_objectives(lms_lp_id,lms_user_id,lms_view_id,lms_item_id,ite
* @uses lp_ajax_switch_item.php
*/
function xajax_switch_item_details(lms_lp_id,lms_user_id,lms_view_id,lms_item_id,next_item) {
var params = {
'lid': lms_lp_id,
'uid': lms_user_id,
@ -2157,7 +2156,6 @@ function attach_glossary_into_scorm(type) {
var complex_array = new Array();
$("iframe").contents().find("body").on("click", ".glossary-ajax", function() {
div_show_id="div_show_id";
div_content_id="div_content_id";
@ -2260,7 +2258,6 @@ function attach_glossary_into_scorm(type) {
objects.each(function (value, obj) {
var dialogId = this.id +'_dialog';
var openerId = this.id +'_opener';
var link = '<a id="'+openerId+'" href="#" class="generated btn">'+
'<div style="text-align: center"><img src="<?php echo Display::returnIconPath('play-circle-8x.png'); ?>"/><br />If video does not work, try clicking here.</div></a>';
var embed = $("iframe").contents().find("#"+this.id).find('embed').first();
@ -2373,6 +2370,5 @@ function attach_glossary_into_scorm(type) {
});
});
}
}
}

@ -567,15 +567,6 @@ class WSUser extends WS
);
if (!$result) {
return new WSError(104, 'There was an error creating the user');
/*$failure = $api_failureList[0];
if($failure == 'login-pass already taken') {
return new WSError(102, 'This username is already taken');
} else if($failure == 'encrypt_method invalid') {
return new WSError(103, 'The encryption of the password is invalid');
} else {
return new WSError(104, 'There was an error creating the user');
}*/
} else {
return $result;
}
@ -649,11 +640,6 @@ class WSUser extends WS
$encrypt_method
);
if (!$result) {
/*if($failure == 'encrypt_method invalid') {
return new WSError(103, 'The encryption of the password is invalid');
} else {
return new WSError(105, 'There was an error updating the user');
}*/
return new WSError(105, 'There was an error updating the user');
} else {
return $result;

Loading…
Cancel
Save