Эх сурвалжийг харах

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

Scrutinizer Auto-Fixes
Julio Montoya 8 жил өмнө
parent
commit
ab40fa3597

+ 2 - 2
main/auth/external_login/login.ldap.php

@@ -40,8 +40,8 @@ use ChamiloSession as Session;
  *
  * */
 
-require_once dirname(__FILE__) . '/ldap.inc.php';
-require_once dirname(__FILE__) . '/functions.inc.php';
+require_once dirname(__FILE__).'/ldap.inc.php';
+require_once dirname(__FILE__).'/functions.inc.php';
 
 $debug = false;
 if ($debug) {

+ 6 - 6
main/auth/lostPassword.php

@@ -47,7 +47,7 @@ if ($reset && $userId) {
     Display::addFlash(
         Display::return_message($messageText, 'info', false)
     );
-    header('Location: ' . api_get_path(WEB_PATH));
+    header('Location: '.api_get_path(WEB_PATH));
     exit;
 }
 
@@ -74,7 +74,7 @@ if ($form->validate()) {
         Display::addFlash(
             Display::return_message($messageText, 'error', false)
         );
-        header('Location: ' . api_get_self());
+        header('Location: '.api_get_self());
         exit;
     }
 
@@ -94,7 +94,7 @@ if ($form->validate()) {
         Display::addFlash(
             Display::return_message($messageText, 'info', false)
         );
-        header('Location: ' . api_get_path(WEB_PATH));
+        header('Location: '.api_get_path(WEB_PATH));
         exit;
     }
 
@@ -102,7 +102,7 @@ if ($form->validate()) {
         Display::addFlash(
             Display::return_message(get_lang('CouldNotResetPasswordBecauseLDAP'), 'info', false)
         );
-        header('Location: ' . api_get_path(WEB_PATH));
+        header('Location: '.api_get_path(WEB_PATH));
         exit;
     }
 
@@ -121,7 +121,7 @@ if ($form->validate()) {
             exit;
         }
 
-        header('Location: ' . api_get_path(WEB_PATH));
+        header('Location: '.api_get_path(WEB_PATH));
         exit;
     }
 
@@ -138,7 +138,7 @@ if ($form->validate()) {
     Display::addFlash(
         Display::return_message($messageText, 'info', false)
     );
-    header('Location: ' . api_get_path(WEB_PATH));
+    header('Location: '.api_get_path(WEB_PATH));
     exit;
 }
 

+ 6 - 6
main/auth/my_progress.php

@@ -53,16 +53,16 @@ if (!empty($course_user_list)) {
         }
         $course_info = api_get_course_info_by_id($result['c_id']);
         $course_image = '<img src="'.$course_info['course_image_large'].'">';
-        $dates .= '<li><a href="#'.$login.'">' . api_convert_and_format_date($login, DATE_FORMAT_SHORT) . '</a></li>';
+        $dates .= '<li><a href="#'.$login.'">'.api_convert_and_format_date($login, DATE_FORMAT_SHORT).'</a></li>';
         $issues .= '<li id ="'.$login.'">';
         $issues .= '<div class="img-course">'.$course_image.'</div>';
 
         $issues .= '<div class="text-course">';
-        $issues .= '<p>' . sprintf(
+        $issues .= '<p>'.sprintf(
                 get_lang('YouHaveEnteredTheCourseXInY'),
-                '" '. $courseInfo['name'] .' "',
+                '" '.$courseInfo['name'].' "',
                 api_convert_and_format_date($login, DATE_TIME_FORMAT_LONG)
-                ) . '</p>';
+                ).'</p>';
         $issues .= '</div>';
         $issues .= '</li>';
         $count++;
