Browse Source

Merge pull request #1872 from chamilo/scrutinizer-patch-1

Scrutinizer Auto-Fixes
Julio Montoya 7 years ago
parent
commit
05bdf0fdf1
36 changed files with 299 additions and 299 deletions
  1. 10 10
      main/admin/access_url_add_courses_to_url.php
  2. 21 21
      main/admin/course_edit.php
  3. 4 4
      main/admin/course_import.php
  4. 11 11
      main/admin/grade_models.php
  5. 46 46
      main/admin/ldap_synchro.php
  6. 2 2
      main/admin/legal_list.php
  7. 2 2
      main/admin/skill_edit.php
  8. 8 8
      main/admin/sub_language_ajax.inc.php
  9. 6 6
      main/announcements/download.php
  10. 1 1
      main/attendance/calendar_logins.php
  11. 3 3
      main/blog/download.php
  12. 1 1
      main/document/slideshow.inc.php
  13. 30 30
      main/gradebook/gradebook_view_result.php
  14. 4 4
      main/gradebook/lib/gradebook_data_generator.class.php
  15. 1 1
      main/inc/ajax/thematic.ajax.php
  16. 5 5
      main/inc/lib/course_description.lib.php
  17. 4 4
      main/inc/lib/legal.lib.php
  18. 11 11
      main/lp/lp_final_item.php
  19. 1 1
      main/reports/index.php
  20. 2 2
      main/session/add_teachers_to_session.php
  21. 18 18
      main/session/session_course_list.php
  22. 35 35
      main/session/session_course_user_list.php
  23. 22 22
      main/session/session_export.php
  24. 8 8
      main/social/group_waiting_list.php
  25. 11 11
      main/upload/upload_word.php
  26. 1 1
      main/work/student_work.php
  27. 2 2
      main/work/view.php
  28. 10 10
      main/work/work.php
  29. 2 2
      main/work/work_list_others.php
  30. 2 2
      main/work/work_missing.php
  31. 4 4
      plugin/advanced_subscription/test/ws_session_user.php
  32. 5 5
      plugin/buycourses/src/process_confirm.php
  33. 3 3
      plugin/buycourses/src/service_success.php
  34. 1 1
      plugin/customfooter/plugin.php
  35. 1 1
      plugin/google_maps/src/map_coordinates.php
  36. 1 1
      plugin/ims_lti/ImsLtiTool.php

+ 10 - 10
main/admin/access_url_add_courses_to_url.php

@@ -10,7 +10,7 @@
 $cidReset = true;
 require_once __DIR__.'/../inc/global.inc.php';
 
-$this_section=SECTION_PLATFORM_ADMIN;
+$this_section = SECTION_PLATFORM_ADMIN;
 
 api_protect_global_admin_script();
 
