Browse Source

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

Scrutinizer Auto-Fixes
Yannick Warnier 8 years ago
parent
commit
54917c0286

+ 1 - 1
custompages/index-unlogged-dist.php

@@ -77,7 +77,7 @@ $rootWeb = api_get_path('WEB_PATH');
 		<div id="login-form-box" class="form-box">
             <div id="login-form-info" class="form-info">
             <?php if (isset($content['info']) && !empty($content['info'])) {
-              echo $content['info'];
+                echo $content['info'];
             }
             ?>
             </div>

+ 5 - 5
main/attendance/attendance_controller.php

@@ -642,11 +642,11 @@ class AttendanceController
             }
             $formToDisplay = $form->returnForm();
         } else {
-           if (!empty($sessionId)) {
-               $sessionInfo = api_get_session_info($sessionId);
-               $startDate = $sessionInfo['access_start_date'];
-               $endDate = $sessionInfo['access_end_date'];
-           }
+            if (!empty($sessionId)) {
+                $sessionInfo = api_get_session_info($sessionId);
+                $startDate = $sessionInfo['access_start_date'];
+                $endDate = $sessionInfo['access_end_date'];
+            }
         }
 
         $attendance = new Attendance();

+ 2 - 2
main/course_description/course_description_controller.php

@@ -153,7 +153,7 @@ class CourseDescriptionController
                 if (isset($_GET['id_session'])) {
                     $session_id = intval($_GET['id_session']);
                 }
