Browse Source

Applied fixes from FlintCI

Julio Montoya 7 years ago
parent
commit
3c271b5819

+ 1 - 1
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 {

+ 1 - 1
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) {

+ 1 - 1
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])) {

+ 1 - 1
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']);
             }

+ 3 - 3
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();

+ 1 - 1
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';

+ 1 - 1
main/forum/viewpost.php

@@ -133,7 +133,7 @@ if ($message != 'PostDeletedSpecial') {
             ) {
                 if ($current_forum['locked'] <> 1 && $current_forum['locked'] <> 1) {
                     echo '&nbsp;&nbsp;';
-                    /*echo '<a href="newthread.php?'.api_get_cidreq().'&forum='.Security::remove_XSS($_GET['forum']).$origin_string.'">'.Display::return_icon('new_thread.png','','',ICON_SIZE_MEDIUM).'</a>';*/
+                /*echo '<a href="newthread.php?'.api_get_cidreq().'&forum='.Security::remove_XSS($_GET['forum']).$origin_string.'">'.Display::return_icon('new_thread.png','','',ICON_SIZE_MEDIUM).'</a>';*/
                 } else {
                     echo get_lang('ForumLocked');
                 }

+ 2 - 2
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,

+ 1 - 1
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';

+ 1 - 1
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'];

+ 1 - 1
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'";

+ 2 - 2
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

+ 1 - 1
main/inc/lib/agenda.lib.php

@@ -3907,7 +3907,7 @@ class Agenda
                                 );
                                 $result .= '</div>';
                                 $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.'</div>';
                             }

+ 2 - 2
main/inc/lib/course_home.lib.php

@@ -169,7 +169,7 @@ class CourseHome
                     $cell_content .= '<a  href="javascript: void(0);" onclick="javascript: window.open(\''.$tool['link'].$link_annex.'\',\'window_visio'.api_get_course_id().'\',config=\'height=\'+730+\', width=\'+1020+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')" target="'.$tool['target'].'"><img src="'.$tool['img'].'" title="'.$tool_name.'" alt="'.$tool_name.'" align="absmiddle" border="0">'.$tool_name.'</a>';
                 } elseif (strpos($tool['name'], 'chat') !== false && api_get_course_setting('allow_open_chat_window')) {
                     $cell_content .= '<a href="javascript: void(0);" onclick="javascript: window.open(\''.$tool['link'].$link_annex.'\',\'window_chat'.api_get_course_id().'\',config=\'height=\'+600+\', width=\'+825+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')" target="'.$tool['target'].'"><img src="'.$tool['img'].'" title="'.$tool_name.'" alt="'.$tool_name.'" align="absmiddle" border="0">'.$tool_name.'</a>';
-                    // 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 .= '<a href="'.$tool['link'].$link_annex.'" target="'.$tool['target'].'"><img src="'.$tool['img'].'" title="'.$tool_name.'" alt="'.$tool_name.'" align="absmiddle" border="0">'.$tool_name.'</a>';
                     // 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 .= '<a  href="javascript: void(0);" onclick="window.open(\''.$tool['link'].$link_annex.'\',\'window_visio'.api_get_course_id().'\',config=\'height=\'+730+\', width=\'+1020+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')" target="'.$tool['target'].'"><img src="'.str_replace(".gif", "_na.gif", $tool['img']).'" title="'.$tool_name.'" alt="'.$tool_name.'" align="absmiddle" border="0">'.$tool_name.'</a>';
                     } elseif (strpos($tool['name'], 'chat') !== false && api_get_course_setting('allow_open_chat_window')) {
                         $cell_content .= '<a href="javascript: void(0);" onclick="javascript: window.open(\''.$tool['link'].$link_annex.'\',\'window_chat'.api_get_course_id().'\',config=\'height=\'+600+\', width=\'+825+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')" target="'.$tool['target'].'" class="text-muted"><img src="'.str_replace(".gif", "_na.gif", $tool['img']).'" title="'.$tool_name.'" alt="'.$tool_name.'" align="absmiddle" border="0">'.$tool_name.'</a>';
-                        // 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 .= '<a href="'.$tool['link'].$link_annex.'" target="'.$tool['target'].'" class="text-muted">
                                             <img src="'.str_replace(".gif", "_na.gif", $tool['img']).'" title="'.$tool_name.'" alt="'.$tool_name.'" align="absmiddle" border="0">'.$tool_name.'</a>';

+ 1 - 1
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;
             }

+ 1 - 1
main/inc/lib/exercise_show_functions.lib.php

@@ -366,7 +366,7 @@ class ExerciseShowFunctions
             if ($studentChoice) {
                 if ($answerCorrect) {
                     $color = 'green';
-                    //echo '<span style="font-weight: bold; color: #008000;">'.nl2br($answerComment).'</span>';
+                //echo '<span style="font-weight: bold; color: #008000;">'.nl2br($answerComment).'</span>';
                 } else {
                     $color = 'black';
                     //echo '<span style="font-weight: bold; color: #FF0000;">'.nl2br($answerComment).'</span>';

+ 1 - 1
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;
                     }

+ 1 - 1
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);

+ 1 - 1
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(

+ 1 - 1
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)) {

+ 2 - 2
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) {

+ 1 - 1
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 */

+ 1 - 1
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);

+ 1 - 1
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']),

+ 1 - 1
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;

+ 8 - 8
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;
         }

+ 6 - 6
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(

+ 1 - 1
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) ";
         }

+ 1 - 1
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);

+ 1 - 1
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)";