@@ -21,7 +21,7 @@ if (!api_get_multiple_access_url()) {
 
 $form_sent = 0;
 $first_letter_course = '';
-$courses = array ();
+$courses = array();
 $url_list = array();
 $users = array();
 
@@ -32,8 +32,8 @@ $tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
 
 /*	Header   */
 $tool_name = get_lang('AddCoursesToURL');
-$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
-$interbreadcrumb[] = array ('url' => 'access_urls.php', 'name' => get_lang('MultipleAccessURLs'));
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
+$interbreadcrumb[] = array('url' => 'access_urls.php', 'name' => get_lang('MultipleAccessURLs'));
 
 Display :: display_header($tool_name);
 
@@ -48,8 +48,8 @@ api_display_tool_title($tool_name);
 
 if (isset($_POST['form_sent']) && $_POST['form_sent']) {
     $form_sent = $_POST['form_sent'];
-    $courses = is_array($_POST['course_list']) ? $_POST['course_list'] : array() ;
-    $url_list = is_array($_POST['url_list']) ? $_POST['url_list'] : array() ;
+    $courses = is_array($_POST['course_list']) ? $_POST['course_list'] : array();
+    $url_list = is_array($_POST['url_list']) ? $_POST['url_list'] : array();
     $first_letter_course = $_POST['first_letter_course'];
 
     foreach ($users as $key => $value) {
@@ -70,7 +70,7 @@ if (empty($first_letter_user)) {
     $sql = "SELECT count(*) as num_courses FROM $tbl_course";
     $result = Database::query($sql);
     $num_row = Database::fetch_array($result);
-    if ($num_row['num_courses']>1000) {
+    if ($num_row['num_courses'] > 1000) {
         //if there are too much num_courses to gracefully handle with the HTML select list,
         // assign a default filter on users names
         $first_letter_user = 'A';
@@ -106,7 +106,7 @@ unset($result);
       <option value="">--</option>
       <?php
         echo Display :: get_alphabet_options($first_letter_course);
-        echo Display :: get_numeric_options(0,9,$first_letter_course);
+        echo Display :: get_numeric_options(0, 9, $first_letter_course);
       ?>
      </select>
     </td>
@@ -119,7 +119,7 @@ unset($result);
     <td width="40%" align="center">
      <select name="course_list[]" multiple="multiple" size="20" style="width:400px;">
 		<?php foreach ($db_courses as $course) { ?>
-			<option value="<?php echo $course['code']; ?>" <?php if(in_array($course['code'],$courses)) echo 'selected="selected"'; ?>><?php echo $course['title'].' ('.$course['code'].')'; ?>
+			<option value="<?php echo $course['code']; ?>" <?php if (in_array($course['code'], $courses)) echo 'selected="selected"'; ?>><?php echo $course['title'].' ('.$course['code'].')'; ?>
             </option>
         <?php } ?>
     </select>
@@ -130,7 +130,7 @@ unset($result);
    <td width="40%" align="center">
     <select name="url_list[]" multiple="multiple" size="20" style="width:300px;">
 		<?php foreach ($db_urls as $url_obj) { ?>
-        <option value="<?php echo $url_obj['id']; ?>" <?php if(in_array($url_obj['id'],$url_list)) echo 'selected="selected"'; ?>><?php echo $url_obj['url']; ?>
+        <option value="<?php echo $url_obj['id']; ?>" <?php if (in_array($url_obj['id'], $url_list)) echo 'selected="selected"'; ?>><?php echo $url_obj['url']; ?>
         </option>
 		<?php } ?>
     </select>

+ 21 - 21
main/admin/course_edit.php

@@ -42,7 +42,7 @@ $sql = "SELECT user.user_id,lastname,firstname
         WHERE
             course_user.status='1' AND
             course_user.user_id=user.user_id AND
-            course_user.c_id ='" . $courseId . "'" .
+            course_user.c_id ='".$courseId."'".
         $order_clause;
 $res = Database::query($sql);
 $course_teachers = array();
@@ -58,18 +58,18 @@ if (api_is_multiple_url_enabled()) {
             INNER JOIN $access_url_rel_user_table url_rel_user
             ON (u.user_id=url_rel_user.user_id)
             WHERE
-                url_rel_user.access_url_id=" . api_get_current_access_url_id() . " AND
+                url_rel_user.access_url_id=".api_get_current_access_url_id()." AND
                 status = 1" . $order_clause;
 } else {
     $sql = "SELECT user_id, lastname, firstname
-            FROM $table_user WHERE status='1'" . $order_clause;
+            FROM $table_user WHERE status='1'".$order_clause;
 }
 $courseInfo['tutor_name'] = null;
 
 $res = Database::query($sql);
 $teachers = array();
 $allTeachers = array();
-$platform_teachers[0] = '-- ' . get_lang('NoManager') . ' --';
+$platform_teachers[0] = '-- '.get_lang('NoManager').' --';
 while ($obj = Database::fetch_object($res)) {
     $allTeachers[$obj->user_id] = api_get_person_name($obj->firstname, $obj->lastname);
     if (!array_key_exists($obj->user_id, $course_teachers)) {
@@ -87,7 +87,7 @@ while ($obj = Database::fetch_object($res)) {
 
 // Case where there is no teacher in the course
 if (count($course_teachers) == 0) {
-    $sql = 'SELECT tutor_name FROM ' . $course_table . ' WHERE code="' . $course_code . '"';
+    $sql = 'SELECT tutor_name FROM '.$course_table.' WHERE code="'.$course_code.'"';
     $res = Database::query($sql);
     $tutor_name = Database::result($res, 0, 0);
     $courseInfo['tutor_name'] = array_search($tutor_name, $platform_teachers);
@@ -95,7 +95,7 @@ if (count($course_teachers) == 0) {
 
 // Build the form
 $form = new FormValidator('update_course', 'post', api_get_self().'?id='.$courseId);
-$form->addElement('header', get_lang('Course') . '  #' . $courseInfo['real_id'] . ' ' . $course_code);
+$form->addElement('header', get_lang('Course').'  #'.$courseInfo['real_id'].' '.$course_code);
 $form->addElement('hidden', 'code', $course_code);
 
 //title
@@ -151,14 +151,14 @@ if (!empty($coursesInSession)) {
             }
         }
 
-        $groupName = 'session_coaches[' . $sessionId . ']';
-        $platformTeacherId = 'platform_teachers_by_session_' . $sessionId;
-        $coachId = 'coaches_by_session_' . $sessionId;
+        $groupName = 'session_coaches['.$sessionId.']';
+        $platformTeacherId = 'platform_teachers_by_session_'.$sessionId;
+        $coachId = 'coaches_by_session_'.$sessionId;
 
         $platformTeacherName = 'platform_teachers_by_session';
         $coachName = 'coaches_by_session';
 
-        $sessionUrl = api_get_path(WEB_CODE_PATH) . 'session/resume_session.php?id_session=' . $sessionId;
+        $sessionUrl = api_get_path(WEB_CODE_PATH).'session/resume_session.php?id_session='.$sessionId;
         $form->addElement(
             'advmultiselect',
             $groupName,
@@ -166,7 +166,7 @@ if (!empty($coursesInSession)) {
                 $session['name'],
                 $sessionUrl,
                 array('target' => '_blank')
-            ) . ' - ' . get_lang('Coaches'),
+            ).' - '.get_lang('Coaches'),
             $allTeachers
         );
         $courseInfo[$groupName] = $sessionTeachers;
@@ -174,7 +174,7 @@ if (!empty($coursesInSession)) {
 }
 
 // Category code
-$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';
 
 $categorySelect = $form->addElement(
     'select_ajax',
@@ -200,11 +200,11 @@ $form->applyFilter('department_url', 'trim');
 $form->addSelectLanguage('course_language', get_lang('CourseLanguage'));
 
 $group = array();
-$group[]= $form->createElement('radio', 'visibility', get_lang("CourseAccess"), get_lang('OpenToTheWorld'), COURSE_VISIBILITY_OPEN_WORLD);
-$group[]= $form->createElement('radio', 'visibility', null, get_lang('OpenToThePlatform'), COURSE_VISIBILITY_OPEN_PLATFORM);
-$group[]= $form->createElement('radio', 'visibility', null, get_lang('Private'), COURSE_VISIBILITY_REGISTERED);
-$group[]= $form->createElement('radio', 'visibility', null, get_lang('CourseVisibilityClosed'), COURSE_VISIBILITY_CLOSED);
-$group[]= $form->createElement('radio', 'visibility', null, get_lang('CourseVisibilityHidden'), COURSE_VISIBILITY_HIDDEN);
+$group[] = $form->createElement('radio', 'visibility', get_lang("CourseAccess"), get_lang('OpenToTheWorld'), COURSE_VISIBILITY_OPEN_WORLD);
+$group[] = $form->createElement('radio', 'visibility', null, get_lang('OpenToThePlatform'), COURSE_VISIBILITY_OPEN_PLATFORM);
+$group[] = $form->createElement('radio', 'visibility', null, get_lang('Private'), COURSE_VISIBILITY_REGISTERED);
+$group[] = $form->createElement('radio', 'visibility', null, get_lang('CourseVisibilityClosed'), COURSE_VISIBILITY_CLOSED);
+$group[] = $form->createElement('radio', 'visibility', null, get_lang('CourseVisibilityHidden'), COURSE_VISIBILITY_HIDDEN);
 $form->addGroup($group, '', get_lang('CourseAccess'));
 
 $group = array();
@@ -228,7 +228,7 @@ $extra = $extra_field->addElements($form, $courseId);
 $htmlHeadXtra[] = '
 <script>
 $(function() {
-    ' . $extra['jquery_ready_content'] . '
+    ' . $extra['jquery_ready_content'].'
 });
 </script>';
 
@@ -283,7 +283,7 @@ if ($form->validate()) {
         foreach ($list as $course_temp) {
             if ($course_temp['code'] != $course_code) {
                 $visual_code_is_used = true;
-                $warn .= ' ' . $course_temp['title'] . ' (' . $course_temp['code'] . '),';
+                $warn .= ' '.$course_temp['title'].' ('.$course_temp['code'].'),';
             }
         }
         $warn = substr($warn, 0, -1);
@@ -302,7 +302,7 @@ if ($form->validate()) {
     $course['course_code'] = $course_code;
 
     if (!stristr($department_url, 'http://')) {
-        $department_url = 'http://' . $department_url;
+        $department_url = 'http://'.$department_url;
     }
 
     Database::query($sql);
@@ -367,7 +367,7 @@ if ($form->validate()) {
     if (array_key_exists('add_teachers_to_sessions_courses', $courseInfo)) {
         $sql = "UPDATE $course_table SET
                 add_teachers_to_sessions_courses = '$addTeacherToSessionCourses'
-                WHERE id = " . $courseInfo['real_id'];
+                WHERE id = ".$courseInfo['real_id'];
         Database::query($sql);
     }
 

+ 4 - 4
main/admin/course_import.php

@@ -15,13 +15,13 @@
  */
 function validate_courses_data($courses)
 {
-    $errors = array ();
-    $coursecodes = array ();
+    $errors = array();
+    $coursecodes = array();
     foreach ($courses as $index => $course) {
-        $course['line'] = $index +1;
+        $course['line'] = $index + 1;
 
         // 1. Check whether mandatory fields are set.
-        $mandatory_fields = array ('Code', 'Title', 'CourseCategory');
+        $mandatory_fields = array('Code', 'Title', 'CourseCategory');
         foreach ($mandatory_fields as $field) {
             if (empty($course[$field])) {
                 $course['error'] = get_lang($field.'Mandatory');

+ 11 - 11
main/admin/grade_models.php

@@ -20,7 +20,7 @@ if (api_get_setting('gradebook_enable_grade_model') != 'true') {
 $htmlHeadXtra[] = api_get_jqgrid_js();
 
 // setting breadcrumbs
-$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
 
 $action = isset($_GET['action']) ? $_GET['action'] : null;
 
@@ -28,16 +28,16 @@ $check = Security::check_token('request');
 $token = Security::get_token();
 
 if ($action === 'add') {
-    $interbreadcrumb[]=array('url' => 'grade_models.php','name' => get_lang('GradeModel'));
-    $interbreadcrumb[]=array('url' => '#','name' => get_lang('Add'));
+    $interbreadcrumb[] = array('url' => 'grade_models.php', 'name' => get_lang('GradeModel'));
+    $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Add'));
 } elseif ($action == 'edit') {
-    $interbreadcrumb[]=array('url' => 'grade_models.php','name' => get_lang('GradeModel'));
-    $interbreadcrumb[]=array('url' => '#','name' => get_lang('Edit'));
+    $interbreadcrumb[] = array('url' => 'grade_models.php', 'name' => get_lang('GradeModel'));
+    $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Edit'));
 } else {
-    $interbreadcrumb[]=array('url' => '#','name' => get_lang('GradeModel'));
+    $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('GradeModel'));
 }
 
-$htmlHeadXtra[]= '<script>
+$htmlHeadXtra[] = '<script>
 function plusItem(item) {
     if (item != 1) {
 		document.getElementById(item).style.display = "inline";
@@ -111,8 +111,8 @@ $extra_params['height'] = 'auto';
 
 //With this function we can add actions to the jgrid (edit, delete, etc)
 $action_links = 'function action_formatter(cellvalue, options, rowObject) {
-     return \'<a href="?action=edit&id=\'+options.rowId+\'">'.Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>'.
-     '&nbsp;<a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."\'".')) return false;"  href="?sec_token='.$token.'&action=delete&id=\'+options.rowId+\'">'.Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'.
+     return \'<a href="?action=edit&id=\'+options.rowId+\'">'.Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>'.
+     '&nbsp;<a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES))."\'".')) return false;"  href="?sec_token='.$token.'&action=delete&id=\'+options.rowId+\'">'.Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'.
      '\';
 }';
 ?>
@@ -157,7 +157,7 @@ switch ($action) {
             $obj->display();
         } else {
             echo '<div class="actions">';
-            echo '<a href="'.api_get_self().'">'.Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>';
+            echo '<a href="'.api_get_self().'">'.Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
             echo '</div>';
             $form->addElement('hidden', 'sec_token');
             $form->setConstants(array('sec_token' => $token));
@@ -179,7 +179,7 @@ switch ($action) {
             $obj->display();
         } else {
             echo '<div class="actions">';
-            echo '<a href="'.api_get_self().'">'.Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>';
+            echo '<a href="'.api_get_self().'">'.Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
             echo '</div>';
             $form->addElement('hidden', 'sec_token');
             $form->setConstants(array('sec_token' => $token));

+ 46 - 46
main/admin/ldap_synchro.php

@@ -8,47 +8,47 @@
  */
 exit(); //not yet functional, needs to be revised
 
-$cidReset=true;
+$cidReset = true;
 
 require_once __DIR__.'/../inc/global.inc.php';
 $libpath = api_get_path(LIBRARY_PATH);
 require_once('../auth/ldap/authldap.php');
-$annee_base=date('Y');
+$annee_base = date('Y');
 // setting the section (for the tabs)
 $this_section = SECTION_PLATFORM_ADMIN;
 //api_protect_admin_script(); // on vire la secu... qui n'a pas lieu d'etre ici (script de synchro)
 
 // setting breadcrumbs
-$interbreadcrumb[]=array('url' => 'index.php',"name" => get_lang('PlatformAdmin'));
-$interbreadcrumb[]=array('url' => api_get_self(),"name" => "Liste des sessions");
+$interbreadcrumb[] = array('url' => 'index.php', "name" => get_lang('PlatformAdmin'));
+$interbreadcrumb[] = array('url' => api_get_self(), "name" => "Liste des sessions");
 
 // Database Table Definitions
 $tbl_session						= Database::get_main_table(TABLE_MAIN_SESSION);
-$tbl_session_rel_class				= Database::get_main_table(TABLE_MAIN_SESSION_CLASS);
-$tbl_session_rel_course				= Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
-$tbl_session_rel_course_rel_user	= Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
-$tbl_course							= Database::get_main_table(TABLE_MAIN_COURSE);
-$tbl_user							= Database::get_main_table(TABLE_MAIN_USER);
-$tbl_session_rel_user				= Database::get_main_table(TABLE_MAIN_SESSION_USER);
-$tbl_class							= Database::get_main_table(TABLE_MAIN_CLASS);
-$tbl_class_user						= Database::get_main_table(TABLE_MAIN_CLASS_USER);
+$tbl_session_rel_class = Database::get_main_table(TABLE_MAIN_SESSION_CLASS);
+$tbl_session_rel_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
+$tbl_session_rel_course_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
+$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
+$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
+$tbl_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_USER);
+$tbl_class = Database::get_main_table(TABLE_MAIN_CLASS);
+$tbl_class_user = Database::get_main_table(TABLE_MAIN_CLASS_USER);
 
-$tbl_session_rel_etape 				= "session_rel_etape";
+$tbl_session_rel_etape = "session_rel_etape";
 
-$message="";
+$message = "";
 
-$result=Database::query("SELECT id, name FROM $tbl_session");
-$Sessions=Database::store_result($result);
+$result = Database::query("SELECT id, name FROM $tbl_session");
+$Sessions = Database::store_result($result);
 
-$result=Database::query($sql);
-$users=Database::store_result($result);
+$result = Database::query($sql);
+$users = Database::store_result($result);
 
-foreach($Sessions as $session){
+foreach ($Sessions as $session) {
 	$id_session = $session['id'];
 	$name_session = $session['name'];
-	$UserList=array();
-	$UserUpdate=array();
-	$UserAdd=array();
+	$UserList = array();
+	$UserUpdate = array();
+	$UserAdd = array();
 
 	// Parse des code etape de la session
 	/*
@@ -65,8 +65,8 @@ foreach($Sessions as $session){
 	{
 		$r = false;
 		$res = ldap_handle_bind($ds, $r);
-		$UserList=array();
-		if($result !== false)
+		$UserList = array();
+		if ($result !== false)
 		{
 			//while($row = Database::fetch_array($result))
 			//{
@@ -81,7 +81,7 @@ foreach($Sessions as $session){
 				//$sr = @ ldap_search($ds, "ou=people,$LDAPbasedn", "edupersonorgunitdn=ou=$etape,ou=$annee,ou=diploma,$LDAPbasedn");
 				$sr = @ ldap_search($ds, $ldap_basedn, '(uid=*)');
 				$info = ldap_get_entries($ds, $sr);
-				for ($key = 0; $key < $info["count"]; $key ++)
+				for ($key = 0; $key < $info["count"]; $key++)
 				{
 					echo "<pre>";
 					print_r($info[$key]);
@@ -90,28 +90,28 @@ foreach($Sessions as $session){
 					$firstname = api_utf8_decode($info[$key]["givenname"][0]);
 					$email = $info[$key]["mail"][0];
 					// Get uid from dn
-					$dn_array=ldap_explode_dn($info[$key]["dn"],1);
+					$dn_array = ldap_explode_dn($info[$key]["dn"], 1);
 					$username = $dn_array[0]; // uid is first key
 					$outab[] = $info[$key]["edupersonprimaryaffiliation"][0]; // Ici "student"
 					$val = ldap_get_values_len($ds, $sr, "userPassword");
 					$password = $val[0];
 					// Pour faciliter la gestion on ajoute le code "etape-annee"
-					$official_code=$etape."-".$annee;
-					$auth_source="ldap";
+					$official_code = $etape."-".$annee;
+					$auth_source = "ldap";
 					// Pas de date d'expiration d'etudiant (a recuperer par rapport au shadow expire LDAP)
-					$expiration_date='';
-					$active=1;
+					$expiration_date = '';
+					$active = 1;
 					// Ajout de l'utilisateur
 					if (UserManager::is_username_available($username)) {
-						$user_id = UserManager::create_user($firstname,$lastname,$status,$email,$username,$password,$official_code,api_get_setting('platformLanguage'),$phone,$picture_uri,$auth_source,$expiration_date,$active);
-						$UserAdd[]=$user_id;
+						$user_id = UserManager::create_user($firstname, $lastname, $status, $email, $username, $password, $official_code, api_get_setting('platformLanguage'), $phone, $picture_uri, $auth_source, $expiration_date, $active);
+						$UserAdd[] = $user_id;
 					} else {
 						$user = api_get_user_info_from_username($username);
-						$user_id=$user['user_id'];
+						$user_id = $user['user_id'];
 						UserManager::update_user($user_id, $firstname, $lastname, $username, null, null, $email, $status, $official_code, $phone, $picture_uri, $expiration_date, $active);
-						$UserUpdate[]=$user_id;
+						$UserUpdate[] = $user_id;
 					}
-					$UserList[]=$user_id;
+					$UserList[] = $user_id;
 				}
 			//}
 		}
@@ -125,10 +125,10 @@ foreach($Sessions as $session){
 		}
 
 		// Une fois les utilisateurs importer dans la base des utilisateurs, on peux les affecter la session
-		$result=Database::query("SELECT c_id FROM $tbl_session_rel_course WHERE session_id='$id_session'");
-		$CourseList=array();
-		while($row=Database::fetch_array($result)) {
-			$CourseList[]= $row['c_id'];
+		$result = Database::query("SELECT c_id FROM $tbl_session_rel_course WHERE session_id='$id_session'");
+		$CourseList = array();
+		while ($row = Database::fetch_array($result)) {
+			$CourseList[] = $row['c_id'];
 		}
 
 		foreach ($CourseList as $enreg_course) {
@@ -138,8 +138,8 @@ foreach($Sessions as $session){
 						VALUES('$id_session','$enreg_course','$enreg_user')";
 				Database::query($sql);
 			}
-			$sql = "SELECT COUNT(user_id) as nbUsers " .
-					"FROM $tbl_session_rel_course_rel_user " .
+			$sql = "SELECT COUNT(user_id) as nbUsers ".
+					"FROM $tbl_session_rel_course_rel_user ".
 					"WHERE session_id='$id_session' AND c_id='$enreg_course'";
 			$rs = Database::query($sql);
 			list($nbr_users) = Database::fetch_array($rs);
@@ -148,13 +148,13 @@ foreach($Sessions as $session){
 			Database::query($sql);
 		}
 		// On ajoute la relation entre l'utilisateur et la session
-		foreach($UserList as $enreg_user){
-			$sql = "INSERT IGNORE INTO $tbl_session_rel_user(session_id, user_id, registered_at) " .
-					"VALUES('$id_session','$enreg_user', '" . api_get_utc_datetime() . "')";
+		foreach ($UserList as $enreg_user) {
+			$sql = "INSERT IGNORE INTO $tbl_session_rel_user(session_id, user_id, registered_at) ".
+					"VALUES('$id_session','$enreg_user', '".api_get_utc_datetime()."')";
 			Database::query($sql);
 		}
-		$sql = "SELECT COUNT(user_id) as nbUsers " .
-				"FROM $tbl_session_rel_user " .
+		$sql = "SELECT COUNT(user_id) as nbUsers ".
+				"FROM $tbl_session_rel_user ".
 				"WHERE session_id='$id_session' AND relation_type<>".SESSION_RELATION_TYPE_RRHH."";
 		$rs = Database::query($sql);
 		list($nbr_users) = Database::fetch_array($rs);

+ 2 - 2
main/admin/legal_list.php

@@ -10,7 +10,7 @@ $cidReset = true;
 require_once __DIR__.'/../inc/global.inc.php';
 $this_section = SECTION_PLATFORM_ADMIN;
 api_protect_admin_script();
-$interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
+$interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
 $tool_name = get_lang('TermsAndConditions');
 Display :: display_header($tool_name);
 
@@ -19,7 +19,7 @@ $parameters['sec_token'] = Security::get_token();
 // action menu
 echo '<div class="actions">';
 echo '<a href="'.api_get_path(WEB_CODE_PATH).'admin/legal_add.php">'.
-    Display::return_icon('edit.gif',get_lang('EditTermsAndConditions'), '').get_lang('EditTermsAndConditions').'</a>&nbsp;&nbsp;';
+    Display::return_icon('edit.gif', get_lang('EditTermsAndConditions'), '').get_lang('EditTermsAndConditions').'</a>&nbsp;&nbsp;';
 echo '</div>';
 
 $legal_count = LegalManager::count();

+ 2 - 2
main/admin/skill_edit.php

@@ -85,7 +85,7 @@ $jquery_ready_content = $returnParams['jquery_ready_content'];
 if (!empty($jquery_ready_content)) {
     $htmlHeadXtra[] = '<script>
     $(document).ready(function(){
-        ' . $jquery_ready_content . '
+        ' . $jquery_ready_content.'
     });
     </script>';
 }
@@ -114,7 +114,7 @@ if ($editForm->validate()) {
         );
     }
 
-    header('Location: '.api_get_path(WEB_CODE_PATH) . 'admin/skill_list.php');
+    header('Location: '.api_get_path(WEB_CODE_PATH).'admin/skill_list.php');
     exit;
 }
 

+ 8 - 8
main/admin/sub_language_ajax.inc.php

@@ -12,9 +12,9 @@ require_once __DIR__.'/../inc/global.inc.php';
 
 api_protect_admin_script();
 
-$new_language        = Security::remove_XSS($_REQUEST['new_language']);
-$language_variable    = Security::remove_XSS($_REQUEST['variable_language']);
-$file_id            = intval($_REQUEST['file_id']);
+$new_language = Security::remove_XSS($_REQUEST['new_language']);
+$language_variable = Security::remove_XSS($_REQUEST['variable_language']);
+$file_id = intval($_REQUEST['file_id']);
 /**
  * Code
  */
@@ -30,10 +30,10 @@ if (isset($new_language) && isset($language_variable) && isset($file_id)) {
 
     //update variable language
     // Replace double quotes to avoid parse errors
-    $new_language = str_replace('"', '\"',$new_language);
+    $new_language = str_replace('"', '\"', $new_language);
     // Replace new line signs to avoid parse errors - see #6773
-    $new_language = str_replace("\n","\\n",$new_language);
-    $all_file_of_directory[$language_variable]="\"".$new_language."\";";
+    $new_language = str_replace("\n", "\\n", $new_language);
+    $all_file_of_directory[$language_variable] = "\"".$new_language."\";";
     $result_array = array();
 
     foreach ($all_file_of_directory as $key_value=>$value_info) {
@@ -43,7 +43,7 @@ if (isset($new_language) && isset($language_variable) && isset($file_id)) {
     if (!empty($result_array)) {
         foreach ($result_array as $key => $result) {
             if ($result == false) {
-                $variables_with_problems .=$key.' <br />';
+                $variables_with_problems .= $key.' <br />';
             }
         }
     }
@@ -53,7 +53,7 @@ if (isset($new_language) && isset($language_variable) && isset($file_id)) {
             Display::return_message(get_lang('TheNewWordHasBeenAdded'), 'success')
         );
 
-        $redirectUrl = api_get_path(WEB_CODE_PATH) . 'admin/extra_fields.php?type=';
+        $redirectUrl = api_get_path(WEB_CODE_PATH).'admin/extra_fields.php?type=';
 
         switch ($_REQUEST['extra_field_type']) {
             case ExtraField::USER_FIELD_TYPE:

+ 6 - 6
main/announcements/download.php

@@ -28,7 +28,7 @@ $doc_url = str_replace('///', '&', $doc_url);
 $doc_url = str_replace(' ', '+', $doc_url);
 $doc_url = str_replace('/..', '', $doc_url); //echo $doc_url;
 
-if (strpos($doc_url,'../') OR strpos($doc_url,'/..')) {
+if (strpos($doc_url, '../') OR strpos($doc_url, '/..')) {
     $doc_url = '';
 }
 
@@ -43,8 +43,8 @@ if (is_dir($full_file_name)) {
     //remove last slash if present
     //$doc_url = ($doc_url{strlen($doc_url)-1}=='/')?substr($doc_url,0,strlen($doc_url)-1):$doc_url;
     //mod_rewrite can change /some/path/ to /some/path// in some cases, so clean them all off (René)
-    while ($doc_url{$dul = strlen($doc_url)-1}=='/') {
-        $doc_url = substr($doc_url,0,$dul);
+    while ($doc_url{$dul = strlen($doc_url) - 1} == '/') {
+        $doc_url = substr($doc_url, 0, $dul);
     }
     //create the path
     $document_explorer = api_get_path(WEB_COURSE_PATH).api_get_course_path(); // home course path
@@ -66,10 +66,10 @@ $sql = "SELECT filename FROM $tbl_announcement_attachment
 
 $result = Database::query($sql);
 if (Database::num_rows($result) > 0) {
-    $row= Database::fetch_array($result);
-    $title = str_replace(' ','_', $row['filename']);
+    $row = Database::fetch_array($result);
+    $title = str_replace(' ', '_', $row['filename']);
     if (Security::check_abs_path($full_file_name,
-        api_get_path(SYS_COURSE_PATH) . api_get_course_path() . '/upload/announcements/')
+        api_get_path(SYS_COURSE_PATH).api_get_course_path().'/upload/announcements/')
     ) {
         $result = DocumentManager::file_send_for_download($full_file_name, true, $title);
         if ($result === false) {

+ 1 - 1
main/attendance/calendar_logins.php

@@ -4,7 +4,7 @@
 // See AttendanceController::calendarLogins function
 echo '<div class="actions">';
 echo '<a href="index.php?'.api_get_cidreq().'&action=calendar_list">'.
-    Display::return_icon('back.png',get_lang('AttendanceCalendar'),'',ICON_SIZE_MEDIUM).'</a>';
+    Display::return_icon('back.png', get_lang('AttendanceCalendar'), '', ICON_SIZE_MEDIUM).'</a>';
 echo '</div>';
 echo $form;
 echo $table;

+ 3 - 3
main/blog/download.php

@@ -12,7 +12,7 @@
 session_cache_limiter('public');
 
 require_once __DIR__.'/../inc/global.inc.php';
-$this_section=SECTION_COURSES;
+$this_section = SECTION_COURSES;
 
 // IMPORTANT to avoid caching of documents
 header('Expires: Wed, 01 Jan 1990 00:00:00 GMT');
@@ -29,7 +29,7 @@ $doc_url = str_replace('///', '&', $doc_url);
 $doc_url = str_replace(' ', '+', $doc_url);
 $doc_url = str_replace('/..', '', $doc_url); //echo $doc_url;
 
-if (! isset($_course)) {
+if (!isset($_course)) {
     api_not_allowed(true);
 }
 $full_file_name = api_get_path(SYS_COURSE_PATH).api_get_course_path().'/upload/blog/'.$doc_url;
@@ -37,7 +37,7 @@ $full_file_name = api_get_path(SYS_COURSE_PATH).api_get_course_path().'/upload/b
 //if the rewrite rule asks for a directory, we redirect to the course view
 if (is_dir($full_file_name)) {
     //remove last slash if present
-    while ($doc_url{$dul = strlen($doc_url)-1}=='/') $doc_url = substr($doc_url,0,$dul);
+    while ($doc_url{$dul = strlen($doc_url) - 1} == '/') $doc_url = substr($doc_url, 0, $dul);
     //create the path
     $document_explorer = api_get_path(WEB_COURSE_PATH).api_get_course_path(); // home course path
     //redirect

+ 1 - 1
main/document/slideshow.inc.php

@@ -34,7 +34,7 @@
 function resize_image($image, $target_width, $target_height, $slideshow = 0) {
     // Modifications by Ivan Tcholakov, 04-MAY-2009.
     $result = array();
-    if ( (isset($_SESSION['image_resizing']) && $_SESSION['image_resizing']== 'resizing') or $slideshow == 1) {
+    if ((isset($_SESSION['image_resizing']) && $_SESSION['image_resizing'] == 'resizing') or $slideshow == 1) {
         $new_sizes = api_resize_image($image, $target_width, $target_height);
         $result[] = $new_sizes['height'];
         $result[] = $new_sizes['width'];

+ 30 - 30
main/gradebook/gradebook_view_result.php

@@ -62,7 +62,7 @@ if (isset($_GET['editres'])) {
         $resultedit[0],
         'edit_result_form',
         null,
-        api_get_self() . '?editres=' . $resultedit[0]->get_id() . '&selecteval=' . $select_eval.'&'.api_get_cidreq()
+        api_get_self().'?editres='.$resultedit[0]->get_id().'&selecteval='.$select_eval.'&'.api_get_cidreq()
     );
 
     if ($edit_res_form->validate()) {
@@ -81,21 +81,21 @@ if (isset($_GET['editres'])) {
         unset($result);
 
         Display::addFlash(Display::return_message(get_lang('ResultEdited'), 'normal', false));
-        header('Location: gradebook_view_result.php?selecteval=' . $select_eval . '&editresmessage=&'.api_get_cidreq());
+        header('Location: gradebook_view_result.php?selecteval='.$select_eval.'&editresmessage=&'.api_get_cidreq());
         exit;
     }
 }
 $file_type = null;
 if (isset($_GET['import'])) {
     $interbreadcrumb[] = array(
-        'url' => api_get_path(WEB_CODE_PATH).'gradebook/gradebook_view_result.php?selecteval=' . $select_eval.'&'.api_get_cidreq(),
+        'url' => api_get_path(WEB_CODE_PATH).'gradebook/gradebook_view_result.php?selecteval='.$select_eval.'&'.api_get_cidreq(),
         'name' => get_lang('ViewResult')
     );
     $import_result_form = new DataForm(
         DataForm :: TYPE_IMPORT,
         'import_result_form',
         null,
-        api_get_self() . '?import=&selecteval=' . $select_eval,
+        api_get_self().'?import=&selecteval='.$select_eval,
         '_blank',
         ''
     );
@@ -123,7 +123,7 @@ if (isset($_GET['import'])) {
                     if (($importedresult['user_id'] == $allresult->get_user_id())) {
                         if ($importedresult['score'] != $allresult->get_score()) {
                             if (!isset($values['overwrite'])) {
-                                header('Location: '.api_get_path(WEB_CODE_PATH).'gradebook/gradebook_view_result.php?selecteval=' . $select_eval . '&import_score_error=' . $importedresult['user_id']);
+                                header('Location: '.api_get_path(WEB_CODE_PATH).'gradebook/gradebook_view_result.php?selecteval='.$select_eval.'&import_score_error='.$importedresult['user_id']);
                                 exit;
                                 break;
                             } else {
@@ -141,7 +141,7 @@ if (isset($_GET['import'])) {
                     }
                 }
                 if ($importedresult['user_id'] == null) {
-                    header('Location: gradebook_view_result.php?selecteval=' . $select_eval . '&incorrectdata=');
+                    header('Location: gradebook_view_result.php?selecteval='.$select_eval.'&incorrectdata=');
                     exit;
                 }
                 $userinfo = api_get_user_info($importedresult['user_id']);
@@ -150,13 +150,13 @@ if (isset($_GET['import'])) {
                     $userinfo['official_code'] != $importedresult['official_code']
                 ) {
                     if (!isset($values['ignoreerrors'])) {
-                        header('Location: gradebook_view_result.php?selecteval=' . $select_eval . '&import_user_error=' . $importedresult['user_id']);
+                        header('Location: gradebook_view_result.php?selecteval='.$select_eval.'&import_user_error='.$importedresult['user_id']);
                         exit;
                     }
                 }
                 if ($added != '1') {
                     if ($importedresult['score'] > $eval[0]->get_max()) {
-                        header('Location: gradebook_view_result.php?selecteval=' . $select_eval . '&overwritemax=');
+                        header('Location: gradebook_view_result.php?selecteval='.$select_eval.'&overwritemax=');
                         exit;
                     }
                     $result = new Result();
@@ -175,7 +175,7 @@ if (isset($_GET['import'])) {
                 }
             }
         } else {
-            header('Location: ' . api_get_self() . '?import=&selecteval=' . $select_eval . '&importnofile=');
+            header('Location: '.api_get_self().'?import=&selecteval='.$select_eval.'&importnofile=');
             Display::addFlash(
                 Display::return_message(
                     get_lang('ImportNoFile'),
@@ -187,7 +187,7 @@ if (isset($_GET['import'])) {
             exit;
         }
         if ($overwritescore != 0) {
-            header('Location: ' . api_get_self() . '?selecteval=' . $select_eval. '&importoverwritescore=' . $overwritescore);
+            header('Location: '.api_get_self().'?selecteval='.$select_eval.'&importoverwritescore='.$overwritescore);
             Display::addFlash(
                 Display::return_message(
                     get_lang('ImportOverWriteScore').' '.$overwritescore
@@ -203,7 +203,7 @@ if (isset($_GET['import'])) {
                     false
                 )
             );
-            header('Location: ' . api_get_self() . '?selecteval=' . $select_eval. '&nothingadded=');
+            header('Location: '.api_get_self().'?selecteval='.$select_eval.'&nothingadded=');
             exit;
         }
         Display::addFlash(
@@ -213,7 +213,7 @@ if (isset($_GET['import'])) {
                 false
             )
         );
-        header('Location: ' . api_get_self() . '?selecteval=' . $select_eval . '&importok=');
+        header('Location: '.api_get_self().'?selecteval='.$select_eval.'&importok=');
         exit;
     }
 }
@@ -228,7 +228,7 @@ if (isset($_GET['export'])) {
         DataForm :: TYPE_EXPORT,
         'export_result_form',
         null,
-        api_get_self() . '?export=&selecteval=' . $select_eval,
+        api_get_self().'?export=&selecteval='.$select_eval,
         '_blank',
         $locked_status
     );
@@ -239,7 +239,7 @@ if (isset($_GET['export'])) {
     if ($export_result_form->validate()) {
         $export = $export_result_form->exportValues();
         $file_type = $export['file_type'];
-        $filename = 'export_results_' . gmdate('Y-m-d_H-i-s');
+        $filename = 'export_results_'.gmdate('Y-m-d_H-i-s');
         $results = Result :: load(null, null, $select_eval);
         $data = array(); //when file type is csv, add a header to the output file
         if ($file_type == 'csv') {
@@ -259,9 +259,9 @@ if (isset($_GET['export'])) {
             $datagen = new ResultsDataGenerator($eval[0], $allresults);
 
             // set headers pdf
-            !empty($_user['official_code']) ? $officialcode = $_user['official_code'] . ' - ' : '';
+            !empty($_user['official_code']) ? $officialcode = $_user['official_code'].' - ' : '';
 
-            $h1 = array(get_lang('Teacher'), $officialcode . $_user['firstName'] . ', ' . $_user['lastName']);
+            $h1 = array(get_lang('Teacher'), $officialcode.$_user['firstName'].', '.$_user['lastName']);
             $h2 = array(get_lang('Score'), $eval[0]->get_max());
             $h3 = array(get_lang('Course'), $_course['name']);
             $h4 = array(get_lang('Weight'), $eval[0]->get_weight());
@@ -271,9 +271,9 @@ if (isset($_GET['export'])) {
             $header_pdf = array($h1, $h2, $h3, $h4, $h5, $h6);
 
             // set footer pdf
-            $f1 = '<hr />' . get_lang('Drh');
-            $f2 = '<hr />' . get_lang('Teacher');
-            $f3 = '<hr />' . get_lang('Date');
+            $f1 = '<hr />'.get_lang('Drh');
+            $f2 = '<hr />'.get_lang('Teacher');
+            $f3 = '<hr />'.get_lang('Date');
             $footer_pdf = array($f1, $f2, $f3);
 
             // set title pdf
@@ -282,9 +282,9 @@ if (isset($_GET['export'])) {
             // set headers data table
             $head_ape_name = '';
             if (api_is_western_name_order()) {
-                $head_ape_name = get_lang('FirstName') . ', ' . get_lang('LastName');
+                $head_ape_name = get_lang('FirstName').', '.get_lang('LastName');
             } else {
-                $head_ape_name = get_lang('LastName') . ', ' . get_lang('FirstName');
+                $head_ape_name = get_lang('LastName').', '.get_lang('FirstName');
             }
 
             $head_table = array(
@@ -319,15 +319,15 @@ if (isset($_GET['export'])) {
                 $result[] = $user_info['username'];
 
                 if (api_is_western_name_order()) {
-                    $result[] = $user_info['firstname'] . ', ' . $user_info['lastname'];
+                    $result[] = $user_info['firstname'].', '.$user_info['lastname'];
                 } else {
-                    $result[] = $user_info['lastname'] . ', ' . $user_info['firstname'];
+                    $result[] = $user_info['lastname'].', '.$user_info['firstname'];
                 }
                 if ($number_decimals == null) {
                     if (empty($data['scoreletter']) && !is_numeric($data['score'])) {
                         $result[] = get_lang('DidNotTakeTheExam');
                     } else {
-                        $result[] = api_strtoupper(get_lang('Literal' . $data['scoreletter']));
+                        $result[] = api_strtoupper(get_lang('Literal'.$data['scoreletter']));
                     }
                 } else {
                     if (empty($data['score']) && !is_numeric($data['score'])) {
@@ -379,7 +379,7 @@ if (isset($_GET['resultdelete'])) {
     $result = Result :: load($_GET['resultdelete']);
     $result[0]->delete();
     Display::addFlash(Display::return_message(get_lang('ResultDeleted')));
-    header('Location: gradebook_view_result.php?selecteval=' . $select_eval.'&'.api_get_cidreq());
+    header('Location: gradebook_view_result.php?selecteval='.$select_eval.'&'.api_get_cidreq());
     exit;
 }
 
@@ -396,7 +396,7 @@ if (isset($_POST['action'])) {
                     $result[0]->delete();
                     $number_of_deleted_results++;
                 }
-                header('Location: gradebook_view_result.php?massdelete=&selecteval=' . $select_eval);
+                header('Location: gradebook_view_result.php?massdelete=&selecteval='.$select_eval);
                 exit;
                 break;
         }
@@ -437,14 +437,14 @@ if (isset($_GET['print'])) {
 
 $htmlHeadXtra[] = '<script>
 function confirmationuser() {
-    if (confirm("' . get_lang('DeleteUser') . '?"))
+    if (confirm("' . get_lang('DeleteUser').'?"))
     	{return true;}
     else
     	{return false;}
 }
 
 function confirmationall () {
-    if (confirm("' . get_lang('DeleteAll') . '?"))
+    if (confirm("' . get_lang('DeleteAll').'?"))
     	{return true;}
     else
     	{return false;}
@@ -453,13 +453,13 @@ function confirmationall () {
 if (isset($_GET['deleteall'])) {
     $eval[0]->delete_results();
     Display::addFlash(Display::return_message(get_lang('AllResultDeleted')));
-    header('Location: '.api_get_path(WEB_CODE_PATH).'gradebook/gradebook_view_result.php?allresdeleted=&selecteval=' . $select_eval.'&'.api_get_cidreq());
+    header('Location: '.api_get_path(WEB_CODE_PATH).'gradebook/gradebook_view_result.php?allresdeleted=&selecteval='.$select_eval.'&'.api_get_cidreq());
     exit;
 }
 if (!isset($_GET['export']) && (!isset($_GET['import']))) {
     if (!isset($_GET['selectcat'])) {
         $interbreadcrumb[] = array(
-            'url' => $_SESSION['gradebook_dest'] . '?selectcat=' . $currentcat[0]->get_id().'&'.api_get_cidreq(),
+            'url' => $_SESSION['gradebook_dest'].'?selectcat='.$currentcat[0]->get_id().'&'.api_get_cidreq(),
             'name' => get_lang('Details')
         );
     }

+ 4 - 4
main/gradebook/lib/gradebook_data_generator.class.php

@@ -217,7 +217,7 @@ class GradebookDataGenerator
         $display = $scoreDisplay->display_score($score, SCORE_DIV_PERCENT_WITH_CUSTOM, SCORE_BOTH, true);
         $type = $item->get_item_type();
         if ($type == 'L' && get_class($item) == 'ExerciseLink') {
-            $display  = ExerciseLib::show_score($score[0], $score[1], false);
+            $display = ExerciseLib::show_score($score[0], $score[1], false);
         }
 
         return array(
@@ -239,7 +239,7 @@ class GradebookDataGenerator
         $type = $item->get_item_type();
 
         if ($type == 'L' && get_class($item) == 'ExerciseLink') {
-            $display  = ExerciseLib::show_score($score[0], $score[1], false);
+            $display = ExerciseLib::show_score($score[0], $score[1], false);
         }
 
         return array(
@@ -415,7 +415,7 @@ class GradebookDataGenerator
     public function sort_by_type($item1, $item2)
     {
         if ($item1->get_item_type() == $item2->get_item_type()) {
-            return $this->sort_by_name($item1,$item2);
+            return $this->sort_by_name($item1, $item2);
         } else {
             return ($item1->get_item_type() < $item2->get_item_type() ? -1 : 1);
         }
@@ -430,7 +430,7 @@ class GradebookDataGenerator
     {
         $result = api_strcmp($item1->get_description(), $item2->get_description());
         if ($result == 0) {
-            return $this->sort_by_name($item1,$item2);
+            return $this->sort_by_name($item1, $item2);
         }
         return $result;
     }

+ 1 - 1
main/inc/ajax/thematic.ajax.php

@@ -148,7 +148,7 @@ switch ($action) {
         $total_average = 0;
         if (!empty($thematic_advance_id)) {
             $thematic = new Thematic();
-            $affected_rows  = $thematic->update_done_thematic_advances($thematic_advance_id);
+            $affected_rows = $thematic->update_done_thematic_advances($thematic_advance_id);
             $total_average = $thematic->get_total_average_of_thematic_advances(
                 api_get_course_id(),
                 api_get_session_id()

+ 5 - 5
main/inc/lib/course_description.lib.php

@@ -175,7 +175,7 @@ class CourseDescription
 
         $sql = "SELECT MAX(description_type) as MAX
                 FROM $tbl_course_description
-		        WHERE c_id = $course_id AND session_id='" . $this->session_id . "'";
+		        WHERE c_id = $course_id AND session_id='".$this->session_id."'";
         $rs = Database::query($sql);
         $max = Database::fetch_array($rs);
 
@@ -216,7 +216,7 @@ class CourseDescription
             'session_id' => $this->session_id
         ];
 
-        $last_id  = Database::insert($table, $params);
+        $last_id = Database::insert($table, $params);
 
         if ($last_id > 0) {
             $sql = "UPDATE $table SET id = iid WHERE iid = $last_id";
@@ -324,8 +324,8 @@ class CourseDescription
         $sql = "DELETE FROM $tbl_course_description
 			 	WHERE
 			 	    c_id = $course_id AND
-			 	    id = '" . intval($this->id) . "' AND
-			 	    session_id = '" . intval($this->session_id) . "'";
+			 	    id = '".intval($this->id)."' AND
+			 	    session_id = '" . intval($this->session_id)."'";
         $result = Database::query($sql);
         $affected_rows = Database::affected_rows($result);
         if ($this->id > 0) {
@@ -354,7 +354,7 @@ class CourseDescription
         $course_id = api_get_course_int_id();
 
         $sql = "SELECT id FROM $tbl_course_description
-		        WHERE c_id = $course_id AND description_type = '" . intval($description_type) . "'";
+		        WHERE c_id = $course_id AND description_type = '".intval($description_type)."'";
         $rs = Database::query($sql);
         $row = Database::fetch_array($rs);
         $description_id = $row['id'];

+ 4 - 4
main/inc/lib/legal.lib.php

@@ -80,7 +80,7 @@ class LegalManager
     public static function get_last_condition_version($language)
     {
         $legal_conditions_table = Database::get_main_table(TABLE_MAIN_LEGAL);
-        $language= Database::escape_string($language);
+        $language = Database::escape_string($language);
         $sql = "SELECT version FROM $legal_conditions_table
                 WHERE language_id = '".$language."'
                 ORDER BY id DESC LIMIT 1 ";
@@ -101,7 +101,7 @@ class LegalManager
     public static function get_last_condition($language)
     {
         $legal_conditions_table = Database::get_main_table(TABLE_MAIN_LEGAL);
-        $language= Database::escape_string($language);
+        $language = Database::escape_string($language);
         $sql = "SELECT * FROM $legal_conditions_table
                 WHERE language_id = '".$language."'
                 ORDER BY version DESC
@@ -214,7 +214,7 @@ class LegalManager
                 break;
                 // Page link
             case 1:
-                $preview ='<fieldset>
+                $preview = '<fieldset>
                              <legend>'.get_lang('TermsAndConditions').'</legend>';
                 $preview .= '<div id="legal-accept-wrapper" class="form-item">
                 <label class="option" for="legal-accept">
@@ -305,7 +305,7 @@ class LegalManager
                 WHERE id =  "'.$legal_id.'" AND language_id="'.$language_id.'"';
         $rs = Database::query($sql);
 
-        return Database::result($rs,0,'type');
+        return Database::result($rs, 0, 'type');
     }
 
     /**

+ 11 - 11
main/lp/lp_final_item.php

@@ -8,7 +8,7 @@
  */
 $_in_course = true;
 
-require_once __DIR__ . '/../inc/global.inc.php';
+require_once __DIR__.'/../inc/global.inc.php';
 
 $current_course_tool = TOOL_GRADEBOOK;
 
@@ -51,7 +51,7 @@ if ($checker) {
                 'normal',
                 false
             ),
-            api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/service_catalog.php'
+            api_get_path(WEB_PLUGIN_PATH).'buycourses/src/service_catalog.php'
         );
         $tpl->assign('content', $content);
         $tpl->display_blank_template();
@@ -201,19 +201,19 @@ function generateLPFinalItemTemplateBadgeLinks($userId, $courseId, $sessionId =
                 <div class='row'>
                     <div class='col-md-2 col-xs-4'>
                         <div class='thumbnail'>
-                          <img class='skill-badge-img' src='" . $skill->getWebIconPath() . "' >
+                          <img class='skill-badge-img' src='" . $skill->getWebIconPath()."' >
                         </div>
                     </div>
                     <div class='col-md-8 col-xs-8'>
-                        <h5><b>" . $skill->getName() . "</b></h5>
-                        " . $skill->getDescription() . "
+                        <h5><b>" . $skill->getName()."</b></h5>
+                        " . $skill->getDescription()."
                     </div>
                     <div class='col-md-2 col-xs-12'>
-                        <h5><b>" . get_lang('ShareWithYourFriends') . "</b></h5>
-                        <a href='http://www.facebook.com/sharer.php?u=" . api_get_path(WEB_PATH) . "badge/" . $skill->getId() . "/user/" . $userId . "' target='_new'>
+                        <h5><b>" . get_lang('ShareWithYourFriends')."</b></h5>
+                        <a href='http://www.facebook.com/sharer.php?u=" . api_get_path(WEB_PATH)."badge/".$skill->getId()."/user/".$userId."' target='_new'>
                             <em class='fa fa-facebook-square fa-3x text-info' aria-hidden='true'></em>
                         </a>
-                        <a href='https://twitter.com/home?status=" . sprintf(get_lang('IHaveObtainedSkillXOnY'), '"' . $skill->getName() . '"', api_get_setting('siteName')) . ' - ' . api_get_path(WEB_PATH) . 'badge/' . $skill->getId() . '/user/' . $userId . "' target='_new'>
+                        <a href='https://twitter.com/home?status=" . sprintf(get_lang('IHaveObtainedSkillXOnY'), '"'.$skill->getName().'"', api_get_setting('siteName')).' - '.api_get_path(WEB_PATH).'badge/'.$skill->getId().'/user/'.$userId."' target='_new'>
                             <em class='fa fa-twitter-square fa-3x text-light' aria-hidden='true'></em>
                         </a>
                     </div>
@@ -223,7 +223,7 @@ function generateLPFinalItemTemplateBadgeLinks($userId, $courseId, $sessionId =
         $badgeLink .= "
             <div class='panel panel-default'>
                 <div class='panel-body'>
-                    <h3 class='text-center'>" . get_lang('AdditionallyYouHaveObtainedTheFollowingSkills') . "</h3>
+                    <h3 class='text-center'>" . get_lang('AdditionallyYouHaveObtainedTheFollowingSkills')."</h3>
                     $skillList
                 </div>
             </div>
@@ -240,7 +240,7 @@ function generateLPFinalItemTemplateBadgeLinks($userId, $courseId, $sessionId =
 function generateLPFinalItemTemplateCertificateLinks($certificate)
 {
     $downloadCertificateLink = Display::url(
-        Display::returnFontAwesomeIcon('file-pdf-o') . get_lang('DownloadCertificatePdf'),
+        Display::returnFontAwesomeIcon('file-pdf-o').get_lang('DownloadCertificatePdf'),
         $certificate['pdf_url'],
         ['class' => 'btn btn-default']
     );
@@ -248,7 +248,7 @@ function generateLPFinalItemTemplateCertificateLinks($certificate)
     $downloadCertificateLink = "
         <div class='panel panel-default'>
             <div class='panel-body'>
-                <h3 class='text-center'>" . get_lang('NowDownloadYourCertificateClickHere') . "</h3>
+                <h3 class='text-center'>" . get_lang('NowDownloadYourCertificateClickHere')."</h3>
                 <div class='text-center'>$downloadCertificateLink $viewCertificateLink</div>
             </div>
         </div>

+ 1 - 1
main/reports/index.php

@@ -22,7 +22,7 @@ api_block_anonymous_users();
 $this_section = SECTION_REPORTS;
 
 // setting the name of the tool
-$tool_name=get_lang('Reports');
+$tool_name = get_lang('Reports');
 
 // Displaying the header
 foreach (array('jquery.ba-bbq.min.js', 'jquery.validate.js', 'jquery.form.js', 'jquery.form.wizard.js', 'jquery.dataTables.min.js') as $js) {

+ 2 - 2
main/session/add_teachers_to_session.php

@@ -14,7 +14,7 @@ $this_section = SECTION_PLATFORM_ADMIN;
 
 // setting breadcrumbs
 //$interbreadcrumb[] = array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
-$interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList'));
+$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList'));
 
 // Setting the name of the tool
 $tool_name = get_lang('EnrollTrainersFromExistingSessions');
@@ -74,7 +74,7 @@ echo Display::input('hidden', 'form_sent', '1');
                     'sessions[]',
                     $sessionList,
                     '',
-                    array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'sessions', 'size'=>'15px'),
+                    array('style'=>'width:360px', 'multiple'=>'multiple', 'id'=>'sessions', 'size'=>'15px'),
                     false
                 );
             ?>

+ 18 - 18
main/session/session_course_list.php

@@ -8,7 +8,7 @@ $cidReset = true;
 require_once __DIR__.'/../inc/global.inc.php';
 
 // setting the section (for the tabs)
-$this_section=SECTION_PLATFORM_ADMIN;
+$this_section = SECTION_PLATFORM_ADMIN;
 
 $id_session = intval($_GET['id_session']);
 SessionManager::protectSession($id_session);
@@ -16,8 +16,8 @@ SessionManager::protectSession($id_session);
 // Database Table Definitions
 $tbl_course							= Database::get_main_table(TABLE_MAIN_COURSE);
 $tbl_session						= Database::get_main_table(TABLE_MAIN_SESSION);
-$tbl_session_rel_course				= Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
-$tbl_session_rel_course_rel_user	= Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
+$tbl_session_rel_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
+$tbl_session_rel_course_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
 
 if (empty($id_session)) {
     api_not_allowed();
@@ -25,26 +25,26 @@ if (empty($id_session)) {
 
 $page   = intval($_GET['page']);
 $action = $_REQUEST['action'];
-$sort   = in_array($_GET['sort'],array('title','nbr_users'))?$_GET['sort']:'title';
+$sort   = in_array($_GET['sort'], array('title', 'nbr_users')) ? $_GET['sort'] : 'title';
 
 $result = Database::query("SELECT name FROM $tbl_session WHERE id='$id_session'");
 
-if (!list($session_name)=Database::fetch_row($result)) {
+if (!list($session_name) = Database::fetch_row($result)) {
     header('Location: session_list.php');
     exit;
 }
 
 if ($action == 'delete') {
     $idChecked = $_REQUEST['idChecked'];
-    if (is_array($idChecked) && count($idChecked)>0) {
+    if (is_array($idChecked) && count($idChecked) > 0) {
         $my_temp = array();
         foreach ($idChecked as $id) {
-            $my_temp[]= Database::escape_string($id);// forcing the escape_string
+            $my_temp[] = Database::escape_string($id); // forcing the escape_string
         }
         $idChecked = $my_temp;
-        $idChecked="'".implode("','", $idChecked)."'";
+        $idChecked = "'".implode("','", $idChecked)."'";
         $result = Database::query("DELETE FROM $tbl_session_rel_course WHERE session_id='$id_session' AND c_id IN($idChecked)");
-        $nbr_affected_rows=Database::affected_rows($result);
+        $nbr_affected_rows = Database::affected_rows($result);
         Database::query("DELETE FROM $tbl_session_rel_course_rel_user WHERE session_id='$id_session' AND c_id IN($idChecked)");
         Database::query("UPDATE $tbl_session SET nbr_courses=nbr_courses-$nbr_affected_rows WHERE id='$id_session'");
     }
@@ -59,14 +59,14 @@ $sql = "SELECT c.id, c.code, c.title, nbr_users
 		FROM $tbl_session_rel_course, $tbl_course c
 		WHERE c_id = c.id AND session_id='$id_session'
 		ORDER BY $sort
-		LIMIT $from,".($limit+1);
-$result=Database::query($sql);
-$Courses=Database::store_result($result);
-$tool_name = api_htmlentities($session_name,ENT_QUOTES,$charset).' : '.get_lang('CourseListInSession');
+		LIMIT $from,".($limit + 1);
+$result = Database::query($sql);
+$Courses = Database::store_result($result);
+$tool_name = api_htmlentities($session_name, ENT_QUOTES, $charset).' : '.get_lang('CourseListInSession');
 
 //$interbreadcrumb[]=array('url' => 'index.php',"name" => get_lang('PlatformAdmin'));
-$interbreadcrumb[] = array('url' => "session_list.php","name" => get_lang('SessionList'));
-$interbreadcrumb[] = array('url' => "resume_session.php?id_session=".Security::remove_XSS($_REQUEST['id_session']),"name" => get_lang('SessionOverview'));
+$interbreadcrumb[] = array('url' => "session_list.php", "name" => get_lang('SessionList'));
+$interbreadcrumb[] = array('url' => "resume_session.php?id_session=".Security::remove_XSS($_REQUEST['id_session']), "name" => get_lang('SessionOverview'));
 
 Display::display_header($tool_name);
 echo Display::page_header($tool_name);
@@ -84,18 +84,18 @@ $tableCourses = array();
 foreach ($Courses as $key=>$enreg) {
     $course = array();
     $course[] = '<input type="checkbox" name="idChecked[]" value="'.$enreg['id'].'">';
-    $course[] = api_htmlentities($enreg['title'],ENT_QUOTES,$charset);
+    $course[] = api_htmlentities($enreg['title'], ENT_QUOTES, $charset);
     $course[] = '<a href="session_course_user_list.php?id_session='.$id_session.'&course_code='.$enreg['code'].'">'.$enreg['nbr_users'].' '.get_lang('Users').'</a>';
     $course[] = '<a href="'.api_get_path(WEB_COURSE_PATH).$enreg['code'].'/?id_session='.$id_session.'">'.
         Display::return_icon('course_home.gif', get_lang('Course')).'</a>
 			<a href="session_course_edit.php?id_session='.$id_session.'&page=session_course_list.php&course_code='.$enreg['code'].'">'.
         Display::return_icon('edit.png', get_lang('Edit')).'</a>
-			<a href="'.api_get_self().'?id_session='.$id_session.'&sort='.$sort.'&action=delete&idChecked[]='.$enreg['id'].'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset)).'\')) return false;">'.
+			<a href="'.api_get_self().'?id_session='.$id_session.'&sort='.$sort.'&action=delete&idChecked[]='.$enreg['id'].'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES, $charset)).'\')) return false;">'.
         Display::return_icon('delete.png', get_lang('Delete')).'</a>';
     $tableCourses[] = $course;
 }
 echo '<form method="post" action="'.api_get_self().'">';
-Display :: display_sortable_table($tableHeader, $tableCourses, array (), array ());
+Display :: display_sortable_table($tableHeader, $tableCourses, array(), array());
 echo '<select name="action">
 	<option value="delete">'.get_lang('UnsubscribeCoursesFromSession').'</option>
 	</select>

+ 35 - 35
main/session/session_course_user_list.php

@@ -18,7 +18,7 @@ $tbl_session_rel_course_rel_user    = Database::get_main_table(TABLE_MAIN_SESSIO
 $id_session = intval($_GET['id_session']);
 SessionManager::protectSession($id_session);
 
-if (empty($id_session )) {
+if (empty($id_session)) {
     api_not_allowed();
 }
 
@@ -28,16 +28,16 @@ $courseId = $courseInfo['real_id'];
 
 $page           = isset($_GET['page']) ? intval($_GET['page']) : null;
 $action         = isset($_REQUEST['action']) ? $_REQUEST['action'] : null;
-$default_sort   = api_sort_by_first_name() ? 'firstname':'lastname';
-$sort           = isset($_GET['sort']) && in_array($_GET['sort'], array('lastname','firstname','username')) ? $_GET['sort'] : $default_sort;
+$default_sort   = api_sort_by_first_name() ? 'firstname' : 'lastname';
+$sort           = isset($_GET['sort']) && in_array($_GET['sort'], array('lastname', 'firstname', 'username')) ? $_GET['sort'] : $default_sort;
 $idChecked      = isset($_GET['idChecked']) && is_array($_GET['idChecked']) ? $_GET['idChecked'] : (isset($_POST['idChecked']) && is_array($_POST['idChecked']) ? $_POST['idChecked'] : null);
-$direction      = isset($_GET['direction']) && in_array($_GET['direction'], array('desc','asc')) ? $_GET['direction'] : 'desc';
+$direction      = isset($_GET['direction']) && in_array($_GET['direction'], array('desc', 'asc')) ? $_GET['direction'] : 'desc';
 
 if (is_array($idChecked)) {
     $my_temp = array();
     foreach ($idChecked as $id) {
         // forcing the intval
-        $my_temp[]= intval($id);
+        $my_temp[] = intval($id);
     }
     $idChecked = $my_temp;
 }
@@ -49,14 +49,14 @@ $sql = "SELECT s.name, c.title
 		WHERE src.session_id='$id_session' AND src.c_id='$courseId' ";
 
 $result = Database::query($sql);
-if (!list($session_name,$course_title) = Database::fetch_row($result)) {
+if (!list($session_name, $course_title) = Database::fetch_row($result)) {
     header('Location: session_course_list.php?id_session='.$id_session);
     exit();
 }
 
 switch ($action) {
     case 'delete':
-        if (is_array($idChecked) && count($idChecked)>0) {
+        if (is_array($idChecked) && count($idChecked) > 0) {
             array_map('intval', $idChecked);
             $idChecked = implode(',', $idChecked);
         }
@@ -91,7 +91,7 @@ $sql = "SELECT DISTINCT
          ON (s.session_id = scru.session_id AND s.user_id = scru.user_id AND scru.c_id = '".$courseId."' )
          WHERE s.session_id='$id_session'
          ORDER BY $sort $direction
-         LIMIT $from,".($limit+1);
+         LIMIT $from,".($limit + 1);
 
 if ($direction == 'desc') {
     $direction = 'asc';
@@ -107,8 +107,8 @@ $nbr_results = sizeof($users);
 $tool_name = get_lang('Session').': '.$session_name.' - '.get_lang('Course').': '.$course_title;
 
 //$interbreadcrumb[] = array("url" => "index.php","name" => get_lang('PlatformAdmin'));
-$interbreadcrumb[] = array("url" => "session_list.php","name" => get_lang('SessionList'));
-$interbreadcrumb[] = array('url' => "resume_session.php?id_session=".$id_session,"name" => get_lang('SessionOverview'));
+$interbreadcrumb[] = array("url" => "session_list.php", "name" => get_lang('SessionList'));
+$interbreadcrumb[] = array('url' => "resume_session.php?id_session=".$id_session, "name" => get_lang('SessionOverview'));
 
 Display::display_header($tool_name);
 
@@ -117,9 +117,9 @@ echo Display::page_header($tool_name);
 <form method="post" action="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=<?php echo $sort; ?>" onsubmit="javascript:if(!confirm('<?php echo get_lang('ConfirmYourChoice'); ?>')) return false;">
 <div align="right">
 <?php
-if($page) {
+if ($page) {
 ?>
-<a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page-1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Previous');?></a>
+<a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page - 1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Previous'); ?></a>
 <?php
 } else {
     echo get_lang('Previous');
@@ -127,9 +127,9 @@ if($page) {
 ?>
 |
 <?php
-if($nbr_results > $limit) {
+if ($nbr_results > $limit) {
 ?>
-<a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page+1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Next');?></a>
+<a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page + 1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Next'); ?></a>
 <?php
 } else {
     echo get_lang('Next');
@@ -141,39 +141,39 @@ if($nbr_results > $limit) {
 <tr>
   <th>&nbsp;</th>
   <?php if ($is_western_name_order) { ?>
-  <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=firstname&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('FirstName');?></a></th>
-  <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=lastname&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('LastName');?></a></th>
+  <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=firstname&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('FirstName'); ?></a></th>
+  <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=lastname&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('LastName'); ?></a></th>
   <?php } else { ?>
-  <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=lastname&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('LastName');?></a></th>
-  <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=firstname&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('FirstName');?></a></th>
+  <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=lastname&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('LastName'); ?></a></th>
+  <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=firstname&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('FirstName'); ?></a></th>
   <?php } ?>
-  <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=username&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('Login');?></a></th>
-  <th><?php echo get_lang('Actions');?></th>
+  <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=username&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('Login'); ?></a></th>
+  <th><?php echo get_lang('Actions'); ?></th>
 </tr>
 <?php
-$i=0;
+$i = 0;
 foreach ($users as $key => $enreg) {
 
     if ($key == $limit) {
         break;
     }
     ?>
-    <tr class="<?php echo $i?'row_odd':'row_even'; ?>">
+    <tr class="<?php echo $i ? 'row_odd' : 'row_even'; ?>">
         <td><input type="checkbox" name="idChecked[]" value="<?php echo $enreg['user_id']; ?>"></td>
         <?php if ($is_western_name_order) { ?>
-        <td><?php echo api_htmlentities($enreg['firstname'],ENT_QUOTES,$charset); ?></td>
-        <td><?php echo api_htmlentities($enreg['lastname'],ENT_QUOTES,$charset); ?></td>
+        <td><?php echo api_htmlentities($enreg['firstname'], ENT_QUOTES, $charset); ?></td>
+        <td><?php echo api_htmlentities($enreg['lastname'], ENT_QUOTES, $charset); ?></td>
         <?php } else { ?>
-        <td><?php echo api_htmlentities($enreg['lastname'],ENT_QUOTES,$charset); ?></td>
-        <td><?php echo api_htmlentities($enreg['firstname'],ENT_QUOTES,$charset); ?></td>
+        <td><?php echo api_htmlentities($enreg['lastname'], ENT_QUOTES, $charset); ?></td>
+        <td><?php echo api_htmlentities($enreg['firstname'], ENT_QUOTES, $charset); ?></td>
         <?php } ?>
-        <td><?php echo api_htmlentities($enreg['username'],ENT_QUOTES,$charset); ?></td>
+        <td><?php echo api_htmlentities($enreg['username'], ENT_QUOTES, $charset); ?></td>
         <td>
         <?php if ($enreg['is_subscribed']) { ?>
             <a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=<?php echo $sort; ?>&action=delete&idChecked[]=<?php echo $enreg['user_id']; ?>" onclick="javascript:if(!confirm('<?php echo get_lang('ConfirmYourChoice'); ?>')) return false;">
                 <?php Display::display_icon('delete.png', get_lang('Delete')); ?>
             </a>
-        <?php } else  { ?>
+        <?php } else { ?>
             <a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=<?php echo $sort; ?>&action=add&idChecked[]=<?php echo $enreg['user_id']; ?>" onclick="javascript:if(!confirm('<?php echo get_lang('ConfirmYourChoice'); ?>')) return false;">
                 <?php Display::display_icon('add.png', get_lang('Add'), array(), ICON_SIZE_SMALL); ?>
             </a>
@@ -182,7 +182,7 @@ foreach ($users as $key => $enreg) {
         </td>
     </tr>
     <?php
-        $i=$i ? 0 : 1;
+        $i = $i ? 0 : 1;
 }
 unset($users);
 ?>
@@ -190,9 +190,9 @@ unset($users);
 <br />
 <div align="left">
     <?php
-    if($page) {
+    if ($page) {
     ?>
-    <a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page-1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Previous'); ?></a>
+    <a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page - 1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Previous'); ?></a>
     <?php
     } else {
         echo get_lang('Previous');
@@ -200,9 +200,9 @@ unset($users);
     ?>
     |
     <?php
-    if($nbr_results > $limit) {
+    if ($nbr_results > $limit) {
     ?>
-    <a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page+1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Next'); ?></a>
+    <a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page + 1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Next'); ?></a>
     <?php
     } else {
         echo get_lang('Next');
@@ -211,8 +211,8 @@ unset($users);
 </div>
 <br />
 <select name="action">
-<option value="delete"><?php echo get_lang('UnsubscribeSelectedUsersFromSession');?></option>
-<option value="add"><?php echo get_lang('AddUsers');?></option>
+<option value="delete"><?php echo get_lang('UnsubscribeSelectedUsersFromSession'); ?></option>
+<option value="add"><?php echo get_lang('AddUsers'); ?></option>
 </select>
 <button class="save" type="submit"> <?php echo get_lang('Ok'); ?></button>
 </form>

+ 22 - 22
main/session/session_export.php

@@ -32,7 +32,7 @@ $archiveURL = api_get_path(WEB_CODE_PATH).'course_info/download.php?archive_path
 
 $tool_name = get_lang('ExportSessionListXMLCSV');
 
-$interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList'));
+$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList'));
 
 set_time_limit(0);
 
@@ -56,9 +56,9 @@ if (isset($_POST['formSent'])) {
 				ORDER BY id";
 
 		if (api_is_multiple_url_enabled()) {
-			$tbl_session_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
+			$tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
 			$access_url_id = api_get_current_access_url_id();
-			if ($access_url_id != -1){
+			if ($access_url_id != -1) {
 			$sql = "SELECT s.id, name,id_coach,username,access_start_date,access_end_date,visibility,session_category_id
 					FROM $tbl_session s
 					INNER JOIN $tbl_session_rel_access_url as session_rel_url
@@ -107,7 +107,7 @@ if (isset($_POST['formSent'])) {
 
 			$archiveFile = 'export_sessions_'.$session_id.'_'.api_get_local_time().'.'.$file_type;
 			while (file_exists($archivePath.$archiveFile)) {
-				$archiveFile ='export_users_'.$session_id.'_'.api_get_local_time().'_'.uniqid('').'.'.$file_type;
+				$archiveFile = 'export_users_'.$session_id.'_'.api_get_local_time().'_'.uniqid('').'.'.$file_type;
 			}
 
 			$cvs = false;
@@ -116,12 +116,12 @@ if (isset($_POST['formSent'])) {
 		}
 
 		while ($row = Database::fetch_array($result)) {
-			$row['name'] = str_replace(';',',',$row['name']);
-			$row['username'] = str_replace(';',',',$row['username']);
-			$row['access_start_date'] = str_replace(';',',',$row['access_start_date']);
-			$row['access_end_date'] = str_replace(';',',',$row['access_end_date']);
-			$row['visibility'] = str_replace(';',',',$row['visibility']);
-			$row['session_category'] = str_replace(';',',',$row['session_category_id']);
+			$row['name'] = str_replace(';', ',', $row['name']);
+			$row['username'] = str_replace(';', ',', $row['username']);
+			$row['access_start_date'] = str_replace(';', ',', $row['access_start_date']);
+			$row['access_end_date'] = str_replace(';', ',', $row['access_end_date']);
+			$row['visibility'] = str_replace(';', ',', $row['visibility']);
+			$row['session_category'] = str_replace(';', ',', $row['session_category_id']);
 			// users
 			$sql = "SELECT DISTINCT $tbl_user.username
 					FROM $tbl_user
@@ -133,9 +133,9 @@ if (isset($_POST['formSent'])) {
 
 			$rsUsers = Database::query($sql);
 			$users = '';
-			while ($rowUsers = Database::fetch_array($rsUsers)){
-				if($cvs){
-					$users .= str_replace(';',',',$rowUsers['username']).'|';
+			while ($rowUsers = Database::fetch_array($rsUsers)) {
+				if ($cvs) {
+					$users .= str_replace(';', ',', $rowUsers['username']).'|';
 				} else {
 					$users .= "\t\t<User>$rowUsers[username]</User>\n";
 				}
@@ -175,8 +175,8 @@ if (isset($_POST['formSent'])) {
 				$coachs = implode(",", $coachs);
 
 				if ($cvs) {
-					$courses .= str_replace(';',',',$rowCourses['code']);
-					$courses .= '['.str_replace(';',',',$coachs).'][';
+					$courses .= str_replace(';', ',', $rowCourses['code']);
+					$courses .= '['.str_replace(';', ',', $coachs).'][';
 				} else {
 					$courses .= "\t\t<Course>\n";
 					$courses .= "\t\t\t<CourseCode>$rowCourses[code]</CourseCode>\n";
@@ -199,9 +199,9 @@ if (isset($_POST['formSent'])) {
 
 				$rsUsersCourse = Database::query($sql);
 				$userscourse = '';
-				while ($rowUsersCourse = Database::fetch_array($rsUsersCourse)){
+				while ($rowUsersCourse = Database::fetch_array($rsUsersCourse)) {
 					if ($cvs) {
-						$userscourse .= str_replace(';',',',$rowUsersCourse['username']).',';
+						$userscourse .= str_replace(';', ',', $rowUsersCourse['username']).',';
 					} else {
 						$courses .= "\t\t\t<User>$rowUsersCourse[username]</User>\n";
 					}
@@ -281,7 +281,7 @@ $sql = "SELECT id, name FROM $tbl_session ORDER BY name";
 if (api_is_multiple_url_enabled()) {
 	$tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
 	$access_url_id = api_get_current_access_url_id();
-	if ($access_url_id != -1){
+	if ($access_url_id != -1) {
 	$sql = "SELECT s.id, name FROM $tbl_session s
 			INNER JOIN $tbl_session_rel_access_url as session_rel_url
 			ON (s.id = session_rel_url.session_id)
@@ -294,7 +294,7 @@ $Sessions = Database::store_result($result);
 
 echo '<div class="actions">';
 echo '<a href="../session/session_list.php">'.
-		Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('SessionList'),'',ICON_SIZE_MEDIUM).'</a>';
+		Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('SessionList'), '', ICON_SIZE_MEDIUM).'</a>';
 echo '</div>';
 
 if (!empty($errorMsg)) {
@@ -303,8 +303,8 @@ if (!empty($errorMsg)) {
 
 $form = new FormValidator('session_export', 'post', api_get_self());
 $form->addElement('hidden', 'formSent', 1);
-$form->addElement('radio', 'file_type', get_lang('OutputFileType'), 'CSV' , 'csv', null);
-$form->addElement('radio', 'file_type', '', 'XLS' , 'xls', null);
+$form->addElement('radio', 'file_type', get_lang('OutputFileType'), 'CSV', 'csv', null);
+$form->addElement('radio', 'file_type', '', 'XLS', 'xls', null);
 $form->addElement('radio', 'file_type', null, 'XML', 'xml', null, array('id' => 'file_type_xml'));
 
 $options = array();
@@ -313,7 +313,7 @@ foreach ($Sessions as $enreg) {
     $options[$enreg['id']] = $enreg['name'];
 }
 
-$form->addElement('select', 'session_id', get_lang('WhichSessionToExport'),  $options);
+$form->addElement('select', 'session_id', get_lang('WhichSessionToExport'), $options);
 $form->addButtonExport(get_lang('ExportSession'));
 
 $defaults = array();

+ 8 - 8
main/social/group_waiting_list.php

@@ -10,13 +10,13 @@ $cidReset = true;
 require_once __DIR__.'/../inc/global.inc.php';
 
 api_block_anonymous_users();
-if (api_get_setting('allow_social_tool') !='true') {
+if (api_get_setting('allow_social_tool') != 'true') {
     api_not_allowed();
 }
 
 $this_section = SECTION_SOCIAL;
 
-$group_id= intval($_GET['id']);
+$group_id = intval($_GET['id']);
 $usergroup = new UserGroup();
 
 //todo @this validation could be in a function in group_portal_manager
@@ -34,9 +34,9 @@ if (empty($group_id)) {
     }
 }
 
-$interbreadcrumb[]= array ('url' => 'groups.php','name' => get_lang('Groups'));
+$interbreadcrumb[] = array('url' => 'groups.php', 'name' => get_lang('Groups'));
 $interbreadcrumb[] = array('url' => 'group_view.php?id='.$group_id, 'name' => $group_info['name']);
-$interbreadcrumb[]= array ('url' => '#','name' => get_lang('WaitingList'));
+$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('WaitingList'));
 
 // Group information
 $admins = $usergroup->get_users_by_group(
@@ -48,7 +48,7 @@ $admins = $usergroup->get_users_by_group(
 );
 $show_message = '';
 
-if (isset($_GET['action']) && $_GET['action']=='accept') {
+if (isset($_GET['action']) && $_GET['action'] == 'accept') {
     // we add a user only if is a open group
     $user_join = intval($_GET['u']);
     //if i'm a moderator
@@ -58,7 +58,7 @@ if (isset($_GET['action']) && $_GET['action']=='accept') {
     }
 }
 
-if (isset($_GET['action']) && $_GET['action']=='deny') {
+if (isset($_GET['action']) && $_GET['action'] == 'deny') {
     // we add a user only if is a open group
     $user_join = intval($_GET['u']);
     //if i'm a moderator
@@ -68,9 +68,9 @@ if (isset($_GET['action']) && $_GET['action']=='deny') {
     }
 }
 
-if (isset($_GET['action']) && $_GET['action']=='set_moderator') {
+if (isset($_GET['action']) && $_GET['action'] == 'set_moderator') {
     // we add a user only if is a open group
-    $user_moderator= intval($_GET['u']);
+    $user_moderator = intval($_GET['u']);
     //if i'm the admin
     if ($usergroup->is_group_admin($group_id)) {
         $usergroup->update_user_role($user_moderator, $group_id, GROUP_USER_PERMISSION_MODERATOR);

+ 11 - 11
main/upload/upload_word.php

@@ -10,7 +10,7 @@
 
 require_once __DIR__.'/../inc/global.inc.php';
 
-$form_style= '<style>
+$form_style = '<style>
 .row {
     width: 200px;
 }
@@ -28,20 +28,20 @@ $htmlHeadXtra[] = '<script type="text/javascript">
 </script>';
 $htmlHeadXtra[] = $form_style;
 
-if (api_get_setting('search_enabled')=='true') {
+if (api_get_setting('search_enabled') == 'true') {
     $specific_fields = get_specific_field_list();
 }
 
 if (isset($_POST['convert'])) {
     $cwdir = getcwd();
     if (isset($_FILES['user_file'])) {
-        $allowed_extensions = array('doc','docx','odt','txt','sxw','rtf');
-        if (in_array(strtolower(pathinfo($_FILES['user_file']['name'],PATHINFO_EXTENSION)),$allowed_extensions)) {
+        $allowed_extensions = array('doc', 'docx', 'odt', 'txt', 'sxw', 'rtf');
+        if (in_array(strtolower(pathinfo($_FILES['user_file']['name'], PATHINFO_EXTENSION)), $allowed_extensions)) {
             require('../lp/lp_upload.php');
             if (isset($o_doc) && $first_item_id != 0) {
                 // Search-related section
-                if (api_get_setting('search_enabled')=='true') {
-                    require_once(api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php');
+                if (api_get_setting('search_enabled') == 'true') {
+                    require_once(api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php');
                     $specific_fields = get_specific_field_list();
 
                     foreach ($specific_fields as $specific_field) {
@@ -77,7 +77,7 @@ if (!$is_allowed_to_edit) {
     api_not_allowed(true);
 }
 
-$interbreadcrumb[]= array ("url"=>"../lp/lp_controller.php?action=list", "name"=> get_lang("Doc"));
+$interbreadcrumb[] = array("url"=>"../lp/lp_controller.php?action=list", "name"=> get_lang("Doc"));
 $nameTools = get_lang("WoogieConversionPowerPoint");
 Display :: display_header($nameTools);
 
@@ -97,7 +97,7 @@ $s_style = "border-width: 1px;
          border-color: #4171B5;
          color: #000;";
 
-$s_style_error="border-width: 1px;
+$s_style_error = "border-width: 1px;
          border-style: solid;
          margin-left: 0;
          margin-top: 10px;
@@ -123,7 +123,7 @@ $form = new FormValidator('update_course', 'POST', '', '', 'style="margin: 0;"')
 
 // build the form
 
-$form -> addElement ('html','<br>');
+$form -> addElement('html', '<br>');
 
 $div_upload_limit = '&nbsp;&nbsp;'.get_lang('UploadMaxSize').' : '.ini_get('post_max_size');
 
@@ -136,7 +136,7 @@ $user_file_template =
         <!-- BEGIN error --><br /><span class="form_error">{error}</span><!-- END error -->
 </div>
 EOT;
-$renderer->setElementTemplate($user_file_template,'user_file');
+$renderer->setElementTemplate($user_file_template, 'user_file');
 
 // set template for other elements
 $user_file_template =
@@ -174,7 +174,7 @@ $form->addElement('hidden', 'split_steps', 'per_page');
 $form->addElement('submit', 'convert', get_lang('ConvertToLP'), 'class="convert_button"');
 $form->addElement('hidden', 'woogie', 'true');
 $form->addProgress();
-$defaults = array('split_steps'=>'per_page','index_document'=>'checked="checked"');
+$defaults = array('split_steps'=>'per_page', 'index_document'=>'checked="checked"');
 $form -> setDefaults($defaults);
 
 // display the form

+ 1 - 1
main/work/student_work.php

@@ -4,7 +4,7 @@
 use ChamiloSession as Session;
 
 require_once __DIR__.'/../inc/global.inc.php';
-$current_course_tool  = TOOL_STUDENTPUBLICATION;
+$current_course_tool = TOOL_STUDENTPUBLICATION;
 
 api_protect_course_script(true);
 

+ 2 - 2
main/work/view.php

@@ -2,7 +2,7 @@
 /* For licensing terms, see /license.txt */
 
 require_once __DIR__.'/../inc/global.inc.php';
-$current_course_tool  = TOOL_STUDENTPUBLICATION;
+$current_course_tool = TOOL_STUDENTPUBLICATION;
 
 require_once 'work.lib.php';
 
@@ -52,7 +52,7 @@ if ((user_is_author($id) || $isDrhOfCourse || (api_is_allowed_to_edit() || api_i
     $userInfo = api_get_user_info($work['user_id']);
     $interbreadcrumb[] = array('url' => $url_dir, 'name' => $my_folder_data['title']);
     $interbreadcrumb[] = array('url' => '#', 'name' => $userInfo['complete_name']);
-    $interbreadcrumb[] = array('url' => '#','name' => $work['title']);
+    $interbreadcrumb[] = array('url' => '#', 'name' => $work['title']);
 
     if (($courseInfo['show_score'] == 0 &&
         $work['active'] == 1 &&

+ 10 - 10
main/work/work.php

@@ -6,7 +6,7 @@
  **/
 
 require_once __DIR__.'/../inc/global.inc.php';
-$current_course_tool  = TOOL_STUDENTPUBLICATION;
+$current_course_tool = TOOL_STUDENTPUBLICATION;
 
 api_protect_course_script(true);
 
@@ -36,7 +36,7 @@ $tool_name = get_lang('StudentPublications');
 $item_id = isset($_REQUEST['item_id']) ? intval($_REQUEST['item_id']) : null;
 $origin = isset($_REQUEST['origin']) ? Security::remove_XSS($_REQUEST['origin']) : '';
 $course_dir = api_get_path(SYS_COURSE_PATH).$courseInfo['path'];
-$base_work_dir = $course_dir . '/work';
+$base_work_dir = $course_dir.'/work';
 $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'list';
 
 //Download folder
@@ -73,7 +73,7 @@ if (!empty($groupId)) {
         'url' => api_get_path(WEB_CODE_PATH).'work/work.php?'.api_get_cidreq(),
         'name' => get_lang('StudentPublications'),
     );
-    $url_dir = api_get_path(WEB_CODE_PATH).'work/work.php?&id=' . $work_id.'&'.api_get_cidreq();
+    $url_dir = api_get_path(WEB_CODE_PATH).'work/work.php?&id='.$work_id.'&'.api_get_cidreq();
     if (!empty($my_folder_data)) {
         $interbreadcrumb[] = array('url' => $url_dir, 'name' =>  $my_folder_data['title']);
     }
@@ -116,7 +116,7 @@ if (!empty($groupId)) {
             $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('EditToolOptions'));
         }
         if ($action == 'create_dir') {
-            $interbreadcrumb[] = array('url' => '#','name' => get_lang('CreateAssignment'));
+            $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('CreateAssignment'));
         }
     }
 }
@@ -163,7 +163,7 @@ switch ($action) {
         if (!$is_allowed_to_edit) {
             api_not_allowed();
         }
-        $addUrl = api_get_path(WEB_CODE_PATH) . 'work/work.php?action=create_dir&' . api_get_cidreq();
+        $addUrl = api_get_path(WEB_CODE_PATH).'work/work.php?action=create_dir&'.api_get_cidreq();
         $form = new FormValidator(
             'form1',
             'post',
@@ -206,7 +206,7 @@ switch ($action) {
             $result = deleteDirWork($_REQUEST['id']);
             if ($result) {
                 $message = Display::return_message(
-                    get_lang('DirDeleted') . ': ' . $work_to_delete['title'],
+                    get_lang('DirDeleted').': '.$work_to_delete['title'],
                     'success'
                 );
                 Display::addFlash($message);
@@ -237,16 +237,16 @@ switch ($action) {
             if ($move_to_path == -1) {
                 $move_to_path = '/';
             } elseif (substr($move_to_path, -1, 1) != '/') {
-                $move_to_path = $move_to_path .'/';
+                $move_to_path = $move_to_path.'/';
             }
 
             // Security fix: make sure they can't move files that are not in the document table
             if ($path = get_work_path($item_id)) {
-                if (move($course_dir.'/'.$path, $base_work_dir . $move_to_path)) {
+                if (move($course_dir.'/'.$path, $base_work_dir.$move_to_path)) {
                     // Update db
                     updateWorkUrl(
                         $item_id,
-                        'work' . $move_to_path,
+                        'work'.$move_to_path,
                         $_REQUEST['move_to_id']
                     );
 
@@ -345,7 +345,7 @@ switch ($action) {
             $content .= '</div>';
             $content .= '</div>';
             $content .= '<div id="student-list-work" style="display: none" class="table-responsive">';
-            $content .= '<div class="toolbar"><a id="closed-view-list" href="#"><em class="fa fa-times-circle"></em> ' .get_lang('Close'). '</a></div>';
+            $content .= '<div class="toolbar"><a id="closed-view-list" href="#"><em class="fa fa-times-circle"></em> '.get_lang('Close').'</a></div>';
             $content .= showStudentList($work_id);
             $content .= '</div>';
         } else {

+ 2 - 2
main/work/work_list_others.php

@@ -3,7 +3,7 @@
 
 require_once __DIR__.'/../inc/global.inc.php';
 
-$current_course_tool  = TOOL_STUDENTPUBLICATION;
+$current_course_tool = TOOL_STUDENTPUBLICATION;
 
 api_protect_course_script(true);
 
@@ -78,7 +78,7 @@ Display :: display_header(null);
 
 echo '<div class="actions">';
 echo '<a href="'.api_get_path(WEB_CODE_PATH).'work/work.php?'.api_get_cidreq().'>'.
-    Display::return_icon('back.png', get_lang('BackToWorksList'),'',ICON_SIZE_MEDIUM).'</a>';
+    Display::return_icon('back.png', get_lang('BackToWorksList'), '', ICON_SIZE_MEDIUM).'</a>';
 echo '</div>';
 
 if (!empty($my_folder_data['description'])) {

+ 2 - 2
main/work/work_missing.php

@@ -2,7 +2,7 @@
 /* For licensing terms, see /license.txt */
 
 require_once __DIR__.'/../inc/global.inc.php';
-$current_course_tool  = TOOL_STUDENTPUBLICATION;
+$current_course_tool = TOOL_STUDENTPUBLICATION;
 
 api_protect_course_script(true);
 
@@ -106,7 +106,7 @@ $output = '';
 if (!empty($workId)) {
     if (empty($_GET['list']) or Security::remove_XSS($_GET['list']) == 'with') {
         $output .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&id='.$workId.'&list=without">'.
-            Display::return_icon('exercice_uncheck.png', get_lang('ViewUsersWithoutTask'),'',ICON_SIZE_MEDIUM)."</a>";
+            Display::return_icon('exercice_uncheck.png', get_lang('ViewUsersWithoutTask'), '', ICON_SIZE_MEDIUM)."</a>";
     } else {
         if (!isset($_GET['action']) || (isset($_GET['action']) && $_GET['action'] != 'send_mail')) {
             $output .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&id='.$workId.'&list=without&action=send_mail&sec_token='.$token.'">'.

+ 4 - 4
plugin/advanced_subscription/test/ws_session_user.php

@@ -8,7 +8,7 @@
 /**
  * Init
  */
-require_once __DIR__ . '/../config.php';
+require_once __DIR__.'/../config.php';
 // Protect test
 api_protect_admin_script();
 
@@ -42,7 +42,7 @@ if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
 }
 // Check if a file that limits access from webservices exists and contains
 // the restraining check
-if (is_file(api_get_path(WEB_CODE_PATH) .'webservices/webservice-auth-ip.conf.php')) {
+if (is_file(api_get_path(WEB_CODE_PATH).'webservices/webservice-auth-ip.conf.php')) {
     include api_get_path(WEB_CODE_PATH).'webservices/webservice-auth-ip.conf.php';
     if (!empty($ws_auth_ip)) {
         $check_ip = true;
@@ -63,7 +63,7 @@ if ($check_ip) {
 $params['secret_key'] = sha1($security_key);
 
 // Registration soap wsdl
-$wsUrl = api_get_path(WEB_CODE_PATH) . 'webservices/registration.soap.php?wsdl';
+$wsUrl = api_get_path(WEB_CODE_PATH).'webservices/registration.soap.php?wsdl';
 $options = array(
     'location' => $wsUrl,
     'uri' => $wsUrl
@@ -79,7 +79,7 @@ try {
     $result = $client->__soapCall('HookAdvancedSubscription..WSSessionGetDetailsByUser', array($params));
     if (is_object($result) && isset($result->action_url)) {
         echo '<br />';
-        echo Display::url("message" . $result->message, $result->action_url);
+        echo Display::url("message".$result->message, $result->action_url);
     }
 } catch (\Exception $e) {
     var_dump($e);

+ 5 - 5
plugin/buycourses/src/process_confirm.php

@@ -46,8 +46,8 @@ switch ($sale['payment_type']) {
             $sale['price'],
             $currency['iso_code'],
             'paypal',
-            api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/success.php',
-            api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/error.php',
+            api_get_path(WEB_PLUGIN_PATH).'buycourses/src/success.php',
+            api_get_path(WEB_PLUGIN_PATH).'buycourses/src/error.php',
             $extra
         );
 
@@ -92,7 +92,7 @@ switch ($sale['payment_type']) {
 
                 unset($_SESSION['bc_sale_id']);
 
-                header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/index.php');
+                header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/index.php');
                 exit;
             }
 
@@ -129,7 +129,7 @@ switch ($sale['payment_type']) {
             );
 
             unset($_SESSION['bc_sale_id']);
-            header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/course_catalog.php');
+            header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/course_catalog.php');
             exit;
         }
 
@@ -200,7 +200,7 @@ switch ($sale['payment_type']) {
                     )
                 );
 
-                header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/index.php');
+                header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/index.php');
                 exit;
             }
         }

+ 3 - 3
plugin/buycourses/src/service_success.php

@@ -49,7 +49,7 @@ if ($form->validate()) {
             Display::return_message($plugin->get_lang('OrderCancelled'), 'error', false)
         );
 
-        header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/service_catalog.php');
+        header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/service_catalog.php');
         exit;
     }
 
@@ -64,7 +64,7 @@ if ($form->validate()) {
             Display::return_message($erroMessage, 'error', false)
         );
         unset($_SESSION['wizard']);
-        header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/service_catalog.php');
+        header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/service_catalog.php');
         exit;
     }
 
@@ -148,7 +148,7 @@ if ($form->validate()) {
 
     unset($_SESSION['bc_service_sale_id']);
 
-    header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/service_catalog.php');
+    header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/service_catalog.php');
 
     exit;
 }

+ 1 - 1
plugin/customfooter/plugin.php

@@ -40,7 +40,7 @@ $form_settings = [];
 
 foreach ($config as $fooid => $configrecord) {
     $canonic = preg_replace('/^customfooter_/', '', $configrecord['variable']);
-    if (in_array($canonic, array('footer_left', 'footer_right'))){
+    if (in_array($canonic, array('footer_left', 'footer_right'))) {
         $form_settings[$canonic] = $configrecord['selected_value'];
     }
 }

+ 1 - 1
plugin/google_maps/src/map_coordinates.php

@@ -23,7 +23,7 @@ $extraFieldName = array_map('trim', explode(',', $extraFieldName));
 
 if ($apiIsEnable) {
     $gmapsApiKey = $plugin->get('api_key');
-    $htmlHeadXtra[] = '<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?key='. $gmapsApiKey . '" ></script>';
+    $htmlHeadXtra[] = '<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?key='.$gmapsApiKey.'" ></script>';
 }
 
 $em = Database::getManager();

+ 1 - 1
plugin/ims_lti/ImsLtiTool.php

@@ -173,7 +173,7 @@ class ImsLtiTool
         $foo = explode('=', $strings);
 
         return [
-            'key' => 'custom_' . $foo[0],
+            'key' => 'custom_'.$foo[0],
             'value' => $foo[1]
         ];
     }