jmontoyaa 8 yıl önce
ebeveyn
işleme
1dceff2b93

+ 1 - 1
custompages/language.php

@@ -6,7 +6,7 @@
  * @package chamilo.custompages
  */
 // Get helper functions
-require_once __DIR__ . '/language.inc.php';
+require_once __DIR__.'/language.inc.php';
 
 // Define the languages you want to make available for auto-detection here
 $available_langs = array('en', 'fr', 'es', 'gl', 'eu');

+ 10 - 10
main/admin/career_dashboard.php

@@ -29,7 +29,7 @@ $interbreadcrumb[] = array(
 
 Display :: display_header(null);
 
-$form = new FormValidator('filter_form','GET', api_get_self());
+$form = new FormValidator('filter_form', 'GET', api_get_self());
 
 $career = new Career();
 
@@ -60,11 +60,11 @@ $form->addButtonSearch(get_lang('Filter'));
 // action links
 echo '<div class="actions" style="margin-bottom:20px">';
     echo  '<a href="../admin/index.php">'.
-            Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('PlatformAdmin'),'',ICON_SIZE_MEDIUM).'</a>';
+            Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('PlatformAdmin'), '', ICON_SIZE_MEDIUM).'</a>';
     echo '<a href="careers.php">'.
-            Display::return_icon('career.png',get_lang('Careers'),'',ICON_SIZE_MEDIUM).'</a>';
+            Display::return_icon('career.png', get_lang('Careers'), '', ICON_SIZE_MEDIUM).'</a>';
     echo '<a href="promotions.php">'.
-            Display::return_icon('promotion.png',get_lang('Promotions'),'',ICON_SIZE_MEDIUM).'</a>';
+            Display::return_icon('promotion.png', get_lang('Promotions'), '', ICON_SIZE_MEDIUM).'</a>';
 echo '</div>';
 
 $form->display();