-		        $course_description_data = $course_description->get_data_by_id(
+                $course_description_data = $course_description->get_data_by_id(
                     $id,
                     null,
                     $session_id
@@ -162,7 +162,7 @@ class CourseDescriptionController
                 $data['description_title'] = $course_description_data['description_title'];
                 $data['description_content'] = $course_description_data['description_content'];
                 $data['progress'] = $course_description_data['progress'];
-		        $data['descriptions'] = $course_description->get_data_by_description_type(
+                $data['descriptions'] = $course_description->get_data_by_description_type(
                     $description_type,
                     null,
                     $session_id

+ 4 - 4
main/help/allowed_html_tags.php

@@ -50,10 +50,10 @@ $table_header = array();
 $table_header[] = array('tag', true);
 $table_header[] = array('attributes', false);
 foreach ($tags as $tag => & $attributes) {
-	$row = array();
-	$row[] = '<kbd>'.$tag.'</kbd>';
-	$row[] = '<kbd>&nbsp;'.implode(', ', array_keys($attributes)).'</kbd>';
-	$table_data[] = $row;
+    $row = array();
+    $row[] = '<kbd>'.$tag.'</kbd>';
+    $row[] = '<kbd>&nbsp;'.implode(', ', array_keys($attributes)).'</kbd>';
+    $table_data[] = $row;
 }
 Display::display_sortable_table($table_header, $table_data, array(), array(), array('fullpage' => intval($_GET['fullpage'])));
 ?>

+ 3 - 3
main/help/faq.php

@@ -47,9 +47,9 @@ if (!empty($_GET['edit']) && $_GET['edit'] == 'true' && api_is_platform_admin())
         $form->display();
     }
 } else {
-	$faq_content = @(string)file_get_contents(api_get_path(SYS_APP_PATH).'home/'.$faq_file);
-	$faq_content = api_to_system_encoding($faq_content, api_detect_encoding(strip_tags($faq_content)));
-	echo $faq_content;
+    $faq_content = @(string)file_get_contents(api_get_path(SYS_APP_PATH).'home/'.$faq_file);
+    $faq_content = api_to_system_encoding($faq_content, api_detect_encoding(strip_tags($faq_content)));
+    echo $faq_content;
 }
 
 Display::display_footer();

+ 6 - 6
main/inc/lib/formvalidator/Element/DateRangePicker.php

@@ -7,8 +7,8 @@
 class DateRangePicker extends HTML_QuickForm_text
 {
     /**
-    * Constructor
-    */
+     * Constructor
+     */
     public function __construct($elementName = null, $elementLabel = null, $attributes = null)
     {
         if (!isset($attributes['id'])) {
@@ -154,10 +154,10 @@ class DateRangePicker extends HTML_QuickForm_text
     }
 
     /**
-    * @param array $dates result of parseDateRange()
-    *
-    * @return bool
-    */
+     * @param array $dates result of parseDateRange()
+     *
+     * @return bool
+     */
     public function validateDates($dates, $format = null)
     {
         if (empty($dates['start']) || empty($dates['end'])) {

+ 17 - 17
main/inc/lib/formvalidator/Rule/MaxFileSize.php

@@ -7,22 +7,22 @@
  */
 class HTML_QuickForm_Rule_MaxFileSize extends HTML_QuickForm_Rule
 {
-	/**
-	 * @param $value array     Uploaded file info (from $_FILES)
-	 * @param null $options
-	 * @return bool
-	 */
-	public function validate($elementValue, $maxSize)
-	{
-		if (!empty($elementValue['error']) &&
-			(UPLOAD_ERR_FORM_SIZE == $elementValue['error'] || UPLOAD_ERR_INI_SIZE == $elementValue['error'])
-		) {
-			return false;
-		}
-		if (!HTML_QuickForm_file::_ruleIsUploadedFile($elementValue)) {
-			return true;
-		}
+    /**
+     * @param $value array     Uploaded file info (from $_FILES)
+     * @param null $options
+     * @return bool
+     */
+    public function validate($elementValue, $maxSize)
+    {
+        if (!empty($elementValue['error']) &&
+            (UPLOAD_ERR_FORM_SIZE == $elementValue['error'] || UPLOAD_ERR_INI_SIZE == $elementValue['error'])
+        ) {
+            return false;
+        }
+        if (!HTML_QuickForm_file::_ruleIsUploadedFile($elementValue)) {
+            return true;
+        }
 
-		return ($maxSize >= @filesize($elementValue['tmp_name']));
-	}
+        return ($maxSize >= @filesize($elementValue['tmp_name']));
+    }
 }

+ 17 - 17
main/inc/lib/formvalidator/Rule/UsernameAvailable.php

@@ -6,24 +6,24 @@
  */
 class HTML_QuickForm_Rule_UsernameAvailable extends HTML_QuickForm_Rule
 {
-	/**
-	 * Function to check if a username is available
-	 * @see HTML_QuickForm_Rule
-	 * @param string $username Wanted username
-	 * @param string $current_username
-	 * @return boolean True if username is available
-	 */
-	function validate($username, $current_username = null) {
-		$user_table = Database::get_main_table(TABLE_MAIN_USER);
+    /**
+     * Function to check if a username is available
+     * @see HTML_QuickForm_Rule
+     * @param string $username Wanted username
+     * @param string $current_username
+     * @return boolean True if username is available
+     */
+    function validate($username, $current_username = null) {
+        $user_table = Database::get_main_table(TABLE_MAIN_USER);
         $username = Database::escape_string($username);
         $current_username = Database::escape_string($current_username);
 
-		$sql = "SELECT * FROM $user_table WHERE username = '$username'";
-		if (!is_null($current_username)) {
-			$sql .= " AND username != '$current_username'";
-		}
-		$res = Database::query($sql);
-		$number = Database::num_rows($res);
-		return $number == 0;
-	}
+        $sql = "SELECT * FROM $user_table WHERE username = '$username'";
+        if (!is_null($current_username)) {
+            $sql .= " AND username != '$current_username'";
+        }
+        $res = Database::query($sql);
+        $number = Database::num_rows($res);
+        return $number == 0;
+    }
 }

+ 9 - 9
main/inc/lib/plugin.lib.php

@@ -175,9 +175,9 @@ class AppPlugin
     }
 
     /**
-    * @param string $pluginName
-    * @param int    $urlId
-    */
+     * @param string $pluginName
+     * @param int    $urlId
+     */
     public function uninstall($pluginName, $urlId = null)
     {
         if (empty($urlId)) {
@@ -254,12 +254,12 @@ class AppPlugin
     }
 
     /**
-    * @param string $region
-    * @param string $template
-    * @param bool   $forced
-    *
-    * @return null|string
-    */
+     * @param string $region
+     * @param string $template
+     * @param bool   $forced
+     *
+     * @return null|string
+     */
     public function load_region($region, $template, $forced = false)
     {
         if ($region == 'course_tool_plugin') {

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

@@ -6452,7 +6452,7 @@ class SessionManager
         ]);
     }
 
-	/**
+    /**
      * Get the count of user courses in session
      * @param int $sessionId The session id
      * @return array

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

@@ -35,11 +35,11 @@ class SkillProfile extends Model
     }
 
     /**
-    * This function is for editing profile info from profile_id.
-    * @param int    $profileId
-    * @param string $name
-    * @param string $description
-    */
+     * This function is for editing profile info from profile_id.
+     * @param int    $profileId
+     * @param string $name
+     * @param string $description
+     */
     public function updateProfileInfo($profileId, $name, $description)
     {
         $profileId = intval($profileId);
@@ -133,9 +133,9 @@ class SkillRelProfile extends Model
     }
 
     /**
-    * This function is for getting profile info from profile_id.
-    * @param int $profileId
-    */
+     * This function is for getting profile info from profile_id.
+     * @param int $profileId
+     */
 
     public function getProfileInfo($profileId)
     {

+ 0 - 1
main/inc/lib/system/web/request.class.php

@@ -2,7 +2,6 @@
 
 /**
  * Provides access to various HTTP request elements: GET, POST, FILE, etc paramaters.
-
  * @license see /license.txt
  * @deprecated
  * @author Laurent Opprecht <laurent@opprecht.info> for the Univesity of Geneva

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

@@ -89,7 +89,7 @@ class Timeline extends Model
 
         $form->addElement('text', 'headline', get_lang('Name'), array('size' => '70'));
         //$form->addHtmlEditor('description', get_lang('Description'), false, false, array('ToolbarSet' => 'Careers','Width' => '100%', 'Height' => '250'));
-	    $status_list = $this->get_status_list();
+        $status_list = $this->get_status_list();
         $form->addElement('select', 'status', get_lang('Status'), $status_list);
         if ($action == 'edit') {
             //$form->addElement('text', 'created_at', get_lang('CreatedAt'));
@@ -173,7 +173,7 @@ class Timeline extends Model
 
         // Setting the rules
         $form->addRule('headline', get_lang('ThisFieldIsRequired'), 'required');
-		return $form;
+        return $form;
 
     }
 

+ 2 - 2
main/reports/index.php

@@ -135,14 +135,14 @@ Display::display_header($tool_name);
                         <select class="input_field_12em link required" name="type" id="type">
 <?php
 foreach ($reports_template as $key => $value) {
-	echo '<option value="'.$key.'">'.$value['description'].'</option>';
+    echo '<option value="'.$key.'">'.$value['description'].'</option>';
 }
 ?>
                         </select><br />
                     </span>
 <?php
 foreach ($reports_template as $key => $value) {
-	echo $value['wizard'];
+    echo $value['wizard'];
 }
 ?>
                     <span id="format" class="step submit_step">

+ 1 - 2
main/survey/fillsurvey.php

@@ -6,8 +6,7 @@
 * @author unknown, the initial survey that did not make it in 1.8 because of bad code
 * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University: cleanup, refactoring and rewriting large parts of the code
 * @author Julio Montoya Armas <gugli100@gmail.com>, Chamilo: Personality Test modification and rewriting large parts of the code as well
-
-* @todo check if the user already filled the survey and if this is the case then the answers have to be updated and not stored again.
+ * @todo check if the user already filled the survey and if this is the case then the answers have to be updated and not stored again.
 * @todo performance could be improved if not the survey_id was stored with the invitation but the survey_code
  */
 // Unsetting the course id (because it is in the URL)

+ 2 - 2
main/tracking/course_log_tools.php

@@ -75,7 +75,7 @@ Display::display_header($nameTools, 'Tracking');
 
 // getting all the students of the course
 if (empty($session_id)) {
-	// Registered students in a course outside session.
+    // Registered students in a course outside session.
     $a_students = CourseManager:: get_student_list_from_course_code(
         api_get_course_id(),
         false,
@@ -86,7 +86,7 @@ if (empty($session_id)) {
         api_get_group_id()
     );
 } else {
-	// Registered students in session.
+    // Registered students in session.
     $a_students = CourseManager:: get_student_list_from_course_code(
         api_get_course_id(),
         true,

+ 49 - 49
main/user/resume_session.php

@@ -60,9 +60,9 @@ if ($allowTutors === 'true') {
     $session_category = '';
 
     if (Database::num_rows($rs)>0) {
-    	$rows_session_category = Database::store_result($rs);
-    	$rows_session_category = $rows_session_category[0];
-    	$session_category = $rows_session_category['name'];
+        $rows_session_category = Database::store_result($rs);
+        $rows_session_category = $rows_session_category[0];
+        $session_category = $rows_session_category['name'];
     }
 
     $action = isset($_GET['action']) ? $_GET['action'] : null;
@@ -140,22 +140,22 @@ if ($allowTutors === 'true') {
     	<td><?php echo get_lang('Date'); ?> :</td>
     	<td>
     	<?php
-    		if ($session['access_start_date'] == '00-00-0000' && $session['access_end_date']== '00-00-0000' ) {
-    		    echo get_lang('NoTimeLimits');
+            if ($session['access_start_date'] == '00-00-0000' && $session['access_end_date']== '00-00-0000' ) {
+                echo get_lang('NoTimeLimits');
             }
-    		else {
+            else {
                 if ($session['access_start_date'] != '00-00-0000') {
-                	//$session['date_start'] = Display::tag('i', get_lang('NoTimeLimits'));
+                    //$session['date_start'] = Display::tag('i', get_lang('NoTimeLimits'));
                     $session['access_start_date'] =  get_lang('From').' '.$session['access_start_date'];
                 } else {
-                	$session['access_start_date'] = '';
+                    $session['access_start_date'] = '';
                 }
                 if ($session['access_end_date'] == '00-00-0000') {
                     $session['access_end_date'] ='';
                 } else {
-                	$session['access_end_date'] = get_lang('Until').' '.$session['access_end_date'];
+                    $session['access_end_date'] = get_lang('Until').' '.$session['access_end_date'];
                 }
-    			echo $session['access_start_date'].' '.$session['access_end_date'];
+                echo $session['access_start_date'].' '.$session['access_end_date'];
             }
             ?>
     	</td>
@@ -214,22 +214,22 @@ if ($allowTutors === 'true') {
     </tr>
     <?php
     if ($session['nbr_courses'] == 0) {
-    	echo '<tr>
+        echo '<tr>
             <td colspan="4">'.get_lang('NoCoursesForThisSession').'</td>
     		</tr>';
     } else {
-    	// select the courses
-    	$sql = "SELECT c.id, code,title,visual_code, nbr_users
+        // select the courses
+        $sql = "SELECT c.id, code,title,visual_code, nbr_users
     			FROM $tbl_course c,$tbl_session_rel_course sc
     			WHERE c.id = sc.c_id
     			AND	session_id='$id_session'
     			ORDER BY title";
-    	$result=Database::query($sql);
-    	$courses=Database::store_result($result);
-    	foreach ($courses as $course) {
-    		//select the number of users
+        $result=Database::query($sql);
+        $courses=Database::store_result($result);
+        foreach ($courses as $course) {
+            //select the number of users
 
-    		$sql = "SELECT count(*) FROM $tbl_session_rel_user sru, $tbl_session_rel_course_rel_user srcru
+            $sql = "SELECT count(*) FROM $tbl_session_rel_user sru, $tbl_session_rel_course_rel_user srcru
                     WHERE
                         srcru.user_id = sru.user_id AND
                         srcru.session_id = sru.session_id AND
@@ -237,49 +237,49 @@ if ($allowTutors === 'true') {
                         sru.relation_type<>".SESSION_RELATION_TYPE_RRHH." AND
                         srcru.session_id = '".intval($id_session)."'";
 
-    		$rs = Database::query($sql);
-    		$course['nbr_users'] = Database::result($rs,0,0);
+            $rs = Database::query($sql);
+            $course['nbr_users'] = Database::result($rs,0,0);
 
-    		// Get coachs of the courses in session
+            // Get coachs of the courses in session
 
-    		$sql = "SELECT user.lastname,user.firstname,user.username
+            $sql = "SELECT user.lastname,user.firstname,user.username
     		        FROM $tbl_session_rel_course_rel_user session_rcru, $tbl_user user
     				WHERE
     				    session_rcru.user_id = user.user_id AND
     				    session_rcru.session_id = '".intval($id_session)."' AND
     				    session_rcru.c_id ='".Database::escape_string($course['id'])."' AND
     				    session_rcru.status=2";
-    		$rs = Database::query($sql);
+            $rs = Database::query($sql);
 
-    		$coachs = array();
-    		if (Database::num_rows($rs) > 0) {
-    			while ($info_coach = Database::fetch_array($rs)) {
+            $coachs = array();
+            if (Database::num_rows($rs) > 0) {
+                while ($info_coach = Database::fetch_array($rs)) {
                     $coachs[] = api_get_person_name(
                             $info_coach['firstname'],
                             $info_coach['lastname']
                         ).' ('.$info_coach['username'].')';
-    			}
-    		} else {
-    			$coach = get_lang('None');
-    		}
-
-    		if (count($coachs) > 0) {
-    			$coach = implode('<br />',$coachs);
-    		} else {
-    			$coach = get_lang('None');
-    		}
-
-    		$orig_param = '&origin=resume_session';
-    		//hide_course_breadcrumb the parameter has been added to hide the
+                }
+            } else {
+                $coach = get_lang('None');
+            }
+
+            if (count($coachs) > 0) {
+                $coach = implode('<br />',$coachs);
+            } else {
+                $coach = get_lang('None');
+            }
+
+            $orig_param = '&origin=resume_session';
+            //hide_course_breadcrumb the parameter has been added to hide the
             // name of the course, that appeared in the default $interbreadcrumb
-    		echo '
+            echo '
     		<tr>
     			<td>'.Display::url($course['title'].' ('.$course['visual_code'].')', api_get_path(WEB_COURSE_PATH).$course['code'].'/?id_session='.$id_session),'</td>
     			<td>'.$coach.'</td>
     			<td>'.$course['nbr_users'].'</td>
 
     		</tr>';
-    	}
+        }
     }
     ?>
     </table>
@@ -300,11 +300,11 @@ if ($allowTutors === 'true') {
     <?php
 
     if ($session['nbr_users']==0) {
-    	echo '<tr>
+        echo '<tr>
     			<td colspan="2">'.get_lang('NoUsersForThisSession').'</td>
     		</tr>';
     } else {
-    	$order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname' : ' ORDER BY lastname, firstname';
+        $order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname' : ' ORDER BY lastname, firstname';
 
         if ($multiple_url_is_on) {
             $sql = "SELECT u.user_id, lastname, firstname, username, access_url_id
@@ -322,11 +322,11 @@ if ($allowTutors === 'true') {
                     AND su.session_id = ".$id_session.$order_clause;
         }
 
-    	$result = Database::query($sql);
-    	$users  = Database::store_result($result);
+        $result = Database::query($sql);
+        $users  = Database::store_result($result);
         // change breadcrumb in destination page
-    	$orig_param = '&origin=resume_session&id_session='.$id_session;
-    	foreach ($users as $user) {
+        $orig_param = '&origin=resume_session&id_session='.$id_session;
+        foreach ($users as $user) {
             $user_link = '';
             if (!empty($user['user_id'])) {
                 $user_link = '<a href="'.api_get_path(WEB_CODE_PATH).'admin/user_information.php?user_id='.intval($user['user_id']).'">'.
@@ -343,7 +343,7 @@ if ($allowTutors === 'true') {
                 }
             }
 
-    		echo '<tr>
+            echo '<tr>
                     <td width="90%">
                         '.$user_link.'
                     </td>
@@ -357,7 +357,7 @@ if ($allowTutors === 'true') {
                         '.$link_to_add_user_in_url.'
                     </td>
                     </tr>';
-    	}
+        }
     }
     ?>
     </table>

+ 185 - 185
main/webservices/soap_course.php

@@ -13,44 +13,44 @@ require_once __DIR__.'/soap.php';
 $s = WSSoapServer::singleton();
 
 $s->wsdl->addComplexType(
-	'course_id',
-	'complexType',
-	'struct',
-	'all',
-	'',
-	array(
-		'course_id_field_name' => array('name' => 'course_id_field_name', 'type' => 'xsd:string'),
-		'course_id_value' => array('name' => 'course_id_value', 'type' => 'xsd:string')
-	)
+    'course_id',
+    'complexType',
+    'struct',
+    'all',
+    '',
+    array(
+        'course_id_field_name' => array('name' => 'course_id_field_name', 'type' => 'xsd:string'),
+        'course_id_value' => array('name' => 'course_id_value', 'type' => 'xsd:string')
+    )
 );
 
 $s->wsdl->addComplexType(
-	'course_result',
-	'complexType',
-	'struct',
-	'all',
-	'',
-	array(
-		'course_id_value' => array('name' => 'course_id_value', 'type' => 'xsd:string'),
-		'result' => array('name' => 'result', 'type' => 'tns:result')
-	)
+    'course_result',
+    'complexType',
+    'struct',
+    'all',
+    '',
+    array(
+        'course_id_value' => array('name' => 'course_id_value', 'type' => 'xsd:string'),
+        'result' => array('name' => 'result', 'type' => 'tns:result')
+    )
 );
 
 $s->wsdl->addComplexType(
-	'course_result_array',
-	'complexType',
-	'array',
-	'',
-	'SOAP-ENC:Array',
-	array(),
-	array(array('ref'=>'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:course_result[]')),
-	'tns:course_result'
+    'course_result_array',
+    'complexType',
+    'array',
+    '',
+    'SOAP-ENC:Array',
+    array(),
+    array(array('ref'=>'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:course_result[]')),
+    'tns:course_result'
 );
 
 $s->register(
-	'WSCourse.DeleteCourse',
-	array('secret_key' => 'xsd:string', 'course_id_field_name' => 'xsd:string', 'course_id_value' => 'xsd:string'),
-	array(),
+    'WSCourse.DeleteCourse',
+    array('secret_key' => 'xsd:string', 'course_id_field_name' => 'xsd:string', 'course_id_value' => 'xsd:string'),
+    array(),
     'urn:WSService',                               // namespace
     'urn:WSService#WSCourse.DeleteCourse',         // soapaction
     'rpc',                                         // style
@@ -60,206 +60,206 @@ $s->register(
 );
 
 $s->register(
-	'WSCourse.DeleteCourses',
-	array('secret_key' => 'xsd:string', 'courses' => 'tns:course_id[]'),
-	array('return' => 'tns:course_result_array')
+    'WSCourse.DeleteCourses',
+    array('secret_key' => 'xsd:string', 'courses' => 'tns:course_id[]'),
+    array('return' => 'tns:course_result_array')
 );
 
 $s->register(
-	'WSCourse.CreateCourse',
-	array(
-		'secret_key' => 'xsd:string',
-		'title' => 'xsd:string',
-		'category_code' => 'xsd:string',
-		'wanted_code' => 'xsd:string',
-		'tutor_name' => 'xsd:string',
-		'course_admin_user_id_field_name' => 'xsd:string',
-		'course_admin_user_id_value' => 'xsd:string',
-		'language' => 'xsd:string',
-		'course_id_field_name' => 'xsd:string',
-		'course_id_value' => 'xsd:string',
-		'extras' => 'tns:extra_field'
-	),
-	array('return' => 'xsd:int')
+    'WSCourse.CreateCourse',
+    array(
+        'secret_key' => 'xsd:string',
+        'title' => 'xsd:string',
+        'category_code' => 'xsd:string',
+        'wanted_code' => 'xsd:string',
+        'tutor_name' => 'xsd:string',
+        'course_admin_user_id_field_name' => 'xsd:string',
+        'course_admin_user_id_value' => 'xsd:string',
+        'language' => 'xsd:string',
+        'course_id_field_name' => 'xsd:string',
+        'course_id_value' => 'xsd:string',
+        'extras' => 'tns:extra_field'
+    ),
+    array('return' => 'xsd:int')
 );
 
 $s->wsdl->addComplexType(
-	'course_create',
-	'complexType',
-	'struct',
-	'all',
-	'',
-	array(
-		'title' => array('name' => 'title', 'type' => 'xsd:string'),
-		'category_code' => array('name' => 'category_code', 'type' => 'xsd:string'),
-		'wanted_code' => array('name' => 'wanted_code', 'type' => 'xsd:int'),
-		'tutor_name' => array('name' => 'tutor_name', 'type' => 'xsd:string'),
-		'course_admin_user_id_field_name' => array('name' => 'course_admin_user_id_field_name', 'type' => 'xsd:string'),
-		'course_admin_user_id_value' => array('name' => 'course_admin_user_id_value', 'type' => 'xsd:string'),
-		'language' => array('name' => 'language', 'type' => 'xsd:string'),
-		'course_id_field_name' => array('name' => 'course_id_field_name', 'type' => 'xsd:string'),
-		'course_id_value' => array('name' => 'course_id_value', 'type' => 'xsd:string'),
-		'extras' => array('name' => 'extras', 'type' => 'tns:extra_field')
-	)
+    'course_create',
+    'complexType',
+    'struct',
+    'all',
+    '',
+    array(
+        'title' => array('name' => 'title', 'type' => 'xsd:string'),
+        'category_code' => array('name' => 'category_code', 'type' => 'xsd:string'),
+        'wanted_code' => array('name' => 'wanted_code', 'type' => 'xsd:int'),
+        'tutor_name' => array('name' => 'tutor_name', 'type' => 'xsd:string'),
+        'course_admin_user_id_field_name' => array('name' => 'course_admin_user_id_field_name', 'type' => 'xsd:string'),
+        'course_admin_user_id_value' => array('name' => 'course_admin_user_id_value', 'type' => 'xsd:string'),
+        'language' => array('name' => 'language', 'type' => 'xsd:string'),
+        'course_id_field_name' => array('name' => 'course_id_field_name', 'type' => 'xsd:string'),
+        'course_id_value' => array('name' => 'course_id_value', 'type' => 'xsd:string'),
+        'extras' => array('name' => 'extras', 'type' => 'tns:extra_field')
+    )
 );
 
 $s->wsdl->addComplexType(
-	'course_create_result',
-	'complexType',
-	'struct',
-	'all',
-	'',
-	array(
-		'course_id_value' => array('name' => 'course_id_value', 'type' => 'xsd:string'),
-		'course_id_generated' => array('name' => 'course_id_generated', 'type' => 'xsd:int'),
-		'result' => array('name' => 'result', 'type' => 'tns:result')
-	)
+    'course_create_result',
+    'complexType',
+    'struct',
+    'all',
+    '',
+    array(
+        'course_id_value' => array('name' => 'course_id_value', 'type' => 'xsd:string'),
+        'course_id_generated' => array('name' => 'course_id_generated', 'type' => 'xsd:int'),
+        'result' => array('name' => 'result', 'type' => 'tns:result')
+    )
 );
 
 $s->wsdl->addComplexType(
-	'course_create_result_array',
-	'complexType',
-	'array',
-	'',
-	'SOAP-ENC:Array',
-	array(),
-	array(array('ref'=>'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:course_create_result[]')),
-	'tns:course_create_result'
+    'course_create_result_array',
+    'complexType',
+    'array',
+    '',
+    'SOAP-ENC:Array',
+    array(),
+    array(array('ref'=>'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:course_create_result[]')),
+    'tns:course_create_result'
 );
 
 $s->register(
-	'WSCourse.CreateCourses',
-	array(
-		'secret_key' => 'xsd:string',
-		'courses' => 'tns:course_create[]'
-	),
-	array('return' => 'tns:course_create_result_array')
+    'WSCourse.CreateCourses',
+    array(
+        'secret_key' => 'xsd:string',
+        'courses' => 'tns:course_create[]'
+    ),
+    array('return' => 'tns:course_create_result_array')
 );
 
 $s->register(
-	'WSCourse.EditCourse',
-	array(
-		'secret_key' => 'xsd:string',
-		'course_id_field_name' => 'xsd:string',
-		'course_id_value' => 'xsd:string',
-		'title' => 'xsd:string',
-		'category_code' => 'xsd:string',
-		'department_name' => 'xsd:string',
-		'department_url' => 'xsd:string',
-		'language' => 'xsd:string',
-		'visibility' => 'xsd:int',
-		'subscribe' => 'xsd:int',
-		'unsubscribe' => 'xsd:int',
-		'visual_code' => 'xsd:string',
-		'extras' => 'tns:extra_field'
-	)
+    'WSCourse.EditCourse',
+    array(
+        'secret_key' => 'xsd:string',
+        'course_id_field_name' => 'xsd:string',
+        'course_id_value' => 'xsd:string',
+        'title' => 'xsd:string',
+        'category_code' => 'xsd:string',
+        'department_name' => 'xsd:string',
+        'department_url' => 'xsd:string',
+        'language' => 'xsd:string',
+        'visibility' => 'xsd:int',
+        'subscribe' => 'xsd:int',
+        'unsubscribe' => 'xsd:int',
+        'visual_code' => 'xsd:string',
+        'extras' => 'tns:extra_field'
+    )
 );
 
 $s->wsdl->addComplexType(
-	'course',
-	'complexType',
-	'struct',
-	'all',
-	'',
-	array(
-		'id' => array('name' => 'id', 'type' => 'xsd:int'),
-		'code' => array('name' => 'code', 'type' => 'xsd:string'),
-		'title' => array('name' => 'title', 'type' => 'xsd:string'),
-		'language' => array('name' => 'language', 'type' => 'xsd:string'),
-		'visibility' => array('name' => 'visibility', 'type' => 'xsd:int'),
-		'category_name' => array('name' => 'category_name', 'type' => 'xsd:string'),
-		'number_students' => array('name' => 'number_students', 'type' => 'xsd:int'),
-		'external_course_id' => array('name' => 'external_course_id', 'type' => 'xsd:string'),
-	)
+    'course',
+    'complexType',
+    'struct',
+    'all',
+    '',
+    array(
+        'id' => array('name' => 'id', 'type' => 'xsd:int'),
+        'code' => array('name' => 'code', 'type' => 'xsd:string'),
+        'title' => array('name' => 'title', 'type' => 'xsd:string'),
+        'language' => array('name' => 'language', 'type' => 'xsd:string'),
+        'visibility' => array('name' => 'visibility', 'type' => 'xsd:int'),
+        'category_name' => array('name' => 'category_name', 'type' => 'xsd:string'),
+        'number_students' => array('name' => 'number_students', 'type' => 'xsd:int'),
+        'external_course_id' => array('name' => 'external_course_id', 'type' => 'xsd:string'),
+    )
 );
 
 $s->wsdl->addComplexType(
-	'course_array',
-	'complexType',
-	'array',
-	'',
-	'SOAP-ENC:Array',
-	array(),
-	array(array('ref'=>'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:course[]')),
-	'tns:course'
+    'course_array',
+    'complexType',
+    'array',
+    '',
+    'SOAP-ENC:Array',
+    array(),
+    array(array('ref'=>'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:course[]')),
+    'tns:course'
 );
 
 $s->register(
-	'WSCourse.ListCourses',
-	array(
-		'secret_key' => 'xsd:string',
-		'course_id_field_name' => 'xsd:string',
-		'visibilities' => 'xsd:string'
-	),
-	array('return' => 'tns:course_array')
+    'WSCourse.ListCourses',
+    array(
+        'secret_key' => 'xsd:string',
+        'course_id_field_name' => 'xsd:string',
+        'visibilities' => 'xsd:string'
+    ),
+    array('return' => 'tns:course_array')
 );
 
 $s->register(
-	'WSCourse.SubscribeUserToCourse',
-	array(
-		'secret_key' => 'xsd:string',
-		'course_id_field_name' => 'xsd:string',
-		'course_id_value' => 'xsd:string',
-		'user_id_field_name' => 'xsd:string',
-		'user_id_value' => 'xsd:string',
-		'status' => 'xsd:int'
-	)
+    'WSCourse.SubscribeUserToCourse',
+    array(
+        'secret_key' => 'xsd:string',
+        'course_id_field_name' => 'xsd:string',
+        'course_id_value' => 'xsd:string',
+        'user_id_field_name' => 'xsd:string',
+        'user_id_value' => 'xsd:string',
+        'status' => 'xsd:int'
+    )
 );
 
 $s->register(
-	'WSCourse.UnsubscribeUserFromCourse',
-	array(
-		'secret_key' => 'xsd:string',
-		'course_id_field_name' => 'xsd:string',
-		'course_id_value' => 'xsd:string',
-		'user_id_field_name' => 'xsd:string',
-		'user_id_value' => 'xsd:string'
-	)
+    'WSCourse.UnsubscribeUserFromCourse',
+    array(
+        'secret_key' => 'xsd:string',
+        'course_id_field_name' => 'xsd:string',
+        'course_id_value' => 'xsd:string',
+        'user_id_field_name' => 'xsd:string',
+        'user_id_value' => 'xsd:string'
+    )
 );
 
 $s->wsdl->addComplexType(
-	'course_description',
-	'complexType',
-	'struct',
-	'all',
-	'',
-	array(
-		'course_desc_id' => array('name' => 'course_desc_id', 'type' => 'xsd:int'),
-		'course_desc_title' => array('name' => 'course_desc_title', 'type' => 'xsd:string'),
-		'course_desc_content' => array('name' => 'course_desc_content', 'type' => 'xsd:string')
-	)
+    'course_description',
+    'complexType',
+    'struct',
+    'all',
+    '',
+    array(
+        'course_desc_id' => array('name' => 'course_desc_id', 'type' => 'xsd:int'),
+        'course_desc_title' => array('name' => 'course_desc_title', 'type' => 'xsd:string'),
+        'course_desc_content' => array('name' => 'course_desc_content', 'type' => 'xsd:string')
+    )
 );
 
 $s->wsdl->addComplexType(
-	'course_description_array',
-	'complexType',
-	'array',
-	'',
-	'SOAP-ENC:Array',
-	array(),
-	array(array('ref'=>'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:course_description[]')),
-	'tns:course_description'
+    'course_description_array',
+    'complexType',
+    'array',
+    '',
+    'SOAP-ENC:Array',
+    array(),
+    array(array('ref'=>'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:course_description[]')),
+    'tns:course_description'
 );
 
 $s->register(
-	'WSCourse.GetCourseDescriptions',
-	array(
-		'secret_key' => 'xsd:string',
-		'course_id_field_name' => 'xsd:string',
-		'course_id_value' => 'xsd:string'
-	),
-	array('return' => 'tns:course_description_array')
+    'WSCourse.GetCourseDescriptions',
+    array(
+        'secret_key' => 'xsd:string',
+        'course_id_field_name' => 'xsd:string',
+        'course_id_value' => 'xsd:string'
+    ),
+    array('return' => 'tns:course_description_array')
 );
 
 $s->register(
-	'WSCourse.EditCourseDescription',
-	array(
-		'secret_key' => 'xsd:string',
-		'course_id_field_name' => 'xsd:string',
-		'course_id_value' => 'xsd:string',
-		'course_desc_id' => 'xsd:int',
-		'course_desc_title' => 'xsd:string',
-		'course_desc_content' => 'xsd:string'
-	)
+    'WSCourse.EditCourseDescription',
+    array(
+        'secret_key' => 'xsd:string',
+        'course_id_field_name' => 'xsd:string',
+        'course_id_value' => 'xsd:string',
+        'course_desc_id' => 'xsd:int',
+        'course_desc_title' => 'xsd:string',
+        'course_desc_content' => 'xsd:string'
+    )
 );
 

+ 1 - 1
plugin/advanced_subscription/src/AdvancedSubscriptionPlugin.php

@@ -1068,7 +1068,7 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
      */
     public function getStatusMessage($status, $isAble = true)
     {
-	$message = '';
+    $message = '';
         switch ($status) {
             case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_NO_QUEUE:
                 if ($isAble) {

+ 2 - 2
plugin/advanced_subscription/src/HookAdvancedSubscription.php

@@ -67,7 +67,7 @@ class HookAdvancedSubscription extends HookObserver implements
         if ($data['type'] === HOOK_EVENT_TYPE_PRE) {
 
         } elseif ($data['type'] === HOOK_EVENT_TYPE_POST) {
-           /** @var \nusoap_server $server */
+            /** @var \nusoap_server $server */
             $server = &$data['server'];
 
             /** WSSessionListInCategory */
@@ -424,7 +424,7 @@ class HookAdvancedSubscription extends HookObserver implements
         }
         if (!WSHelperVerifyKey($params)) {
 
-           //return return_error(WS_ERROR_SECRET_KEY);
+            //return return_error(WS_ERROR_SECRET_KEY);
         }
         // Check if category ID is set
         if (!empty($params['id']) && empty($params['name'])) {

+ 6 - 6
plugin/courselegal/CourseLegalPlugin.php

@@ -108,12 +108,12 @@ class CourseLegalPlugin extends Plugin
     }
 
     /**
-    * @param int $userId
-    * @param int $courseCode
-    * @param int $sessionId
-    * @param boolean $sendEmail Optional. Indicate whether the mail must be sent. Default is true
-    * @return mixed
-    */
+     * @param int $userId
+     * @param int $courseCode
+     * @param int $sessionId
+     * @param boolean $sendEmail Optional. Indicate whether the mail must be sent. Default is true
+     * @return mixed
+     */
     public function saveUserLegal($userId, $courseCode, $sessionId, $sendEmail = true)
     {
         $courseInfo = api_get_course_info($courseCode);

+ 39 - 39
whoisonlinesession.php

@@ -41,10 +41,10 @@ Display::display_header(get_lang('UserOnlineListSession'));
 		</th>
 	</tr>
 <?php
-	$session_is_coach = array();
-	if (isset($_user['user_id']) && $_user['user_id'] != '') {
-		$_user['user_id'] = intval($_user['user_id']);
-		$sql = "SELECT DISTINCT session.id,
+    $session_is_coach = array();
+    if (isset($_user['user_id']) && $_user['user_id'] != '') {
+        $_user['user_id'] = intval($_user['user_id']);
+        $sql = "SELECT DISTINCT session.id,
 					name,
 					access_start_date,
 					access_end_date
@@ -53,13 +53,13 @@ Display::display_header(get_lang('UserOnlineListSession'));
 					ON srcru.user_id = ".$_user['user_id']." AND srcru.status=2
 					AND session.id = srcru.session_id
 				ORDER BY access_start_date, access_end_date, name";
-		$result = Database::query($sql);
+        $result = Database::query($sql);
 
-		while ($session = Database:: fetch_array($result)) {
-			$session_is_coach[$session['id']] = $session;
-		}
+        while ($session = Database:: fetch_array($result)) {
+            $session_is_coach[$session['id']] = $session;
+        }
 
-		$sql = "SELECT DISTINCT session.id,
+        $sql = "SELECT DISTINCT session.id,
 					name,
 					access_start_date,
 					access_end_date
@@ -67,9 +67,9 @@ Display::display_header(get_lang('UserOnlineListSession'));
 				WHERE session.id_coach = ".$_user['user_id']."
 				ORDER BY access_start_date, access_end_date, name";
         $result = Database::query($sql);
-		while ($session = Database:: fetch_array($result)) {
-			$session_is_coach[$session['id']] = $session;
-		}
+        while ($session = Database:: fetch_array($result)) {
+            $session_is_coach[$session['id']] = $session;
+        }
 
         if (empty($time_limit)) {
             $time_limit = api_get_setting('time_limit_whosonline');
@@ -82,7 +82,7 @@ Display::display_header(get_lang('UserOnlineListSession'));
 
         $students_online = array();
         foreach ($session_is_coach as $session) {
-			$sql = "SELECT DISTINCT last_access.access_user_id,
+            $sql = "SELECT DISTINCT last_access.access_user_id,
 						last_access.access_date,
 						last_access.c_id,
 						last_access.access_session_id,
@@ -95,49 +95,49 @@ Display::display_header(get_lang('UserOnlineListSession'));
 					AND access_date >= '$current_date'
 					GROUP BY access_user_id";
 
-			$result = Database::query($sql);
+            $result = Database::query($sql);
 
-			while($user_list = Database::fetch_array($result)) {
-				$students_online[$user_list['access_user_id']] = $user_list;
-			}
-		}
+            while($user_list = Database::fetch_array($result)) {
+                $students_online[$user_list['access_user_id']] = $user_list;
+            }
+        }
 
-		if (count($students_online) > 0) {
-			foreach ($students_online as $student_online) {
-				echo "<tr>
+        if (count($students_online) > 0) {
+            foreach ($students_online as $student_online) {
+                echo "<tr>
 						<td>
 					";
-				echo $student_online['name'];
-				echo "	</td>
+                echo $student_online['name'];
+                echo "	</td>
 						<td align='center'>
 					 ";
-				$courseInfo = api_get_course_info_by_id($student_online['c_id']);
-				echo $courseInfo['title'];
-				echo "	</td>
+                $courseInfo = api_get_course_info_by_id($student_online['c_id']);
+                echo $courseInfo['title'];
+                echo "	</td>
 						<td align='center'>
 					 ";
-							 if (!empty($student_online['email'])) {
-								echo $student_online['email'];
-							 } else {
-							 	echo get_lang('NoEmail');
-							 }
-				echo "	</td>
+                                if (!empty($student_online['email'])) {
+                                echo $student_online['email'];
+                                } else {
+                                    echo get_lang('NoEmail');
+                                }
+                echo "	</td>
 						<td align='center'>
 					 ";
-				echo '<a href="main/chat/chat.php?cidReq='.$courseInfo['code'].'&id_session='.$student_online['access_session_id'].'"> -> </a>';
-				echo "	</td>
+                echo '<a href="main/chat/chat.php?cidReq='.$courseInfo['code'].'&id_session='.$student_online['access_session_id'].'"> -> </a>';
+                echo "	</td>
 					</tr>
 					 ";
-			}
-		} else {
-			echo '	<tr>
+            }
+        } else {
+            echo '	<tr>
 						<td colspan="4">
 							'.get_lang('NoOnlineStudents').'
 						</td>
 					</tr>
 				 ';
-		}
-	}
+        }
+    }
 ?>
 </table>
 <?php