@@ -80,8 +80,8 @@ if (!empty($dates)) {
     $content .= '<div class="row">';
     $content .= '<div class="col-md-12">';
     $content .= '<div id="my_timeline">';
-    $content .= '<ul id="dates">' . $dates . '</ul>';
-    $content .= '<ul id="issues">' . $issues . '</ul>';
+    $content .= '<ul id="dates">'.$dates.'</ul>';
+    $content .= '<ul id="issues">'.$issues.'</ul>';
     $content .= '<div id="grad_left"></div>';
     $content .= '<div id="grad_right"></div>';
     $content .= '<a href="#" id="prev"></a>';

+ 1 - 1
main/course_info/delete_course.php

@@ -36,7 +36,7 @@ if (isset($_GET['delete']) && $_GET['delete'] === 'yes') {
     Session::erase('_real_cid');
     $noPHP_SELF = true;
     $message = '<h2>'.get_lang('Course').' : '.$current_course_name.' ('.$current_course_code.') </h2>';
-    $message .=get_lang('HasDel');
+    $message .= get_lang('HasDel');
     $message .= '<br /><br /><a href="../../index.php">'.get_lang('BackHome').'</a>';
 } else {
     $message = '<h3>'.get_lang('Course').' : '.$current_course_name.' ('.$current_course_code.') </h3>';

+ 8 - 8
main/course_info/tools.php

@@ -49,14 +49,14 @@ switch ($action) {
         );
         $toolName = Security::remove_XSS(stripslashes($tool['name']));
 
-        $currentUrl = api_get_self().'?action=edit_icon&id=' . $id.'&'.api_get_cidreq();
+        $currentUrl = api_get_self().'?action=edit_icon&id='.$id.'&'.api_get_cidreq();
 
         $form = new FormValidator('icon_edit', 'post', $currentUrl);
         $form->addHeader(get_lang('EditIcon'));
         $form->addHtml('<div class="col-md-7">');
         $form->addText('name', get_lang('Name'));
         $form->addText('link', get_lang('Links'));
-        $allowed_picture_types = array ('jpg', 'jpeg', 'png');
+        $allowed_picture_types = array('jpg', 'jpeg', 'png');
         $form->addFile('icon', get_lang('CustomIcon'));
         $form->addRule('icon', get_lang('OnlyImagesAllowed').' ('.implode(',', $allowed_picture_types).')', 'filetype', $allowed_picture_types);
         $form->addSelect(
@@ -117,7 +117,7 @@ switch ($action) {
         $iconsTools .= '<div class="row">';
         foreach ($toolList as $tool) {
             $tool['name'] = Security::remove_XSS(stripslashes($tool['name']));
-            $toolIconName = 'Tool' . api_underscore_to_camel_case($tool['name']);
+            $toolIconName = 'Tool'.api_underscore_to_camel_case($tool['name']);
             $toolIconName = isset($$toolIconName) ? get_lang($toolIconName) : $tool['name'];
 
             $iconsTools .= '<div class="col-md-2">';
@@ -139,13 +139,13 @@ switch ($action) {
 
             $delete = (!empty($tool['custom_icon'])) ? "<a class=\"btn btn-default\" onclick=\"javascript:
                 if(!confirm('".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset)).
-                "')) return false;\" href=\"". api_get_self() . '?action=delete_icon&id=' . $tool['iid'] . '&'.api_get_cidreq()."\">
+                "')) return false;\" href=\"".api_get_self().'?action=delete_icon&id='.$tool['iid'].'&'.api_get_cidreq()."\">
             <em class=\"fa fa-trash-o\"></em></a>" : "";
-            $edit = '<a class="btn btn-default" href="' . api_get_self() . '?action=edit_icon&id=' . $tool['iid'] . '&'.api_get_cidreq().'"><em class="fa fa-pencil"></em></a>';
+            $edit = '<a class="btn btn-default" href="'.api_get_self().'?action=edit_icon&id='.$tool['iid'].'&'.api_get_cidreq().'"><em class="fa fa-pencil"></em></a>';
 
-            $iconsTools .= '<div class="icon-tools">'. $icon . '</div>';
-            $iconsTools .= '<div class="name-tools">' . $toolIconName . '</div>';
-            $iconsTools .= '<div class="toolbar">' . $edit . $delete . '</div>';
+            $iconsTools .= '<div class="icon-tools">'.$icon.'</div>';
+            $iconsTools .= '<div class="name-tools">'.$toolIconName.'</div>';
+            $iconsTools .= '<div class="toolbar">'.$edit.$delete.'</div>';
             $iconsTools .= '</div>';
             $iconsTools .= '</div>';
         }

+ 13 - 13
main/exercise/feedback.php

@@ -9,23 +9,23 @@
 * 	@version $Id: admin.php 10680 2007-01-11 21:26:23Z pcool $
 */
 require_once __DIR__.'/../inc/global.inc.php';
-$this_section=SECTION_COURSES;
+$this_section = SECTION_COURSES;
 
-$nameTools=get_lang('ExerciseManagement');
+$nameTools = get_lang('ExerciseManagement');
 
-if (isset($_SESSION['gradebook'])){
-	$gradebook=	$_SESSION['gradebook'];
+if (isset($_SESSION['gradebook'])) {
+	$gradebook = $_SESSION['gradebook'];
 }
 
-if (!empty($gradebook) && $gradebook=='view') {
-	$interbreadcrumb[]= array (
+if (!empty($gradebook) && $gradebook == 'view') {
+	$interbreadcrumb[] = array(
 			'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
 			'name' => get_lang('ToolGradebook')
 		);
 }
 
-$interbreadcrumb[]=array("url" => "exercise.php","name" => get_lang('Exercises'));
-Display::display_header($nameTools,"Exercises");
+$interbreadcrumb[] = array("url" => "exercise.php", "name" => get_lang('Exercises'));
+Display::display_header($nameTools, "Exercises");
 ?>
 <table border="0" align="center" cellpadding="2" cellspacing="2" width="100%">
 <h4>
@@ -38,17 +38,17 @@ Display::display_header($nameTools,"Exercises");
 	echo $objQuestionTmp->selectTitle();
 	echo "</td></tr>";
 	echo " <br><tr><td><b><br>".get_lang('Answer')." : </b></td></tr>";
-	$objAnswerTmp=new Answer($id);
+	$objAnswerTmp = new Answer($id);
 	$num = $objAnswerTmp->selectNbrAnswers();
 	$objAnswerTmp->read();
-	for($i=1;$i<=$num;$i++)
+	for ($i = 1; $i <= $num; $i++)
 	{
 	echo "<tr><td width='10%'> ";
-	$ans =  $objAnswerTmp->answer[$i];
+	$ans = $objAnswerTmp->answer[$i];
 
-	$form = new FormValidator('feedbackform','post',api_get_self()."?".api_get_cidreq()."&modifyQuestion=".$modifyQuestion."&newQuestion=".$newQuestion);
+	$form = new FormValidator('feedbackform', 'post', api_get_self()."?".api_get_cidreq()."&modifyQuestion=".$modifyQuestion."&newQuestion=".$newQuestion);
 	$obj_registration_form = new HTML_QuickForm('frmRegistration', 'POST');
-	$renderer =& $obj_registration_form->defaultRenderer();
+	$renderer = & $obj_registration_form->defaultRenderer();
 	$renderer->setCustomElementTemplate(
 '<tr>
 	<td align="left" style="" valign="top" width=30%>{label}

+ 20 - 20
main/forum/viewthread_nested.inc.php

@@ -52,7 +52,7 @@ foreach ($rows as $post) {
     $indent = $post['indent_cnt'];
 
     $html = '';
-    $html .= '<div class="col-md-offset-' . $indent . '" >';
+    $html .= '<div class="col-md-offset-'.$indent.'" >';
     $html .= '<div class="panel panel-default forum-post">';
     $html .= '<div class="panel-body">';
     $html .= '<div class="row">';
@@ -67,7 +67,7 @@ foreach ($rows as $post) {
 
     if ($origin != 'learnpath') {
         if ($allowUserImageForum) {
-            $html .= '<div class="thumbnail">' . display_user_image($post['user_id'], $name, $origin) . '</div>';
+            $html .= '<div class="thumbnail">'.display_user_image($post['user_id'], $name, $origin).'</div>';
         }
 
         $html .= Display::tag(
@@ -77,7 +77,7 @@ foreach ($rows as $post) {
         );
     } else {
         if ($allowUserImageForum) {
-            $html .= '<div class="thumbnail">' . display_user_image($post['user_id'], $name, $origin) . '</div>';
+            $html .= '<div class="thumbnail">'.display_user_image($post['user_id'], $name, $origin).'</div>';
         }
 
         $html .= Display::tag(
@@ -142,7 +142,7 @@ foreach ($rows as $post) {
         !(api_is_course_coach() && $current_forum['session_id'] != $sessionId)
     ) {
         if ($locked == false) {
-            $deleteUrl = api_get_self() . '?' . api_get_cidreq() . '&' . http_build_query([
+            $deleteUrl = api_get_self().'?'.api_get_cidreq().'&'.http_build_query([
                     'forum' => $clean_forum_id,
                     'thread' => $clean_thread_id,
                     'action' => 'delete',
@@ -180,9 +180,9 @@ foreach ($rows as $post) {
         );
 
         if ($count > 0) {
-            $iconEdit .= "<a href=\"viewthread.php?" . api_get_cidreq()
+            $iconEdit .= "<a href=\"viewthread.php?".api_get_cidreq()
                 . "&forum=$clean_forum_id&thread=$clean_thread_id&action=move&post={$post['post_id']}"
-                . "\">" . Display::return_icon('move.png', get_lang('MovePost'), array(), ICON_SIZE_SMALL) . "</a>";
+                . "\">".Display::return_icon('move.png', get_lang('MovePost'), array(), ICON_SIZE_SMALL)."</a>";
         }
     }
 
@@ -203,11 +203,11 @@ foreach ($rows as $post) {
                 $_GET['thread']
             );
             if ($locked == false) {
-                $iconEdit .= "<a href=\"forumqualify.php?" . api_get_cidreq()
+                $iconEdit .= "<a href=\"forumqualify.php?".api_get_cidreq()
                     . "&forum=$clean_forum_id&thread=$clean_thread_id&action=list&post={$post['post_id']}"
                     . "&user={$post['user_id']}&user_id={$post['user_id']}"
                     . "&idtextqualify=$current_qualify_thread"
-                    . "\" >" . Display::return_icon('quiz.png', get_lang('Qualify')) . "</a>";
+                    . "\" >".Display::return_icon('quiz.png', get_lang('Qualify'))."</a>";
             }
         }
     }
@@ -215,7 +215,7 @@ foreach ($rows as $post) {
     $statusIcon = getPostStatus($current_forum, $post);
 
     if ($iconEdit != '') {
-        $html .= '<div class="tools-icons">' . $iconEdit . ' '.$statusIcon.'</div>';
+        $html .= '<div class="tools-icons">'.$iconEdit.' '.$statusIcon.'</div>';
     }
 
     $buttonReply = '';
@@ -229,7 +229,7 @@ foreach ($rows as $post) {
             if (!api_is_anonymous() && api_is_allowed_to_session_edit(false, true)) {
                 $buttonReply = Display::toolbarButton(
                     get_lang('ReplyToMessage'),
-                    'reply.php?' . api_get_cidreq() . '&' . http_build_query([
+                    'reply.php?'.api_get_cidreq().'&'.http_build_query([
                         'forum' => $clean_forum_id,
                         'thread' => $clean_thread_id,
                         'post' => $post['post_id'],
@@ -242,7 +242,7 @@ foreach ($rows as $post) {
 
                 $buttonQuote = Display::toolbarButton(
                     get_lang('QuoteMessage'),
-                    'reply.php?' . api_get_cidreq() . '&' . http_build_query([
+                    'reply.php?'.api_get_cidreq().'&'.http_build_query([
                         'forum' => $clean_forum_id,
                         'thread' => $clean_thread_id,
                         'post' => $post['post_id'],
@@ -266,21 +266,21 @@ foreach ($rows as $post) {
         if ($current_forum_category && $current_forum_category['locked'] == 1) {
             $closedPost = Display::tag(
                 'div',
-                '<em class="fa fa-exclamation-triangle"></em> ' . get_lang('ForumcategoryLocked'),
+                '<em class="fa fa-exclamation-triangle"></em> '.get_lang('ForumcategoryLocked'),
                 array('class' => 'alert alert-warning post-closed')
             );
         }
         if ($current_forum['locked'] == 1) {
             $closedPost = Display::tag(
                 'div',
-                '<em class="fa fa-exclamation-triangle"></em> ' . get_lang('ForumLocked'),
+                '<em class="fa fa-exclamation-triangle"></em> '.get_lang('ForumLocked'),
                 array('class' => 'alert alert-warning post-closed')
             );
         }
         if ($current_thread['locked'] == 1) {
             $closedPost = Display::tag(
                 'div',
-                '<em class="fa fa-exclamation-triangle"></em> ' . get_lang('ThreadLocked'),
+                '<em class="fa fa-exclamation-triangle"></em> '.get_lang('ThreadLocked'),
                 array('class' => 'alert alert-warning post-closed')
             );
         }
@@ -328,16 +328,16 @@ foreach ($rows as $post) {
             $html .= Display::return_icon('attachment.gif', get_lang('Attachment'));
             $html .= '<a href="download.php?file=';
             $html .= $attachment['path'];
-            $html .= ' "> ' . $user_filename . ' </a>';
-            $html .= '<span class="forum_attach_comment" >' . $attachment['comment'] . '</span>';
+            $html .= ' "> '.$user_filename.' </a>';
+            $html .= '<span class="forum_attach_comment" >'.$attachment['comment'].'</span>';
             if (($current_forum['allow_edit'] == 1 && $post['user_id'] == $userId) ||
                 (api_is_allowed_to_edit(false, true) && !(api_is_course_coach() && $current_forum['session_id'] != $sessionId))
             ) {
-                $html .= '&nbsp;&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=delete_attach&id_attach='
-                    . $attachment['iid'] . '&forum=' . $clean_forum_id . '&thread=' . $clean_thread_id
+                $html .= '&nbsp;&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&action=delete_attach&id_attach='
+                    . $attachment['iid'].'&forum='.$clean_forum_id.'&thread='.$clean_thread_id
                     . '" onclick="javascript:if(!confirm(\''
-                    . addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES)) . '\')) return false;">'
-                    . Display::return_icon('delete.gif', get_lang('Delete')) . '</a><br />';
+                    . addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES)).'\')) return false;">'
+                    . Display::return_icon('delete.gif', get_lang('Delete')).'</a><br />';
             }
         }
     }

+ 11 - 11
main/group/group_edit.php

@@ -13,7 +13,7 @@
 
 require_once __DIR__.'/../inc/global.inc.php';
 $this_section = SECTION_COURSES;
-$current_course_tool  = TOOL_GROUP;
+$current_course_tool = TOOL_GROUP;
 
 // Notice for unauthorized people.
 api_protect_course_script(true);
@@ -22,8 +22,8 @@ $group_id = api_get_group_id();
 $current_group = GroupManager :: get_group_properties($group_id);
 
 $nameTools = get_lang('EditGroup');
-$interbreadcrumb[] = array ('url' => 'group.php?'.api_get_cidreq(), 'name' => get_lang('Groups'));
-$interbreadcrumb[] = array ('url' => 'group_space.php?'.api_get_cidreq(), 'name' => $current_group['name']);
+$interbreadcrumb[] = array('url' => 'group.php?'.api_get_cidreq(), 'name' => get_lang('Groups'));
+$interbreadcrumb[] = array('url' => 'group_space.php?'.api_get_cidreq(), 'name' => $current_group['name']);
 
 $is_group_member = GroupManager :: is_tutor_of_group(api_get_user_id(), $current_group);
 
@@ -130,7 +130,7 @@ $form->addElement('hidden', 'referer');
 $form->addText('name', get_lang('GroupName'));
 
 // Description
-$form->addElement('textarea', 'description', get_lang('Description'), array ('rows' => 6));
+$form->addElement('textarea', 'description', get_lang('Description'), array('rows' => 6));
 
 $complete_user_list = GroupManager :: fill_groups_list($current_group);
 usort($complete_user_list, 'sort_users');
@@ -159,7 +159,7 @@ $group_tutors_element = $form->addElement(
 // Group members
 $group_member_list = GroupManager::get_subscribed_users($current_group);
 
-$selected_users = array ();
+$selected_users = array();
 foreach ($group_member_list as $index => $user) {
     $selected_users[] = $user['user_id'];
 }
@@ -205,7 +205,7 @@ $group = array(
 $form->addGroup(
     $group,
     '',
-    Display::return_icon('user.png', get_lang('GroupSelfRegistration')) . ' ' . get_lang('GroupSelfRegistration'),
+    Display::return_icon('user.png', get_lang('GroupSelfRegistration')).' '.get_lang('GroupSelfRegistration'),
     null,
     false
 );
@@ -231,7 +231,7 @@ $group[] = $form->createElement('radio', 'work_state', null, get_lang('Private')
 $form->addGroup(
     $group,
     '',
-    Display::return_icon('work.png', get_lang('GroupWork')) . ' ' . get_lang('GroupWork'),
+    Display::return_icon('work.png', get_lang('GroupWork')).' '.get_lang('GroupWork'),
     null,
     false
 );
@@ -244,7 +244,7 @@ $group[] = $form->createElement('radio', 'calendar_state', null, get_lang('Priva
 $form->addGroup(
     $group,
     '',
-    Display::return_icon('agenda.png', get_lang('GroupCalendar')) . ' ' . get_lang('GroupCalendar'),
+    Display::return_icon('agenda.png', get_lang('GroupCalendar')).' '.get_lang('GroupCalendar'),
     null,
     false
 );
@@ -257,7 +257,7 @@ $group[] = $form->createElement('radio', 'announcements_state', null, get_lang('
 $form->addGroup(
     $group,
     '',
-    Display::return_icon('announce.png', get_lang('GroupAnnouncements')) . ' ' . get_lang('GroupAnnouncements'),
+    Display::return_icon('announce.png', get_lang('GroupAnnouncements')).' '.get_lang('GroupAnnouncements'),
     null,
     false
 );
@@ -270,7 +270,7 @@ $group[] = $form->createElement('radio', 'forum_state', null, get_lang('Private'
 $form->addGroup(
     $group,
     '',
-    Display::return_icon('forum.png', get_lang('GroupForum')) . ' ' . get_lang('GroupForum'),
+    Display::return_icon('forum.png', get_lang('GroupForum')).' '.get_lang('GroupForum'),
     null,
     false
 );
@@ -284,7 +284,7 @@ $group = array(
 $form->addGroup(
     $group,
     '',
-    Display::return_icon('wiki.png', get_lang('GroupWiki')) . ' ' . get_lang('GroupWiki'),
+    Display::return_icon('wiki.png', get_lang('GroupWiki')).' '.get_lang('GroupWiki'),
     null,
     false
 );

+ 65 - 65
main/inc/lib/CourseChatUtils.php

@@ -67,7 +67,7 @@ class CourseChatUtils
             return '';
         }
 
-        Emojione\Emojione::$imagePathPNG = api_get_path(WEB_LIBRARY_PATH) . 'javascript/emojione/png/';
+        Emojione\Emojione::$imagePathPNG = api_get_path(WEB_LIBRARY_PATH).'javascript/emojione/png/';
         Emojione\Emojione::$ascii = true;
 
         $message = trim($message);
@@ -113,15 +113,15 @@ class CourseChatUtils
         $user = $em->find('ChamiloUserBundle:User', $this->userId);
         $courseInfo = api_get_course_info_by_id($this->courseId);
         $isMaster = (bool) api_is_course_admin();
-        $document_path = api_get_path(SYS_COURSE_PATH) . $courseInfo['path'] . '/document';
+        $document_path = api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/document';
         $basepath_chat = '/chat_files';
 
         if (!$this->groupId) {
             $group_info = GroupManager::get_group_properties($this->groupId);
-            $basepath_chat = $group_info['directory'] . '/chat_files';
+            $basepath_chat = $group_info['directory'].'/chat_files';
         }
 
-        $chat_path = $document_path . $basepath_chat . '/';
+        $chat_path = $document_path.$basepath_chat.'/';
 
         if (!is_dir($chat_path)) {
             if (is_file($chat_path)) {
@@ -131,25 +131,25 @@ class CourseChatUtils
 
         $date_now = date('Y-m-d');
         $timeNow = date('d/m/y H:i:s');
-        $basename_chat = 'messages-' . $date_now;
+        $basename_chat = 'messages-'.$date_now;
 
         if ($this->groupId && !$friendId) {
-            $basename_chat = 'messages-' . $date_now . '_gid-' . $this->groupId;
+            $basename_chat = 'messages-'.$date_now.'_gid-'.$this->groupId;
         } elseif ($this->sessionId && !$friendId) {
-            $basename_chat = 'messages-' . $date_now . '_sid-' . $this->sessionId;
+            $basename_chat = 'messages-'.$date_now.'_sid-'.$this->sessionId;
         } elseif ($friendId) {
             if ($this->userId < $friendId) {
-                $basename_chat = 'messages-' . $date_now . '_uid-' . $this->userId . '-' . $friendId;
+                $basename_chat = 'messages-'.$date_now.'_uid-'.$this->userId.'-'.$friendId;
             } else {
-                $basename_chat = 'messages-' . $date_now . '_uid-' . $friendId . '-' . $this->userId;
+                $basename_chat = 'messages-'.$date_now.'_uid-'.$friendId.'-'.$this->userId;
             }
         }
 
         $message = self::prepareMessage($message);
 
-        $fileTitle = $basename_chat . '.log.html';
-        $filePath = $basepath_chat . '/' . $fileTitle;
-        $absoluteFilePath = $chat_path . $fileTitle;
+        $fileTitle = $basename_chat.'.log.html';
+        $filePath = $basepath_chat.'/'.$fileTitle;
+        $absoluteFilePath = $chat_path.$fileTitle;
 
         if (!file_exists($absoluteFilePath)) {
             $doc_id = add_document($courseInfo, $filePath, 'file', 0, $fileTitle);
@@ -182,23 +182,23 @@ class CourseChatUtils
             $fileContent = '
                 <div class="message-teacher">
                     <div class="content-message">
-                        <div class="chat-message-block-name">' . $user->getCompleteName() . '</div>
-                        <div class="chat-message-block-content">' . $message . '</div>
-                        <div class="message-date">' . $timeNow . '</div>
+                        <div class="chat-message-block-name">' . $user->getCompleteName().'</div>
+                        <div class="chat-message-block-content">' . $message.'</div>
+                        <div class="message-date">' . $timeNow.'</div>
                     </div>
                     <div class="icon-message"></div>
-                    <img class="chat-image" src="' . $userPhoto . '">
+                    <img class="chat-image" src="' . $userPhoto.'">
                 </div>
             ';
         } else {
             $fileContent = '
                 <div class="message-student">
-                    <img class="chat-image" src="' . $userPhoto . '">
+                    <img class="chat-image" src="' . $userPhoto.'">
                     <div class="icon-message"></div>
                     <div class="content-message">
-                        <div class="chat-message-block-name">' . $user->getCompleteName() . '</div>
-                        <div class="chat-message-block-content">' . $message . '</div>
-                        <div class="message-date">' . $timeNow . '</div>
+                        <div class="chat-message-block-name">' . $user->getCompleteName().'</div>
+                        <div class="chat-message-block-content">' . $message.'</div>
+                        <div class="message-date">' . $timeNow.'</div>
                     </div>
                 </div>
             ';
@@ -293,9 +293,9 @@ class CourseChatUtils
         $extraCondition = null;
 
         if ($this->groupId) {
-            $extraCondition = 'AND ccc.toGroupId = ' . intval($this->groupId);
+            $extraCondition = 'AND ccc.toGroupId = '.intval($this->groupId);
         } else {
-            $extraCondition = 'AND ccc.sessionId = ' . intval($this->sessionId);
+            $extraCondition = 'AND ccc.sessionId = '.intval($this->sessionId);
         }
 
         $currentTime = new DateTime(api_get_utc_datetime(), new DateTimeZone('UTC'));
@@ -1394,7 +1394,7 @@ class CourseChatUtils
     {
         return [
             ':bowtie:',
-            ':smile:'|
+            ':smile:' |
             ':laughing:',
             ':blush:',
             ':smiley:',
@@ -1467,17 +1467,17 @@ class CourseChatUtils
     public function getFileName($absolute = false, $friendId = 0)
     {
         $date = date('Y-m-d');
-        $base = 'messages-' . $date . '.log.html';
+        $base = 'messages-'.$date.'.log.html';
 
         if ($this->groupId && !$friendId) {
-            $base = 'messages-' . $date . '_gid-' . $this->groupId . '.log.html';
+            $base = 'messages-'.$date.'_gid-'.$this->groupId.'.log.html';
         } elseif ($this->sessionId && !$friendId) {
-            $base = 'messages-' . $date . '_sid-' . $this->sessionId . '.log.html';
+            $base = 'messages-'.$date.'_sid-'.$this->sessionId.'.log.html';
         } elseif ($friendId) {
             if ($this->userId < $friendId) {
-                $base = 'messages-' . $date . '_uid-' . $this->userId . '-' . $friendId . '.log.html';
+                $base = 'messages-'.$date.'_uid-'.$this->userId.'-'.$friendId.'.log.html';
             } else {
-                $base = 'messages-' . $date . '_uid-' . $friendId . '-' . $this->userId . '.log.html';
+                $base = 'messages-'.$date.'_uid-'.$friendId.'-'.$this->userId.'.log.html';
             }
         }
 
@@ -1486,16 +1486,16 @@ class CourseChatUtils
         }
 
         $courseInfo = api_get_course_info_by_id($this->courseId);
-        $document_path = api_get_path(SYS_COURSE_PATH) . $courseInfo['path'] . '/document';
+        $document_path = api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/document';
 
-        $chatPath = $document_path . '/chat_files/';
+        $chatPath = $document_path.'/chat_files/';
 
         if ($this->groupId) {
             $group_info = GroupManager::get_group_properties($this->groupId);
-            $chatPath = $document_path . $group_info['directory'] . '/chat_files/';
+            $chatPath = $document_path.$group_info['directory'].'/chat_files/';
         }
 
-        return $chatPath . $base;
+        return $chatPath.$base;
     }
 
     /**
@@ -1508,16 +1508,16 @@ class CourseChatUtils
     {
         $courseInfo = api_get_course_info_by_id($this->courseId);
         $date_now = date('Y-m-d');
-        $isMaster = (bool)api_is_course_admin();
+        $isMaster = (bool) api_is_course_admin();
         $basepath_chat = '/chat_files';
-        $document_path = api_get_path(SYS_COURSE_PATH) . $courseInfo['path'] . '/document';
+        $document_path = api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/document';
 
         if ($this->groupId) {
             $group_info = GroupManager:: get_group_properties($this->groupId);
-            $basepath_chat = $group_info['directory'] . '/chat_files';
+            $basepath_chat = $group_info['directory'].'/chat_files';
         }
 
-        $chat_path = $document_path . $basepath_chat . '/';
+        $chat_path = $document_path.$basepath_chat.'/';
 
         if (!is_dir($chat_path)) {
             if (is_file($chat_path)) {
@@ -1544,24 +1544,24 @@ class CourseChatUtils
             }
         }
 
-        $filename_chat = 'messages-' . $date_now . '.log.html';
+        $filename_chat = 'messages-'.$date_now.'.log.html';
 
         if ($this->groupId && !$friendId) {
-            $filename_chat = 'messages-' . $date_now . '_gid-' . $this->groupId . '.log.html';
+            $filename_chat = 'messages-'.$date_now.'_gid-'.$this->groupId.'.log.html';
         } else if ($this->sessionId && !$friendId) {
-            $filename_chat = 'messages-' . $date_now . '_sid-' . $this->sessionId . '.log.html';
+            $filename_chat = 'messages-'.$date_now.'_sid-'.$this->sessionId.'.log.html';
         } elseif ($friendId) {
             if ($this->userId < $friendId) {
-                $filename_chat = 'messages-' . $date_now . '_uid-' . $this->userId . '-' . $friendId . '.log.html';
+                $filename_chat = 'messages-'.$date_now.'_uid-'.$this->userId.'-'.$friendId.'.log.html';
             } else {
-                $filename_chat = 'messages-' . $date_now . '_uid-' . $friendId . '-' . $this->userId . '.log.html';
+                $filename_chat = 'messages-'.$date_now.'_uid-'.$friendId.'-'.$this->userId.'.log.html';
             }
         }
 
-        if (!file_exists($chat_path . $filename_chat)) {
-            @fclose(fopen($chat_path . $filename_chat, 'w'));
+        if (!file_exists($chat_path.$filename_chat)) {
+            @fclose(fopen($chat_path.$filename_chat, 'w'));
             if (!api_is_anonymous()) {
-                $doc_id = add_document($courseInfo, $basepath_chat . '/' . $filename_chat, 'file', 0, $filename_chat);
+                $doc_id = add_document($courseInfo, $basepath_chat.'/'.$filename_chat, 'file', 0, $filename_chat);
                 api_item_property_update(
                     $courseInfo,
                     TOOL_DOCUMENT,
@@ -1590,17 +1590,17 @@ class CourseChatUtils
             }
         }
 
-        $basename_chat = 'messages-' . $date_now;
+        $basename_chat = 'messages-'.$date_now;
 
         if ($this->groupId && !$friendId) {
-            $basename_chat = 'messages-' . $date_now . '_gid-' . $this->groupId;
+            $basename_chat = 'messages-'.$date_now.'_gid-'.$this->groupId;
         } else if ($this->sessionId && !$friendId) {
-            $basename_chat = 'messages-' . $date_now . '_sid-' . $this->sessionId;
+            $basename_chat = 'messages-'.$date_now.'_sid-'.$this->sessionId;
         } elseif ($friendId) {
             if ($this->userId < $friendId) {
-                $basename_chat = 'messages-' . $date_now . '_uid-' . $this->userId . '-' . $friendId;
+                $basename_chat = 'messages-'.$date_now.'_uid-'.$this->userId.'-'.$friendId;
             } else {
-                $basename_chat = 'messages-' . $date_now . '_uid-' . $friendId . '-' . $this->userId;
+                $basename_chat = 'messages-'.$date_now.'_uid-'.$friendId.'-'.$this->userId;
             }
         }
 
@@ -1608,19 +1608,19 @@ class CourseChatUtils
 
             $i = 1;
 
-            while (file_exists($chat_path . $basename_chat . '-' . $i . '.log.html')) {
+            while (file_exists($chat_path.$basename_chat.'-'.$i.'.log.html')) {
                 $i++;
             }
 
-            @rename($chat_path . $basename_chat . '.log.html', $chat_path . $basename_chat . '-' . $i . '.log.html');
-            @fclose(fopen($chat_path . $basename_chat . '.log.html', 'w'));
+            @rename($chat_path.$basename_chat.'.log.html', $chat_path.$basename_chat.'-'.$i.'.log.html');
+            @fclose(fopen($chat_path.$basename_chat.'.log.html', 'w'));
 
             $doc_id = add_document(
                 $courseInfo,
-                $basepath_chat . '/' . $basename_chat . '-' . $i . '.log.html',
+                $basepath_chat.'/'.$basename_chat.'-'.$i.'.log.html',
                 'file',
-                filesize($chat_path . $basename_chat . '-' . $i . '.log.html'),
-                $basename_chat . '-' . $i . '.log.html'
+                filesize($chat_path.$basename_chat.'-'.$i.'.log.html'),
+                $basename_chat.'-'.$i.'.log.html'
             );
 
             api_item_property_update(
@@ -1651,7 +1651,7 @@ class CourseChatUtils
 
             $doc_id = DocumentManager::get_document_id(
                 $courseInfo,
-                $basepath_chat . '/' . $basename_chat . '.log.html'
+                $basepath_chat.'/'.$basename_chat.'.log.html'
             );
 
             update_existing_document($courseInfo, $doc_id, 0);
@@ -1660,8 +1660,8 @@ class CourseChatUtils
         $remove = 0;
         $content = array();
 
-        if (file_exists($chat_path . $basename_chat . '.log.html')) {
-            $content = file($chat_path . $basename_chat . '.log.html');
+        if (file_exists($chat_path.$basename_chat.'.log.html')) {
+            $content = file($chat_path.$basename_chat.'.log.html');
             $nbr_lines = sizeof($content);
             $remove = $nbr_lines - 100;
         }
@@ -1674,7 +1674,7 @@ class CourseChatUtils
 
         if (isset($_GET['origin']) && $_GET['origin'] == 'whoisonline') {
             //the caller
-            $content[0] = get_lang('CallSent') . '<br />' . $content[0];
+            $content[0] = get_lang('CallSent').'<br />'.$content[0];
         }
 
         $history = '<div id="content-chat">';
@@ -1689,7 +1689,7 @@ class CourseChatUtils
             $history .= '
                 <div id="clear-chat">
                     <button type="button" id="chat-reset" class="btn btn-danger btn-sm">
-                        ' . get_lang('ClearList') . '
+                        ' . get_lang('ClearList').'
                     </button>
                 </div>
             ';
@@ -1710,9 +1710,9 @@ class CourseChatUtils
         $extraCondition = null;
 
         if ($this->groupId) {
-            $extraCondition = 'AND ccc.toGroupId = ' . intval($this->groupId);
+            $extraCondition = 'AND ccc.toGroupId = '.intval($this->groupId);
         } else {
-            $extraCondition = 'AND ccc.sessionId = ' . intval($this->sessionId);
+            $extraCondition = 'AND ccc.sessionId = '.intval($this->sessionId);
         }
 
         $number = Database::getManager()
@@ -1742,9 +1742,9 @@ class CourseChatUtils
         $extraCondition = null;
 
         if ($this->groupId) {
-            $extraCondition = 'AND ccc.toGroupId = ' . intval($this->groupId);
+            $extraCondition = 'AND ccc.toGroupId = '.intval($this->groupId);
         } else {
-            $extraCondition = 'AND ccc.sessionId = ' . intval($this->sessionId);
+            $extraCondition = 'AND ccc.sessionId = '.intval($this->sessionId);
         }
 
         $number = Database::getManager()
@@ -1780,7 +1780,7 @@ class CourseChatUtils
                 'lastname' => $user->getLastname(),
                 'status' => !$this->sessionId ? $subscription->getStatus() : $user->getStatus(),
                 'image_url' => UserManager::getUserPicture($user->getId(), USER_IMAGE_SIZE_MEDIUM),
-                'profile_url' => api_get_path(WEB_CODE_PATH) . 'social/profile.php?u=' . $user->getId(),
+                'profile_url' => api_get_path(WEB_CODE_PATH).'social/profile.php?u='.$user->getId(),
                 'complete_name' => $user->getCompleteName(),
                 'username' => $user->getUsername(),
                 'email' => $user->getEmail(),

+ 8 - 8
main/inc/lib/extra_field_value.lib.php

@@ -218,7 +218,7 @@ class ExtraFieldValue extends Model
                             break;
                     }
 
-                    $fileName = ExtraField::FIELD_TYPE_FILE_IMAGE . "_{$params['item_id']}.png";
+                    $fileName = ExtraField::FIELD_TYPE_FILE_IMAGE."_{$params['item_id']}.png";
 
                     if (!file_exists($fileDir)) {
                         mkdir($fileDir, $dirPermissions, true);
@@ -227,15 +227,15 @@ class ExtraFieldValue extends Model
                     if ($value['error'] == 0) {
                         //Crop the image to adjust 16:9 ratio
                         $crop = new Image($value['tmp_name']);
-                        $crop->crop($params['extra_' . $field_variable . '_crop_result']);
+                        $crop->crop($params['extra_'.$field_variable.'_crop_result']);
 
                         $imageExtraField = new Image($value['tmp_name']);
                         $imageExtraField->resize(400);
-                        $imageExtraField->send_image($fileDir . $fileName, -1, 'png');
+                        $imageExtraField->send_image($fileDir.$fileName, -1, 'png');
                         $newParams = array(
                             'item_id' => $params['item_id'],
                             'field_id' => $extraFieldInfo['id'],
-                            'value' => $fileDirStored . $fileName,
+                            'value' => $fileDirStored.$fileName,
                             'comment' => $comment
                         );
                         self::save($newParams);
@@ -260,18 +260,18 @@ class ExtraFieldValue extends Model
                     }
 
                     $cleanedName = api_replace_dangerous_char($value['name']);
-                    $fileName = ExtraField::FIELD_TYPE_FILE . "_{$params['item_id']}_$cleanedName";
+                    $fileName = ExtraField::FIELD_TYPE_FILE."_{$params['item_id']}_$cleanedName";
                     if (!file_exists($fileDir)) {
                         mkdir($fileDir, $dirPermissions, true);
                     }
 
                     if ($value['error'] == 0) {
-                        moveUploadedFile($value, $fileDir . $fileName);
+                        moveUploadedFile($value, $fileDir.$fileName);
 
                         $new_params = array(
                             'item_id' => $params['item_id'],
                             'field_id' => $extraFieldInfo['id'],
-                            'value' => $fileDirStored . $fileName
+                            'value' => $fileDirStored.$fileName
                         );
 
                         if ($this->type !== 'session' && $this->type !== 'course') {
@@ -472,7 +472,7 @@ class ExtraFieldValue extends Model
                 */
                 if (false) {
                     global $app;
-                    switch($this->type) {
+                    switch ($this->type) {
                         case 'question':
                             $extraFieldValue = $app['orm.ems']['db_write']->getRepository('ChamiloLMS\Entity\QuestionFieldValues')->find($field_values['id']);
                             $extraFieldValue->setUserId(api_get_user_id());

+ 14 - 14
main/mySpace/user_edit.php

@@ -85,15 +85,15 @@ $auth_sources = 0; //make available wider as we need it in case of form reset (s
 	$group[] =& $form->createElement('select', 'auth_source', null, $auth_sources);
 	$group[] =& $form->createElement('static', '', '', '<br />');
 }*/
-$group[] =& $form->createElement('radio', 'password_auto', get_lang('Password'), get_lang('AutoGeneratePassword').'<br />', 1);
-$group[] =& $form->createElement('radio', 'password_auto', 'id="radio_user_password"', null, 0);
-$group[] =& $form->createElement('password', 'password', null, array('onkeydown' => 'javascript: password_switch_radio_button(document.user_add,"password[password_auto]");'));
+$group[] = & $form->createElement('radio', 'password_auto', get_lang('Password'), get_lang('AutoGeneratePassword').'<br />', 1);
+$group[] = & $form->createElement('radio', 'password_auto', 'id="radio_user_password"', null, 0);
+$group[] = & $form->createElement('password', 'password', null, array('onkeydown' => 'javascript: password_switch_radio_button(document.user_add,"password[password_auto]");'));
 $form->addGroup($group, 'password', get_lang('Password'));
 
 // Send email
 $group = array();
-$group[] =& $form->createElement('radio', 'send_mail', null, get_lang('Yes'), 1);
-$group[] =& $form->createElement('radio', 'send_mail', null, get_lang('No'), 0);
+$group[] = & $form->createElement('radio', 'send_mail', null, get_lang('Yes'), 1);
+$group[] = & $form->createElement('radio', 'send_mail', null, get_lang('No'), 0);
 $form->addGroup($group, 'mail', get_lang('SendMailToNewUser'));
 
 // Set default values
@@ -104,7 +104,7 @@ $defaults['password']['password_auto'] = 1;
 
 $form->setDefaults($defaults);
 // Submit button
-$select_level = array ();
+$select_level = array();
 $html_results_enabled[] = $form->addButtonUpdate(get_lang('Update'), 'submit', true);
 $form->addGroup($html_results_enabled);
 // Validate form
@@ -165,17 +165,17 @@ if ($form->validate()) {
 			}
 
 			$emailbody = get_lang('Dear')." ".stripslashes(api_get_person_name($userInfo['firstname'], $userInfo['lastname'])).",\n\n".
-                get_lang('YouAreReg')." ". api_get_setting('siteName') ." ".get_lang('WithTheFollowingSettings')."\n\n".
-                get_lang('Username')." : ". $username ."\n". get_lang('Pass')." : ".stripslashes($password)."\n\n" .
-                get_lang('Address') ." ". api_get_setting('siteName') ." ".
-                get_lang('Is') ." : ".$portal_url."\n\n".
-                get_lang('Problem'). "\n\n".
+                get_lang('YouAreReg')." ".api_get_setting('siteName')." ".get_lang('WithTheFollowingSettings')."\n\n".
+                get_lang('Username')." : ".$username."\n".get_lang('Pass')." : ".stripslashes($password)."\n\n".
+                get_lang('Address')." ".api_get_setting('siteName')." ".
+                get_lang('Is')." : ".$portal_url."\n\n".
+                get_lang('Problem')."\n\n".
                 get_lang('SignatureFormula').",\n\n".
                 api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname'))."\n".
-                get_lang('Manager'). " ".
+                get_lang('Manager')." ".
                 api_get_setting('siteName')."\nT. ".
-                api_get_setting('administratorTelephone')."\n" .
-                get_lang('Email') ." : ".api_get_setting('emailAdministrator');
+                api_get_setting('administratorTelephone')."\n".
+                get_lang('Email')." : ".api_get_setting('emailAdministrator');
             $emailbody = nl2br($emailbody);
 
 			api_mail_html(

+ 3 - 3
main/notebook/index.php

@@ -9,7 +9,7 @@
 
 require_once __DIR__.'/../inc/global.inc.php';
 
-$current_course_tool  = TOOL_NOTEBOOK;
+$current_course_tool = TOOL_NOTEBOOK;
 
 // The section (tabs)
 $this_section = SECTION_COURSES;
@@ -99,7 +99,7 @@ if ($action === 'addnote') {
         NotebookManager::display_notes();
     } else {
         echo '<div class="actions">';
-        echo '<a href="index.php">'.Display::return_icon('back.png',get_lang('BackToNotesList'),'',ICON_SIZE_MEDIUM).'</a>';
+        echo '<a href="index.php">'.Display::return_icon('back.png', get_lang('BackToNotesList'), '', ICON_SIZE_MEDIUM).'</a>';
         echo '</div>';
         $token = Security::get_token();
         $form->addElement('hidden', 'sec_token');
@@ -153,7 +153,7 @@ if ($action === 'addnote') {
     } else {
         echo '<div class="actions">';
         echo '<a href="index.php">'.
-            Display::return_icon('back.png',get_lang('BackToNotesList'),'',ICON_SIZE_MEDIUM).'</a>';
+            Display::return_icon('back.png', get_lang('BackToNotesList'), '', ICON_SIZE_MEDIUM).'</a>';
         echo '</div>';
         $token = Security::get_token();
         $form->addElement('hidden', 'sec_token');

+ 2 - 2
main/session/add_students_to_session.php

@@ -13,12 +13,12 @@ require_once __DIR__.'/../inc/global.inc.php';
 $this_section = SECTION_PLATFORM_ADMIN;
 
 // setting breadcrumbs
-$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('SubscribeStudentsToSession');
 $add_type = 'multiple';
-if (isset($_REQUEST['add_type']) && $_REQUEST['add_type']!='') {
+if (isset($_REQUEST['add_type']) && $_REQUEST['add_type'] != '') {
     $add_type = Security::remove_XSS($_REQUEST['add_type']);
 }
 $form_sent  = 0;

+ 2 - 2
main/session/session_category_list.php

@@ -41,7 +41,7 @@ if ($action == 'delete_on_session' || $action == 'delete_off_session') {
     exit();
 }
 
-$interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList'));
+$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList'));
 
 if (isset($_GET['search']) && $_GET['search'] == 'advanced') {
     $interbreadcrumb[] = array("url" => 'session_category_list.php', "name" => get_lang('ListSessionCategory'));
@@ -74,7 +74,7 @@ if (isset($_GET['search']) && $_GET['search'] == 'advanced') {
         $where .= " AND access_url_id = ".api_get_current_access_url_id()." ";
     }
 
-    $table_access_url_rel_session= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
+    $table_access_url_rel_session = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
     $query = "SELECT sc.*, (
                 SELECT count(id) FROM $tbl_session s
                 INNER JOIN $table_access_url_rel_session us

+ 13 - 13
main/session/session_list.php

@@ -55,14 +55,14 @@ $courseSelect = $sessionFilter->addElement(
     'course_name',
     get_lang('SearchCourse'),
     null,
-    array('url' => api_get_path(WEB_AJAX_PATH) . 'course.ajax.php?a=search_course')
+    array('url' => api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=search_course')
 );
 
 if (!empty($courseId)) {
     $courseInfo = api_get_course_info_by_id($courseId);
     $parents = CourseCategory::getParentsToString($courseInfo['categoryCode']);
 
-    $courseSelect->addOption($parents . $courseInfo['title'], $courseInfo['code'], ['selected' => 'selected']);
+    $courseSelect->addOption($parents.$courseInfo['title'], $courseInfo['code'], ['selected' => 'selected']);
 }
 
 $url = api_get_self();
@@ -114,7 +114,7 @@ $extra_params['autowidth'] = 'true';
 // height auto
 $extra_params['height'] = 'auto';
 
-$extra_params['postData'] =array(
+$extra_params['postData'] = array(
     'filters' => array(
         "groupOp" => "AND",
         "rules" => $result['rules'],
@@ -128,11 +128,11 @@ $extra_params['postData'] =array(
 
 //With this function we can add actions to the jgrid (edit, delete, etc)
 $action_links = 'function action_formatter(cellvalue, options, rowObject) {
-     return \'<a href="session_edit.php?page=resume_session.php&id=\'+options.rowId+\'">'.Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>'.
-    '&nbsp;<a href="add_users_to_session.php?page=session_list.php&id_session=\'+options.rowId+\'">'.Display::return_icon('user_subscribe_session.png',get_lang('SubscribeUsersToSession'),'',ICON_SIZE_SMALL).'</a>'.
-    '&nbsp;<a href="add_courses_to_session.php?page=session_list.php&id_session=\'+options.rowId+\'">'.Display::return_icon('courses_to_session.png',get_lang('SubscribeCoursesToSession'),'',ICON_SIZE_SMALL).'</a>'.
-    '&nbsp;<a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."\'".')) return false;"  href="session_list.php?action=copy&idChecked=\'+options.rowId+\'">'.Display::return_icon('copy.png',get_lang('Copy'),'',ICON_SIZE_SMALL).'</a>'.
-    '&nbsp;<a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."\'".')) return false;"  href="session_list.php?action=delete&idChecked=\'+options.rowId+\'">'.Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'.
+     return \'<a href="session_edit.php?page=resume_session.php&id=\'+options.rowId+\'">'.Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>'.
+    '&nbsp;<a href="add_users_to_session.php?page=session_list.php&id_session=\'+options.rowId+\'">'.Display::return_icon('user_subscribe_session.png', get_lang('SubscribeUsersToSession'), '', ICON_SIZE_SMALL).'</a>'.
+    '&nbsp;<a href="add_courses_to_session.php?page=session_list.php&id_session=\'+options.rowId+\'">'.Display::return_icon('courses_to_session.png', get_lang('SubscribeCoursesToSession'), '', ICON_SIZE_SMALL).'</a>'.
+    '&nbsp;<a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES))."\'".')) return false;"  href="session_list.php?action=copy&idChecked=\'+options.rowId+\'">'.Display::return_icon('copy.png', get_lang('Copy'), '', ICON_SIZE_SMALL).'</a>'.
+    '&nbsp;<a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES))."\'".')) return false;"  href="session_list.php?action=delete&idChecked=\'+options.rowId+\'">'.Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'.
     '\';
 }';
 
@@ -301,18 +301,18 @@ $urlAjaxExtraField = api_get_path(WEB_AJAX_PATH).'extra_field.ajax.php?1=1';
 <?php
 
 echo '<a href="'.api_get_path(WEB_CODE_PATH).'session/session_add.php">'.
-    Display::return_icon('new_session.png',get_lang('AddSession'),'',ICON_SIZE_MEDIUM).'</a>';
+    Display::return_icon('new_session.png', get_lang('AddSession'), '', ICON_SIZE_MEDIUM).'</a>';
 if (api_is_platform_admin()) {
     echo '<a href="'.api_get_path(WEB_CODE_PATH).'session/add_many_session_to_category.php">'.
-        Display::return_icon('session_to_category.png',get_lang('AddSessionsInCategories'),'',ICON_SIZE_MEDIUM).'</a>';
+        Display::return_icon('session_to_category.png', get_lang('AddSessionsInCategories'), '', ICON_SIZE_MEDIUM).'</a>';
     echo '<a href="'.api_get_path(WEB_CODE_PATH).'session/session_category_list.php">'.
-        Display::return_icon('folder.png',get_lang('ListSessionCategory'),'',ICON_SIZE_MEDIUM).'</a>';
+        Display::return_icon('folder.png', get_lang('ListSessionCategory'), '', ICON_SIZE_MEDIUM).'</a>';
 }
 
 if ($list_type == 'complete') {
-    echo '<a href="'.api_get_self().'?list_type=simple">'.Display::return_icon('view_remove.png',get_lang('Simple'),'',ICON_SIZE_MEDIUM).'</a>';
+    echo '<a href="'.api_get_self().'?list_type=simple">'.Display::return_icon('view_remove.png', get_lang('Simple'), '', ICON_SIZE_MEDIUM).'</a>';
 } else {
-    echo '<a href="'.api_get_self().'?list_type=complete">'.Display::return_icon('view_text.png',get_lang('Complete'),'',ICON_SIZE_MEDIUM).'</a>';
+    echo '<a href="'.api_get_self().'?list_type=complete">'.Display::return_icon('view_text.png', get_lang('Complete'), '', ICON_SIZE_MEDIUM).'</a>';
 }
 
 echo $actions;

+ 5 - 5
main/social/group_topics.php

@@ -10,7 +10,7 @@ $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();
 }
 
@@ -67,7 +67,7 @@ if (isset($_POST['action'])) {
     }
 
     if ($_POST['action'] == 'edit_message_group') {
-        $edit_message_id =  intval($_POST['message_id']);
+        $edit_message_id = intval($_POST['message_id']);
         $res = MessageManager::send_message(
             0,
             $title,
@@ -99,7 +99,7 @@ if (isset($_POST['action'])) {
 
     // display error messages
     if (!$res) {
-        $social_right_content .= Display::return_message(get_lang('Error'),'error');
+        $social_right_content .= Display::return_message(get_lang('Error'), 'error');
     }
     $topic_id = isset($_GET['topic_id']) ? intval($_GET['topic_id']) : null;
     if ($_POST['action'] == 'add_message_group') {
@@ -197,9 +197,9 @@ $(document).ready(function() {
 </script>';
 
 $this_section = SECTION_SOCIAL;
-$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' => Security::remove_XSS($group_info['name']));
-$interbreadcrumb[] = array('url' => '#',  'name' => get_lang('Discussions'));
+$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Discussions'));
 
 $social_left_content = SocialManager::show_social_menu('member_list', $group_id);
 $show_message = null;

+ 42 - 42
main/social/groups.php

@@ -17,24 +17,24 @@ if (api_get_setting('allow_social_tool') !== 'true') {
 $join_url = '';
 
 $this_section = SECTION_SOCIAL;
-$allowed_views = array('mygroups','newest','pop');
+$allowed_views = array('mygroups', 'newest', 'pop');
 $content = null;
 
 if (isset($_GET['view']) && in_array($_GET['view'], $allowed_views)) {
     if ($_GET['view'] == 'mygroups') {
-        $interbreadcrumb[]= array ('url' =>'groups.php','name' => get_lang('Groups'));
-        $interbreadcrumb[]= array ('url' =>'#','name' => get_lang('MyGroups'));
-    } else if ( $_GET['view'] == 'newest') {
-        $interbreadcrumb[]= array ('url' =>'groups.php','name' => get_lang('Groups'));
-        $interbreadcrumb[]= array ('url' =>'#','name' => get_lang('Newest'));
-    } else  {
-        $interbreadcrumb[]= array ('url' =>'groups.php','name' => get_lang('Groups'));
-        $interbreadcrumb[]= array ('url' =>'#','name' => get_lang('Popular'));
+        $interbreadcrumb[] = array('url' =>'groups.php', 'name' => get_lang('Groups'));
+        $interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('MyGroups'));
+    } else if ($_GET['view'] == 'newest') {
+        $interbreadcrumb[] = array('url' =>'groups.php', 'name' => get_lang('Groups'));
+        $interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('Newest'));
+    } else {
+        $interbreadcrumb[] = array('url' =>'groups.php', 'name' => get_lang('Groups'));
+        $interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('Popular'));
     }
 } else {
-    $interbreadcrumb[]= array ('url' =>'groups.php','name' => get_lang('Groups'));
+    $interbreadcrumb[] = array('url' =>'groups.php', 'name' => get_lang('Groups'));
     if (!isset($_GET['id'])) {
-        $interbreadcrumb[]= array ('url' =>'#','name' => get_lang('GroupList'));
+        $interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('GroupList'));
     }
 }
 
@@ -71,7 +71,7 @@ if (is_array($results) && count($results) > 0) {
         } elseif ($result['relation_type'] == GROUP_USER_PERMISSION_MODERATOR) {
             $name .= ' '.Display::return_icon('social_group_moderator.png', get_lang('Moderator'), array('style'=>'vertical-align:middle'));
         }
-        $url  = '<a href="group_view.php?id='.$id.'">' . $name . '</a>';
+        $url = '<a href="group_view.php?id='.$id.'">'.$name.'</a>';
 
         $count_users_group = count(
             $usergroup->get_users_by_group(
@@ -108,9 +108,9 @@ if (is_array($results) && count($results) > 0) {
         $html .= '<div class="title-groups">';
         $html .= Display::tag('h5', $url);
         $html .= '</div>';
-        $html .= '<div class="members-groups">' . $members . '</div>';
+        $html .= '<div class="members-groups">'.$members.'</div>';
         if ($result['description'] != '') {
-            $html .= '<div class="description-groups">' . cut($result['description'],100,true) . '</div>';
+            $html .= '<div class="description-groups">'.cut($result['description'], 100, true).'</div>';
         } else {
             $html .= '';
         }
@@ -118,12 +118,12 @@ if (is_array($results) && count($results) > 0) {
         $html .= '</div>';
 
         $grid_item_2 = $html;
-        $grid_my_groups[]= array($grid_item_2);
+        $grid_my_groups[] = array($grid_item_2);
     }
 }
 
 // Newest groups
-$results = $usergroup->get_groups_by_age(4,false);
+$results = $usergroup->get_groups_by_age(4, false);
 
 $grid_newest_groups = array();
 foreach ($results as $result) {
@@ -132,16 +132,16 @@ foreach ($results as $result) {
     $id = $result['id'];
     $name = cut($result['name'], GROUP_TITLE_LENGTH, true);
 
-    $count_users_group = count($usergroup->get_users_by_group($id, false, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR), 0 , 1000));
-    if ($count_users_group == 1 ) {
+    $count_users_group = count($usergroup->get_users_by_group($id, false, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR), 0, 1000));
+    if ($count_users_group == 1) {
         $count_users_group = $count_users_group.' '.get_lang('Member');
     } else {
         $count_users_group = $count_users_group.' '.get_lang('Members');
     }
 
-    $url  = '<a href="group_view.php?id='.$id.'">' . $name . '</a>';
+    $url = '<a href="group_view.php?id='.$id.'">'.$name.'</a>';
 
-    $picture = $usergroup->get_picture_group($result['id'], $result['picture'],80);
+    $picture = $usergroup->get_picture_group($result['id'], $result['picture'], 80);
     $result['picture'] = '<img class="social-groups-image" src="'.$picture['file'].'" />';
     $members = Display::returnFontAwesomeIcon('user').$count_users_group;
 
@@ -153,15 +153,15 @@ foreach ($results as $result) {
     $html .= '<div class="title-groups">';
     $html .= Display::tag('h5', $url);
     $html .= '</div>';
-    $html .= '<div class="members-groups">' . $members . '</div>';
+    $html .= '<div class="members-groups">'.$members.'</div>';
     if ($result['description'] != '') {
-        $html .= '<div class="description-groups">' . cut($result['description'],100,true) . '</div>';
+        $html .= '<div class="description-groups">'.cut($result['description'], 100, true).'</div>';
     } else {
         $html .= '';
     }
     //Avoiding my groups
 
-    if (!in_array($id,$my_group_list)) {
+    if (!in_array($id, $my_group_list)) {
         $html .= '<a class="btn btn-primary" href="group_view.php?id='.$id.'&action=join&u='.api_get_user_id().'">'.get_lang('JoinGroup').'</a> ';
     }
 
@@ -202,9 +202,9 @@ if (is_array($results) && count($results) > 0) {
             $count_users_group = $count_users_group.' '.get_lang('Members');
         }
 
-        $url  = '<a href="group_view.php?id='.$id.'">' . $name . '</a>';
+        $url = '<a href="group_view.php?id='.$id.'">'.$name.'</a>';
 
-        $picture = $usergroup->get_picture_group($result['id'], $result['picture'],80);
+        $picture = $usergroup->get_picture_group($result['id'], $result['picture'], 80);
         $result['picture'] = '<img class="social-groups-image" src="'.$picture['file'].'" />';
 
         $html = '<div class="row">';
@@ -215,14 +215,14 @@ if (is_array($results) && count($results) > 0) {
         $html .= '<div class="title-groups">';
         $html .= Display::tag('h5', $url);
         $html .= '</div>';
-        $html .= '<div class="members-groups">' . $members . '</div>';
+        $html .= '<div class="members-groups">'.$members.'</div>';
         if ($result['description'] != '') {
-            $html .= '<div class="description-groups">' . cut($result['description'],100,true) . '</div>';
+            $html .= '<div class="description-groups">'.cut($result['description'], 100, true).'</div>';
         } else {
             $html .= '';
         }
         //Avoiding my groups
-        if (!in_array($id,$my_group_list)) {
+        if (!in_array($id, $my_group_list)) {
             $html .= '<a class="btn btn-primary" href="group_view.php?id='.$id.'&action=join&u='.api_get_user_id().'">'.get_lang('JoinGroup').'</a> ';
         }
 
@@ -231,7 +231,7 @@ if (is_array($results) && count($results) > 0) {
         $html .= '</div>';
 
         $grid_item_2 = $html;
-        $grid_pop_groups[]= array($grid_item_2);
+        $grid_pop_groups[] = array($grid_item_2);
     }
 }
 
@@ -254,58 +254,58 @@ if (isset($_GET['view']) && in_array($_GET['view'], $allowed_views)) {
                 );
             }
             if (api_get_setting('allow_students_to_create_groups_in_social') == 'true') {
-                $create_group_item =  '<a class="btn btn-default" href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'.
+                $create_group_item = '<a class="btn btn-default" href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'.
                     get_lang('CreateASocialGroup').'</a>';
             } else {
-                if (api_is_allowed_to_edit(null,true)) {
-                    $create_group_item =  '<a class="btn btn-default" href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'.
+                if (api_is_allowed_to_edit(null, true)) {
+                    $create_group_item = '<a class="btn btn-default" href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'.
                         get_lang('CreateASocialGroup').'</a>';
                 }
             }
             break;
         case 'newest':
             if (count($grid_newest_groups) > 0) {
-                $newest_content = Display::return_sortable_grid('newest', array(), $grid_newest_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true,false));
+                $newest_content = Display::return_sortable_grid('newest', array(), $grid_newest_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true, false));
             }
             break;
         default:
             if (count($grid_pop_groups) > 0) {
-                $popular_content = Display::return_sortable_grid('popular', array(), $grid_pop_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true,true,true));
+                $popular_content = Display::return_sortable_grid('popular', array(), $grid_pop_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true, true, true));
             }
             break;
     }
 } else {
     $my_group_content = null;
     if (count($grid_my_groups) > 0) {
-        $my_group_content = Display::return_sortable_grid('mygroups', array(), $grid_my_groups, array('hide_navigation'=>true, 'per_page' => 2), $query_vars, false, array(true, true, true,false));
+        $my_group_content = Display::return_sortable_grid('mygroups', array(), $grid_my_groups, array('hide_navigation'=>true, 'per_page' => 2), $query_vars, false, array(true, true, true, false));
     } else {
         $my_group_content = '<span class="muted">'.get_lang('GroupNone').'</span>';
     }
     if (api_get_setting('allow_students_to_create_groups_in_social') == 'true') {
-        $create_group_item =  '<a class="btn btn-default" href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'.
+        $create_group_item = '<a class="btn btn-default" href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'.
             get_lang('CreateASocialGroup').'</a>';
     } else {
-        if (api_is_allowed_to_edit(null,true)) {
-            $create_group_item =  '<a class="btn btn-default" href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'.get_lang('CreateASocialGroup').'</a>';
+        if (api_is_allowed_to_edit(null, true)) {
+            $create_group_item = '<a class="btn btn-default" href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'.get_lang('CreateASocialGroup').'</a>';
         }
     }
     if (count($grid_newest_groups) > 0) {
-        $newest_content = Display::return_sortable_grid('mygroups', array(), $grid_newest_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true,false));
+        $newest_content = Display::return_sortable_grid('mygroups', array(), $grid_newest_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true, false));
     } else {
         $newest_content = '<div class="muted">'.get_lang('GroupNone').'</div>';
     }
     if (count($grid_pop_groups) > 0) {
-        $popular_content = Display::return_sortable_grid('mygroups', array(), $grid_pop_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true,true,true));
+        $popular_content = Display::return_sortable_grid('mygroups', array(), $grid_pop_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true, true, true));
     } else {
         $popular_content = '<div class="muted">'.get_lang('GroupNone').'</div>';
     }
 }
 
 if (!empty($create_group_item)) {
-    $social_right_content .=  Display::page_subheader($create_group_item);
+    $social_right_content .= Display::page_subheader($create_group_item);
 }
 $headers = array(get_lang('Newest'), get_lang('Popular'), get_lang('MyGroups'));
-$social_right_content .= Display::tabs($headers, array($newest_content, $popular_content, $my_group_content),'tab_browse');
+$social_right_content .= Display::tabs($headers, array($newest_content, $popular_content, $my_group_content), 'tab_browse');
 
 $tpl = new Template(null);
 

+ 20 - 20
main/ticket/report.php

@@ -18,8 +18,8 @@ unset($_SESSION['this_section']);
 
 $htmlHeadXtra[] = '<script>
 $(document).ready(function(){
-    $( "#keyword_start_date_start" ).datepicker({ dateFormat: ' . "'yy-mm-dd'" . ' });
-    $( "#keyword_start_date_end" ).datepicker({ dateFormat: ' . "'yy-mm-dd'" . ' });
+    $( "#keyword_start_date_start" ).datepicker({ dateFormat: ' . "'yy-mm-dd'".' });
+    $( "#keyword_start_date_end" ).datepicker({ dateFormat: ' . "'yy-mm-dd'".' });
 });
 
 function validate() {
@@ -90,7 +90,7 @@ $tools['forum'] = array('id' => 'forum', 'name' => get_lang('Forum'));
  */
 function js_str($s)
 {
-    return '"' . addcslashes($s, "\0..\37\"\\") . '"';
+    return '"'.addcslashes($s, "\0..\37\"\\").'"';
 }
 /**
  * This function is to show the ticket form
@@ -100,29 +100,29 @@ function show_form()
 {
     global $tools;
     echo '<div class="ticket-form">';
-    echo '<form enctype="multipart/form-data" action="' . api_get_self() . '" method="post" name="send_ticket" id="send_ticket"
+    echo '<form enctype="multipart/form-data" action="'.api_get_self().'" method="post" name="send_ticket" id="send_ticket"
  	onsubmit="return validate()" style="width:100%">';
     $select_course = '<div id="user_request" >
 	 </div>';
     echo $select_course;
     //select status
     $select_tool = '<div class="row"  >
-	<div class="label2"  >' . get_lang('Tool') .':</div>
+	<div class="label2"  >' . get_lang('Tool').':</div>
 	<div class="formw2">';
     $select_tool .= '<select style="width: 95%; " name = "tool" id="tool" >';
 
     foreach ($tools as $tool) {
-        $select_tool .= "<option value = '" . $tool['id'] . "' selected >" . $tool['name'] . "</option>";
+        $select_tool .= "<option value = '".$tool['id']."' selected >".$tool['name']."</option>";
     }
     $select_tool .= "</select>";
     $select_tool .= '</div></div>';
     echo $select_tool;
     echo '<div class="row">
-	      <div class="label2">' . get_lang('From') . ':</div>
+	      <div class="label2">' . get_lang('From').':</div>
               <div class="formw2"><input id="keyword_start_date_start" name="keyword_start_date_start" type="text"></div>
           </div>
 	  <div class="row">
-	      <div class="label2"> ' . get_lang('To') . '</div>
+	      <div class="label2"> ' . get_lang('To').'</div>
 	      <div class="formw2"><input id="keyword_start_date_end" name="keyword_start_date_end" type="text"></div>
 	  </div>';
     echo '</div>';
@@ -130,7 +130,7 @@ function show_form()
 		<div class="label2">
 		</div>
 		<div class="formw2">
-			<button class="save" name="report" type="submit" id="btnsubmit" disabled="disabled">' . get_lang('CompleteReport') .'</button>
+			<button class="save" name="report" type="submit" id="btnsubmit" disabled="disabled">' . get_lang('CompleteReport').'</button>
 		</div>
 	</div>';
 }
@@ -145,7 +145,7 @@ function get_number_of_users()
     $sql = "SELECT COUNT(u.user_id) AS total_number_of_items FROM $user_table u";
     if ((api_is_platform_admin() || api_is_session_admin()) && api_get_multiple_access_url()) {
         $access_url_rel_user_table = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
-        $sql.= " INNER JOIN $access_url_rel_user_table url_rel_user ON (u.user_id=url_rel_user.user_id)";
+        $sql .= " INNER JOIN $access_url_rel_user_table url_rel_user ON (u.user_id=url_rel_user.user_id)";
     }
     if (isset($_GET['keyword'])) {
         $keyword = Database::escape_string(trim($_GET['keyword']));
@@ -220,10 +220,10 @@ function get_user_data($from, $number_of_items, $column, $direction)
     $webPath = api_get_path(WEB_PATH);
     while ($user = Database::fetch_row($res)) {
         $userPicture = UserManager::getUserPicture($user[0]);
-        $photo = '<img src="' . $userPicture . '" alt="' . api_get_person_name($user[2], $user[3]) . '" title="' . api_get_person_name($user[2], $user[3]) . '" />';
+        $photo = '<img src="'.$userPicture.'" alt="'.api_get_person_name($user[2], $user[3]).'" title="'.api_get_person_name($user[2], $user[3]).'" />';
         $user_id = $user[0];
-        $button = '<a  href="javascript:void(0)" onclick="load_course_list(\'div_' . $user_id . '\',' . $user_id . ')">
-					<img onclick="load_course_list(\'div_' . $user_id . '\',' . $user_id . ')"  src="' . $webPath . 'img/view_more_stats.gif" title="' . get_lang('Courses') . '" alt="' . get_lang('Courses') . '"/>
+        $button = '<a  href="javascript:void(0)" onclick="load_course_list(\'div_'.$user_id.'\','.$user_id.')">
+					<img onclick="load_course_list(\'div_' . $user_id.'\','.$user_id.')"  src="'.$webPath.'img/view_more_stats.gif" title="'.get_lang('Courses').'" alt="'.get_lang('Courses').'"/>
 					</a>&nbsp;&nbsp;';
         $users[] = array(
             $photo,
@@ -241,7 +241,7 @@ function get_user_data($from, $number_of_items, $column, $direction)
 
 Display::display_header('Reports');
 echo '<div class="actions">
-    <form action="' . api_get_self() . '" method="get" name="search_simple" id="search_simple">
+    <form action="' . api_get_self().'" method="get" name="search_simple" id="search_simple">
         <input name="user_id_request" id="user_id_request" type="hidden" value="">
         <span><label for="keyword">B&uacute;squeda del usuario: </label><input size="25" name="keyword" type="text" id="keyword"></span>
         <span><button class="search" name="submit" type="submit">Buscar</button></span>
@@ -275,12 +275,12 @@ if (isset($_POST['report'])) {
                 u.username , CONCAT(u.lastname, ' ', u.firstname) AS fullname,
                 DATE_SUB(access.access_date,INTERVAL 5 HOUR) AS  access_date,
                 c.title AS course, access_tool AS tool
-            FROM  " . Database::get_main_table(TABLE_STATISTIC_TRACK_E_ACCESS) . " access
-            LEFT JOIN  " . Database::get_main_table(TABLE_MAIN_USER) . " u ON access.access_user_id = u.user_id
-            LEFT JOIN  " . Database::get_main_table(TABLE_MAIN_COURSE) . " c ON access.c_id = c.id
-            WHERE access.c_id = " . $course_info['real_id'] . " AND u.user_id = $user_id ";
+            FROM  " . Database::get_main_table(TABLE_STATISTIC_TRACK_E_ACCESS)." access
+            LEFT JOIN  " . Database::get_main_table(TABLE_MAIN_USER)." u ON access.access_user_id = u.user_id
+            LEFT JOIN  " . Database::get_main_table(TABLE_MAIN_COURSE)." c ON access.c_id = c.id
+            WHERE access.c_id = " . $course_info['real_id']." AND u.user_id = $user_id ";
     if ($tool != '') {
-        $sql.="AND access.access_tool = '$tool' ";
+        $sql .= "AND access.access_tool = '$tool' ";
     }
 
     $start_date = Database::escape_string($_POST['keyword_start_date_start']);
@@ -291,7 +291,7 @@ if (isset($_POST['report'])) {
         if ($start_date != '')
             $sql .= "  access_date >= '$start_date'   ";
         if ($end_date != '') {
-            $sql = ($start_date == '') ? $sql : ($sql . " AND ");
+            $sql = ($start_date == '') ? $sql : ($sql." AND ");
             $sql .= "  access_date <= '$end_date'   ";
         }
     }

+ 2 - 2
main/ticket/ticket_plugin.class.php

@@ -46,7 +46,7 @@ class TicketPlugin extends Plugin
     public function install()
     {
         // Create database tables and insert a Tab
-        require_once api_get_path(SYS_PLUGIN_PATH) . PLUGIN_NAME . '/database.php';
+        require_once api_get_path(SYS_PLUGIN_PATH).PLUGIN_NAME.'/database.php';
     }
 
     /**
@@ -92,7 +92,7 @@ class TicketPlugin extends Plugin
         $rsTab = $this->deleteTab($plugSetting['comment']);
 
         if ($rsTab) {
-            echo "<script>location.href = '" . $_SERVER['REQUEST_URI'] . "';</script>";
+            echo "<script>location.href = '".$_SERVER['REQUEST_URI']."';</script>";
         }
     }
 }

+ 1 - 1
main/work/download.php

@@ -12,7 +12,7 @@
 require_once __DIR__.'/../inc/global.inc.php';
 require_once 'work.lib.php';
 
-$current_course_tool  = TOOL_STUDENTPUBLICATION;
+$current_course_tool = TOOL_STUDENTPUBLICATION;
 $this_section = SECTION_COURSES;
 
 // Course protection

+ 1 - 1
main/work/upload.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);
 

+ 1 - 1
src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/ProjectComment.php

@@ -89,7 +89,7 @@ class ProjectComment extends Basic
         return [
             $this->getNewPageBlock(),
             ['Undo', 'Redo'],
-            ['Link', 'Image', 'Video', 'Flash', 'Audio', 'Table',  'Asciimath'],
+            ['Link', 'Image', 'Video', 'Flash', 'Audio', 'Table', 'Asciimath'],
             ['BulletedList', 'NumberedList', 'HorizontalRule'],
             ['JustifyLeft', 'JustifyCenter', 'JustifyBlock'],
             ['Format', 'Font', 'FontSize', 'Bold', 'Italic', 'TextColor'],

+ 5 - 5
src/Chamilo/CoreBundle/Component/Editor/Driver/CourseDriver.php

@@ -27,13 +27,13 @@ class CourseDriver extends Driver implements DriverInterface
 
         if (!empty($courseInfo)) {
             $coursePath = api_get_path(SYS_COURSE_PATH);
-            $courseDir = $courseInfo['directory'] . '/document';
-            $baseDir = $coursePath . $courseDir;
+            $courseDir = $courseInfo['directory'].'/document';
+            $baseDir = $coursePath.$courseDir;
 
             $this->coursePath = $baseDir;
 
             // Creates shared folder
-            if (!file_exists($baseDir . '/shared_folder')) {
+            if (!file_exists($baseDir.'/shared_folder')) {
                 $title = get_lang('UserFolders');
                 $folderName = '/shared_folder';
                 //$groupId = 0;
@@ -52,9 +52,9 @@ class CourseDriver extends Driver implements DriverInterface
             }
 
             // Creates user-course folder
-            if (!file_exists($baseDir . '/shared_folder/sf_user_' . $userId)) {
+            if (!file_exists($baseDir.'/shared_folder/sf_user_'.$userId)) {
                 $title = $userInfo['complete_name'];
-                $folderName = '/shared_folder/sf_user_' . $userId;
+                $folderName = '/shared_folder/sf_user_'.$userId;
                 $visibility = 1;
                 create_unexisting_directory(
                     $courseInfo,