@@ -124,22 +124,22 @@ if (!empty($career_array)) {
     foreach ($career_array as $career_id => $data) {
         $career = $data['name'];
         $promotions = $data['promotions'];
-        $career = Display::url($career, 'careers.php?action=edit&id=' . $career_id);
+        $career = Display::url($career, 'careers.php?action=edit&id='.$career_id);
         $career = Display::tag('h4', $career);
-        echo '<tr><td style="background-color:#ECF0F1" colspan="3">' . $career . '</td></tr>';
+        echo '<tr><td style="background-color:#ECF0F1" colspan="3">'.$career.'</td></tr>';
         if (!empty($promotions)) {
             foreach ($promotions as $promotion_id => $promotion) {
                 $promotion_name = $promotion['name'];
-                $promotion_url = Display::url($promotion_name, 'promotions.php?action=edit&id=' . $promotion_id);
+                $promotion_url = Display::url($promotion_name, 'promotions.php?action=edit&id='.$promotion_id);
                 $sessions = $promotion['sessions'];
                 $count = count($promotion['sessions']);
                 $rowspan = '';
                 if (!empty($count)) {
-                    $rowspan = 'rowspan="' . $count . '"';
+                    $rowspan = 'rowspan="'.$count.'"';
                 }
 
                 echo '<tr style="border-bottom:1px solid #ccc;">'.
-                    '<td ' . $rowspan . ' style="border-right:1px solid #aaa;">'.
+                    '<td '.$rowspan.' style="border-right:1px solid #aaa;">'.
                     Display::tag('h5', $promotion_url).
                     '</td>';
 
@@ -167,7 +167,7 @@ if (!empty($career_array)) {
                                 echo '<li>';
                                 $url = Display::url(
                                     $course['title'],
-                                    api_get_path(WEB_COURSE_PATH) . $course['directory'] . '/index.php?id_session=' . $session['data']['id']
+                                    api_get_path(WEB_COURSE_PATH).$course['directory'].'/index.php?id_session='.$session['data']['id']
                                 );
                                 echo $url;
                                 echo '</li>';

+ 11 - 11
main/admin/course_export.php

@@ -14,7 +14,7 @@ $this_section = SECTION_PLATFORM_ADMIN;
 api_protect_admin_script();
 
 $tool_name = get_lang('ExportCourses');
-$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
 
 set_time_limit(0);
 
@@ -59,17 +59,17 @@ if (isset($_POST['formSent']) && $_POST['formSent']) {
         $dataToExport = [];
 
         foreach ($courses as $course) {
-            $dataToExport['code'] = str_replace(';',',',$course['code']);
-            $dataToExport['title'] = str_replace(';',',',$course['title']);
-            $dataToExport['category_code'] = str_replace(';',',',$course['category_code']);
+            $dataToExport['code'] = str_replace(';', ',', $course['code']);
+            $dataToExport['title'] = str_replace(';', ',', $course['title']);
+            $dataToExport['category_code'] = str_replace(';', ',', $course['category_code']);
             $categoryInfo = CourseCategory::getCategory($course['category_code']);
             if ($categoryInfo) {
-                $dataToExport['category_name'] = str_replace(';',',',$categoryInfo['name']);
+                $dataToExport['category_name'] = str_replace(';', ',', $categoryInfo['name']);
             } else {
                 $dataToExport['category_name'] = '';
             }
-            $dataToExport['tutor_name'] = str_replace(';',',',$course['tutor_name']);
-            $dataToExport['course_language'] = str_replace(';',',',$course['course_language']);
+            $dataToExport['tutor_name'] = str_replace(';', ',', $course['tutor_name']);
+            $dataToExport['course_language'] = str_replace(';', ',', $course['course_language']);
 
             $dataToExport['students'] = '';
             $dataToExport['teachers'] = '';
@@ -79,9 +79,9 @@ if (isset($_POST['formSent']) && $_POST['formSent']) {
             if (is_array($usersInCourse) && !empty($usersInCourse)) {
                 foreach ($usersInCourse as $user) {
                     if ($user['status_rel'] == COURSEMANAGER) {
-                        $dataToExport['teachers'] .= $user['username'] . '|';
+                        $dataToExport['teachers'] .= $user['username'].'|';
                     } else {
-                        $dataToExport['students'] .= $user['username'] . '|';
+                        $dataToExport['students'] .= $user['username'].'|';
                     }
                 }
             }
@@ -153,8 +153,8 @@ if (!empty($course_list)) {
 	$form->addHtml('</div>');
 }
 
-$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'));
 
 $form->setDefaults(['select_type' => '1', 'file_type' => 'csv']);

+ 10 - 10
main/admin/user_edit.php

@@ -73,7 +73,7 @@ $geolocalization = $gMapsPlugin->get('enable_api') === 'true';
 
 if ($geolocalization) {
 	$gmapsApiKey = $gMapsPlugin->get('api_key');
-	$htmlHeadXtra[] = '<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=true&key='. $gmapsApiKey . '" ></script>';
+	$htmlHeadXtra[] = '<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=true&key='.$gmapsApiKey.'" ></script>';
 }
 
 $htmlHeadXtra[] = api_get_css_asset('cropper/dist/cropper.min.css');
@@ -153,7 +153,7 @@ if (api_get_setting('registration', 'email') == 'true') {
 }
 
 if (api_get_setting('login_is_email') == 'true') {
-    $form->addRule('email', sprintf(get_lang('UsernameMaxXCharacters'), (string)USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
+    $form->addRule('email', sprintf(get_lang('UsernameMaxXCharacters'), (string) USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
     $form->addRule('email', get_lang('UserTaken'), 'username_available', $user_data['username']);
 }
 
@@ -187,7 +187,7 @@ if (strlen($user_data['picture_uri']) > 0) {
 if (api_get_setting('login_is_email') != 'true') {
 	$form->addElement('text', 'username', get_lang('LoginName'), array('maxlength' => USERNAME_MAX_LENGTH));
     $form->addRule('username', get_lang('ThisFieldIsRequired'), 'required');
-    $form->addRule('username', sprintf(get_lang('UsernameMaxXCharacters'), (string)USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
+    $form->addRule('username', sprintf(get_lang('UsernameMaxXCharacters'), (string) USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
     $form->addRule('username', get_lang('OnlyLettersAndNumbersAllowed'), 'username');
     $form->addRule('username', get_lang('UserTaken'), 'username_available', $user_data['username']);
 }
@@ -224,7 +224,7 @@ if (isset($extAuthSource) && !empty($extAuthSource) && count($extAuthSource) > 0
 }
 $form->addElement('radio', 'reset_password', null, get_lang('AutoGeneratePassword'), 1);
 $group = array();
-$group[] =$form->createElement('radio', 'reset_password', null, get_lang('EnterPassword'), 2);
+$group[] = $form->createElement('radio', 'reset_password', null, get_lang('EnterPassword'), 2);
 $group[] = $form->createElement(
     'password',
     'password',
@@ -260,10 +260,10 @@ $display = isset($user_data['status']) && ($user_data['status'] == STUDENT || (i
 // Platform admin
 if (api_is_platform_admin()) {
 	$group = array();
-	$group[] =$form->createElement('radio', 'platform_admin', null, get_lang('Yes'), 1);
-	$group[] =$form->createElement('radio', 'platform_admin', null, get_lang('No'), 0);
+	$group[] = $form->createElement('radio', 'platform_admin', null, get_lang('Yes'), 1);
+	$group[] = $form->createElement('radio', 'platform_admin', null, get_lang('No'), 0);
 
-	$user_data['status'] == 1 ? $display = 'block':$display = 'none';
+	$user_data['status'] == 1 ? $display = 'block' : $display = 'none';
 
 	$form->addElement('html', '<div id="id_platform_admin" style="display:'.$display.'">');
 	$form->addGroup($group, 'admin', get_lang('PlatformAdmin'), null, false);
@@ -287,7 +287,7 @@ $form->addElement('label', get_lang('RegistrationDate'), $date);
 if (!$user_data['platform_admin']) {
 	// Expiration Date
 	$form->addElement('radio', 'radio_expiration_date', get_lang('ExpirationDate'), get_lang('NeverExpires'), 0);
-	$group = array ();
+	$group = array();
 	$group[] = $form->createElement('radio', 'radio_expiration_date', null, get_lang('Enabled'), 1);
 	$group[] = $form->createElement('DateTimePicker', 'expiration_date', null, array('onchange' => 'javascript: enable_expiration_date();'));
 	$form->addGroup($group, 'max_member_group', null, null, false);
@@ -305,7 +305,7 @@ $studentBossToSelect = [];
 if ($studentBoss) {
     foreach ($studentBoss as $bossId => $userData) {
         $bossInfo = api_get_user_info($userData['user_id']);
-        $studentBossToSelect[$bossInfo['user_id']] =  $bossInfo['complete_name_with_username'];
+        $studentBossToSelect[$bossInfo['user_id']] = $bossInfo['complete_name_with_username'];
     }
 }
 
@@ -331,7 +331,7 @@ $returnParams = $extraField->addElements(
 $jquery_ready_content = $returnParams['jquery_ready_content'];
 
 // the $jquery_ready_content variable collects all functions that will be load in the $(document).ready javascript function
-$htmlHeadXtra[] ='<script>
+$htmlHeadXtra[] = '<script>
 $(document).ready(function(){
 	'.$jquery_ready_content.'
 });

+ 9 - 9
main/course_home/activity.php

@@ -22,7 +22,7 @@ if (api_is_platform_admin()) {
     // Show message to confirm that a tool it to be hidden from available tools
     // visibility 0,1->2
     if (!empty($_GET['askDelete'])) {
-        $content .='<div id="toolhide">'.get_lang('DelLk').'<br />&nbsp;&nbsp;&nbsp;
+        $content .= '<div id="toolhide">'.get_lang('DelLk').'<br />&nbsp;&nbsp;&nbsp;
             <a href="'.api_get_self().'">'.get_lang('No').'</a>&nbsp;|&nbsp;
             <a href="'.api_get_self().'?delete=yes&id='.$id.'">'.get_lang('Yes').'</a>
         </div>';
@@ -49,11 +49,11 @@ if ($enabled === 'true') {
 
 // Start of tools for CourseAdmins (teachers/tutors)
 if ($session_id === 0 && api_is_course_admin() && api_is_allowed_to_edit(null, true)) {
-    $content .=  '<div class="alert alert-success" style="border:0px; margin-top: 0px;padding:0px;">
+    $content .= '<div class="alert alert-success" style="border:0px; margin-top: 0px;padding:0px;">
 		<div class="normal-message" id="id_normal_message" style="display:none">';
-    $content .=  '<img src="'.api_get_path(WEB_PATH).'main/inc/lib/javascript/indicator.gif"/>&nbsp;&nbsp;';
-    $content .=  get_lang('PleaseStandBy');
-    $content .=  '</div>
+    $content .= '<img src="'.api_get_path(WEB_PATH).'main/inc/lib/javascript/indicator.gif"/>&nbsp;&nbsp;';
+    $content .= get_lang('PleaseStandBy');
+    $content .= '</div>
 		<div class="alert alert-success" id="id_confirmation_message" style="display:none"></div>
 	</div>';
 
@@ -79,7 +79,7 @@ if ($session_id === 0 && api_is_course_admin() && api_is_allowed_to_edit(null, t
     $list2 = CourseHome::get_tools_category(TOOL_COURSE_PLUGIN);
 
     $my_list = array_merge($my_list, $list2);
-    $items =  CourseHome::show_tools_category($my_list);
+    $items = CourseHome::show_tools_category($my_list);
     $content .= return_block(get_lang('Interaction'), $items, 'course-tools-interaction');
 
     $my_list = CourseHome::get_tools_category(TOOL_ADMIN_PLATFORM);
@@ -94,10 +94,10 @@ if ($session_id === 0 && api_is_course_admin() && api_is_allowed_to_edit(null, t
 			<span class="viewcaption">'.get_lang('SessionData').'</span>
 			<table class="course_activity_home">';
         $content .= CourseHome::show_session_data($session_id);
-        $content .=  '</table></div></div>';
+        $content .= '</table></div></div>';
     }
 
-    $content .=  '<div class="row">';
+    $content .= '<div class="row">';
     $my_list = CourseHome::get_tools_category(TOOL_STUDENT_VIEW);
     $content .= CourseHome::show_tools_category($my_list);
     $content .= '</div>';
@@ -179,7 +179,7 @@ function return_block($title, $content, $class = null)
 {
     $html = '<div class="row">
                 <div class="col-xs-12 col-md-12">
-                    <div class="title-tools">' . $title . '</div>
+                    <div class="title-tools">' . $title.'</div>
                 </div>
             </div>
             <div class="row '.$class.'">'.$content.'</div>';

+ 38 - 38
main/coursecopy/copy_course_session_selected.php

@@ -47,7 +47,7 @@ if (function_exists('ini_set')) {
 
 $this_section = SECTION_COURSES;
 $nameTools = get_lang('CopyCourse');
-$returnLink = api_get_path(WEB_CODE_PATH) . 'course_info/maintenance_coach.php?' . api_get_cidreq();
+$returnLink = api_get_path(WEB_CODE_PATH).'course_info/maintenance_coach.php?'.api_get_cidreq();
 $interbreadcrumb[] = array(
     'url' => $returnLink,
     'name' => get_lang('Maintenance')
@@ -73,29 +73,29 @@ function make_select_session_list($name, $sessions, $attr = array())
     $attrs = '';
     if (count($attr) > 0) {
         foreach ($attr as $key => $value) {
-            $attrs .= ' ' . $key . '="' . $value . '"';
+            $attrs .= ' '.$key.'="'.$value.'"';
         }
     }
-    $output = '<select name="' . $name . '" ' . $attrs . '>';
+    $output = '<select name="'.$name.'" '.$attrs.'>';
 
     if (count($sessions) == 0) {
-        $output .= '<option value = "0">' . get_lang(
+        $output .= '<option value = "0">'.get_lang(
                 'ThereIsNotStillASession'
-            ) . '</option>';
+            ).'</option>';
     } else {
-        $output .= '<option value = "0">' . get_lang(
+        $output .= '<option value = "0">'.get_lang(
                 'SelectASession'
-            ) . '</option>';
+            ).'</option>';
     }
 
     if (is_array($sessions)) {
         foreach ($sessions as $session) {
             $category_name = '';
             if (!empty($session['category_name'])) {
-                $category_name = ' (' . $session['category_name'] . ')';
+                $category_name = ' ('.$session['category_name'].')';
             }
 
-            $output .= '<option value="' . $session['id'] . '">' . $session['name'] . ' ' . $category_name . '</option>';
+            $output .= '<option value="'.$session['id'].'">'.$session['name'].' '.$category_name.'</option>';
         }
     }
     $output .= '</select>';
@@ -120,43 +120,43 @@ function displayForm()
     // Actions
     $html .= '<div class="actions">';
     // Link back to the documents overview
-    $html .= '<a href="' . $returnLink . '">' . Display::return_icon(
-            'back.png', get_lang('BackTo') . ' ' . get_lang('Maintenance'), '', ICON_SIZE_MEDIUM
-        ) . '</a>';
+    $html .= '<a href="'.$returnLink.'">'.Display::return_icon(
+            'back.png', get_lang('BackTo').' '.get_lang('Maintenance'), '', ICON_SIZE_MEDIUM
+        ).'</a>';
     $html .= '</div>';
 
     $html .= Display::return_message(
             get_lang('CopyCourseFromSessionToSessionExplanation')
     );
 
-    $html .= '<form name="formulaire" method="post" action="' . api_get_self(
-        ) . '?' . api_get_cidreq() . '" >';
+    $html .= '<form name="formulaire" method="post" action="'.api_get_self(
+        ).'?'.api_get_cidreq().'" >';
     $html .= '<table border="0" cellpadding="5" cellspacing="0" width="100%">';
 
     // Source
-    $html .= '<tr><td width="15%"><b>' . get_lang(
+    $html .= '<tr><td width="15%"><b>'.get_lang(
             'OriginCoursesFromSession'
-        ) . ':</b></td>';
-    $html .= '<td width="10%" align="left">' . api_get_session_name(
+        ).':</b></td>';
+    $html .= '<td width="10%" align="left">'.api_get_session_name(
             $sessionId
-        ) . '</td>';
+        ).'</td>';
     $html .= '<td width="50%">';
-    $html .= "{$courseInfo['title']} ({$courseInfo['code']})" . '</td></tr>';
+    $html .= "{$courseInfo['title']} ({$courseInfo['code']})".'</td></tr>';
 
     // Destination
-    $html .= '<tr><td width="15%"><b>' . get_lang(
+    $html .= '<tr><td width="15%"><b>'.get_lang(
             'DestinationCoursesFromSession'
-        ) . ':</b></td>';
+        ).':</b></td>';
     $html .= '<td width="10%" align="left"><div id="ajax_sessions_list_destination">';
     $html .= '<select name="sessions_list_destination" onchange="javascript: xajax_searchCourses(this.value,\'destination\');">';
     if (empty($sessions)) {
-        $html .= '<option value = "0">' . get_lang(
+        $html .= '<option value = "0">'.get_lang(
                 'ThereIsNotStillASession'
-            ) . '</option>';
+            ).'</option>';
     } else {
-        $html .= '<option value = "0">' . get_lang(
+        $html .= '<option value = "0">'.get_lang(
                 'SelectASession'
-            ) . '</option>';
+            ).'</option>';
         foreach ($sessions as $session) {
             if ($session['id'] == $sessionId) {
                 continue;
@@ -166,7 +166,7 @@ function displayForm()
                 continue;
             }
 
-            $html .= '<option value="' . $session['id'] . '">' . $session['name'] . '</option>';
+            $html .= '<option value="'.$session['id'].'">'.$session['name'].'</option>';
         }
     }
 
@@ -178,17 +178,17 @@ function displayForm()
     $html .= '</tr></table>';
 
     $html .= "<fieldset>";
-    $html .= '<legend>' . get_lang('TypeOfCopy') . ' <small>(' . get_lang('CopyOnlySessionItems') . ')</small></legend>';
+    $html .= '<legend>'.get_lang('TypeOfCopy').' <small>('.get_lang('CopyOnlySessionItems').')</small></legend>';
     $html .= '<label class="radio"><input type="radio" id="copy_option_1" name="copy_option" value="full_copy" checked="checked"/>';
-    $html .= get_lang('FullCopy') . '</label>';
+    $html .= get_lang('FullCopy').'</label>';
     $html .= '<label class="radio"><input type="radio" id="copy_option_2" name="copy_option" value="select_items"/>';
-    $html .= ' ' . get_lang('LetMeSelectItems') . '</label><br/>';
+    $html .= ' '.get_lang('LetMeSelectItems').'</label><br/>';
 
     $html .= "</fieldset>";
 
-    $html .= '<button class="save" type="submit" onclick="javascript:if(!confirm(' . "'" . addslashes(
+    $html .= '<button class="save" type="submit" onclick="javascript:if(!confirm('."'".addslashes(
             api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES)
-        ) . "'" . ')) return false;">' . get_lang('CopyCourse') . '</button>';
+        )."'".')) return false;">'.get_lang('CopyCourse').'</button>';
     $html .= '</form>';
     echo $html;
 }
@@ -214,10 +214,10 @@ function searchCourses($idSession, $type)
 
             $courseTitle = str_replace("'", "\'", $course['title']);
 
-            $return .= '<option value="' . $course['code'] . '" title="' . @htmlspecialchars(
-                    $course['title'] . ' (' . $course['visual_code'] . ')', ENT_QUOTES, api_get_system_encoding()
-                ) . '">' .
-                $course['title'] . ' (' . $course['visual_code'] . ')</option>';
+            $return .= '<option value="'.$course['code'].'" title="'.@htmlspecialchars(
+                    $course['title'].' ('.$course['visual_code'].')', ENT_QUOTES, api_get_system_encoding()
+                ).'">'.
+                $course['title'].' ('.$course['visual_code'].')</option>';
         }
         $return .= '</select>';
         $_SESSION['course_list_destination'] = $course_list_destination;
@@ -235,7 +235,7 @@ $xajax->processRequests();
 /* HTML head extra */
 
 $htmlHeadXtra[] = $xajax->getJavascript(
-    api_get_path(WEB_LIBRARY_PATH) . 'xajax/'
+    api_get_path(WEB_LIBRARY_PATH).'xajax/'
 );
 $htmlHeadXtra[] = '<script>
 	function checkSelected(id_select,id_radio,id_title,id_destination) {
@@ -380,7 +380,7 @@ if ((isset($_POST['action']) && $_POST['action'] == 'course_select_form') ||
 
         CourseSelectForm :: display_form($course, $hiddenFields, true);
 
-        echo '<div style="float:right"><a href="javascript:window.history.go(-1);">' .
+        echo '<div style="float:right"><a href="javascript:window.history.go(-1);">'.
             Display::return_icon(
                 'back.png',
                 get_lang('Back').' '.get_lang('To').' '.get_lang(
@@ -388,7 +388,7 @@ if ((isset($_POST['action']) && $_POST['action'] == 'course_select_form') ||
                 ),
                 array('style' => 'vertical-align:middle')
             ).
-            get_lang('Back') . '</a></div>';
+            get_lang('Back').'</a></div>';
     } else {
         Display::display_error_message(
             get_lang('You must select a course from original session and select a destination session')

+ 1 - 1
main/exercise/hotspot.inc.php

@@ -18,7 +18,7 @@ header('Content-Type: text/html; charset=UTF-8');
 $file = file(api_get_path(SYS_LANG_PATH).'english/hotspot.inc.php');
 
 foreach ($file as &$value) {
-	$variable = explode('=', $value , 2);
+	$variable = explode('=', $value, 2);
 	if (count($variable) > 1) {
 		$variable = substr(trim($variable[0]), 1);
 		$variable = '&'.$variable.'='.api_utf8_encode(get_lang($variable)).' ';

+ 3 - 3
main/exercise/hotspot_updatescore.inc.php

@@ -33,13 +33,13 @@ if ($_GET['answerId'] == "0") { // click is NOT on a hotspot
 }
 
 //round-up the coordinates
-$coords = explode('/',$coordinates);
+$coords = explode('/', $coordinates);
 $coordinates = '';
 foreach ($coords as $coord) {
-    list($x,$y) = explode(';',$coord);
+    list($x, $y) = explode(';', $coord);
     $coordinates .= round($x).';'.round($y).'/';
 }
-$coordinates = substr($coordinates,0,-1);
+$coordinates = substr($coordinates, 0, -1);
 
 $TBL_TRACK_E_HOTSPOT = Database::get_main_table(TABLE_STATISTIC_TRACK_E_HOTSPOT);
 

+ 4 - 4
main/exercise/qti2.php

@@ -19,8 +19,8 @@ if (!api_is_allowed_to_edit(null, true)) {
 }
 
 // the breadcrumbs
-$interbreadcrumb[]= array (
-    "url" => api_get_path(WEB_CODE_PATH) . "exercise/exercise.php?".api_get_cidreq(),
+$interbreadcrumb[] = array(
+    "url" => api_get_path(WEB_CODE_PATH)."exercise/exercise.php?".api_get_cidreq(),
     "name" => get_lang('Exercises')
 );
 $is_allowedToEdit = api_is_allowed_to_edit(null, true);
@@ -32,7 +32,7 @@ function ch_qti2_display_form()
 {
     $name_tools = get_lang('ImportQtiQuiz');
     $form  = '<div class="actions">';
-    $form .= '<a href="' . api_get_path(WEB_CODE_PATH) . 'exercise/exercise.php?show=test&'.api_get_cidreq().'">'.
+    $form .= '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/exercise.php?show=test&'.api_get_cidreq().'">'.
         Display::return_icon('back.png', get_lang('BackToExercisesList'), '', ICON_SIZE_MEDIUM).'</a>';
     $form .= '</div>';
     $formValidator = new FormValidator(
@@ -83,7 +83,7 @@ if ((api_is_allowed_to_edit(null, true))) {
         $imported = ch_qti2_import_file($_FILES['userFile']);
 
         if (is_numeric($imported) && !empty($imported)) {
-            header('Location: '.api_get_path(WEB_CODE_PATH) . 'exercise/admin.php?'.api_get_cidreq().'&exerciseId='.$imported);
+            header('Location: '.api_get_path(WEB_CODE_PATH).'exercise/admin.php?'.api_get_cidreq().'&exerciseId='.$imported);
             exit;
         } else {
             $message = Display::return_message(get_lang($imported));

+ 8 - 8
main/inc/lib/formvalidator/Element/DatePicker.php

@@ -46,14 +46,14 @@ class DatePicker extends HTML_QuickForm_text
         return '
             <div class="input-group">
                 <span class="input-group-addon cursor-pointer">
-                    <input ' . $this->_getAttrString($this->_attributes) . '>
+                    <input ' . $this->_getAttrString($this->_attributes).'>
                 </span>
-                <p class="form-control disabled" id="' . $id . '_alt_text">' . $value . '</p>
-                <input class="form-control" type="hidden" id="' . $id . '_alt" value="' . $value . '">
+                <p class="form-control disabled" id="' . $id.'_alt_text">'.$value.'</p>
+                <input class="form-control" type="hidden" id="' . $id.'_alt" value="'.$value.'">
                 <span class="input-group-btn">
                     <button class="btn btn-default" type="button">
                         <span class="fa fa-times text-danger" aria-hidden="true"></span>
-                        <span class="sr-only">' . get_lang('Reset') . '</span>
+                        <span class="sr-only">' . get_lang('Reset').'</span>
                     </button>
                 </span>
             </div>
@@ -92,14 +92,14 @@ class DatePicker extends HTML_QuickForm_text
                 txtDate
                     .hide()
                     .datepicker({
-                        defaultDate: '" . $this->getValue() . "',
+                        defaultDate: '".$this->getValue()."',
                         dateFormat: 'yy-mm-dd',
                         altField: '#{$id}_alt',
-                        altFormat: \"" . get_lang('DateFormatLongNoDayJS') . "\",
+                        altFormat: \"".get_lang('DateFormatLongNoDayJS')."\",
                         showOn: 'both',
-                        buttonImage: '" . Display::return_icon('attendance.png', null, [], ICON_SIZE_TINY, true, true) . "',
+                        buttonImage: '" . Display::return_icon('attendance.png', null, [], ICON_SIZE_TINY, true, true)."',
                         buttonImageOnly: true,
-                        buttonText: '" . get_lang('SelectDate') . "',
+                        buttonText: '" . get_lang('SelectDate')."',
                         changeMonth: true,
                         changeYear: true,
                         yearRange: 'c-60y:c+5y'

+ 13 - 13
main/inc/lib/online.inc.php

@@ -33,17 +33,17 @@ function LoginCheck($uid)
 
         $login_date = api_get_utc_datetime();
         $access_url_id = 1;
-        if (api_get_multiple_access_url() && api_get_current_access_url_id()!=-1) {
+        if (api_get_multiple_access_url() && api_get_current_access_url_id() != -1) {
             $access_url_id = api_get_current_access_url_id();
         }
         $session_id = api_get_session_id();
         // if the $_course array exists this means we are in a course and we have to store this in the who's online table also
         // to have the x users in this course feature working
-        if (is_array($_course) && count($_course)>0 && !empty($_course['id'])) {
-            $query = "REPLACE INTO ".$online_table ." (login_id,login_user_id,login_date,user_ip, c_id, session_id, access_url_id)
+        if (is_array($_course) && count($_course) > 0 && !empty($_course['id'])) {
+            $query = "REPLACE INTO ".$online_table." (login_id,login_user_id,login_date,user_ip, c_id, session_id, access_url_id)
                       VALUES ($uid,$uid,'$login_date','$user_ip', '".$_course['real_id']."' , '$session_id' , '$access_url_id' )";
         } else {
-            $query = "REPLACE INTO ".$online_table ." (login_id,login_user_id,login_date,user_ip, c_id, session_id, access_url_id)
+            $query = "REPLACE INTO ".$online_table." (login_id,login_user_id,login_date,user_ip, c_id, session_id, access_url_id)
                       VALUES ($uid,$uid,'$login_date','$user_ip', 0, '$session_id', '$access_url_id')";
         }
         Database::query($query);
@@ -117,7 +117,7 @@ function online_logout($user_id = null, $logout_redirect = false)
     		ORDER BY login_date DESC
     		LIMIT 0,1";
     $q_last_connection = Database::query($sql);
-    if (Database::num_rows($q_last_connection)>0) {
+    if (Database::num_rows($q_last_connection) > 0) {
         $i_id_last_connection = Database::result($q_last_connection, 0, "login_id");
     }
 
@@ -167,7 +167,7 @@ function LoginDelete($user_id)
 {
     $online_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ONLINE);
     $user_id = intval($user_id);
-    $query = "DELETE FROM " . $online_table . " WHERE login_user_id = $user_id";
+    $query = "DELETE FROM ".$online_table." WHERE login_user_id = $user_id";
     Database::query($query);
 }
 
@@ -248,7 +248,7 @@ function who_is_online($from, $number_of_items, $column = null, $direction = nul
     $current_date = api_get_utc_datetime($online_time);
     $track_online_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ONLINE);
     $friend_user_table = Database::get_main_table(TABLE_MAIN_USER_REL_USER);
-    $table_user	= Database::get_main_table(TABLE_MAIN_USER);
+    $table_user = Database::get_main_table(TABLE_MAIN_USER);
 
     if ($friends) {
         // 	who friends from social network is online
@@ -264,8 +264,8 @@ function who_is_online($from, $number_of_items, $column = null, $direction = nul
                   LIMIT $from, $number_of_items";
     } else {
         $query = "SELECT DISTINCT login_user_id, login_date
-                    FROM ".$track_online_table ." e
-                    INNER JOIN ".$table_user ." u ON (u.id = e.login_user_id)
+                    FROM ".$track_online_table." e
+                    INNER JOIN ".$table_user." u ON (u.id = e.login_user_id)
                   WHERE u.status != ".ANONYMOUS." AND login_date >= '".$current_date."'
                   ORDER BY $column $direction
                   LIMIT $from, $number_of_items";
@@ -288,8 +288,8 @@ function who_is_online($from, $number_of_items, $column = null, $direction = nul
             } else {
                 // all users online
                 $query = "SELECT login_user_id, login_date
-                          FROM ".$track_online_table ." track
-                          INNER JOIN ".$table_user ." u
+                          FROM ".$track_online_table." track
+                          INNER JOIN ".$table_user." u
                           ON (u.id=track.login_user_id)
                           WHERE u.status != ".ANONYMOUS." AND track.access_url_id =  $access_url_id AND
                                 login_date >= '".$current_date."'
@@ -427,7 +427,7 @@ function who_is_online_in_this_course($from, $number_of_items, $uid, $time_limit
 	if ($result) {
 		$users_online = array();
 
-		while(list($login_user_id, $login_date) = Database::fetch_row($result)) {
+		while (list($login_user_id, $login_date) = Database::fetch_row($result)) {
             $users_online[] = $login_user_id;
 		}
 		return $users_online;
@@ -436,7 +436,7 @@ function who_is_online_in_this_course($from, $number_of_items, $uid, $time_limit
 	}
 }
 
-function who_is_online_in_this_course_count($uid, $time_limit, $coursecode=null)
+function who_is_online_in_this_course_count($uid, $time_limit, $coursecode = null)
 {
 	if (empty($coursecode)) {
 		return false;

+ 20 - 20
main/inc/lib/pdf.lib.php

@@ -33,7 +33,7 @@ class PDF
         /* More info @ http://mpdf1.com/manual/index.php?tid=184&searchstring=mPDF
          * mPDF ([ string $mode [, mixed $format [, float $default_font_size [, string $default_font [, float $margin_left , float $margin_right , float $margin_top , float $margin_bottom , float $margin_header , float $margin_footer [, string $orientation ]]]]]])
          */
-        if (!in_array($orientation, array('P','L'))) {
+        if (!in_array($orientation, array('P', 'L'))) {
             $orientation = 'P';
         }
         //left, right, top, bottom, margin_header, margin footer
@@ -105,7 +105,7 @@ class PDF
             $visualTheme = api_get_visual_theme();
             $img = api_get_path(SYS_CSS_PATH).'themes/'.$visualTheme.'/images/pdf_logo_header.png';
             if (file_exists($img)) {
-                $img = api_get_path(WEB_CSS_PATH) . 'themes/' . $visualTheme . '/images/pdf_logo_header.png';
+                $img = api_get_path(WEB_CSS_PATH).'themes/'.$visualTheme.'/images/pdf_logo_header.png';
                 $organization = "<img src='$img'>";
             }
         }
@@ -242,7 +242,7 @@ class PDF
             // then print the title in the PDF
             if (is_array($file) && isset($file['title'])) {
                 $html_title = $file['title'];
-                $file  = $file['path'];
+                $file = $file['path'];
             } else {
                 //we suppose we've only been sent a file path
                 $html_title = basename($file);
@@ -272,7 +272,7 @@ class PDF
             //it's not a chapter but the file exists, print its title
             if ($print_title) {
                 $this->pdf->WriteHTML(
-                    '<html><body><h3>' . $html_title . '</h3></body></html>'
+                    '<html><body><h3>'.$html_title.'</h3></body></html>'
                 );
             }
 
@@ -298,7 +298,7 @@ class PDF
                 $document_html = str_replace('href="./css/frames.css"', $absolute_css_path, $document_html);
 
                 if (!empty($course_data['path'])) {
-                    $document_html= str_replace('../', '', $document_html);
+                    $document_html = str_replace('../', '', $document_html);
                     $document_path = api_get_path(SYS_COURSE_PATH).$course_data['path'].'/document/';
 
                     $doc = new DOMDocument();
@@ -375,7 +375,7 @@ class PDF
                 if (!empty($document_html)) {
                     $this->pdf->WriteHTML($document_html.$page_break);
                 }
-            } elseif (in_array($extension, array('jpg','jpeg','png','gif'))) {
+            } elseif (in_array($extension, array('jpg', 'jpeg', 'png', 'gif'))) {
                 //Images
                 $image = Display::img($file);
                 $this->pdf->WriteHTML('<html><body>'.$image.'</body></html>'.$page_break);
@@ -438,7 +438,7 @@ class PDF
 
         //absolute path for frames.css //TODO: necessary?
         $absolute_css_path = api_get_path(WEB_CSS_PATH).api_get_setting('stylesheets').'/frames.css';
-        $document_html = str_replace('href="./css/frames.css"','href="'.$absolute_css_path.'"', $document_html);
+        $document_html = str_replace('href="./css/frames.css"', 'href="'.$absolute_css_path.'"', $document_html);
 
         $document_html = str_replace('../../', '', $document_html);
         $document_html = str_replace('../', '', $document_html);
@@ -466,7 +466,7 @@ class PDF
                                 $old_src_fixed = str_replace(api_get_path(REL_COURSE_PATH).$course_data['path'].'/document/', '', $old_src);
                                 $old_src_fixed = str_replace('courses/'.$course_data['path'].'/document/', '', $old_src_fixed);
                                 $new_path = $document_path.$old_src_fixed;
-                                $document_html= str_replace($old_src, $new_path, $document_html);
+                                $document_html = str_replace($old_src, $new_path, $document_html);
 
                             }
                         }
@@ -485,7 +485,7 @@ class PDF
         //$document_html= str_replace('temp_template_path', 'src="/main/default_course_document/', $document_html);// restore src templates
 
         api_set_encoding_html($document_html, 'UTF-8'); // The library mPDF expects UTF-8 encoded input data.
-        $title = api_get_title_html($document_html, 'UTF-8', 'UTF-8');  // TODO: Maybe it is better idea the title to be passed through
+        $title = api_get_title_html($document_html, 'UTF-8', 'UTF-8'); // TODO: Maybe it is better idea the title to be passed through
         // $_GET[] too, as it is done with file name.
         // At the moment the title is retrieved from the html document itself.
 
@@ -507,7 +507,7 @@ class PDF
         //$this->pdf->Output($output_file, $outputMode); // F to save the pdf in a file
 
         if ($outputMode == 'F') {
-            $output_file = api_get_path(SYS_ARCHIVE_PATH) . $output_file;
+            $output_file = api_get_path(SYS_ARCHIVE_PATH).$output_file;
         }
 
         if ($saveInFile) {
@@ -540,12 +540,12 @@ class PDF
         $web_path = false;
         if (!empty($course_code) && api_get_setting('pdf_export_watermark_by_course') == 'true') {
             $course_info = api_get_course_info($course_code);
-            $store_path = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/'.api_get_current_access_url_id().'_pdf_watermark.png';   // course path
+            $store_path = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/'.api_get_current_access_url_id().'_pdf_watermark.png'; // course path
             if (file_exists($store_path)) {
                 $web_path = api_get_path(WEB_COURSE_PATH).$course_info['path'].'/'.api_get_current_access_url_id().'_pdf_watermark.png';
             }
         } else {
-            $store_path = api_get_path(SYS_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png';   // course path
+            $store_path = api_get_path(SYS_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png'; // course path
             if (file_exists($store_path))
                 $web_path = api_get_path(WEB_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png';
         }
@@ -586,10 +586,10 @@ class PDF
     {
         if (!empty($course_code) && api_get_setting('pdf_export_watermark_by_course') == 'true') {
             $course_info = api_get_course_info($course_code);
-            $store_path = api_get_path(SYS_COURSE_PATH).$course_info['path'];   // course path
+            $store_path = api_get_path(SYS_COURSE_PATH).$course_info['path']; // course path
             $web_path   = api_get_path(WEB_COURSE_PATH).$course_info['path'].'/pdf_watermark.png';
         } else {
-            $store_path = api_get_path(SYS_CODE_PATH).'default_course_document/images';   // course path
+            $store_path = api_get_path(SYS_CODE_PATH).'default_course_document/images'; // course path
             $web_path   = api_get_path(WEB_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png';
         }
         $course_image = $store_path.'/'.api_get_current_access_url_id().'_pdf_watermark.png';
@@ -640,9 +640,9 @@ class PDF
      */
     public function set_header($course_data)
     {
-        $this->pdf->defaultheaderfontsize   = 10;   // in pts
-        $this->pdf->defaultheaderfontstyle  = 'BI';   // blank, B, I, or BI
-        $this->pdf->defaultheaderline       = 1;    // 1 to include line below header/above footer
+        $this->pdf->defaultheaderfontsize   = 10; // in pts
+        $this->pdf->defaultheaderfontstyle  = 'BI'; // blank, B, I, or BI
+        $this->pdf->defaultheaderline       = 1; // 1 to include line below header/above footer
 
         if (!empty($course_data['code'])) {
             $teacher_list = CourseManager::get_teacher_list_from_course_code($course_data['code']);
@@ -650,7 +650,7 @@ class PDF
             $teachers = '';
             if (!empty($teacher_list)) {
                 foreach ($teacher_list as $teacher) {
-                    $teachers[]= $teacher['firstname'].' '.$teacher['lastname'];
+                    $teachers[] = $teacher['firstname'].' '.$teacher['lastname'];
                 }
                 if (count($teachers) > 1) {
                     $teachers = get_lang('Teachers').': '.implode(', ', $teachers);
@@ -717,7 +717,7 @@ class PDF
                     'line' => 1,
                 ),
             );
-            $this->pdf->SetHeader($header);// ('{DATE j-m-Y}|{PAGENO}/{nb}|'.$title);
+            $this->pdf->SetHeader($header); // ('{DATE j-m-Y}|{PAGENO}/{nb}|'.$title);
         }
     }
 
@@ -762,7 +762,7 @@ class PDF
         $this->pdf->directionality = api_get_text_direction();
         $this->pdf->useOnlyCoreFonts = true;
         // Use different Odd/Even headers and footers and mirror margins
-        $this->pdf->mirrorMargins       = 1;
+        $this->pdf->mirrorMargins = 1;
 
         // Add decoration only if not stated otherwise
         if ($complete) {

+ 15 - 15
main/inc/lib/sortable_table.class.php

@@ -217,7 +217,7 @@ class SortableTable extends HTML_Table
             $params['spacesBeforeSeparator'] = '';
             $params['spacesAfterSeparator'] = '';
             $query_vars = array_keys($_GET);
-            $query_vars_needed = array ($this->param_prefix.'column', $this->param_prefix.'direction', $this->param_prefix.'per_page');
+            $query_vars_needed = array($this->param_prefix.'column', $this->param_prefix.'direction', $this->param_prefix.'per_page');
             if (count($this->additional_parameters) > 0) {
                 $query_vars_needed = array_merge($query_vars_needed, array_keys($this->additional_parameters));
             }
@@ -287,7 +287,7 @@ class SortableTable extends HTML_Table
 
         if (!$empty_table) {
             if (!empty($this->additional_parameters)) {
-                foreach($this->additional_parameters as $key => $value) {
+                foreach ($this->additional_parameters as $key => $value) {
                     $html .= '<input type="hidden" name ="'.Security::remove_XSS($key).'" value ="'.Security::remove_XSS($value).'" />';
                 }
             }
@@ -312,7 +312,7 @@ class SortableTable extends HTML_Table
                     $html .= '<li><a data-action ="'.$action.'" href="#" onclick="javascript:action_click(this, \''.$table_id.'\');">'.$label.'</a></li>';
                 }
                 $html .= '</ul>';
-                $html .= '</div>';//btn-group
+                $html .= '</div>'; //btn-group
                 $html .= '</div>'; //toolbar
             } else {
                 $html .= $form;
@@ -336,7 +336,7 @@ class SortableTable extends HTML_Table
             }
         }
 
-        return '<div class="table-responsive">' . $html . '</div>';
+        return '<div class="table-responsive">'.$html.'</div>';
     }
 
     /**
@@ -390,7 +390,7 @@ class SortableTable extends HTML_Table
 
             $html .= '<div class="clear"></div>';
             if (count($this->form_actions) > 0) {
-                $script= '<script>
+                $script = '<script>
                             /*<![CDATA[*/
                             function setCheckbox(value) {
                                  d = document.form_'.$this->table_name.';
@@ -412,7 +412,7 @@ class SortableTable extends HTML_Table
             }
         }
         // Getting the items of the table
-        $items = $this->get_clean_html(false);    //no sort
+        $items = $this->get_clean_html(false); //no sort
 
         // Generation of style classes must be improved. Maybe we need a a table name to create style on the fly:
         // i.e: .whoisonline_table_grid_container instead of  .grid_container
@@ -480,7 +480,7 @@ class SortableTable extends HTML_Table
 
             $html .= '<div class="clear"></div>';
             if (count($this->form_actions) > 0) {
-                $script= '<script>
+                $script = '<script>
                             /*<![CDATA[*/
                             function setCheckbox(value) {
                                  d = document.form_'.$this->table_name.';
@@ -588,7 +588,7 @@ class SortableTable extends HTML_Table
                     $counter = 0;
                     foreach ($row as $index => $rowInfo) {
                         if (!isset($this->columnsToHide[$index])) {
-                            $newRow[$counter] = $rowInfo ;
+                            $newRow[$counter] = $rowInfo;
                             $counter++;
                         }
                     }
@@ -603,7 +603,7 @@ class SortableTable extends HTML_Table
         }
 
         if ($this->odd_even_rows_enabled == true) {
-            $this->altRowAttributes(0, array ('class' => 'row_odd'), array ('class' => 'row_even'), true);
+            $this->altRowAttributes(0, array('class' => 'row_odd'), array('class' => 'row_even'), true);
         }
 
         foreach ($this->th_attributes as $column => $attributes) {
@@ -665,11 +665,11 @@ class SortableTable extends HTML_Table
         }
         $result[] = '<select name="'.$this->param_prefix.'per_page" onchange="javascript: this.form.submit();">';
         for ($nr = 10; $nr <= min(50, $total_number_of_items); $nr += 10) {
-            $result[] = '<option value="'.$nr.'" '. ($nr == $this->per_page ? 'selected="selected"' : '').'>'.$nr.'</option>';
+            $result[] = '<option value="'.$nr.'" '.($nr == $this->per_page ? 'selected="selected"' : '').'>'.$nr.'</option>';
         }
         // @todo no limits
         //if ($total_number_of_items < 500) {
-            $result[] = '<option value="'.$total_number_of_items.'" '. ($total_number_of_items == $this->per_page ? 'selected="selected"' : '').'>'.api_ucfirst(get_lang('All')).'</option>';
+            $result[] = '<option value="'.$total_number_of_items.'" '.($total_number_of_items == $this->per_page ? 'selected="selected"' : '').'>'.api_ucfirst(get_lang('All')).'</option>';
         //}
         $result[] = '</select>';
         $result[] = '<noscript>';
@@ -787,7 +787,7 @@ class SortableTable extends HTML_Table
      */
     public function get_additional_url_paramstring()
     {
-        $param_string_parts = array ();
+        $param_string_parts = array();
         if (is_array($this->additional_parameters) && count($this->additional_parameters) > 0) {
             foreach ($this->additional_parameters as $key => & $value) {
                 $param_string_parts[] = urlencode($key).'='.urlencode($value);
@@ -800,7 +800,7 @@ class SortableTable extends HTML_Table
                 //$param[$tablename.'_direction'] = $_GET[$tablename.'_direction'];
                 $my_get_direction = $_GET[$tablename.'_direction'];
                 if (!in_array($my_get_direction, array('ASC', 'DESC'))) {
-                     $param[$tablename.'_direction'] =  'ASC';
+                     $param[$tablename.'_direction'] = 'ASC';
                 } else {
                     $param[$tablename.'_direction'] = $my_get_direction;
                 }
@@ -814,7 +814,7 @@ class SortableTable extends HTML_Table
             if (isset($_GET[$tablename.'_column'])) {
                 $param[$tablename.'_column'] = intval($_GET[$tablename.'_column']);
             }
-            $param_string_parts = array ();
+            $param_string_parts = array();
             foreach ($param as $key => & $value) {
                 $param_string_parts[] = urlencode($key).'='.urlencode($value);
             }
@@ -835,7 +835,7 @@ class SortableTable extends HTML_Table
         $param[$this->param_prefix.'page_nr'] = $this->page_nr;
         $param[$this->param_prefix.'per_page'] = $this->per_page;
         $param[$this->param_prefix.'column'] = $this->column;
-        $param_string_parts = array ();
+        $param_string_parts = array();
         foreach ($param as $key => & $value) {
             $param_string_parts[] = urlencode($key).'='.urlencode($value);
         }

+ 10 - 10
main/ticket/assign_tickets.php

@@ -19,7 +19,7 @@ echo '<form action="tutor.php" name="assign" id ="assign">';
 echo '<div id="confirmation"></div>';
 $id = intval($_GET['id']);
 $tblWeeklyReport = Database::get_main_table('rp_reporte_semanas');
-$sql ="SELECT * FROM $tblWeeklyReport WHERE id = '$id'";
+$sql = "SELECT * FROM $tblWeeklyReport WHERE id = '$id'";
 $sql_tasks = "SELECT id AS colid, title as coltitle
     FROM ".Database::get_course_table(TABLE_STUDENT_PUBLICATION)."
     WHERE parent_id = 0
@@ -44,28 +44,28 @@ $result_tareas = Database::query($sql_tasks);
 $result_forum = Database::query($sql_forum);
 
 echo '<div class="row">
-        <input type="hidden" id="rs_id" name ="rs_id" value="' . $id . '">
-        <div class="formw">' . get_lang('PleaseSelectTasks') . '</div>
+        <input type="hidden" id="rs_id" name ="rs_id" value="' . $id.'">
+        <div class="formw">' . get_lang('PleaseSelectTasks').'</div>
     </div>';
 echo '<div class="row"><div class="formw"><select name ="work_id" id="work_id">';
-echo '<option value="0"' . (($row['colid'] == $rs->work_id) ? "selected" : "") . '>' . get_lang('PleaseSelect') . '</option>';
+echo '<option value="0"'.(($row['colid'] == $rs->work_id) ? "selected" : "").'>'.get_lang('PleaseSelect').'</option>';
 while ($row = Database::fetch_assoc($result_tasks)) {
-    echo '<option value="' . $row['colid'] . '"' . (($row['colid'] == $rs->work_id) ? "selected" : "") . '>' . $row['coltitle'] . '</option>';
+    echo '<option value="'.$row['colid'].'"'.(($row['colid'] == $rs->work_id) ? "selected" : "").'>'.$row['coltitle'].'</option>';
 }
 echo '</select></div><div>';
 echo '<div class="row">
-        <div class="formw">' . get_lang('PleaseSelectThread') . '</div>
+        <div class="formw">' . get_lang('PleaseSelectThread').'</div>
     </div>';
 echo '<div class="row"><div class="formw"><select name ="forum_id" id="forum_id">';
-echo '<option value="0"' . (($row['colid'] == $rs->work_id) ? "forum_id" : "") . '>' . get_lang('PleaseSelect') . '</option>';
+echo '<option value="0"'.(($row['colid'] == $rs->work_id) ? "forum_id" : "").'>'.get_lang('PleaseSelect').'</option>';
 while ($row = Database::fetch_assoc($result_forum)) {
-    echo '<option value="' . $row['colid'] . '"' . (($row['colid'] == $rs->forum_id) ? "selected" : "") . '>' . $row['coltitle'] . '</option>';
+    echo '<option value="'.$row['colid'].'"'.(($row['colid'] == $rs->forum_id) ? "selected" : "").'>'.$row['coltitle'].'</option>';
 }
 echo '</select></div><div>';
 echo '<div class="row">
         <div class="formw">
-        <button class="save" name="edit" type="button" value="' . get_lang('Edit') . '" onClick="save(' . "$id" . ');">' .
-            get_lang('Edit') . '</button>
+        <button class="save" name="edit" type="button" value="' . get_lang('Edit').'" onClick="save('."$id".');">'.
+            get_lang('Edit').'</button>
         </div>
     </div>';
 echo '</form>';

+ 43 - 43
main/webservices/lp.php

@@ -65,7 +65,7 @@ function WSHelperVerifyKey($params)
     }
 
     if ($debug) {
-        error_log("checkip " . intval($check_ip));
+        error_log("checkip ".intval($check_ip));
     }
 
     if ($check_ip) {
@@ -120,13 +120,13 @@ $server->wsdl->addComplexType(
 );
 
 // Register the method to expose
-$server->register('WSImportLP',                            // method name
-    array('params' => 'tns:params'),  // input parameters
-    array('return' => 'xsd:string'),                                        // output parameters
-    'urn:WSLP',                                                   // namespace
-    'urn:WSLP#WSImportLP',                       // soapaction
-    'rpc',                                                                  // style
-    'encoded',                                                              // use
+$server->register('WSImportLP', // method name
+    array('params' => 'tns:params'), // input parameters
+    array('return' => 'xsd:string'), // output parameters
+    'urn:WSLP', // namespace
+    'urn:WSLP#WSImportLP', // soapaction
+    'rpc', // style
+    'encoded', // use
     'This service adds users'                                               // documentation
 );
 
@@ -183,7 +183,7 @@ function WSImportLP($params)
 
     $uniqueFile = uniqid();
     $userId = 1; // admin
-    $filePath = api_get_path(SYS_ARCHIVE_PATH) . $uniqueFile;
+    $filePath = api_get_path(SYS_ARCHIVE_PATH).$uniqueFile;
     file_put_contents($filePath, $fileData);
 
     $fileName = $params['filename'];
@@ -256,8 +256,8 @@ $server->wsdl->addComplexType(
     'all',
     '',
     array(
-        'id'    => array('name' => 'id',    'type' => 'xsd:string'),
-        'name'  => array('name' => 'name',  'type' => 'xsd:string'),
+        'id'    => array('name' => 'id', 'type' => 'xsd:string'),
+        'name'  => array('name' => 'name', 'type' => 'xsd:string'),
     )
 );
 
@@ -273,13 +273,13 @@ $server->wsdl->addComplexType(
 );
 
 // Register the method to expose
-$server->register('WSGetLpList',                            // method name
-    array('params' => 'tns:paramsGetLpList'),  // input parameters
-    array('return' => 'tns:lpList'),                                        // output parameters
-    'urn:WSLP',                                                   // namespace
-    'urn:WSLP#WSGetLpList',                       // soapaction
-    'rpc',                                                                  // style
-    'encoded',                                                              // use
+$server->register('WSGetLpList', // method name
+    array('params' => 'tns:paramsGetLpList'), // input parameters
+    array('return' => 'tns:lpList'), // output parameters
+    'urn:WSLP', // namespace
+    'urn:WSLP#WSGetLpList', // soapaction
+    'rpc', // style
+    'encoded', // use
     'This service adds users'                                               // documentation
 );
 
@@ -294,9 +294,9 @@ function WSGetLpList($params)
         return return_error(WS_ERROR_SECRET_KEY);
     }
 
-    require_once api_get_path(SYS_CODE_PATH) . 'lp/learnpathList.class.php';
-    require_once api_get_path(SYS_CODE_PATH) . 'lp/learnpath.class.php';
-    require_once api_get_path(SYS_CODE_PATH) . 'lp/learnpathItem.class.php';
+    require_once api_get_path(SYS_CODE_PATH).'lp/learnpathList.class.php';
+    require_once api_get_path(SYS_CODE_PATH).'lp/learnpath.class.php';
+    require_once api_get_path(SYS_CODE_PATH).'lp/learnpathItem.class.php';
 
     $courseIdName = $params['course_id_name'];
     $courseIdValue = $params['course_id_value'];
@@ -368,13 +368,13 @@ $server->wsdl->addComplexType(
 );
 
 // Register the method to expose
-$server->register('WSDeleteLp',                            // method name
-    array('params' => 'tns:paramsDeleteLp'),  // input parameters
-    array('return' => 'xsd:string'),                                        // output parameters
-    'urn:WSLP',                                                   // namespace
-    'urn:WSLP#WSDeleteLp',                       // soapaction
-    'rpc',                                                                  // style
-    'encoded',                                                              // use
+$server->register('WSDeleteLp', // method name
+    array('params' => 'tns:paramsDeleteLp'), // input parameters
+    array('return' => 'xsd:string'), // output parameters
+    'urn:WSLP', // namespace
+    'urn:WSLP#WSDeleteLp', // soapaction
+    'rpc', // style
+    'encoded', // use
     'This service deletes a LP'                                               // documentation
 );
 
@@ -389,9 +389,9 @@ function WSDeleteLp($params)
         return return_error(WS_ERROR_SECRET_KEY);
     }
 
-    require_once api_get_path(SYS_CODE_PATH) . 'lp/learnpathList.class.php';
-    require_once api_get_path(SYS_CODE_PATH) . 'lp/learnpath.class.php';
-    require_once api_get_path(SYS_CODE_PATH) . 'lp/learnpathItem.class.php';
+    require_once api_get_path(SYS_CODE_PATH).'lp/learnpathList.class.php';
+    require_once api_get_path(SYS_CODE_PATH).'lp/learnpath.class.php';
+    require_once api_get_path(SYS_CODE_PATH).'lp/learnpathItem.class.php';
 
     $courseIdName = $params['course_id_name'];
     $courseIdValue = $params['course_id_value'];
@@ -433,9 +433,9 @@ function WSDeleteLp($params)
     if ($lp) {
         if ($debug) error_log("LP deleted $lpId");
 
-        $course_dir = $courseInfo['directory'] . '/document';
+        $course_dir = $courseInfo['directory'].'/document';
         $sys_course_path = api_get_path(SYS_COURSE_PATH);
-        $base_work_dir = $sys_course_path . $course_dir;
+        $base_work_dir = $sys_course_path.$course_dir;
 
         $items = $lp->get_flat_ordered_items_list($lpId, 0, $courseId);
 
@@ -494,9 +494,9 @@ $server->wsdl->addComplexType(
     'all',
     '',
     array(
-        'data'  => array('name' => 'data',  'type' => 'xsd:string'),
-        'title'  => array('name' => 'title',  'type' => 'xsd:string'),
-        'filename'  => array('name' => 'filename',  'type' => 'xsd:string'),
+        'data'  => array('name' => 'data', 'type' => 'xsd:string'),
+        'title'  => array('name' => 'title', 'type' => 'xsd:string'),
+        'filename'  => array('name' => 'filename', 'type' => 'xsd:string'),
     )
 );
 
@@ -547,13 +547,13 @@ $server->wsdl->addComplexType(
 );
 
 // Register the method to expose
-$server->register('WSCreateLp',                            // method name
-    array('params' => 'tns:paramsCreateLp'),  // input parameters
-    array('return' => 'xsd:string'),                                        // output parameters
-    'urn:WSLP',                                                   // namespace
-    'urn:WSLP#WSCreateLp',                       // soapaction
-    'rpc',                                                                  // style
-    'encoded',                                                              // use
+$server->register('WSCreateLp', // method name
+    array('params' => 'tns:paramsCreateLp'), // input parameters
+    array('return' => 'xsd:string'), // output parameters
+    'urn:WSLP', // namespace
+    'urn:WSLP#WSCreateLp', // soapaction
+    'rpc', // style
+    'encoded', // use
     'This service creates a LP'                                               // documentation
 );
 

+ 8 - 8
plugin/buycourses/src/paymentsetup.php

@@ -26,7 +26,7 @@ if (isset($_GET['action'], $_GET['id'])) {
             Display::return_message(get_lang('ItemRemoved'), 'success')
         );
 
-        header('Location: ' . api_get_self());
+        header('Location: '.api_get_self());
         exit;
     }
 }
@@ -44,7 +44,7 @@ if ($currencyForm->validate()) {
         Display::return_message(get_lang('Saved'), 'success')
     );
 
-    header('Location:' . api_get_self());
+    header('Location:'.api_get_self());
     exit;
 }
 
@@ -76,7 +76,7 @@ foreach ($currencies as $currency) {
     }
 }
 
-$currencyForm->addTextarea('terms_and_conditions', [ get_lang('TermsAndConditions'), $plugin->get_lang('WriteHereTheTermsAndConditionsOfYourECommerce') ], '');
+$currencyForm->addTextarea('terms_and_conditions', [get_lang('TermsAndConditions'), $plugin->get_lang('WriteHereTheTermsAndConditionsOfYourECommerce')], '');
 $currencyForm->addButtonSave(get_lang('Save'));
 $currencyForm->setDefaults($plugin->getGlobalParameters());
 
@@ -93,7 +93,7 @@ if ($paypalForm->validate()) {
         Display::return_message(get_lang('Saved'), 'success')
     );
 
-    header('Location:' . api_get_self());
+    header('Location:'.api_get_self());
     exit;
 }
 
@@ -132,7 +132,7 @@ if ($commissionForm->validate()) {
         Display::return_message(get_lang('Saved'), 'success')
     );
 
-    header('Location:' . api_get_self());
+    header('Location:'.api_get_self());
     exit;
 }
 
@@ -158,7 +158,7 @@ if ($transferForm->validate()) {
         Display::return_message(get_lang('Saved'), 'success')
     );
 
-    header('Location:' . api_get_self());
+    header('Location:'.api_get_self());
     exit;
 }
 
@@ -197,7 +197,7 @@ if ($culqiForm->validate()) {
         Display::return_message(get_lang('Saved'), 'success')
     );
 
-    header('Location:' . api_get_self());
+    header('Location:'.api_get_self());
     exit;
 }
 
@@ -219,7 +219,7 @@ $culqiForm->setDefaults($plugin->getCulqiParams());
 
 // breadcrumbs
 $interbreadcrumb[] = [
-    'url' => api_get_path(WEB_PLUGIN_PATH) . 'buycourses/index.php',
+    'url' => api_get_path(WEB_PLUGIN_PATH).'buycourses/index.php',
     'name' => $plugin->get_lang('plugin_title')
 ];
 

+ 2 - 2
plugin/ims_lti/start.php

@@ -7,7 +7,7 @@ $toolId = isset($_GET['id']) ? intval($_GET['id']) : 0;
 
 if (empty($toolId)) {
     if (api_is_platform_admin()) {
-        header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'ims_lti/list.php');
+        header('Location: '.api_get_path(WEB_PLUGIN_PATH).'ims_lti/list.php');
         exit;
     }
 
@@ -26,7 +26,7 @@ $htmlHeadXtra[] = '<link rel="stylesheet" href="../assets/css/style.css" type="t
 $template = new Template($imsLtiPlugin->get_title());
 $template->assign(
     'launch_url',
-    api_get_path(WEB_PLUGIN_PATH) . 'ims_lti/form.php?' . http_build_query(['id' => $tool->getId()])
+    api_get_path(WEB_PLUGIN_PATH).'ims_lti/form.php?'.http_build_query(['id' => $tool->getId()])
 );
 
 $content = $template->fetch('ims_lti/view/start.tpl');

+ 68 - 68
src/Chamilo/CourseBundle/Component/CourseCopy/CourseRestorer.php

@@ -219,7 +219,7 @@ class CourseRestorer
                                 $params['lastedit_date'] = self::DBUTF8($property['lastedit_date']);
                                 $params['ref'] = $resource->destination_id;
                                 $params['lastedit_type'] = self::DBUTF8($property['lastedit_type']);
-                                $params['lastedit_user_id'] =  $this->checkUserId($property['lastedit_user_id']);
+                                $params['lastedit_user_id'] = $this->checkUserId($property['lastedit_user_id']);
                                 $params['visibility'] = self::DBUTF8($property['visibility']);
                                 $params['start_visible'] = self::DBUTF8($property['start_visible']);
                                 $params['end_visible'] = self::DBUTF8($property['end_visible']);
@@ -587,7 +587,7 @@ class CourseRestorer
                             $new_file_name = $file_name_no_ext.'_'.$i.$ext;
                             $file_exists = file_exists($path.$new_file_name);
                             while ($file_exists) {
-                                $i ++;
+                                $i++;
                                 $new_file_name = $file_name_no_ext.'_'.$i.$ext;
                                 $file_exists = file_exists($path.$new_file_name);
                             }
@@ -631,9 +631,9 @@ class CourseRestorer
                                         $new_base_path = $_SESSION['new_base_path'];
                                     }
 
-                                    $dest_document_path = $new_base_path.'/'.$document_path[2];		// e.g: "/var/www/wiener/courses/CURSO4/document/carpeta1_1/subcarpeta1/collaborative.png"
-                                    $basedir_dest_path 	= dirname($dest_document_path);				// e.g: "/var/www/wiener/courses/CURSO4/document/carpeta1_1/subcarpeta1"
-                                    $base_path_document = $course_path.$document_path[0];			// e.g: "/var/www/wiener/courses/CURSO4/document"
+                                    $dest_document_path = $new_base_path.'/'.$document_path[2]; // e.g: "/var/www/wiener/courses/CURSO4/document/carpeta1_1/subcarpeta1/collaborative.png"
+                                    $basedir_dest_path 	= dirname($dest_document_path); // e.g: "/var/www/wiener/courses/CURSO4/document/carpeta1_1/subcarpeta1"
+                                    $base_path_document = $course_path.$document_path[0]; // e.g: "/var/www/wiener/courses/CURSO4/document"
                                     $path_title = '/'.$new_base_foldername.'/'.$document_path[2];
 
                                     copy_folder_course_session(
@@ -652,7 +652,7 @@ class CourseRestorer
                                     // Replace old course code with the new destination code see BT#1985
                                     if (file_exists($dest_document_path)) {
                                         $file_info = pathinfo($dest_document_path);
-                                        if (in_array($file_info['extension'], array('html','htm'))) {
+                                        if (in_array($file_info['extension'], array('html', 'htm'))) {
                                             $content = file_get_contents($dest_document_path);
                                             if (UTF8_CONVERT) {
                                                 $content = utf8_encode($content);
@@ -714,8 +714,8 @@ class CourseRestorer
                                     //Replace old course code with the new destination code see BT#1985
                                     if (file_exists($path.$new_file_name)) {
                                         $file_info = pathinfo($path.$new_file_name);
-                                        if (in_array($file_info['extension'], array('html','htm'))) {
-                                            $content    = file_get_contents($path.$new_file_name);
+                                        if (in_array($file_info['extension'], array('html', 'htm'))) {
+                                            $content = file_get_contents($path.$new_file_name);
                                             if (UTF8_CONVERT) {
                                                 $content = utf8_encode($content);
                                             }
@@ -779,7 +779,7 @@ class CourseRestorer
                                 // Replace old course code with the new destination code see BT#1985
                                 if (file_exists($path.$new_file_name)) {
                                     $file_info = pathinfo($path.$new_file_name);
-                                    if (in_array($file_info['extension'], array('html','htm'))) {
+                                    if (in_array($file_info['extension'], array('html', 'htm'))) {
                                         $content = file_get_contents($path.$new_file_name);
                                         if (UTF8_CONVERT) {
                                             $content = utf8_encode($content);
@@ -854,7 +854,7 @@ class CourseRestorer
                         // Replace old course code with the new destination code see BT#1985
                         if (file_exists($path.$document->path)) {
                             $file_info = pathinfo($path.$document->path);
-                            if (isset($file_info['extension']) && in_array($file_info['extension'], array('html','htm'))) {
+                            if (isset($file_info['extension']) && in_array($file_info['extension'], array('html', 'htm'))) {
                                 $content = file_get_contents($path.$document->path);
                                 if (UTF8_CONVERT) {
                                     $content = utf8_encode($content);
@@ -971,8 +971,8 @@ class CourseRestorer
 						case FILE_OVERWRITE:
 							rmdirr($path.$document->path);
                             copyDirTo(
-                                $this->course->backup_path . '/' . $document->path,
-                                $path . dirname($document->path),
+                                $this->course->backup_path.'/'.$document->path,
+                                $path.dirname($document->path),
                                 false
                             );
 							break;
@@ -994,23 +994,23 @@ class CourseRestorer
 							$file_exists = file_exists($path.$new_file_name);
 
 							while ($file_exists) {
-								$i ++;
+								$i++;
 								$new_file_name = $file_name_no_ext.'_'.$i.$ext;
 								$file_exists = file_exists($path.$new_file_name);
 							}
 
                             rename(
-                                $this->course->backup_path . '/' . $document->path,
-                                $this->course->backup_path . '/' . $new_file_name
+                                $this->course->backup_path.'/'.$document->path,
+                                $this->course->backup_path.'/'.$new_file_name
                             );
                             copyDirTo(
-                                $this->course->backup_path . '/' . $new_file_name,
-                                $path . dirname($new_file_name),
+                                $this->course->backup_path.'/'.$new_file_name,
+                                $path.dirname($new_file_name),
                                 false
                             );
                             rename(
-                                $this->course->backup_path . '/' . $new_file_name,
-                                $this->course->backup_path . '/' . $document->path
+                                $this->course->backup_path.'/'.$new_file_name,
+                                $this->course->backup_path.'/'.$document->path
                             );
 
 							break;
@@ -1018,8 +1018,8 @@ class CourseRestorer
 				} else {
                     // end if file exists
                     copyDirTo(
-                        $this->course->backup_path . '/' . $document->path,
-                        $path . dirname($document->path),
+                        $this->course->backup_path.'/'.$document->path,
+                        $path.dirname($document->path),
                         false
                     );
 				}
@@ -1039,7 +1039,7 @@ class CourseRestorer
 			$table_forum = Database::get_course_table(TABLE_FORUM);
 			$resources = $this->course->resources;
 			foreach ($resources[RESOURCE_FORUM] as $id => $forum) {
-                $params = (array)$forum->obj;
+                $params = (array) $forum->obj;
                 $cat_id = '';
                 if (isset($this->course->resources[RESOURCE_FORUMCATEGORY]) &&
                     isset($this->course->resources[RESOURCE_FORUMCATEGORY][$params['forum_category']])) {
@@ -1092,13 +1092,13 @@ class CourseRestorer
 					foreach ($this->course->resources[RESOURCE_FORUMTOPIC] as $topic_id => $topic) {
 						if ($topic->obj->forum_id == $id) {
 							$this->restore_topic($topic_id, $new_id, $sessionId);
-							$forum_topics ++;
+							$forum_topics++;
 						}
 					}
 				}
 				if ($forum_topics > 0) {
 					$sql = "UPDATE ".$table_forum." SET forum_threads = ".$forum_topics."
-                            WHERE c_id = {$this->destination_course_id} AND forum_id = ".(int)$new_id;
+                            WHERE c_id = {$this->destination_course_id} AND forum_id = ".(int) $new_id;
 					Database::query($sql);
 				}
 			}
@@ -1160,7 +1160,7 @@ class CourseRestorer
 		$table = Database::get_course_table(TABLE_FORUM_THREAD);
 		$topic = $this->course->resources[RESOURCE_FORUMTOPIC][$thread_id];
 
-        $params = (array)$topic->obj;
+        $params = (array) $topic->obj;
         $params = self::DBUTF8_array($params);
         $params['c_id'] = $this->destination_course_id;
         $params['forum_id'] = $forum_id;
@@ -1274,7 +1274,7 @@ class CourseRestorer
 				        FROM $link_table
 				        WHERE
 				            c_id = ".$this->destination_course_id." AND
-				            category_id='" . intval($cat_id). "'";
+				            category_id='" . intval($cat_id)."'";
 				$result = Database::query($sql);
     			list($max_order) = Database::fetch_array($result);
 
@@ -1289,7 +1289,7 @@ class CourseRestorer
                 $params['description'] = self::DBUTF8($link->description);
                 $params['category_id'] = $cat_id;
                 $params['on_homepage'] = $link->on_homepage;
-                $params['display_order'] = $max_order+1;
+                $params['display_order'] = $max_order + 1;
 
                 $id = Database::insert($link_table, $params);
 
@@ -1712,7 +1712,7 @@ class CourseRestorer
                         $this->course->resources[RESOURCE_DOCUMENT][$quiz->sound]->is_restored()) {
                         $sql = "SELECT path FROM $table_doc
                                 WHERE
-                                    c_id = " . $this->destination_course_id . "  AND
+                                    c_id = ".$this->destination_course_id."  AND
                                     id = " . $resources[RESOURCE_DOCUMENT][$quiz->sound]->destination_id;
 						$doc = Database::query($sql);
 						$doc = Database::fetch_object($doc);
@@ -1749,17 +1749,17 @@ class CourseRestorer
                         'random' => $quiz->random,
                         'active' => $quiz->active,
                         'sound' => self::DBUTF8($doc),
-                        'max_attempt' => (int)$quiz->max_attempt,
-                        'results_disabled' => (int)$quiz->results_disabled,
+                        'max_attempt' => (int) $quiz->max_attempt,
+                        'results_disabled' => (int) $quiz->results_disabled,
                         'access_condition' => $quiz->access_condition,
                         'pass_percentage' => $quiz->pass_percentage,
-                        'feedback_type' => (int)$quiz->feedback_type,
-                        'random_answers' => (int)$quiz->random_answers,
+                        'feedback_type' => (int) $quiz->feedback_type,
+                        'random_answers' => (int) $quiz->random_answers,
                         'random_by_category' => $quiz->random_by_category,
                         'review_answers' => $quiz->review_answers,
                         'propagate_neg' => $quiz->propagate_neg,
                         'text_when_finished' => $quiz->text_when_finished,
-                        'expired_time' => (int)$quiz->expired_time,
+                        'expired_time' => (int) $quiz->expired_time,
                         'start_time' => $quiz->start_time,
                         'end_time' => $quiz->end_time,
                         'save_correct_answers' => 0,
@@ -1800,10 +1800,10 @@ class CourseRestorer
                         $qid = $this->restore_quiz_question($question_id);
                         $question_order = $quiz->question_orders[$index] ? $quiz->question_orders[$index] : ++$order;
                         $sql = "INSERT IGNORE INTO $table_rel SET
-                                c_id = " . $this->destination_course_id . ",
+                                c_id = ".$this->destination_course_id.",
                                 question_id = $qid ,
                                 exercice_id = $new_id ,
-                                question_order = " . $question_order;
+                                question_order = ".$question_order;
                         Database::query($sql);
                     }
                 }
@@ -2267,7 +2267,7 @@ class CourseRestorer
 							break;
 						case FILE_RENAME:
 							$survey_code = $survey->code.'_';
-							$i=1;
+							$i = 1;
 							$temp_survey_code = $survey_code.$i;
 							while (!$this->is_survey_code_available($temp_survey_code)) {
 								$temp_survey_code = $survey_code.++$i;
@@ -2299,15 +2299,15 @@ class CourseRestorer
 							$sql = "SELECT * FROM $table_sur
 							        WHERE
 							            c_id = ".$this->destination_course_id." AND
-							            survey_id='".self::DBUTF8escapestring(Database::result($result_check,0,0))."'";
+							            survey_id='".self::DBUTF8escapestring(Database::result($result_check, 0, 0))."'";
 							$result = Database::query($sql);
-							$survey_data = Database::fetch_array($result,'ASSOC');
+							$survey_data = Database::fetch_array($result, 'ASSOC');
 
 							// if the survey is shared => also delete the shared content
 							if (isset($survey_data['survey_share']) && is_numeric($survey_data['survey_share'])) {
-                                SurveyManager::delete_survey($survey_data['survey_share'], true,$this->destination_course_id);
+                                SurveyManager::delete_survey($survey_data['survey_share'], true, $this->destination_course_id);
 							}
-							SurveyManager::delete_survey($survey_data['survey_id'],false,$this->destination_course_id);
+							SurveyManager::delete_survey($survey_data['survey_id'], false, $this->destination_course_id);
 
 							// Insert the new source survey
                             $new_id = Database::insert($table_sur, $params);
@@ -2492,10 +2492,10 @@ class CourseRestorer
 
                 // Adding the author's image
                 if (!empty($lp->preview_image)) {
-                    $new_filename = uniqid('') . substr($lp->preview_image, strlen($lp->preview_image) - 7,
+                    $new_filename = uniqid('').substr($lp->preview_image, strlen($lp->preview_image) - 7,
                             strlen($lp->preview_image));
-                    if (file_exists($origin_path . $lp->preview_image) && !is_dir($origin_path . $lp->preview_image)) {
-                        $copy_result = copy($origin_path . $lp->preview_image, $destination_path . $new_filename);
+                    if (file_exists($origin_path.$lp->preview_image) && !is_dir($origin_path.$lp->preview_image)) {
+                        $copy_result = copy($origin_path.$lp->preview_image, $destination_path.$new_filename);
                         if ($copy_result) {
                             $lp->preview_image = $new_filename;
                         } else {
@@ -2505,7 +2505,7 @@ class CourseRestorer
                 }
 
                 if ($this->add_text_in_items) {
-                    $lp->name = $lp->name . ' ' . get_lang('CopyLabelSuffix');
+                    $lp->name = $lp->name.' '.get_lang('CopyLabelSuffix');
                 }
 
                 if (isset($this->tool_copy_settings['learnpaths'])) {
@@ -2573,7 +2573,7 @@ class CourseRestorer
                         $params = [
                             'c_id' => $this->destination_course_id,
                             'name' => self::DBUTF8($lp->name),
-                            'link' => 'lp/lp_controller.php?action=view&lp_id=$new_lp_id&id_session=' . $session_id,
+                            'link' => 'lp/lp_controller.php?action=view&lp_id=$new_lp_id&id_session='.$session_id,
                             'image' => 'scormbuilder.gif',
                             'visibility' => '0',
                             'admin' => '0',
@@ -2697,8 +2697,8 @@ class CourseRestorer
                     // Updating prerequisites
                     foreach ($old_prerequisite as $key => $my_old_prerequisite) {
                         if ($my_old_prerequisite != '') {
-                            $sql = "UPDATE " . $table_item . " SET prerequisite = '" . $my_old_prerequisite . "'
-                                    WHERE c_id = " . $this->destination_course_id . " AND id = '" . $key . "'  ";
+                            $sql = "UPDATE ".$table_item." SET prerequisite = '".$my_old_prerequisite."'
+                                    WHERE c_id = " . $this->destination_course_id." AND id = '".$key."'  ";
                             Database::query($sql);
                         }
                     }
@@ -2706,8 +2706,8 @@ class CourseRestorer
                     // Updating refs
                     foreach ($old_refs as $key => $my_old_ref) {
                         if ($my_old_ref != '') {
-                            $sql = "UPDATE " . $table_item . " SET ref = '" . $my_old_ref . "'
-                                    WHERE c_id = " . $this->destination_course_id . " AND id = '" . $key . "'  ";
+                            $sql = "UPDATE ".$table_item." SET ref = '".$my_old_ref."'
+                                    WHERE c_id = " . $this->destination_course_id." AND id = '".$key."'  ";
                             Database::query($sql);
                         }
                     }
@@ -2717,8 +2717,8 @@ class CourseRestorer
                         if ($parent_item_old_id != 0) {
                             $parent_new_id = $new_item_ids[$parent_item_old_id];
                         }
-                        $sql = "UPDATE " . $table_item . " SET parent_item_id = '" . $parent_new_id . "'
-                                WHERE c_id = " . $this->destination_course_id . " AND id = '" . $new_item_id . "'";
+                        $sql = "UPDATE ".$table_item." SET parent_item_id = '".$parent_new_id."'
+                                WHERE c_id = " . $this->destination_course_id." AND id = '".$new_item_id."'";
                         Database::query($sql);
                     }
                     foreach ($previous_item_ids as $new_item_id => $previous_item_old_id) {
@@ -2726,8 +2726,8 @@ class CourseRestorer
                         if ($previous_item_old_id != 0) {
                             $previous_new_id = $new_item_ids[$previous_item_old_id];
                         }
-                        $sql = "UPDATE " . $table_item . " SET previous_item_id = '" . $previous_new_id . "'
-                                WHERE  c_id = " . $this->destination_course_id . " AND id = '" . $new_item_id . "'";
+                        $sql = "UPDATE ".$table_item." SET previous_item_id = '".$previous_new_id."'
+                                WHERE  c_id = " . $this->destination_course_id." AND id = '".$new_item_id."'";
                         Database::query($sql);
                     }
 
@@ -2736,8 +2736,8 @@ class CourseRestorer
                         if ($next_item_old_id != 0) {
                             $next_new_id = $new_item_ids[$next_item_old_id];
                         }
-                        $sql = "UPDATE " . $table_item . " SET next_item_id = '" . $next_new_id . "'
-                                WHERE c_id = " . $this->destination_course_id . " AND id = '" . $new_item_id . "'";
+                        $sql = "UPDATE ".$table_item." SET next_item_id = '".$next_new_id."'
+                                WHERE c_id = " . $this->destination_course_id." AND id = '".$new_item_id."'";
                         Database::query($sql);
                     }
 
@@ -2746,8 +2746,8 @@ class CourseRestorer
                         if ($prerequisite_old_id != 0) {
                             $prerequisite_new_id = $new_item_ids[$prerequisite_old_id];
                         }
-                        $sql = "UPDATE " . $table_item . " SET prerequisite = '" . $prerequisite_new_id . "'
-                                WHERE c_id = " . $this->destination_course_id . " AND id = '" . $new_item_id . "'";
+                        $sql = "UPDATE ".$table_item." SET prerequisite = '".$prerequisite_new_id."'
+                                WHERE c_id = " . $this->destination_course_id." AND id = '".$new_item_id."'";
                         Database::query($sql);
                     }
                     $this->course->resources[RESOURCE_LEARNPATH][$id]->destination_id = $new_lp_id;
@@ -2867,17 +2867,17 @@ class CourseRestorer
             while (false !== ($file = readdir($handle))) {
 // as long as storing the next file to $file is successful, continue
                 if ($file != '.' && $file != '..') {
-                    $path = $source . '/' . $file;
+                    $path = $source.'/'.$file;
                     if (is_file($path)) {
                        /* if (!is_file($dest . '/' . $file) || $overwrite)
                         if (!@copy($path, $dest . '/' . $file)) {
                             echo '<font color="red">File ('.$path.') '.get_lang('NotHavePermission').'</font>';
                         }*/
-                    } elseif(is_dir($path)) {
-                        if (!is_dir($dest . '/' . $file)) {
-                                                mkdir($dest . '/' . $file);
+                    } elseif (is_dir($path)) {
+                        if (!is_dir($dest.'/'.$file)) {
+                                                mkdir($dest.'/'.$file);
                         }
-                        self:: allow_create_all_directory($path, $dest . '/' . $file, $overwrite);
+                        self:: allow_create_all_directory($path, $dest.'/'.$file, $overwrite);
                     }
                 }
             }
@@ -3075,7 +3075,7 @@ class CourseRestorer
                     $this->course->backup_path,
                     $this->course->info['path']
                 );
-				$thematic->params['c_id']  = $this->destination_course_id;
+				$thematic->params['c_id'] = $this->destination_course_id;
 				unset($thematic->params['id']);
                 unset($thematic->params['iid']);
 
@@ -3099,7 +3099,7 @@ class CourseRestorer
                         unset($thematic_advance['iid']);
 						$thematic_advance['attendance_id'] = 0;
 						$thematic_advance['thematic_id'] = $last_id;
-						$thematic_advance['c_id']  = $this->destination_course_id;
+						$thematic_advance['c_id'] = $this->destination_course_id;
 
                         $my_id = Database::insert(
                             $table_thematic_advance,
@@ -3122,7 +3122,7 @@ class CourseRestorer
 						}
 					}
 
-					foreach($thematic->thematic_plan_list as $thematic_plan) {
+					foreach ($thematic->thematic_plan_list as $thematic_plan) {
 						unset($thematic_plan['id']);
                         unset($thematic_plan['iid']);
 						$thematic_plan['thematic_id'] = $last_id;
@@ -3238,7 +3238,7 @@ class CourseRestorer
                 // re-create dir
                 // @todo check security against injection of dir in crafted course backup here!
                 $path = $obj->params['url'];
-                $path = '/'.str_replace('/','',substr($path,1));
+                $path = '/'.str_replace('/', '', substr($path, 1));
 
                 $workData = array();
                 switch ($this->file_option) {
@@ -3262,9 +3262,9 @@ class CourseRestorer
                         $obj->params['new_dir'] = $obj->params['title'];
 
                         if (!empty($this->course_origin_id)) {
-                            $sql = 'SELECT * FROM ' . $table_work_assignment . '
+                            $sql = 'SELECT * FROM '.$table_work_assignment.'
                                     WHERE
-                                        c_id = ' . $this->course_origin_id . ' AND
+                                        c_id = ' . $this->course_origin_id.' AND
                                         publication_id = ' . $id_work;
 
                             $result = Database::query($sql);

+ 1 - 1
src/Chamilo/CourseBundle/Component/CourseCopy/Resources/SurveyQuestion.php

@@ -85,7 +85,7 @@ class SurveyQuestion extends Resource
      * @param string $option_text
      * @param int $sort
      */
-    public function add_answer($option_text,$sort)
+    public function add_answer($option_text, $sort)
     {
         $answer = array();
         $answer['option_text'] = $option_text;