From 3c271b581947ae368c4e0784b0f273e8d39586ff Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Mon, 15 Jan 2018 13:18:59 +0100 Subject: [PATCH] Applied fixes from FlintCI --- main/admin/settings.lib.php | 2 +- main/course_home/vertical_activity.php | 2 +- main/exercise/exercise.class.php | 2 +- main/exercise/exercise_admin.php | 2 +- main/exercise/hotpotatoes_exercise_report.php | 6 +++--- main/forum/viewforumcategory.php | 2 +- main/forum/viewpost.php | 2 +- main/gradebook/lib/be/category.class.php | 4 ++-- main/inc/ajax/model.ajax.php | 2 +- main/inc/ajax/skill.ajax.php | 2 +- main/inc/global.inc.php | 2 +- main/inc/lib/AnnouncementManager.php | 4 ++-- main/inc/lib/agenda.lib.php | 2 +- main/inc/lib/course_home.lib.php | 4 ++-- main/inc/lib/events.lib.php | 2 +- main/inc/lib/exercise_show_functions.lib.php | 2 +- main/inc/lib/myspace.lib.php | 2 +- main/inc/lib/tracking.lib.php | 2 +- main/inc/local.inc.php | 2 +- main/install/install.lib.php | 2 +- main/lp/learnpath.class.php | 4 ++-- main/lp/lp_final_item.php | 2 +- main/lp/scorm.class.php | 2 +- main/webservices/http-auth.php | 2 +- main/webservices/registration.soap.php | 2 +- main/webservices/webservice_user.php | 16 ++++++++-------- main/wiki/wiki.inc.php | 12 ++++++------ main/work/work.lib.php | 2 +- plugin/buycourses/src/paypalfunctions.php | 2 +- .../Component/CourseCopy/CourseBuilder.php | 2 +- 30 files changed, 48 insertions(+), 48 deletions(-) diff --git a/main/admin/settings.lib.php b/main/admin/settings.lib.php index 063af6847a..e2661ebd24 100755 --- a/main/admin/settings.lib.php +++ b/main/admin/settings.lib.php @@ -1450,7 +1450,7 @@ function generateSettingsForm($settings, $settings_by_access_list) $form->applyFilter($row['variable'], 'html_filter'); $default_values[$row['variable']] = $row['selected_value']; - // For platform character set selection: Conversion of the textfield to a select box with valid values. + // For platform character set selection: Conversion of the textfield to a select box with valid values. } elseif ($row['variable'] == 'platform_charset') { continue; } else { diff --git a/main/course_home/vertical_activity.php b/main/course_home/vertical_activity.php index 3198588067..fa9e3a892d 100755 --- a/main/course_home/vertical_activity.php +++ b/main/course_home/vertical_activity.php @@ -105,7 +105,7 @@ if (api_is_allowed_to_edit(null, true) && !api_is_coach()) { 'class' => 'Authoringview', 'content' => CourseHome::show_tools_category($my_list) ]; - // TOOLS AUTHORING +// TOOLS AUTHORING } else { $my_list = CourseHome::get_tools_category(TOOL_STUDENT_VIEW); if (count($my_list) > 0) { diff --git a/main/exercise/exercise.class.php b/main/exercise/exercise.class.php index ce9663dea1..47d354b587 100755 --- a/main/exercise/exercise.class.php +++ b/main/exercise/exercise.class.php @@ -5588,7 +5588,7 @@ class Exercise } elseif (in_array($answerType, [UNIQUE_ANSWER, UNIQUE_ANSWER_IMAGE, UNIQUE_ANSWER_NO_OPTION, READING_COMPREHENSION])) { $answer = $choice; Event::saveQuestionAttempt($questionScore, $answer, $quesId, $exeId, 0, $this->id); - // } elseif ($answerType == HOT_SPOT || $answerType == HOT_SPOT_DELINEATION) { + // } elseif ($answerType == HOT_SPOT || $answerType == HOT_SPOT_DELINEATION) { } elseif ($answerType == HOT_SPOT || $answerType == ANNOTATION) { $answer = []; if (isset($exerciseResultCoordinates[$questionId]) && !empty($exerciseResultCoordinates[$questionId])) { diff --git a/main/exercise/exercise_admin.php b/main/exercise/exercise_admin.php index 2393c92e9b..339223c341 100755 --- a/main/exercise/exercise_admin.php +++ b/main/exercise/exercise_admin.php @@ -190,7 +190,7 @@ if ($form->validate()) { if (!empty($_GET['lp_id']) || !empty($_POST['lp_id'])) { if (!empty($_POST['lp_id'])) { $lp_id = intval($_POST['lp_id']); - //TODO:this remains to be implemented after press the first post + //TODO:this remains to be implemented after press the first post } else { $lp_id = intval($_GET['lp_id']); } diff --git a/main/exercise/hotpotatoes_exercise_report.php b/main/exercise/hotpotatoes_exercise_report.php index b56f17339d..b9cb8171d1 100755 --- a/main/exercise/hotpotatoes_exercise_report.php +++ b/main/exercise/hotpotatoes_exercise_report.php @@ -101,9 +101,9 @@ if ($is_allowedToEdit || $is_tutor) { $nameTools = get_lang('StudentScore'); $interbreadcrumb[] = ["url" => "exercise.php", "name" => get_lang('Exercises')]; $objExerciseTmp = new Exercise(); - /*if ($objExerciseTmp->read($exercise_id)) { - $interbreadcrumb[] = array("url" => "admin.php?exerciseId=".$exercise_id, "name" => $objExerciseTmp->name); - }*/ +/*if ($objExerciseTmp->read($exercise_id)) { + $interbreadcrumb[] = array("url" => "admin.php?exerciseId=".$exercise_id, "name" => $objExerciseTmp->name); +}*/ } else { $interbreadcrumb[] = ["url" => "exercise.php", "name" => get_lang('Exercises')]; $objExerciseTmp = new Exercise(); diff --git a/main/forum/viewforumcategory.php b/main/forum/viewforumcategory.php index 5457c9cf57..5bfbad667f 100755 --- a/main/forum/viewforumcategory.php +++ b/main/forum/viewforumcategory.php @@ -277,7 +277,7 @@ if ($action != 'add') { // it is a group forum but it is public => show if ($forum['forum_group_public_private'] == 'public') { $show_forum = true; - //echo '-publiek'; + //echo '-publiek'; } else { // it is a group forum and it is private //echo '-prive'; diff --git a/main/forum/viewpost.php b/main/forum/viewpost.php index c3b63886dc..bec7ad8f1b 100755 --- a/main/forum/viewpost.php +++ b/main/forum/viewpost.php @@ -133,7 +133,7 @@ if ($message != 'PostDeletedSpecial') { ) { if ($current_forum['locked'] <> 1 && $current_forum['locked'] <> 1) { echo '  '; - /*echo ''.Display::return_icon('new_thread.png','','',ICON_SIZE_MEDIUM).'';*/ + /*echo ''.Display::return_icon('new_thread.png','','',ICON_SIZE_MEDIUM).'';*/ } else { echo get_lang('ForumLocked'); } diff --git a/main/gradebook/lib/be/category.class.php b/main/gradebook/lib/be/category.class.php index b27df37232..0413b9a087 100755 --- a/main/gradebook/lib/be/category.class.php +++ b/main/gradebook/lib/be/category.class.php @@ -1823,7 +1823,7 @@ class Category implements GradebookItem $session_id, false ); - // inside a course + // inside a course } elseif (!empty($this->course_code)) { return self::load( null, @@ -1844,7 +1844,7 @@ class Category implements GradebookItem $session_id, $order ); - // course independent + // course independent } else { return self::load( null, diff --git a/main/inc/ajax/model.ajax.php b/main/inc/ajax/model.ajax.php index ddba2386b8..ac19de52d5 100755 --- a/main/inc/ajax/model.ajax.php +++ b/main/inc/ajax/model.ajax.php @@ -2084,7 +2084,7 @@ 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'; + //$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'; diff --git a/main/inc/ajax/skill.ajax.php b/main/inc/ajax/skill.ajax.php index 9298c6252b..f99cdc1fc4 100755 --- a/main/inc/ajax/skill.ajax.php +++ b/main/inc/ajax/skill.ajax.php @@ -55,7 +55,7 @@ switch ($action) { foreach ($gradebooks as $gradebook) { if ($gradebook['parent_id'] == 0 && !empty($gradebook['certif_min_score']) && !empty($gradebook['document_id'])) { $gradebook_list[] = $gradebook; - //$gradebook['name'] = $gradebook['name']; + //$gradebook['name'] = $gradebook['name']; //$gradebook_list[] = $gradebook; } else { // $gradebook['name'] = $gradebook_list[$gradebook['parent_id']]['name'].' > '.$gradebook['name']; diff --git a/main/inc/global.inc.php b/main/inc/global.inc.php index bafe565d31..3005fd34fe 100755 --- a/main/inc/global.inc.php +++ b/main/inc/global.inc.php @@ -600,7 +600,7 @@ if (!isset($_SESSION['login_as']) && isset($_user)) { if ($res_logout_date < time() - $lifeTime) { // it isn't, we should create a fresh entry Event::eventLogin($_user['user_id']); - // now that it's created, we can get its ID and carry on + // now that it's created, we can get its ID and carry on } else { $sql = "UPDATE $tbl_track_login SET logout_date = '$now' WHERE login_id = '$i_id_last_connection'"; diff --git a/main/inc/lib/AnnouncementManager.php b/main/inc/lib/AnnouncementManager.php index b14282d46e..a8777a5599 100755 --- a/main/inc/lib/AnnouncementManager.php +++ b/main/inc/lib/AnnouncementManager.php @@ -1537,7 +1537,7 @@ class AnnouncementManager $extraGroupCondition $groupBy ORDER BY display_order DESC"; - //GROUP BY ip.ref + //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 @@ -1557,7 +1557,7 @@ class AnnouncementManager $groupBy ORDER BY display_order DESC"; - //GROUP BY ip.ref + //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 diff --git a/main/inc/lib/agenda.lib.php b/main/inc/lib/agenda.lib.php index 6d4a9f1de9..4f6d2870a4 100644 --- a/main/inc/lib/agenda.lib.php +++ b/main/inc/lib/agenda.lib.php @@ -3907,7 +3907,7 @@ class Agenda ); $result .= ''; $html .= $result; - //echo Display::div($content, array('id'=>'main_'.$value['calendar_type'].'_'.$value['id'], 'class' => 'dialog')); + //echo Display::div($content, array('id'=>'main_'.$value['calendar_type'].'_'.$value['id'], 'class' => 'dialog')); } else { $html .= $result .= $icon.''; } diff --git a/main/inc/lib/course_home.lib.php b/main/inc/lib/course_home.lib.php index 1f702d796f..24922fb1e4 100755 --- a/main/inc/lib/course_home.lib.php +++ b/main/inc/lib/course_home.lib.php @@ -169,7 +169,7 @@ class CourseHome $cell_content .= ''.$tool_name.''.$tool_name.''; } elseif (strpos($tool['name'], 'chat') !== false && api_get_course_setting('allow_open_chat_window')) { $cell_content .= ''.$tool_name.''.$tool_name.''; - // don't replace img with display::return_icon because $tool['img'] = api_get_path(WEB_IMG_PATH).$tool['img'] + // don't replace img with display::return_icon because $tool['img'] = api_get_path(WEB_IMG_PATH).$tool['img'] } else { $cell_content .= ''.$tool_name.''.$tool_name.''; // don't replace img with display::return_icon because $tool['img'] = api_get_path(WEB_IMG_PATH).$tool['img'] @@ -181,7 +181,7 @@ class CourseHome $cell_content .= ''.$tool_name.''.$tool_name.''; } elseif (strpos($tool['name'], 'chat') !== false && api_get_course_setting('allow_open_chat_window')) { $cell_content .= ''.$tool_name.''.$tool_name.''; - // don't replace img with display::return_icon because $tool['img'] = api_get_path(WEB_IMG_PATH).$tool['img'] + // don't replace img with display::return_icon because $tool['img'] = api_get_path(WEB_IMG_PATH).$tool['img'] } else { $cell_content .= ' '.$tool_name.''.$tool_name.''; diff --git a/main/inc/lib/events.lib.php b/main/inc/lib/events.lib.php index 39a892dac8..dea7fae774 100644 --- a/main/inc/lib/events.lib.php +++ b/main/inc/lib/events.lib.php @@ -2040,7 +2040,7 @@ class Event counter = counter + 1 WHERE course_access_id = $courseAccessId"; Database::query($sql); - //} + //} } else { $insert = true; } diff --git a/main/inc/lib/exercise_show_functions.lib.php b/main/inc/lib/exercise_show_functions.lib.php index d0d96926c5..45cc4b4c34 100755 --- a/main/inc/lib/exercise_show_functions.lib.php +++ b/main/inc/lib/exercise_show_functions.lib.php @@ -366,7 +366,7 @@ class ExerciseShowFunctions if ($studentChoice) { if ($answerCorrect) { $color = 'green'; - //echo ''.nl2br($answerComment).''; + //echo ''.nl2br($answerComment).''; } else { $color = 'black'; //echo ''.nl2br($answerComment).''; diff --git a/main/inc/lib/myspace.lib.php b/main/inc/lib/myspace.lib.php index eb11f1539e..321de77ccd 100644 --- a/main/inc/lib/myspace.lib.php +++ b/main/inc/lib/myspace.lib.php @@ -2325,7 +2325,7 @@ class MySpace $sql_select = "SELECT user_id FROM $table_user WHERE username ='$user_name' "; $rs = Database::query($sql_select); $user['create'] = Database::result($rs, 0, 0); - // This should be the ID because the user exists. + // This should be the ID because the user exists. } else { $user['create'] = $is_session_avail; } diff --git a/main/inc/lib/tracking.lib.php b/main/inc/lib/tracking.lib.php index f58e3f5bad..f12ed9f902 100755 --- a/main/inc/lib/tracking.lib.php +++ b/main/inc/lib/tracking.lib.php @@ -5413,7 +5413,7 @@ class Tracking $html .= Display::tag('td', $position); $html .= Display::tag('td', $best_score); $html .= Display::tag('td', $graph); - //$html .= Display::tag('td', $latest_attempt_url, array('align'=>'center', 'width'=>'25')); + //$html .= Display::tag('td', $latest_attempt_url, array('align'=>'center', 'width'=>'25')); } else { // Exercise configuration NO results $html .= Display::tag('td', $attempts); diff --git a/main/inc/local.inc.php b/main/inc/local.inc.php index a0f8ba2651..c3e9ce6866 100755 --- a/main/inc/local.inc.php +++ b/main/inc/local.inc.php @@ -538,7 +538,7 @@ if (!empty($_SESSION['_user']['user_id']) && !($login || $logout)) { /* >>>>>>>> External authentication modules <<<<<<<<< */ // see configuration.php to define these include_once($extAuthSource[$key]['login']); - /* >>>>>>>> External authentication modules <<<<<<<<< */ + /* >>>>>>>> External authentication modules <<<<<<<<< */ } else { // no standard Chamilo login - try external authentification //huh... nothing to do... we shouldn't get here error_log( diff --git a/main/install/install.lib.php b/main/install/install.lib.php index 000e48acd0..9b8d6cd1fc 100755 --- a/main/install/install.lib.php +++ b/main/install/install.lib.php @@ -2009,7 +2009,7 @@ function check_course_script_interpretation( } } fclose($fp); - //Check allow_url_fopen + //Check allow_url_fopen } elseif (ini_get('allow_url_fopen')) { if ($fp = @fopen($url, 'r')) { while ($result = fgets($fp, 1024)) { diff --git a/main/lp/learnpath.class.php b/main/lp/learnpath.class.php index a1724e8e30..fcf5c42a29 100755 --- a/main/lp/learnpath.class.php +++ b/main/lp/learnpath.class.php @@ -5418,7 +5418,7 @@ class learnpath error_log('New LP - In learnpath::stop_previous_item() - '.$this->last.' in lp_type 3 is <> au', 0); } $this->items[$this->last]->close(); - //$this->autocomplete_parents($this->last); + //$this->autocomplete_parents($this->last); //$this->update_queue[$this->last] = $this->items[$this->last]->get_status(); } else { if ($this->debug > 2) { @@ -5432,7 +5432,7 @@ class learnpath error_log('New LP - In learnpath::stop_previous_item() - '.$this->last.' in lp_type 2 is <> sco', 0); } $this->items[$this->last]->close(); - //$this->autocomplete_parents($this->last); + //$this->autocomplete_parents($this->last); //$this->update_queue[$this->last] = $this->items[$this->last]->get_status(); } else { if ($this->debug > 2) { diff --git a/main/lp/lp_final_item.php b/main/lp/lp_final_item.php index 04e16bbc98..ca72dc4ad7 100644 --- a/main/lp/lp_final_item.php +++ b/main/lp/lp_final_item.php @@ -115,7 +115,7 @@ if ($accessGranted == false) { $downloadCertificateLink, $badgeLink ); - // TODO: Missing validation of learning path completion + // TODO: Missing validation of learning path completion } else { // A gradebook was found, proceed... /** @var Category $category */ diff --git a/main/lp/scorm.class.php b/main/lp/scorm.class.php index 7f27d83ba2..7d8c2dddc1 100755 --- a/main/lp/scorm.class.php +++ b/main/lp/scorm.class.php @@ -218,7 +218,7 @@ class scorm extends learnpath } } unset($doc); - // End parsing using PHP5 DOMXML methods. + // End parsing using PHP5 DOMXML methods. } else { if ($this->debug > 1) { error_log('New LP - Could not open/read file '.$file); diff --git a/main/webservices/http-auth.php b/main/webservices/http-auth.php index f735208df7..7437253d9c 100755 --- a/main/webservices/http-auth.php +++ b/main/webservices/http-auth.php @@ -41,7 +41,7 @@ function getDigest() // mod_php if (isset($_SERVER['PHP_AUTH_DIGEST'])) { $digest = $_SERVER['PHP_AUTH_DIGEST']; - // most other servers + // most other servers } elseif (isset($_SERVER['HTTP_AUTHENTICATION'])) { if (strpos( strtolower($_SERVER['HTTP_AUTHENTICATION']), diff --git a/main/webservices/registration.soap.php b/main/webservices/registration.soap.php index f4b890c48a..432171096a 100755 --- a/main/webservices/registration.soap.php +++ b/main/webservices/registration.soap.php @@ -329,7 +329,7 @@ function WSCreateUsers($params) $userManager->updateUser($user, true); $results[] = $user_id; continue; - //return $r_check_user[0]; + //return $r_check_user[0]; } else { $results[] = 0; continue; diff --git a/main/webservices/webservice_user.php b/main/webservices/webservice_user.php index 3837a418bc..a1a4f7c62c 100755 --- a/main/webservices/webservice_user.php +++ b/main/webservices/webservice_user.php @@ -319,14 +319,14 @@ 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'); - }*/ + /*$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; } diff --git a/main/wiki/wiki.inc.php b/main/wiki/wiki.inc.php index 6edbabdfec..19554af190 100755 --- a/main/wiki/wiki.inc.php +++ b/main/wiki/wiki.inc.php @@ -2722,7 +2722,7 @@ class Wiki $search_term )."%' AND ".$groupfilter.$condition_session.""; - //search all pages and all versions + //search all pages and all versions } else { $sql = "SELECT * FROM ".$tbl_wiki." WHERE @@ -2751,7 +2751,7 @@ class Wiki s2.c_id = $course_id AND s1.reflink = s2.reflink AND ".$groupfilter.$condition_session.")"; - // warning don't use group by reflink because don't return the last version + // warning don't use group by reflink because don't return the last version } else { $sql = "SELECT * FROM ".$tbl_wiki." s1 WHERE @@ -2783,7 +2783,7 @@ class Wiki $search_term )."%' AND ".$groupfilter.$condition_session.""; - //search all pages and all versions + //search all pages and all versions } else { $sql = "SELECT * FROM ".$tbl_wiki." WHERE @@ -2813,7 +2813,7 @@ class Wiki WHERE s2.c_id = $course_id AND s1.reflink = s2.reflink AND ".$groupfilter.$condition_session.")"; - // warning don't use group by reflink because don't return the last version + // warning don't use group by reflink because don't return the last version } else { $sql = "SELECT * FROM ".$tbl_wiki." s1 WHERE @@ -4460,7 +4460,7 @@ class Wiki s1.reflink = s2.reflink AND '.$groupfilter.' AND session_id='.$session_id.')'; - // warning don't use group by reflink because does not return the last version + // warning don't use group by reflink because does not return the last version } else { $sql = 'SELECT * FROM '.$tbl_wiki.' s1 WHERE visibility=1 AND s1.c_id = '.$course_id.' AND id=( @@ -4899,7 +4899,7 @@ class Wiki )."%' AND id=( SELECT MAX(s2.id) FROM ".$tbl_wiki." s2 WHERE s2.c_id = $course_id AND s1.reflink = s2.reflink AND ".$groupfilter.$condition_session.")"; - //add blank space after like '%" " %' to identify each word + //add blank space after like '%" " %' to identify each word } else { $sql = "SELECT * FROM ".$tbl_wiki." s1 WHERE s1.c_id = $course_id AND visibility=1 AND linksto LIKE '%".Database::escape_string( diff --git a/main/work/work.lib.php b/main/work/work.lib.php index f386feb3e3..52b430b7b1 100755 --- a/main/work/work.lib.php +++ b/main/work/work.lib.php @@ -2032,7 +2032,7 @@ function get_work_user_list( if (!empty($work_data)) { if (!empty($group_id)) { $extra_conditions = " work.post_group_id = '".intval($groupIid)."' "; - // set to select only messages posted by the user's group + // set to select only messages posted by the user's group } else { $extra_conditions = " (work.post_group_id = '0' OR work.post_group_id is NULL) "; } diff --git a/plugin/buycourses/src/paypalfunctions.php b/plugin/buycourses/src/paypalfunctions.php index 7f327b9137..a204b8ddcf 100644 --- a/plugin/buycourses/src/paypalfunctions.php +++ b/plugin/buycourses/src/paypalfunctions.php @@ -391,7 +391,7 @@ function hash_call($methodName, $nvpStr) // moving to display page to display curl errors $_SESSION['curl_error_no'] = curl_errno($ch); $_SESSION['curl_error_msg'] = curl_error($ch); - //Execute the Error handling module to display errors. + //Execute the Error handling module to display errors. } else { //closing the curl curl_close($ch); diff --git a/src/Chamilo/CourseBundle/Component/CourseCopy/CourseBuilder.php b/src/Chamilo/CourseBundle/Component/CourseCopy/CourseBuilder.php index 3a87bf4e3a..d5bda310e5 100644 --- a/src/Chamilo/CourseBundle/Component/CourseCopy/CourseBuilder.php +++ b/src/Chamilo/CourseBundle/Component/CourseCopy/CourseBuilder.php @@ -585,7 +585,7 @@ class CourseBuilder } $sql = "SELECT * FROM $table_qui WHERE c_id = $courseId AND active >=0 $session_condition"; - //select only quizzes with active = 0 or 1 (not -1 which is for deleted quizzes) + //select only quizzes with active = 0 or 1 (not -1 which is for deleted quizzes) } else { $sql = "SELECT * FROM $table_qui WHERE c_id = $courseId AND active >=0 AND (session_id = 0 OR session_id IS NULL)";