Passed
Push — 1.10.x ( 4b2d9f...3e6bac )
by Yannick
182:52 queued 136:22
created
main/inc/lib/search/xapian/XapianIndexer.class.php 3 patches
Doc Comments   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 
99 99
     /**
100 100
      * Simple getter for the db attribute
101
-     * @return  object  The db attribute
101
+     * @return  null|XapianWritableDatabase  The db attribute
102 102
      */
103 103
     function getDb()
104 104
     {
@@ -108,6 +108,7 @@  discard block
 block discarded – undo
108 108
     /**
109 109
      * Add this chunk to the chunk array attribute
110 110
      * @param  string  Chunk of text
111
+     * @param IndexableChunk $chunk
111 112
      * @return  void
112 113
      */
113 114
     function addChunk($chunk)
@@ -179,7 +180,7 @@  discard block
 block discarded – undo
179 180
      * Get document data on a xapian document
180 181
      *
181 182
      * @param XapianDocument $doc xapian document to push into the db
182
-     * @return mixed xapian document data or FALSE if error
183
+     * @return string xapian document data or FALSE if error
183 184
      */
184 185
     function get_document_data($doc)
185 186
     {
@@ -286,7 +287,7 @@  discard block
 block discarded – undo
286 287
      * Replace a document in the actual db
287 288
      *
288 289
      * @param XapianDocument $doc xapian document to push into the db
289
-     * @param Xapian::docid $did xapian document id of the document to replace
290
+     * @param integer $did xapian document id of the document to replace
290 291
      */
291 292
     function replace_document($doc, $did)
292 293
     {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  */
7 7
 
8 8
 require_once 'xapian.php';
9
-require_once dirname(__FILE__) . '/../IndexableChunk.class.php';
9
+require_once dirname(__FILE__).'/../IndexableChunk.class.php';
10 10
 
11 11
 /**
12 12
  * Abstract helper class
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
                     if (!empty($chunk->terms)) {
131 131
                         foreach ($chunk->terms as $term) {
132 132
                             /* FIXME: think of getting weight */
133
-                            $doc->add_term($term['flag'] . $term['name'], 1);
133
+                            $doc->add_term($term['flag'].$term['name'], 1);
134 134
                         }
135 135
                     }
136 136
 
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
         $doc->clear_terms();
216 216
         foreach ($terms as $term) {
217 217
             //add directly
218
-            $doc->add_term($prefix . $term, 1);
218
+            $doc->add_term($prefix.$term, 1);
219 219
         }
220 220
         $this->db->replace_document($did, $doc);
221 221
         $this->db->flush();
Please login to merge, or discard this patch.
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -70,13 +70,16 @@
 block discarded – undo
70 70
      */
71 71
     function connectDb($path = null, $dbMode = null, $lang = 'english')
72 72
     {
73
-        if ($this->db != null)
74
-            return $this->db;
75
-        if ($dbMode == null)
76
-            $dbMode = Xapian::DB_CREATE_OR_OPEN;
73
+        if ($this->db != null) {
74
+                    return $this->db;
75
+        }
76
+        if ($dbMode == null) {
77
+                    $dbMode = Xapian::DB_CREATE_OR_OPEN;
78
+        }
77 79
 
78
-        if ($path == null)
79
-            $path = api_get_path(SYS_UPLOAD_PATH).'plugins/xapian/searchdb/';
80
+        if ($path == null) {
81
+                    $path = api_get_path(SYS_UPLOAD_PATH).'plugins/xapian/searchdb/';
82
+        }
80 83
 
81 84
         try {
82 85
             $this->db = new XapianWritableDatabase($path, $dbMode);
Please login to merge, or discard this patch.
main/inc/lib/security.lib.php 3 patches
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,6 +45,8 @@  discard block
 block discarded – undo
45 45
      * checker path (directory)
46 46
      * @param	string	Absolute path to be checked (with trailing slash)
47 47
      * @param	string	Checker path under which the path should be (absolute path, with trailing slash, get it from api_get_path(SYS_COURSE_PATH))
48
+     * @param string $abs_path
49
+     * @param string $checker_path
48 50
      * @return	bool	True if the path is under the checker, false otherwise
49 51
      */
50 52
     public static function check_abs_path($abs_path, $checker_path)
@@ -300,6 +302,7 @@  discard block
 block discarded – undo
300 302
      * @param string	The variable to filter for XSS, this params can be a string or an array (example : array(x,y))
301 303
      * @param int The user status,constant allowed (STUDENT, COURSEMANAGER, ANONYMOUS, COURSEMANAGERLOWSECURITY)
302 304
      * @param bool $filter_terms
305
+     * @param integer $user_status
303 306
      * @return	mixed	Filtered string or array
304 307
      */
305 308
     public static function remove_XSS($var, $user_status = null, $filter_terms = false)
@@ -453,7 +456,7 @@  discard block
 block discarded – undo
453 456
      * This method provides specific protection (against XSS and other kinds of attacks) for static images (icons) used by the system.
454 457
      * Image paths are supposed to be given by programmers - people who know what they do, anyway, this method encourages
455 458
      * a safe practice for generating icon paths, without using heavy solutions based on HTMLPurifier for example.
456
-     * @param string $img_path          The input path of the image, it could be relative or absolute URL.
459
+     * @param string $image_path          The input path of the image, it could be relative or absolute URL.
457 460
      * @return string                   Returns sanitized image path or an empty string when the image path is not secure.
458 461
      * @author Ivan Tcholakov, March 2011
459 462
      */
Please login to merge, or discard this patch.
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -304,9 +304,9 @@  discard block
 block discarded – undo
304 304
      */
305 305
     public static function remove_XSS($var, $user_status = null, $filter_terms = false)
306 306
     {
307
-    	if ($filter_terms) {
308
-    		$var = self::filter_terms($var);
309
-    	}
307
+        if ($filter_terms) {
308
+            $var = self::filter_terms($var);
309
+        }
310 310
 
311 311
         if (empty($user_status)) {
312 312
             if (api_is_anonymous()) {
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
      */
402 402
     static function filter_terms($text)
403 403
     {
404
-    	static $bad_terms = array();
404
+        static $bad_terms = array();
405 405
 
406 406
         if (empty($bad_terms)) {
407 407
             $list = api_get_setting('filter_terms');
@@ -420,14 +420,14 @@  discard block
 block discarded – undo
420 420
             }
421 421
         }
422 422
 
423
-    	$replace = '***';
423
+        $replace = '***';
424 424
 
425
-    	if (!empty($bad_terms)) {
426
-    		//Fast way
427
-    		$new_text = str_ireplace($bad_terms, $replace, $text, $count);
425
+        if (!empty($bad_terms)) {
426
+            //Fast way
427
+            $new_text = str_ireplace($bad_terms, $replace, $text, $count);
428 428
 
429
-    		//We need statistics
430
-    		/*
429
+            //We need statistics
430
+            /*
431 431
     		if (strlen($new_text) != strlen($text)) {
432 432
     			$table = Database::get_main_table(TABLE_STATISTIC_TRACK_FILTERED_TERMS);
433 433
     			$attributes = array();
@@ -442,10 +442,10 @@  discard block
 block discarded – undo
442 442
     			$sql = Database::insert($table, $attributes);
443 443
     		}
444 444
     		*/
445
-    		$text = $new_text;
445
+            $text = $new_text;
446 446
 
447
-    	}
448
-		return $text;
447
+        }
448
+        return $text;
449 449
     }
450 450
 
451 451
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
             $rel_path = '/'.$rel_path;
92 92
         }
93 93
         $abs_path = $current_path.$rel_path;
94
-        $true_path=str_replace("\\", '/', realpath($abs_path));
94
+        $true_path = str_replace("\\", '/', realpath($abs_path));
95 95
         $found = strpos($true_path.'/', $checker_path);
96 96
         if ($found === 0) {
97 97
             return true;
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
         }
322 322
 
323 323
         if ($user_status == COURSEMANAGERLOWSECURITY) {
324
-            return $var;  // No filtering.
324
+            return $var; // No filtering.
325 325
         }
326 326
 
327 327
         static $purifier = array();
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
             }
345 345
 
346 346
             // Shows _target attribute in anchors
347
-            $config->set('Attr.AllowedFrameTargets', array('_blank','_top','_self', '_parent'));
347
+            $config->set('Attr.AllowedFrameTargets', array('_blank', '_top', '_self', '_parent'));
348 348
 
349 349
             if ($user_status == STUDENT) {
350 350
                 global $allowed_html_student;
Please login to merge, or discard this patch.
main/inc/lib/sessionmanager.lib.php 4 patches
Doc Comments   +25 added lines, -20 removed lines patch added patch discarded remove patch
@@ -1336,9 +1336,9 @@  discard block
 block discarded – undo
1336 1336
      * @param integer   $sessionCategoryId
1337 1337
      * @param int       $visibility
1338 1338
      * @param string    $description
1339
-     * @param bool      $showDescription
1339
+     * @param integer      $showDescription
1340 1340
      * @param int       $duration
1341
-     * @param array     $extraFields
1341
+     * @param boolean|null     $extraFields
1342 1342
      * @param int       $sessionAdminId
1343 1343
      * @param boolean $sendSubscriptionNotification Optional.
1344 1344
      *          Whether send a mail notification to users being subscribed
@@ -1558,7 +1558,7 @@  discard block
 block discarded – undo
1558 1558
      * @param array $user_list
1559 1559
      * @param int $session_visibility
1560 1560
      * @param bool $empty_users
1561
-     * @return bool
1561
+     * @return false|null
1562 1562
      */
1563 1563
     public static function suscribe_users_to_session(
1564 1564
         $id_session,
@@ -1830,7 +1830,7 @@  discard block
 block discarded – undo
1830 1830
      * @param array $courseInfo
1831 1831
      * @param int $status
1832 1832
      * @param bool $updateTotal
1833
-     * @return bool
1833
+     * @return false|null
1834 1834
      */
1835 1835
     public static function removeUsersFromCourseSession(
1836 1836
         $userList,
@@ -1896,7 +1896,7 @@  discard block
 block discarded – undo
1896 1896
      * @param string $course_code
1897 1897
      * @param int $session_visibility
1898 1898
      * @param bool $removeUsersNotInList
1899
-     * @return bool
1899
+     * @return false|null
1900 1900
      */
1901 1901
     public static function subscribe_users_to_session_course(
1902 1902
         $user_list,
@@ -2079,7 +2079,7 @@  discard block
 block discarded – undo
2079 2079
      * @param	bool	$removeExistingCoursesWithUsers Whether to unsubscribe
2080 2080
      * existing courses and users (true, default) or not (false)
2081 2081
      * @param $copyEvaluation from base course to session course
2082
-     * @return	void	Nothing, or false on error
2082
+     * @return	false|null	Nothing, or false on error
2083 2083
      * */
2084 2084
     public static function add_courses_to_session(
2085 2085
         $sessionId,
@@ -2275,6 +2275,8 @@  discard block
 block discarded – undo
2275 2275
      *
2276 2276
      * @param int Session id
2277 2277
      * @param int Course id
2278
+     * @param integer $session_id
2279
+     * @param integer $course_id
2278 2280
      * @return bool True in case of success, false otherwise
2279 2281
      */
2280 2282
     public static function unsubscribe_course_from_session($session_id, $course_id)
@@ -2330,7 +2332,7 @@  discard block
 block discarded – undo
2330 2332
      * @param	string	$variable Field's internal variable name
2331 2333
      * @param	int		$fieldType Field's type
2332 2334
      * @param	string	$displayText Field's language var name
2333
-     * @return int     new extra field id
2335
+     * @return boolean     new extra field id
2334 2336
      */
2335 2337
     public static function create_session_extra_field($variable, $fieldType, $displayText)
2336 2338
     {
@@ -2349,7 +2351,7 @@  discard block
 block discarded – undo
2349 2351
      * @param	integer	Course ID
2350 2352
      * @param	string	Field variable name
2351 2353
      * @param	string	Field value
2352
-     * @return	boolean	true if field updated, false otherwise
2354
+     * @return	boolean|null	true if field updated, false otherwise
2353 2355
      */
2354 2356
     public static function update_session_extra_field_value($sessionId, $variable, $value = '')
2355 2357
     {
@@ -2554,7 +2556,7 @@  discard block
 block discarded – undo
2554 2556
      * @param	array	id_checked
2555 2557
      * @param	bool	include delete session
2556 2558
      * @param	bool	optional, true if the function is called by a webservice, false otherwise.
2557
-     * @return	void	Nothing, or false on error
2559
+     * @return	boolean	Nothing, or false on error
2558 2560
      * The parameters is a array to delete sessions
2559 2561
      * */
2560 2562
     public static function delete_session_category($id_checked, $delete_session = false, $from_ws = false)
@@ -2605,7 +2607,7 @@  discard block
 block discarded – undo
2605 2607
      * @param  array $conditions a list of condition example :
2606 2608
      * array('status' => STUDENT) or
2607 2609
      * array('s.name' => array('operator' => 'LIKE', value = '%$needle%'))
2608
-     * @param  array $order_by a list of fields on which sort
2610
+     * @param  string[] $order_by a list of fields on which sort
2609 2611
      * @return array An array with all sessions of the platform.
2610 2612
      * @todo   optional course code parameter, optional sorting parameters...
2611 2613
      */
@@ -3043,6 +3045,7 @@  discard block
 block discarded – undo
3043 3045
      * @param string $orderCondition
3044 3046
      * @param string $keyword
3045 3047
      * @param string $description
3048
+     * @param integer $status
3046 3049
      * @return array sessions
3047 3050
      */
3048 3051
     public static function getSessionsFollowedByUser(
@@ -3255,8 +3258,8 @@  discard block
 block discarded – undo
3255 3258
     /**
3256 3259
      * Gets the list of courses by session filtered by access_url
3257 3260
      *
3258
-     * @param $userId
3259
-     * @param $sessionId
3261
+     * @param integer $userId
3262
+     * @param null|integer $sessionId
3260 3263
      * @param null $from
3261 3264
      * @param null $limit
3262 3265
      * @param null $column
@@ -3381,6 +3384,7 @@  discard block
 block discarded – undo
3381 3384
     /**
3382 3385
      * Gets the count of courses by session filtered by access_url
3383 3386
      * @param int session id
3387
+     * @param integer $session_id
3384 3388
      * @return array list of courses
3385 3389
      */
3386 3390
     public static function getCourseCountBySessionId($session_id, $keyword = null)
@@ -3632,6 +3636,7 @@  discard block
 block discarded – undo
3632 3636
      * Updates a session status
3633 3637
      * @param	int 	session id
3634 3638
      * @param	int 	status
3639
+     * @param integer $status
3635 3640
      */
3636 3641
     public static function set_session_status($session_id, $status)
3637 3642
     {
@@ -3943,7 +3948,7 @@  discard block
 block discarded – undo
3943 3948
 
3944 3949
     /**
3945 3950
      * @param $id
3946
-     * @return bool
3951
+     * @return null|boolean
3947 3952
      */
3948 3953
     public static function protect_teacher_session_edit($id)
3949 3954
     {
@@ -4007,7 +4012,7 @@  discard block
 block discarded – undo
4007 4012
      *  true: if the session exists it will be updated.
4008 4013
      *  false: if session exists a new session will be created adding a counter session1, session2, etc
4009 4014
      * @param int $defaultUserId
4010
-     * @param mixed $logger
4015
+     * @param Logger $logger
4011 4016
      * @param array $extraFields convert a file row to an extra field. Example in CSV file there's a SessionID then it will
4012 4017
      * converted to extra_external_session_id if you set this: array('SessionId' => 'extra_external_session_id')
4013 4018
      * @param string $extraFieldId
@@ -5249,7 +5254,6 @@  discard block
 block discarded – undo
5249 5254
      * @param string $lastConnectionDate
5250 5255
      * @param array $sessionIdList
5251 5256
      * @param array $studentIdList
5252
-     * @param int $userStatus STUDENT|COURSEMANAGER constants
5253 5257
      *
5254 5258
      * @return array|int
5255 5259
      */
@@ -5401,7 +5405,7 @@  discard block
 block discarded – undo
5401 5405
     /**
5402 5406
      * Get the list of course tools that have to be dealt with in case of
5403 5407
      * registering any course to a session
5404
-     * @return array The list of tools to be dealt with (literal names)
5408
+     * @return string[] The list of tools to be dealt with (literal names)
5405 5409
      */
5406 5410
     public static function getCourseToolToBeManaged()
5407 5411
     {
@@ -5415,7 +5419,7 @@  discard block
 block discarded – undo
5415 5419
      * Calls the methods bound to each tool when a course is registered into a session
5416 5420
      * @param int $sessionId
5417 5421
      * @param int $courseId
5418
-     * @return void
5422
+     * @return boolean|null
5419 5423
      */
5420 5424
     public static function installCourse($sessionId, $courseId)
5421 5425
     {
@@ -6055,6 +6059,7 @@  discard block
 block discarded – undo
6055 6059
      * @param int $categoryId The internal ID of the session category
6056 6060
      * @param string $target Value to search for in the session field values
6057 6061
      * @param array $extraFields A list of fields to be scanned and returned
6062
+     * @param DateTime $publicationDate
6058 6063
      * @return mixed
6059 6064
      */
6060 6065
     public static function getShortSessionListAndExtraByCategory($categoryId, $target, $extraFields = null, $publicationDate = null)
@@ -7384,7 +7389,7 @@  discard block
 block discarded – undo
7384 7389
     /**
7385 7390
      * Get link to the admin page for this session
7386 7391
      * @param   int $id Session ID
7387
-     * @return mixed    URL to the admin page to manage the session, or false on error
7392
+     * @return false|string    URL to the admin page to manage the session, or false on error
7388 7393
      */
7389 7394
     public static function getAdminPath($id)
7390 7395
     {
@@ -7401,7 +7406,7 @@  discard block
 block discarded – undo
7401 7406
      * If a course is provided, build the link to the course
7402 7407
      * @param   int $id Session ID
7403 7408
      * @param   int $courseId Course ID (optional) in case the link has to send straight to the course
7404
-     * @return mixed    URL to the page to use the session, or false on error
7409
+     * @return false|string    URL to the page to use the session, or false on error
7405 7410
      */
7406 7411
     public static function getPath($id, $courseId = 0)
7407 7412
     {
@@ -7499,7 +7504,7 @@  discard block
 block discarded – undo
7499 7504
     /**
7500 7505
      * Return true if coach is allowed to access this session
7501 7506
      * @param int $sessionId
7502
-     * @return bool
7507
+     * @return integer
7503 7508
      */
7504 7509
     public static function isSessionDateOkForCoach($sessionId)
7505 7510
     {
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6022,7 +6022,7 @@
 block discarded – undo
6022 6022
         ]);
6023 6023
     }
6024 6024
 
6025
-	/**
6025
+    /**
6026 6026
      * Get the count of user courses in session
6027 6027
      * @param int $sessionId The session id
6028 6028
      * @return array
Please login to merge, or discard this patch.
Braces   +14 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1588,8 +1588,10 @@  discard block
 block discarded – undo
1588 1588
         if (empty($session_visibility)) {
1589 1589
             $session_visibility = $session->getVisibility();
1590 1590
             //default status loaded if empty
1591
-            if (empty($session_visibility))
1592
-                $session_visibility = SESSION_VISIBLE_READ_ONLY; // by default readonly 1
1591
+            if (empty($session_visibility)) {
1592
+                            $session_visibility = SESSION_VISIBLE_READ_ONLY;
1593
+            }
1594
+            // by default readonly 1
1593 1595
         } else {
1594 1596
             if (!in_array($session_visibility, array(SESSION_VISIBLE_READ_ONLY, SESSION_VISIBLE, SESSION_INVISIBLE))) {
1595 1597
                 $session_visibility = SESSION_VISIBLE_READ_ONLY;
@@ -2792,10 +2794,11 @@  discard block
 block discarded – undo
2792 2794
                                 c_id = $courseId AND
2793 2795
                                 user_id = $user_id ";
2794 2796
                     $result = Database::query($sql);
2795
-                    if (Database::affected_rows($result) > 0)
2796
-                        return true;
2797
-                    else
2798
-                        return false;
2797
+                    if (Database::affected_rows($result) > 0) {
2798
+                                            return true;
2799
+                    } else {
2800
+                                            return false;
2801
+                    }
2799 2802
                 } else {
2800 2803
                     // The user is not subscribed to the session, so make sure
2801 2804
                     // he isn't subscribed to a course in this session either
@@ -2806,10 +2809,11 @@  discard block
 block discarded – undo
2806 2809
                                 c_id = $courseId AND
2807 2810
                                 user_id = $user_id ";
2808 2811
                     $result = Database::query($sql);
2809
-                    if (Database::affected_rows($result) > 0)
2810
-                        return true;
2811
-                    else
2812
-                        return false;
2812
+                    if (Database::affected_rows($result) > 0) {
2813
+                                            return true;
2814
+                    } else {
2815
+                                            return false;
2816
+                    }
2813 2817
                 }
2814 2818
             } else {
2815 2819
                 // Assign user as a coach to course
Please login to merge, or discard this patch.
Spacing   +196 added lines, -196 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
                     return $msg;
144 144
                 }
145 145
             } else {
146
-                $rs = Database::query("SELECT 1 FROM $tbl_session WHERE name='" . $name . "'");
146
+                $rs = Database::query("SELECT 1 FROM $tbl_session WHERE name='".$name."'");
147 147
                 if (Database::num_rows($rs)) {
148 148
                     $msg = get_lang('SessionNameAlreadyExists');
149 149
                     return $msg;
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
     public static function session_name_exists($name)
257 257
     {
258 258
         $name = Database::escape_string($name);
259
-        $sql = "SELECT COUNT(*) as count FROM " . Database::get_main_table(TABLE_MAIN_SESSION) . "
259
+        $sql = "SELECT COUNT(*) as count FROM ".Database::get_main_table(TABLE_MAIN_SESSION)."
260 260
                 WHERE name = '$name'";
261 261
         $result = Database::fetch_array(Database::query($sql));
262 262
 
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
             $where .= " AND (
288 288
                             s.session_admin_id = $user_id  OR
289 289
                             sru.user_id = '$user_id' AND
290
-                            sru.relation_type = '" . SESSION_RELATION_TYPE_RRHH . "'
290
+                            sru.relation_type = '".SESSION_RELATION_TYPE_RRHH."'
291 291
                             )
292 292
                       ";
293 293
 
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
             $where_condition = str_replace('category_name', 'sc.name', $where_condition);
306 306
             $where_condition = str_replace(
307 307
                 array("AND session_active = '1'  )", " AND (  session_active = '1'  )"),
308
-                array(') GROUP BY s.name HAVING session_active = 1 ', " GROUP BY s.name HAVING session_active = 1 " )
308
+                array(') GROUP BY s.name HAVING session_active = 1 ', " GROUP BY s.name HAVING session_active = 1 ")
309 309
                 , $where_condition
310 310
             );
311 311
             $where_condition = str_replace(
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 
351 351
             $access_url_id = api_get_current_access_url_id();
352 352
             if ($access_url_id != -1) {
353
-                $where.= " AND ar.access_url_id = $access_url_id ";
353
+                $where .= " AND ar.access_url_id = $access_url_id ";
354 354
 
355 355
                 $sql = "SELECT count(id) as total_rows FROM (
356 356
                 SELECT DISTINCT
@@ -400,14 +400,14 @@  discard block
 block discarded – undo
400 400
             if (api_is_session_admin() &&
401 401
                 api_get_setting('allow_session_admins_to_manage_all_sessions') == 'false'
402 402
             ) {
403
-                $where .=" AND s.session_admin_id = $user_id ";
403
+                $where .= " AND s.session_admin_id = $user_id ";
404 404
             }
405 405
         }
406 406
 
407 407
         if (!api_is_platform_admin() && api_is_teacher() &&
408 408
             api_get_setting('allow_teachers_to_create_sessions') == 'true'
409 409
         ) {
410
-            $where .=" AND s.id_coach = $user_id ";
410
+            $where .= " AND s.id_coach = $user_id ";
411 411
         }
412 412
 
413 413
         $extra_field = new ExtraField('session');
@@ -457,10 +457,10 @@  discard block
 block discarded – undo
457 457
         $query = "$select FROM $tbl_session s $inject_joins $where $inject_where";
458 458
 
459 459
         if (api_is_multiple_url_enabled()) {
460
-            $table_access_url_rel_session= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
460
+            $table_access_url_rel_session = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
461 461
             $access_url_id = api_get_current_access_url_id();
462 462
             if ($access_url_id != -1) {
463
-                $where.= " AND ar.access_url_id = $access_url_id ";
463
+                $where .= " AND ar.access_url_id = $access_url_id ";
464 464
                 $query = "$select
465 465
                         FROM $tbl_session s $inject_joins
466 466
                         INNER JOIN $table_access_url_rel_session ar
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
                 INNER JOIN $tbl_lp l ON l.id = v.lp_id
565 565
                 INNER JOIN $tbl_user u ON u.user_id = v.user_id
566 566
                 INNER JOIN $tbl_course c
567
-                WHERE v.session_id = " . $sessionId;
567
+                WHERE v.session_id = ".$sessionId;
568 568
         $result_rows = Database::query($sql);
569 569
         $row = Database::fetch_array($result_rows);
570 570
         $num = $row['total_rows'];
@@ -616,7 +616,7 @@  discard block
 block discarded – undo
616 616
 
617 617
         $limit = null;
618 618
         if (!empty($options['limit'])) {
619
-            $limit = " LIMIT " . $options['limit'];
619
+            $limit = " LIMIT ".$options['limit'];
620 620
         }
621 621
 
622 622
         if (!empty($options['where'])) {
@@ -625,7 +625,7 @@  discard block
 block discarded – undo
625 625
 
626 626
         $order = null;
627 627
         if (!empty($options['order'])) {
628
-            $order = " ORDER BY " . $options['order'];
628
+            $order = " ORDER BY ".$options['order'];
629 629
         }
630 630
 
631 631
         $sql = "SELECT u.user_id, u.lastname, u.firstname, u.username, u.email, s.c_id
@@ -684,13 +684,13 @@  discard block
 block discarded – undo
684 684
             foreach ($lessons as $lesson) {
685 685
                 $data[$lesson['id']] = (!empty($user_lessons[$lesson['id']]['progress'])) ? $user_lessons[$lesson['id']]['progress'] : 0;
686 686
                 $progress += $data[$lesson['id']];
687
-                $data[$lesson['id']] = $data[$lesson['id']] . '%';
687
+                $data[$lesson['id']] = $data[$lesson['id']].'%';
688 688
                 $count++;
689 689
             }
690 690
             if ($count == 0) {
691 691
                 $data['total'] = 0;
692 692
             } else {
693
-                $data['total'] = round($progress / $count, 2) . '%';
693
+                $data['total'] = round($progress / $count, 2).'%';
694 694
             }
695 695
             $table[] = $data;
696 696
         }
@@ -731,7 +731,7 @@  discard block
 block discarded – undo
731 731
 
732 732
         $limit = null;
733 733
         if (!empty($options['limit'])) {
734
-            $limit = " LIMIT " . $options['limit'];
734
+            $limit = " LIMIT ".$options['limit'];
735 735
         }
736 736
 
737 737
         if (!empty($options['where'])) {
@@ -740,7 +740,7 @@  discard block
 block discarded – undo
740 740
 
741 741
         $order = null;
742 742
         if (!empty($options['order'])) {
743
-            $order = " ORDER BY " . $options['order'];
743
+            $order = " ORDER BY ".$options['order'];
744 744
         }
745 745
 
746 746
         $sql = "SELECT u.user_id, u.lastname, u.firstname, u.username, u.email, s.c_id
@@ -842,7 +842,7 @@  discard block
 block discarded – undo
842 842
 
843 843
         $limit = null;
844 844
         if (!empty($options['limit'])) {
845
-            $limit = " LIMIT " . $options['limit'];
845
+            $limit = " LIMIT ".$options['limit'];
846 846
         }
847 847
 
848 848
         if (!empty($options['where'])) {
@@ -851,7 +851,7 @@  discard block
 block discarded – undo
851 851
 
852 852
         $order = null;
853 853
         if (!empty($options['order'])) {
854
-            $order = " ORDER BY " . $options['order'];
854
+            $order = " ORDER BY ".$options['order'];
855 855
         }
856 856
 
857 857
         //TODO, fix create report without session
@@ -884,7 +884,7 @@  discard block
 block discarded – undo
884 884
         /**
885 885
          *  Lessons
886 886
          */
887
-        $sql = "SELECT * FROM $tbl_course_lp WHERE c_id = %s ";  //AND session_id = %s
887
+        $sql = "SELECT * FROM $tbl_course_lp WHERE c_id = %s "; //AND session_id = %s
888 888
         $sql_query = sprintf($sql, $course['real_id']);
889 889
         $result = Database::query($sql_query);
890 890
         $arrLesson = array(array());
@@ -892,7 +892,7 @@  discard block
 block discarded – undo
892 892
             if (empty($arrLesson[$row['session_id']]['lessons_total'])) {
893 893
                 $arrLesson[$row['session_id']]['lessons_total'] = 1;
894 894
             } else {
895
-                $arrLesson[$row['session_id']]['lessons_total'] ++;
895
+                $arrLesson[$row['session_id']]['lessons_total']++;
896 896
             }
897 897
         }
898 898
 
@@ -959,7 +959,7 @@  discard block
 block discarded – undo
959 959
                 $course['real_id']
960 960
             );
961 961
             foreach ($user_list as $user_id) {
962
-                isset($survey_user_list[$user_id]) ? $survey_user_list[$user_id] ++ : $survey_user_list[$user_id] = 1;
962
+                isset($survey_user_list[$user_id]) ? $survey_user_list[$user_id]++ : $survey_user_list[$user_id] = 1;
963 963
             }
964 964
         }
965 965
 
@@ -1013,7 +1013,7 @@  discard block
 block discarded – undo
1013 1013
             $assignments_done = Tracking::count_student_assignments($user['user_id'], $course['code'], $user['id_session']);
1014 1014
             $assignments_left = $assignments_total - $assignments_done;
1015 1015
             if (!empty($assignments_total)) {
1016
-                $assignments_progress = round((( $assignments_done * 100 ) / $assignments_total), 2);
1016
+                $assignments_progress = round((($assignments_done * 100) / $assignments_total), 2);
1017 1017
             } else {
1018 1018
                 $assignments_progress = 0;
1019 1019
             }
@@ -1043,7 +1043,7 @@  discard block
 block discarded – undo
1043 1043
             $wiki_read = $row['count'];
1044 1044
             $wiki_unread = $wiki_total - $wiki_read;
1045 1045
             if (!empty($wiki_total)) {
1046
-                $wiki_progress = round((( $wiki_read * 100 ) / $wiki_total), 2);
1046
+                $wiki_progress = round((($wiki_read * 100) / $wiki_total), 2);
1047 1047
             } else {
1048 1048
                 $wiki_progress = 0;
1049 1049
             }
@@ -1052,7 +1052,7 @@  discard block
 block discarded – undo
1052 1052
             $surveys_done = (isset($survey_user_list[$user['user_id']]) ? $survey_user_list[$user['user_id']] : 0);
1053 1053
             $surveys_left = $surveys_total - $surveys_done;
1054 1054
             if (!empty($surveys_total)) {
1055
-                $surveys_progress = round((( $surveys_done * 100 ) / $surveys_total), 2);
1055
+                $surveys_progress = round((($surveys_done * 100) / $surveys_total), 2);
1056 1056
             } else {
1057 1057
                 $surveys_progress = 0;
1058 1058
             }
@@ -1065,7 +1065,7 @@  discard block
 block discarded – undo
1065 1065
             );
1066 1066
             $forums_left = $forums_total - $forums_done;
1067 1067
             if (!empty($forums_total)) {
1068
-                $forums_progress = round((( $forums_done * 100 ) / $forums_total), 2);
1068
+                $forums_progress = round((($forums_done * 100) / $forums_total), 2);
1069 1069
             } else {
1070 1070
                 $forums_progress = 0;
1071 1071
             }
@@ -1073,58 +1073,58 @@  discard block
 block discarded – undo
1073 1073
             //Overall Total
1074 1074
             $overall_total = ($course_description_progress + $exercises_progress + $forums_progress + $assignments_progress + $wiki_progress + $surveys_progress) / 6;
1075 1075
 
1076
-            $link = '<a href="' . api_get_path(WEB_CODE_PATH) . 'mySpace/myStudents.php?student=' . $user[0] . '&details=true&course=' . $course['code'] . '&id_session=' . $user['id_session'] . '"> %s </a>';
1077
-            $linkForum = '<a href="' . api_get_path(WEB_CODE_PATH) . 'forum/index.php?cidReq=' . $course['code'] . '&id_session=' . $user['id_session'] . '"> %s </a>';
1078
-            $linkWork = '<a href="' . api_get_path(WEB_CODE_PATH) . 'work/work.php?cidReq=' . $course['code'] . '&id_session=' . $user['id_session'] . '"> %s </a>';
1079
-            $linkWiki = '<a href="' . api_get_path(WEB_CODE_PATH) . 'wiki/index.php?cidReq=' . $course['code'] . '&session_id=' . $user['id_session'] . '&action=statistics"> %s </a>';
1080
-            $linkSurvey = '<a href="' . api_get_path(WEB_CODE_PATH) . 'survey/survey_list.php?cidReq=' . $course['code'] . '&id_session=' . $user['id_session'] . '"> %s </a>';
1076
+            $link = '<a href="'.api_get_path(WEB_CODE_PATH).'mySpace/myStudents.php?student='.$user[0].'&details=true&course='.$course['code'].'&id_session='.$user['id_session'].'"> %s </a>';
1077
+            $linkForum = '<a href="'.api_get_path(WEB_CODE_PATH).'forum/index.php?cidReq='.$course['code'].'&id_session='.$user['id_session'].'"> %s </a>';
1078
+            $linkWork = '<a href="'.api_get_path(WEB_CODE_PATH).'work/work.php?cidReq='.$course['code'].'&id_session='.$user['id_session'].'"> %s </a>';
1079
+            $linkWiki = '<a href="'.api_get_path(WEB_CODE_PATH).'wiki/index.php?cidReq='.$course['code'].'&session_id='.$user['id_session'].'&action=statistics"> %s </a>';
1080
+            $linkSurvey = '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_list.php?cidReq='.$course['code'].'&id_session='.$user['id_session'].'"> %s </a>';
1081 1081
 
1082 1082
             $table[] = array(
1083 1083
                 'lastname' => $user[1],
1084 1084
                 'firstname' => $user[2],
1085 1085
                 'username' => $user[3],
1086 1086
                 #'profile'   => '',
1087
-                'total' => round($overall_total, 2) . '%',
1088
-                'courses' => sprintf($link, $course_description_progress . '%'),
1089
-                'lessons' => sprintf($link, $lessons_progress . '%'),
1090
-                'exercises' => sprintf($link, $exercises_progress . '%'),
1091
-                'forums' => sprintf($link, $forums_progress . '%'),
1092
-                'homeworks' => sprintf($link, $assignments_progress . '%'),
1093
-                'wikis' => sprintf($link, $wiki_progress . '%'),
1094
-                'surveys' => sprintf($link, $surveys_progress . '%'),
1087
+                'total' => round($overall_total, 2).'%',
1088
+                'courses' => sprintf($link, $course_description_progress.'%'),
1089
+                'lessons' => sprintf($link, $lessons_progress.'%'),
1090
+                'exercises' => sprintf($link, $exercises_progress.'%'),
1091
+                'forums' => sprintf($link, $forums_progress.'%'),
1092
+                'homeworks' => sprintf($link, $assignments_progress.'%'),
1093
+                'wikis' => sprintf($link, $wiki_progress.'%'),
1094
+                'surveys' => sprintf($link, $surveys_progress.'%'),
1095 1095
                 //course description
1096
-                'course_description_progress' => $course_description_progress . '%',
1096
+                'course_description_progress' => $course_description_progress.'%',
1097 1097
                 //lessons
1098 1098
                 'lessons_total' => sprintf($link, $lessons_total),
1099 1099
                 'lessons_done' => sprintf($link, $lessons_done),
1100 1100
                 'lessons_left' => sprintf($link, $lessons_left),
1101
-                'lessons_progress' => sprintf($link, $lessons_progress . '%'),
1101
+                'lessons_progress' => sprintf($link, $lessons_progress.'%'),
1102 1102
                 //exercises
1103 1103
                 'exercises_total' => sprintf($link, $exercises_total),
1104 1104
                 'exercises_done' => sprintf($link, $exercises_done),
1105 1105
                 'exercises_left' => sprintf($link, $exercises_left),
1106
-                'exercises_progress' => sprintf($link, $exercises_progress . '%'),
1106
+                'exercises_progress' => sprintf($link, $exercises_progress.'%'),
1107 1107
                 //forums
1108 1108
                 'forums_total' => sprintf($linkForum, $forums_total),
1109 1109
                 'forums_done' => sprintf($linkForum, $forums_done),
1110 1110
                 'forums_left' => sprintf($linkForum, $forums_left),
1111
-                'forums_progress' => sprintf($linkForum, $forums_progress . '%'),
1111
+                'forums_progress' => sprintf($linkForum, $forums_progress.'%'),
1112 1112
                 //assignments
1113 1113
                 'assignments_total' => sprintf($linkWork, $assignments_total),
1114 1114
                 'assignments_done' => sprintf($linkWork, $assignments_done),
1115 1115
                 'assignments_left' => sprintf($linkWork, $assignments_left),
1116
-                'assignments_progress' => sprintf($linkWork, $assignments_progress . '%'),
1116
+                'assignments_progress' => sprintf($linkWork, $assignments_progress.'%'),
1117 1117
                 //wiki
1118 1118
                 'wiki_total' => sprintf($linkWiki, $wiki_total),
1119 1119
                 'wiki_revisions' => sprintf($linkWiki, $wiki_revisions),
1120 1120
                 'wiki_read' => sprintf($linkWiki, $wiki_read),
1121 1121
                 'wiki_unread' => sprintf($linkWiki, $wiki_unread),
1122
-                'wiki_progress' => sprintf($linkWiki, $wiki_progress . '%'),
1122
+                'wiki_progress' => sprintf($linkWiki, $wiki_progress.'%'),
1123 1123
                 //survey
1124 1124
                 'surveys_total' => sprintf($linkSurvey, $surveys_total),
1125 1125
                 'surveys_done' => sprintf($linkSurvey, $surveys_done),
1126 1126
                 'surveys_left' => sprintf($linkSurvey, $surveys_left),
1127
-                'surveys_progress' => sprintf($linkSurvey, $surveys_progress . '%'),
1127
+                'surveys_progress' => sprintf($linkSurvey, $surveys_progress.'%'),
1128 1128
             );
1129 1129
         }
1130 1130
 
@@ -1204,7 +1204,7 @@  discard block
 block discarded – undo
1204 1204
 
1205 1205
         $limit = null;
1206 1206
         if (!empty($options['limit'])) {
1207
-            $limit = " LIMIT " . $options['limit'];
1207
+            $limit = " LIMIT ".$options['limit'];
1208 1208
         }
1209 1209
 
1210 1210
         if (!empty($options['where'])) {
@@ -1213,7 +1213,7 @@  discard block
 block discarded – undo
1213 1213
 
1214 1214
         $order = null;
1215 1215
         if (!empty($options['order'])) {
1216
-            $order = " ORDER BY " . $options['order'];
1216
+            $order = " ORDER BY ".$options['order'];
1217 1217
         }
1218 1218
 
1219 1219
         //TODO add course name
@@ -1226,7 +1226,7 @@  discard block
 block discarded – undo
1226 1226
                     " : "
1227 1227
                     u.lastname,
1228 1228
                     u.firstname,
1229
-                ") . "
1229
+                ")."
1230 1230
                 a.logout_course_date,
1231 1231
                 a.counter,
1232 1232
                 c.title,
@@ -1310,7 +1310,7 @@  discard block
 block discarded – undo
1310 1310
             if (Database::num_rows($result) > 0) {
1311 1311
                 $row = Database::fetch_array($result);
1312 1312
                 $count = $row['count'] + 1;
1313
-                $session_name = $session_name . '_' . $count;
1313
+                $session_name = $session_name.'_'.$count;
1314 1314
                 $result = self::session_name_exists($session_name);
1315 1315
                 if (!$result) {
1316 1316
                     return $session_name;
@@ -1390,7 +1390,7 @@  discard block
 block discarded – undo
1390 1390
 
1391 1391
             return false;
1392 1392
         } else {
1393
-            $sql = "SELECT id FROM $tbl_session WHERE name='" . Database::escape_string($name) . "'";
1393
+            $sql = "SELECT id FROM $tbl_session WHERE name='".Database::escape_string($name)."'";
1394 1394
             $rs = Database::query($sql);
1395 1395
             $exists = false;
1396 1396
             while ($row = Database::fetch_array($rs)) {
@@ -1488,7 +1488,7 @@  discard block
 block discarded – undo
1488 1488
         }
1489 1489
 
1490 1490
         if (SessionManager::allowed($id_checked) && !$from_ws) {
1491
-            $sql = 'SELECT session_admin_id FROM ' . $tbl_session. '
1491
+            $sql = 'SELECT session_admin_id FROM '.$tbl_session.'
1492 1492
                     WHERE id IN (' . $id_checked.')';
1493 1493
             $rs = Database::query($sql);
1494 1494
             if (Database::result($rs, 0, 0) != $userId) {
@@ -1749,7 +1749,7 @@  discard block
 block discarded – undo
1749 1749
         // Delete users from the session
1750 1750
         if ($empty_users === true) {
1751 1751
             $sql = "DELETE FROM $tbl_session_rel_user
1752
-                    WHERE session_id = $id_session AND relation_type<>" . SESSION_RELATION_TYPE_RRHH . "";
1752
+                    WHERE session_id = $id_session AND relation_type<>".SESSION_RELATION_TYPE_RRHH."";
1753 1753
             Database::query($sql);
1754 1754
         }
1755 1755
 
@@ -1760,7 +1760,7 @@  discard block
 block discarded – undo
1760 1760
             $enreg_user = Database::escape_string($enreg_user);
1761 1761
             $nbr_users++;
1762 1762
             $sql = "INSERT IGNORE INTO $tbl_session_rel_user (relation_type, session_id, user_id, registered_at)
1763
-                    VALUES (0, $id_session, $enreg_user, '" . api_get_utc_datetime() . "')";
1763
+                    VALUES (0, $id_session, $enreg_user, '".api_get_utc_datetime()."')";
1764 1764
             Database::query($sql);
1765 1765
         }
1766 1766
 
@@ -1850,9 +1850,9 @@  discard block
 block discarded – undo
1850 1850
         is_array($courseInfo) ? $courseId = $courseInfo['real_id'] : $courseId = $courseInfo;
1851 1851
 
1852 1852
         $statusCondition = null;
1853
-        if (isset($status) && !is_null($status))  {
1853
+        if (isset($status) && !is_null($status)) {
1854 1854
             $status = intval($status);
1855
-            $statusCondition  = " AND status = $status";
1855
+            $statusCondition = " AND status = $status";
1856 1856
         }
1857 1857
 
1858 1858
         foreach ($userList as $userId) {
@@ -1984,7 +1984,7 @@  discard block
 block discarded – undo
1984 1984
             if (empty($count)) {
1985 1985
                 // If user is not registered to a session then add it.
1986 1986
                 $sql = "INSERT IGNORE INTO $tbl_session_rel_user (session_id, user_id, registered_at)
1987
-                        VALUES ($session_id, $enreg_user, '" . api_get_utc_datetime() . "')";
1987
+                        VALUES ($session_id, $enreg_user, '".api_get_utc_datetime()."')";
1988 1988
                 Database::query($sql);
1989 1989
 
1990 1990
                 $sql = "UPDATE $tbl_session SET nbr_users = nbr_users + 1
@@ -2027,7 +2027,7 @@  discard block
 block discarded – undo
2027 2027
 		               WHERE
2028 2028
                             session_id = $session_id AND
2029 2029
 		                    user_id = $user_id AND
2030
-		                    relation_type <> " . SESSION_RELATION_TYPE_RRHH . "";
2030
+		                    relation_type <> ".SESSION_RELATION_TYPE_RRHH."";
2031 2031
         $result = Database::query($delete_sql);
2032 2032
         $return = Database::affected_rows($result);
2033 2033
 
@@ -2111,7 +2111,7 @@  discard block
 block discarded – undo
2111 2111
                 FROM $tbl_session_rel_user
2112 2112
                 WHERE
2113 2113
                     session_id = $sessionId AND
2114
-                    relation_type<>" . SESSION_RELATION_TYPE_RRHH;
2114
+                    relation_type<>".SESSION_RELATION_TYPE_RRHH;
2115 2115
         $result = Database::query($sql);
2116 2116
         $user_list = Database::store_result($result);
2117 2117
 
@@ -2123,7 +2123,7 @@  discard block
 block discarded – undo
2123 2123
 
2124 2124
                     $sql = "DELETE FROM $tbl_session_rel_course
2125 2125
                             WHERE
2126
-                                c_id = " . $existingCourse['c_id'] . " AND
2126
+                                c_id = ".$existingCourse['c_id']." AND
2127 2127
                                 session_id = $sessionId";
2128 2128
                     Database::query($sql);
2129 2129
 
@@ -2186,7 +2186,7 @@  discard block
 block discarded – undo
2186 2186
                             $links = $cat->get_links(null, false, $courseInfo['code'], 0);
2187 2187
 
2188 2188
                             $cat->set_session_id($sessionId);
2189
-                            $oldCategoryId= $cat->get_id();
2189
+                            $oldCategoryId = $cat->get_id();
2190 2190
                             $newId = $cat->add();
2191 2191
                             $newCategoryIdList[$oldCategoryId] = $newId;
2192 2192
 
@@ -2374,8 +2374,8 @@  discard block
 block discarded – undo
2374 2374
         $return_value = false;
2375 2375
         $sql = "SELECT c_id FROM $tbl_session_course
2376 2376
                 WHERE
2377
-                  session_id = " . intval($session_id) . " AND
2378
-                  c_id = " . intval($courseId) . "";
2377
+                  session_id = ".intval($session_id)." AND
2378
+                  c_id = " . intval($courseId)."";
2379 2379
         $result = Database::query($sql);
2380 2380
         $num = Database::num_rows($result);
2381 2381
         if ($num > 0) {
@@ -2398,8 +2398,8 @@  discard block
 block discarded – undo
2398 2398
         }
2399 2399
 
2400 2400
         $sql = 'SELECT *
2401
-		        FROM ' . $tbl_session . '
2402
-		        WHERE name = "' . Database::escape_string($session_name) . '"';
2401
+		        FROM ' . $tbl_session.'
2402
+		        WHERE name = "' . Database::escape_string($session_name).'"';
2403 2403
         $result = Database::query($sql);
2404 2404
         $num = Database::num_rows($result);
2405 2405
         if ($num > 0) {
@@ -2439,8 +2439,8 @@  discard block
 block discarded – undo
2439 2439
         $month_end = intval($smonth_end);
2440 2440
         $day_end = intval($sday_end);
2441 2441
 
2442
-        $date_start = "$year_start-" . (($month_start < 10) ? "0$month_start" : $month_start) . "-" . (($day_start < 10) ? "0$day_start" : $day_start);
2443
-        $date_end = "$year_end-" . (($month_end < 10) ? "0$month_end" : $month_end) . "-" . (($day_end < 10) ? "0$day_end" : $day_end);
2442
+        $date_start = "$year_start-".(($month_start < 10) ? "0$month_start" : $month_start)."-".(($day_start < 10) ? "0$day_start" : $day_start);
2443
+        $date_end = "$year_end-".(($month_end < 10) ? "0$month_end" : $month_end)."-".(($day_end < 10) ? "0$day_end" : $day_end);
2444 2444
 
2445 2445
         if (empty($name)) {
2446 2446
             $msg = get_lang('SessionCategoryNameIsRequired');
@@ -2512,8 +2512,8 @@  discard block
 block discarded – undo
2512 2512
         $month_end = intval($smonth_end);
2513 2513
         $day_end = intval($sday_end);
2514 2514
         $id = intval($id);
2515
-        $date_start = "$year_start-" . (($month_start < 10) ? "0$month_start" : $month_start) . "-" . (($day_start < 10) ? "0$day_start" : $day_start);
2516
-        $date_end = "$year_end-" . (($month_end < 10) ? "0$month_end" : $month_end) . "-" . (($day_end < 10) ? "0$day_end" : $day_end);
2515
+        $date_start = "$year_start-".(($month_start < 10) ? "0$month_start" : $month_start)."-".(($day_start < 10) ? "0$day_start" : $day_start);
2516
+        $date_end = "$year_end-".(($month_end < 10) ? "0$month_end" : $month_end)."-".(($day_end < 10) ? "0$day_end" : $day_end);
2517 2517
 
2518 2518
         if (empty($name)) {
2519 2519
             $msg = get_lang('SessionCategoryNameIsRequired');
@@ -2533,13 +2533,13 @@  discard block
 block discarded – undo
2533 2533
         if ($date_end <> null) {
2534 2534
             $sql = "UPDATE $tbl_session_category
2535 2535
                     SET
2536
-                        name = '" . Database::escape_string($name) . "',
2536
+                        name = '".Database::escape_string($name)."',
2537 2537
                         date_start = '$date_start' ,
2538 2538
                         date_end = '$date_end'
2539 2539
                     WHERE id= $id";
2540 2540
         } else {
2541 2541
             $sql = "UPDATE $tbl_session_category SET
2542
-                        name = '" . Database::escape_string($name) . "',
2542
+                        name = '".Database::escape_string($name)."',
2543 2543
                         date_start = '$date_start',
2544 2544
                         date_end = NULL
2545 2545
                     WHERE id= $id";
@@ -2569,10 +2569,10 @@  discard block
 block discarded – undo
2569 2569
 
2570 2570
         //Setting session_category_id to 0
2571 2571
         $sql = "UPDATE $tbl_session SET session_category_id = 0
2572
-                WHERE session_category_id IN (" . $id_checked . ")";
2572
+                WHERE session_category_id IN (".$id_checked.")";
2573 2573
         Database::query($sql);
2574 2574
 
2575
-        $sql = "SELECT id FROM $tbl_session WHERE session_category_id IN (" . $id_checked . ")";
2575
+        $sql = "SELECT id FROM $tbl_session WHERE session_category_id IN (".$id_checked.")";
2576 2576
         $result = Database::query($sql);
2577 2577
         while ($rows = Database::fetch_array($result)) {
2578 2578
             $session_id = $rows['id'];
@@ -2584,7 +2584,7 @@  discard block
 block discarded – undo
2584 2584
                 }
2585 2585
             }
2586 2586
         }
2587
-        $sql = "DELETE FROM $tbl_session_category WHERE id IN (" . $id_checked . ")";
2587
+        $sql = "DELETE FROM $tbl_session_category WHERE id IN (".$id_checked.")";
2588 2588
         Database::query($sql);
2589 2589
 
2590 2590
         // Add event to system log
@@ -2657,7 +2657,7 @@  discard block
 block discarded – undo
2657 2657
                 $value = Database::escape_string($options['value']);
2658 2658
                 $sql_query .= ' AND ';
2659 2659
                 if (in_array($field, $availableFields) && in_array($operator, $availableOperator)) {
2660
-                    $sql_query .= $field . " $operator '" . $value . "'";
2660
+                    $sql_query .= $field." $operator '".$value."'";
2661 2661
                 }
2662 2662
             }
2663 2663
         }
@@ -2718,8 +2718,8 @@  discard block
 block discarded – undo
2718 2718
     {
2719 2719
         $tbl_session_category = Database::get_main_table(TABLE_MAIN_SESSION_CATEGORY);
2720 2720
         $id = api_get_current_access_url_id();
2721
-        $sql = 'SELECT * FROM ' . $tbl_session_category . '
2722
-                WHERE access_url_id = ' . $id . '
2721
+        $sql = 'SELECT * FROM '.$tbl_session_category.'
2722
+                WHERE access_url_id = ' . $id.'
2723 2723
                 ORDER BY name ASC';
2724 2724
         $result = Database::query($sql);
2725 2725
         if (Database::num_rows($result) > 0) {
@@ -2898,11 +2898,11 @@  discard block
 block discarded – undo
2898 2898
                         INNER JOIN $tbl_session_rel_access_url a ON (a.session_id = s.session_id)
2899 2899
                         WHERE
2900 2900
                             s.user_id = $userId AND
2901
-                            relation_type=" . SESSION_RELATION_TYPE_RRHH . " AND
2902
-                            access_url_id = " . api_get_current_access_url_id() . "";
2901
+                            relation_type=".SESSION_RELATION_TYPE_RRHH." AND
2902
+                            access_url_id = " . api_get_current_access_url_id()."";
2903 2903
             } else {
2904 2904
                 $sql = "SELECT session_id FROM $tbl_session_rel_user s
2905
-                        WHERE user_id = $userId AND relation_type=" . SESSION_RELATION_TYPE_RRHH . "";
2905
+                        WHERE user_id = $userId AND relation_type=".SESSION_RELATION_TYPE_RRHH."";
2906 2906
             }
2907 2907
             $result = Database::query($sql);
2908 2908
 
@@ -2912,7 +2912,7 @@  discard block
 block discarded – undo
2912 2912
                             WHERE
2913 2913
                                 session_id = {$row['session_id']} AND
2914 2914
                                 user_id = $userId AND
2915
-                                relation_type=" . SESSION_RELATION_TYPE_RRHH . " ";
2915
+                                relation_type=".SESSION_RELATION_TYPE_RRHH." ";
2916 2916
                     Database::query($sql);
2917 2917
                 }
2918 2918
             }
@@ -2926,8 +2926,8 @@  discard block
 block discarded – undo
2926 2926
                         VALUES (
2927 2927
                             $session_id,
2928 2928
                             $userId,
2929
-                            '" . SESSION_RELATION_TYPE_RRHH . "',
2930
-                            '" . api_get_utc_datetime() . "'
2929
+                            '".SESSION_RELATION_TYPE_RRHH."',
2930
+                            '" . api_get_utc_datetime()."'
2931 2931
                         )";
2932 2932
 
2933 2933
                 Database::query($sql);
@@ -2969,8 +2969,8 @@  discard block
 block discarded – undo
2969 2969
                     WHERE
2970 2970
                         sru.user_id = '$userId' AND
2971 2971
                         sru.session_id = '$sessionId' AND
2972
-                        sru.relation_type = '" . SESSION_RELATION_TYPE_RRHH . "' AND
2973
-                        access_url_id = " . api_get_current_access_url_id() . "
2972
+                        sru.relation_type = '".SESSION_RELATION_TYPE_RRHH."' AND
2973
+                        access_url_id = " . api_get_current_access_url_id()."
2974 2974
                         ";
2975 2975
         } else {
2976 2976
             $sql = "$select FROM $tbl_session s
@@ -2979,7 +2979,7 @@  discard block
 block discarded – undo
2979 2979
                         sru.session_id = s.id AND
2980 2980
                         sru.user_id = '$userId' AND
2981 2981
                         sru.session_id = '$sessionId' AND
2982
-                        sru.relation_type = '" . SESSION_RELATION_TYPE_RRHH . "'
2982
+                        sru.relation_type = '".SESSION_RELATION_TYPE_RRHH."'
2983 2983
                     ";
2984 2984
         }
2985 2985
 
@@ -3077,7 +3077,7 @@  discard block
 block discarded – undo
3077 3077
 
3078 3078
         $limitCondition = null;
3079 3079
         if (!empty($start) && !empty($limit)) {
3080
-            $limitCondition = " LIMIT " . intval($start) . ", " . intval($limit);
3080
+            $limitCondition = " LIMIT ".intval($start).", ".intval($limit);
3081 3081
         }
3082 3082
 
3083 3083
         if (empty($orderCondition)) {
@@ -3155,26 +3155,26 @@  discard block
 block discarded – undo
3155 3155
 
3156 3156
         $sessions = array();
3157 3157
         if (Database::num_rows($result) > 0) {
3158
-            $sysUploadPath = api_get_path(SYS_UPLOAD_PATH). 'sessions/';
3159
-            $webUploadPath = api_get_path(WEB_UPLOAD_PATH). 'sessions/';
3158
+            $sysUploadPath = api_get_path(SYS_UPLOAD_PATH).'sessions/';
3159
+            $webUploadPath = api_get_path(WEB_UPLOAD_PATH).'sessions/';
3160 3160
             $imgPath = Display::returnIconPath('session_default_small.png');
3161 3161
 
3162 3162
             $tableExtraFields = Database::get_main_table(TABLE_EXTRA_FIELD);
3163
-            $sql = "SELECT id FROM " . $tableExtraFields . "
3163
+            $sql = "SELECT id FROM ".$tableExtraFields."
3164 3164
                     WHERE extra_field_type = 3 AND variable='image'";
3165 3165
             $resultField = Database::query($sql);
3166 3166
             $imageFieldId = Database::fetch_assoc($resultField);
3167 3167
 
3168 3168
             while ($row = Database::fetch_array($result)) {
3169 3169
 
3170
-                $row['image'] =  null;
3171
-                $sessionImage = $sysUploadPath . $imageFieldId['id'] . '_' . $row['id'] . '.png';
3170
+                $row['image'] = null;
3171
+                $sessionImage = $sysUploadPath.$imageFieldId['id'].'_'.$row['id'].'.png';
3172 3172
 
3173 3173
                 if (is_file($sessionImage)) {
3174
-                    $sessionImage = $webUploadPath . $imageFieldId['id'] . '_' . $row['id'] . '.png';
3174
+                    $sessionImage = $webUploadPath.$imageFieldId['id'].'_'.$row['id'].'.png';
3175 3175
                     $row['image'] = $sessionImage;
3176 3176
                 } else {
3177
-                    $row['image'] =  $imgPath;
3177
+                    $row['image'] = $imgPath;
3178 3178
                 }
3179 3179
 
3180 3180
                 $sessions[$row['id']] = $row;
@@ -3244,7 +3244,7 @@  discard block
 block discarded – undo
3244 3244
                 return intval($count[0]);
3245 3245
             }
3246 3246
 
3247
-            while ($row = Database::fetch_array($result,'ASSOC'))	{
3247
+            while ($row = Database::fetch_array($result, 'ASSOC')) {
3248 3248
                 $courses[$row['real_id']] = $row;
3249 3249
             }
3250 3250
         }
@@ -3288,7 +3288,7 @@  discard block
 block discarded – undo
3288 3288
         }
3289 3289
 
3290 3290
         $tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
3291
-        $tbl_session_rel_course	= Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
3291
+        $tbl_session_rel_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
3292 3292
 
3293 3293
         if ($getCount) {
3294 3294
             $select = "SELECT COUNT(DISTINCT(c.code)) as count ";
@@ -3313,7 +3313,7 @@  discard block
 block discarded – undo
3313 3313
 		        ";
3314 3314
         if ($getCount) {
3315 3315
             $result = Database::query($sql);
3316
-            $row = Database::fetch_array($result,'ASSOC');
3316
+            $row = Database::fetch_array($result, 'ASSOC');
3317 3317
             return $row['count'];
3318 3318
         }
3319 3319
 
@@ -3328,7 +3328,7 @@  discard block
 block discarded – undo
3328 3328
         $courses = array();
3329 3329
 
3330 3330
         if ($num_rows > 0) {
3331
-            while ($row = Database::fetch_array($result,'ASSOC'))	{
3331
+            while ($row = Database::fetch_array($result, 'ASSOC')) {
3332 3332
                 $courses[$row['id']] = $row;
3333 3333
             }
3334 3334
         }
@@ -3406,7 +3406,7 @@  discard block
 block discarded – undo
3406 3406
         $result = Database::query($sql);
3407 3407
         $num_rows = Database::num_rows($result);
3408 3408
         if ($num_rows > 0) {
3409
-            $row = Database::fetch_array($result,'ASSOC');
3409
+            $row = Database::fetch_array($result, 'ASSOC');
3410 3410
             return $row['count'];
3411 3411
         }
3412 3412
 
@@ -3518,9 +3518,9 @@  discard block
 block discarded – undo
3518 3518
 
3519 3519
             if ($access_url_id != -1) {
3520 3520
                 $sql = 'SELECT DISTINCT session.*
3521
-                    FROM ' . $session_table . ' session INNER JOIN ' . $tbl_session_rel_access_url . ' session_rel_url
3521
+                    FROM ' . $session_table.' session INNER JOIN '.$tbl_session_rel_access_url.' session_rel_url
3522 3522
                     ON (session.id = session_rel_url.session_id)
3523
-                    WHERE '.$sqlCoach.' access_url_id = ' . $access_url_id;
3523
+                    WHERE '.$sqlCoach.' access_url_id = '.$access_url_id;
3524 3524
             }
3525 3525
         }
3526 3526
         $sql .= ' ORDER by name';
@@ -3554,8 +3554,8 @@  discard block
 block discarded – undo
3554 3554
                 FROM $tbl_session_rel_course_rel_user session_rcru, $tbl_user user
3555 3555
                 WHERE
3556 3556
                     session_rcru.user_id = user.user_id AND
3557
-                    session_rcru.session_id = '" . intval($session_id) . "' AND
3558
-                    session_rcru.c_id ='" . intval($courseId) . "' AND
3557
+                    session_rcru.session_id = '".intval($session_id)."' AND
3558
+                    session_rcru.c_id ='" . intval($courseId)."' AND
3559 3559
                     user.user_id = " . intval($user_id);
3560 3560
 
3561 3561
         $result = Database::query($sql);
@@ -3586,8 +3586,8 @@  discard block
 block discarded – undo
3586 3586
         $sql = "SELECT session_rcru.status
3587 3587
                 FROM $tbl_session_rel_course_rel_user session_rcru, $tbl_user user
3588 3588
                 WHERE session_rcru.user_id = user.user_id AND
3589
-                    session_rcru.session_id = '" . intval($session_id) . "' AND
3590
-                    session_rcru.c_id ='" . intval($courseId) . "' AND
3589
+                    session_rcru.session_id = '".intval($session_id)."' AND
3590
+                    session_rcru.c_id ='" . intval($courseId)."' AND
3591 3591
                     user.user_id = " . intval($user_id);
3592 3592
         $result = Database::query($sql);
3593 3593
         $status = false;
@@ -3664,7 +3664,7 @@  discard block
 block discarded – undo
3664 3664
         // Get timestamp for now in UTC - see http://php.net/manual/es/function.time.php#117251
3665 3665
         $now = time() - date('Z');
3666 3666
         // Timestamp in one month
3667
-        $inOneMonth = $now + (30*24*3600);
3667
+        $inOneMonth = $now + (30 * 24 * 3600);
3668 3668
         $inOneMonth = api_get_local_time($inOneMonth);
3669 3669
         if (api_strtotime($s['access_start_date']) < $now) {
3670 3670
             $s['access_start_date'] = api_get_local_time($now);
@@ -3686,16 +3686,16 @@  discard block
 block discarded – undo
3686 3686
         }
3687 3687
         // Now try to create the session
3688 3688
         $sid = self::create_session(
3689
-            $s['name'] . ' ' . get_lang('CopyLabelSuffix'),
3689
+            $s['name'].' '.get_lang('CopyLabelSuffix'),
3690 3690
             $s['access_start_date'],
3691 3691
             $s['access_end_date'],
3692 3692
             $s['display_start_date'],
3693 3693
             $s['display_end_date'],
3694 3694
             $s['coach_access_start_date'],
3695 3695
             $s['coach_access_end_date'],
3696
-            (int)$s['id_coach'],
3696
+            (int) $s['id_coach'],
3697 3697
             $s['session_category_id'],
3698
-            (int)$s['visibility'],
3698
+            (int) $s['visibility'],
3699 3699
             true
3700 3700
         );
3701 3701
 
@@ -3809,7 +3809,7 @@  discard block
 block discarded – undo
3809 3809
         $session_table = Database::get_main_table(TABLE_MAIN_SESSION);
3810 3810
         $sql = "SELECT DISTINCT id
3811 3811
 	         	FROM $session_table
3812
-	         	WHERE session.id_coach =  '" . $user_id . "' AND id = '$session_id'";
3812
+	         	WHERE session.id_coach =  '".$user_id."' AND id = '$session_id'";
3813 3813
         $result = Database::query($sql);
3814 3814
         if ($result && Database::num_rows($result)) {
3815 3815
             return true;
@@ -3828,7 +3828,7 @@  discard block
 block discarded – undo
3828 3828
         $access_url_rel_session_table = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
3829 3829
         $sql = "SELECT count(id) FROM $session_table s";
3830 3830
         if (!empty($access_url_id) && $access_url_id == intval($access_url_id)) {
3831
-            $sql .= ", $access_url_rel_session_table u " .
3831
+            $sql .= ", $access_url_rel_session_table u ".
3832 3832
                 " WHERE s.id = u.session_id AND u.access_url_id = $access_url_id";
3833 3833
         }
3834 3834
         $res = Database::query($sql);
@@ -4075,7 +4075,7 @@  discard block
 block discarded – undo
4075 4075
 
4076 4076
         $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
4077 4077
         $tbl_session_user = Database::get_main_table(TABLE_MAIN_SESSION_USER);
4078
-        $tbl_session_course  = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
4078
+        $tbl_session_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
4079 4079
         $tbl_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
4080 4080
 
4081 4081
         $sessions = array();
@@ -4169,10 +4169,10 @@  discard block
 block discarded – undo
4169 4169
                     $suffix = null;
4170 4170
                     while (!$unique_name) {
4171 4171
                         if ($i > 1) {
4172
-                            $suffix = ' - ' . $i;
4172
+                            $suffix = ' - '.$i;
4173 4173
                         }
4174
-                        $sql = 'SELECT 1 FROM ' . $tbl_session . '
4175
-                                WHERE name="' . $session_name . $suffix . '"';
4174
+                        $sql = 'SELECT 1 FROM '.$tbl_session.'
4175
+                                WHERE name="' . $session_name.$suffix.'"';
4176 4176
                         $rs = Database::query($sql);
4177 4177
 
4178 4178
                         if (Database::result($rs, 0, 0)) {
@@ -4190,13 +4190,13 @@  discard block
 block discarded – undo
4190 4190
 
4191 4191
                     // Creating the session.
4192 4192
                     $sql = "INSERT IGNORE INTO $tbl_session SET
4193
-                            name = '" . $session_name . "',
4193
+                            name = '".$session_name."',
4194 4194
                             id_coach = '$coach_id',
4195 4195
                             access_start_date = '$date_start',
4196 4196
                             access_end_date = '$date_end',
4197 4197
                             visibility = '$visibilityAfterExpirationPerSession',
4198 4198
                             $sessionCondition
4199
-                            session_admin_id = " . intval($defaultUserId) . $extraParameters . $extraSessionParameters;
4199
+                            session_admin_id = ".intval($defaultUserId).$extraParameters.$extraSessionParameters;
4200 4200
                     Database::query($sql);
4201 4201
 
4202 4202
                     $session_id = Database::insert_id();
@@ -4236,7 +4236,7 @@  discard block
 block discarded – undo
4236 4236
                                 access_start_date = '$date_start',
4237 4237
                                 access_end_date = '$date_end',
4238 4238
                                 visibility = '$visibilityAfterExpirationPerSession',
4239
-                                session_category_id = '$session_category_id' " . $extraParameters . $extraSessionParameters;
4239
+                                session_category_id = '$session_category_id' ".$extraParameters.$extraSessionParameters;
4240 4240
 
4241 4241
                         Database::query($sql);
4242 4242
 
@@ -4256,7 +4256,7 @@  discard block
 block discarded – undo
4256 4256
 
4257 4257
                             // Delete session-user relation only for students
4258 4258
                             $sql = "DELETE FROM $tbl_session_user
4259
-                                    WHERE session_id = '$session_id' AND relation_type <> " . SESSION_RELATION_TYPE_RRHH;
4259
+                                    WHERE session_id = '$session_id' AND relation_type <> ".SESSION_RELATION_TYPE_RRHH;
4260 4260
                             Database::query($sql);
4261 4261
 
4262 4262
                             $sql = "DELETE FROM $tbl_session_course WHERE session_id = '$session_id'";
@@ -4344,7 +4344,7 @@  discard block
 block discarded – undo
4344 4344
 
4345 4345
                             // Delete session-user relation only for students
4346 4346
                             $sql = "DELETE FROM $tbl_session_user
4347
-                                    WHERE session_id = '$session_id' AND relation_type <> " . SESSION_RELATION_TYPE_RRHH;
4347
+                                    WHERE session_id = '$session_id' AND relation_type <> ".SESSION_RELATION_TYPE_RRHH;
4348 4348
                             Database::query($sql);
4349 4349
 
4350 4350
                             $sql = "DELETE FROM $tbl_session_course WHERE session_id = '$session_id'";
@@ -4387,7 +4387,7 @@  discard block
 block discarded – undo
4387 4387
                             $sql = "INSERT IGNORE INTO $tbl_session_user SET
4388 4388
                                     user_id = '$user_id',
4389 4389
                                     session_id = '$session_id',
4390
-                                    registered_at = '" . api_get_utc_datetime() . "'";
4390
+                                    registered_at = '".api_get_utc_datetime()."'";
4391 4391
                             Database::query($sql);
4392 4392
                             if ($debug) {
4393 4393
                                 $logger->addInfo("Sessions - Adding User #$user_id ($user) to session #$session_id");
@@ -5025,7 +5025,7 @@  discard block
 block discarded – undo
5025 5025
 
5026 5026
         if (!empty($lastConnectionDate)) {
5027 5027
             $lastConnectionDate = Database::escape_string($lastConnectionDate);
5028
-            $userConditions .=  " AND u.last_login <= '$lastConnectionDate' ";
5028
+            $userConditions .= " AND u.last_login <= '$lastConnectionDate' ";
5029 5029
         }
5030 5030
 
5031 5031
         if (!empty($keyword)) {
@@ -5084,7 +5084,7 @@  discard block
 block discarded – undo
5084 5084
         $result = Database::query($sql);
5085 5085
         $result = Database::store_result($result);
5086 5086
 
5087
-        return $result ;
5087
+        return $result;
5088 5088
     }
5089 5089
 
5090 5090
     /**
@@ -5144,7 +5144,7 @@  discard block
 block discarded – undo
5144 5144
                     $userToString = null;
5145 5145
                     foreach ($userList as $userInfo) {
5146 5146
                         $newUserList[] = $userInfo['user_id'];
5147
-                        $userToString .= $userInfo['firstname'] . ' ' . $userInfo['lastname'] . '<br />';
5147
+                        $userToString .= $userInfo['firstname'].' '.$userInfo['lastname'].'<br />';
5148 5148
                     }
5149 5149
 
5150 5150
                     if (!empty($sessionsDestination)) {
@@ -5157,7 +5157,7 @@  discard block
 block discarded – undo
5157 5157
                                 $messages[] = Display::return_message(sprintf(get_lang('SessionXSkipped'), $sessionDestinationId), 'warning', false);
5158 5158
                                 continue;
5159 5159
                             }
5160
-                            $messages[] = Display::return_message(get_lang('StudentList') . '<br />' . $userToString, 'info', false);
5160
+                            $messages[] = Display::return_message(get_lang('StudentList').'<br />'.$userToString, 'info', false);
5161 5161
                             SessionManager::suscribe_users_to_session(
5162 5162
                                 $sessionDestinationId,
5163 5163
                                 $newUserList,
@@ -5208,7 +5208,7 @@  discard block
 block discarded – undo
5208 5208
                 }
5209 5209
             }
5210 5210
         }
5211
-        $sessionUrl = api_get_path(WEB_CODE_PATH) . 'admin/resume_session.php?id_session=';
5211
+        $sessionUrl = api_get_path(WEB_CODE_PATH).'admin/resume_session.php?id_session=';
5212 5212
 
5213 5213
         $htmlResult = null;
5214 5214
 
@@ -5223,7 +5223,7 @@  discard block
 block discarded – undo
5223 5223
                     $sessionInfo = self::fetch($sessionId);
5224 5224
                     $htmlResult .= '<br />';
5225 5225
                     $htmlResult .= Display::url(
5226
-                        get_lang('Session') . ': ' . $sessionInfo['name'] . ' <br />', $sessionUrl . $sessionId, array('target' => '_blank')
5226
+                        get_lang('Session').': '.$sessionInfo['name'].' <br />', $sessionUrl.$sessionId, array('target' => '_blank')
5227 5227
                     );
5228 5228
                     $teacherList = array();
5229 5229
                     foreach ($coachList as $coachId) {
@@ -5336,7 +5336,7 @@  discard block
 block discarded – undo
5336 5336
                 }
5337 5337
 
5338 5338
                 $sessionIdList = array_map('intval', $sessionIdList);
5339
-                $sessionToString = implode("', '",  $sessionIdList);
5339
+                $sessionToString = implode("', '", $sessionIdList);
5340 5340
 
5341 5341
                 $course = Database::get_main_table(TABLE_MAIN_COURSE);
5342 5342
                 $sessionCourse = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
@@ -5348,7 +5348,7 @@  discard block
 block discarded – undo
5348 5348
                         INNER JOIN $courseUser cu ON (cu.c_id = c.id)
5349 5349
 		                WHERE src.session_id IN ('$sessionToString') AND cu.status = 1";
5350 5350
                 $result = Database::query($sql);
5351
-                while($row = Database::fetch_array($result, 'ASSOC')) {
5351
+                while ($row = Database::fetch_array($result, 'ASSOC')) {
5352 5352
                     $teacherListId[$row['user_id']] = $row['user_id'];
5353 5353
                 }
5354 5354
             } else {
@@ -5423,7 +5423,7 @@  discard block
 block discarded – undo
5423 5423
         $toolList = self::getCourseToolToBeManaged();
5424 5424
 
5425 5425
         foreach ($toolList as $tool) {
5426
-            $method = 'add' . $tool;
5426
+            $method = 'add'.$tool;
5427 5427
             if (method_exists(get_class(), $method)) {
5428 5428
                 self::$method($sessionId, $courseId);
5429 5429
             }
@@ -5442,7 +5442,7 @@  discard block
 block discarded – undo
5442 5442
         $toolList = self::getCourseToolToBeManaged();
5443 5443
 
5444 5444
         foreach ($toolList as $tool) {
5445
-            $method = 'remove' . $tool;
5445
+            $method = 'remove'.$tool;
5446 5446
             if (method_exists(get_class(), $method)) {
5447 5447
                 self::$method($sessionId, $courseId);
5448 5448
             }
@@ -5560,18 +5560,18 @@  discard block
 block discarded – undo
5560 5560
                         }
5561 5561
                     }
5562 5562
 
5563
-                    $message .= '<strong>' . get_lang('User') . '</strong> ' . $userInfo['complete_name'] . ' <br />';
5563
+                    $message .= '<strong>'.get_lang('User').'</strong> '.$userInfo['complete_name'].' <br />';
5564 5564
 
5565 5565
                     if (!in_array($userInfo['status'], array(DRH)) && !api_is_platform_admin_by_id($userInfo['user_id'])) {
5566
-                        $message .= get_lang('UserMustHaveTheDrhRole') . '<br />';
5566
+                        $message .= get_lang('UserMustHaveTheDrhRole').'<br />';
5567 5567
                         continue;
5568 5568
                     }
5569 5569
 
5570 5570
                     if (!empty($sessionList)) {
5571
-                        $message .= '<strong>' . get_lang('Sessions') . ':</strong> <br />';
5572
-                        $message .= implode(', ', $sessionList) . '<br /><br />';
5571
+                        $message .= '<strong>'.get_lang('Sessions').':</strong> <br />';
5572
+                        $message .= implode(', ', $sessionList).'<br /><br />';
5573 5573
                     } else {
5574
-                        $message .= get_lang('NoSessionProvided') . ' <br /><br />';
5574
+                        $message .= get_lang('NoSessionProvided').' <br /><br />';
5575 5575
                     }
5576 5576
                 }
5577 5577
             }
@@ -5751,8 +5751,8 @@  discard block
 block discarded – undo
5751 5751
 
5752 5752
         $firstAccess = api_strtotime($courseAccess['login_course_date'], 'UTC');
5753 5753
 
5754
-        $endDateInSeconds = $firstAccess + $duration*24*60*60;
5755
-        $leftDays = round(($endDateInSeconds- $currentTime) / 60 / 60 / 24);
5754
+        $endDateInSeconds = $firstAccess + $duration * 24 * 60 * 60;
5755
+        $leftDays = round(($endDateInSeconds - $currentTime) / 60 / 60 / 24);
5756 5756
 
5757 5757
         return $leftDays;
5758 5758
     }
@@ -6034,7 +6034,7 @@  discard block
 block discarded – undo
6034 6034
         $sql = "SELECT COUNT(1) as count, u.id, scu.status status_in_session, u.status user_status
6035 6035
                 FROM $tableSessionRelCourseRelUser scu
6036 6036
                 INNER JOIN $tableUser u ON scu.user_id = u.id
6037
-                WHERE scu.session_id = " . intval($sessionId) ."
6037
+                WHERE scu.session_id = ".intval($sessionId)."
6038 6038
                 GROUP BY u.id";
6039 6039
 
6040 6040
         $result = Database::query($sql);
@@ -6069,7 +6069,7 @@  discard block
 block discarded – undo
6069 6069
             $sfTable = Database::get_main_table(TABLE_EXTRA_FIELD);
6070 6070
             $sfvTable = Database::get_main_table(TABLE_EXTRA_FIELD_VALUES);
6071 6071
             // Join session field and session field values tables
6072
-            $joinTable = $sfTable . ' sf INNER JOIN ' . $sfvTable . ' sfv ON sf.id = sfv.field_id';
6072
+            $joinTable = $sfTable.' sf INNER JOIN '.$sfvTable.' sfv ON sf.id = sfv.field_id';
6073 6073
             $fieldsArray = array();
6074 6074
             foreach ($extraFields as $field) {
6075 6075
                 $fieldsArray[] = Database::escape_string($field);
@@ -6112,14 +6112,14 @@  discard block
 block discarded – undo
6112 6112
                 for ($i = 1; $i < count($fieldsArray); $i++) {
6113 6113
                     $whereParams .= ', ?';
6114 6114
                 }
6115
-                $whereFieldVariables = ' variable IN ( ' . $whereParams .' )';
6116
-                $whereFieldIds = 'field_id IN ( ' . $whereParams .  ' )';
6115
+                $whereFieldVariables = ' variable IN ( '.$whereParams.' )';
6116
+                $whereFieldIds = 'field_id IN ( '.$whereParams.' )';
6117 6117
             }
6118 6118
             // Get session fields
6119 6119
             $extraField = new ExtraField('session');
6120 6120
             $questionMarks = substr(str_repeat('?, ', count($fieldsArray)), 0, -2);
6121 6121
             $fieldsList = $extraField->get_all(array(
6122
-                ' variable IN ( ' . $questionMarks . ' )' => $fieldsArray,
6122
+                ' variable IN ( '.$questionMarks.' )' => $fieldsArray,
6123 6123
             ));
6124 6124
             // Index session fields
6125 6125
             foreach ($fieldsList as $field) {
@@ -6128,7 +6128,7 @@  discard block
 block discarded – undo
6128 6128
             // Get session field values
6129 6129
             $extra = new ExtraFieldValue('session');
6130 6130
             $questionMarksFields = substr(str_repeat('?, ', count($fields)), 0, -2);
6131
-            $sessionFieldValueList = $extra->get_all(array ('where' => array('field_id IN ( ' . $questionMarksFields . ' )' => array_keys($fields))));
6131
+            $sessionFieldValueList = $extra->get_all(array('where' => array('field_id IN ( '.$questionMarksFields.' )' => array_keys($fields))));
6132 6132
             // Add session fields values to session list
6133 6133
             foreach ($sessionList as $id => &$session) {
6134 6134
                 foreach ($sessionFieldValueList as $sessionFieldValue) {
@@ -6181,7 +6181,7 @@  discard block
 block discarded – undo
6181 6181
             // Check the result
6182 6182
             if ($result < 1) {
6183 6183
                 // If not found any result, update error message
6184
-                $errorResult['errorMessage'] = 'Not found any session category name ' . $categoryName;
6184
+                $errorResult['errorMessage'] = 'Not found any session category name '.$categoryName;
6185 6185
             } elseif (count($result) > 1 && !$force) {
6186 6186
                 // If found more than one result and force is disabled, update error message
6187 6187
                 $errorResult['errorMessage'] = 'Found many session categories';
@@ -6240,7 +6240,7 @@  discard block
 block discarded – undo
6240 6240
             // Check if session list query had result
6241 6241
             if (!empty($sessionList)) {
6242 6242
                 // implode all session id
6243
-                $sessionIdsString = '(' . implode(', ', array_keys($sessionList)) . ')';
6243
+                $sessionIdsString = '('.implode(', ', array_keys($sessionList)).')';
6244 6244
                 // Get all field variables
6245 6245
                 $sessionFieldList = Database::select(
6246 6246
                     'id, variable',
@@ -6327,7 +6327,7 @@  discard block
 block discarded – undo
6327 6327
                 return $sessionList;
6328 6328
             } else {
6329 6329
                 // Not found result, update error message
6330
-                $errorResult['errorMessage'] = 'Not found any session for session category id ' . $sessionCategoryId;
6330
+                $errorResult['errorMessage'] = 'Not found any session for session category id '.$sessionCategoryId;
6331 6331
             }
6332 6332
         }
6333 6333
 
@@ -6431,7 +6431,7 @@  discard block
 block discarded – undo
6431 6431
 
6432 6432
         $sessionExtraField = new ExtraField('session');
6433 6433
         $fieldList = $sessionExtraField->get_all(array(
6434
-            "variable IN ( " . implode(", ", $variablePlaceHolders) . " ) " => $variables,
6434
+            "variable IN ( ".implode(", ", $variablePlaceHolders)." ) " => $variables,
6435 6435
         ));
6436 6436
 
6437 6437
         $fields = array();
@@ -6445,7 +6445,7 @@  discard block
 block discarded – undo
6445 6445
         $extra = new ExtraFieldValue('session');
6446 6446
         $sessionFieldValueList = $extra->get_all(
6447 6447
             array(
6448
-                "field_id IN ( " . implode(", ", $variablePlaceHolders) . " )" => array_keys($fields),
6448
+                "field_id IN ( ".implode(", ", $variablePlaceHolders)." )" => array_keys($fields),
6449 6449
             )
6450 6450
         );
6451 6451
 
@@ -6516,7 +6516,7 @@  discard block
 block discarded – undo
6516 6516
                 FROM $sessionTable s
6517 6517
                 INNER JOIN $sessionUserTable sru ON s.id = sru.id_session
6518 6518
                 WHERE
6519
-                    (sru.id_user IN (" . implode(', ', $userIdList) . ")
6519
+                    (sru.id_user IN (".implode(', ', $userIdList).")
6520 6520
                     AND sru.relation_type = 0
6521 6521
                 )";
6522 6522
 
@@ -6532,7 +6532,7 @@  discard block
 block discarded – undo
6532 6532
                         WHERE
6533 6533
                             srau.access_url_id = $accessUrlId
6534 6534
                             AND (
6535
-                                sru.id_user IN (" . implode(', ', $userIdList) . ")
6535
+                                sru.id_user IN (".implode(', ', $userIdList).")
6536 6536
                                 AND sru.relation_type = 0
6537 6537
                             )";
6538 6538
             }
@@ -6553,7 +6553,7 @@  discard block
 block discarded – undo
6553 6553
      */
6554 6554
     public static function getSessionVisibility($sessionInfo)
6555 6555
     {
6556
-        switch($sessionInfo['visibility']) {
6556
+        switch ($sessionInfo['visibility']) {
6557 6557
             case 1:
6558 6558
                 return get_lang('ReadOnly');
6559 6559
             case 2:
@@ -6584,7 +6584,7 @@  discard block
 block discarded – undo
6584 6584
 
6585 6585
         $result = '';
6586 6586
         if (!empty($startDateToLocal) && !empty($endDateToLocal)) {
6587
-            $result =  sprintf(get_lang('FromDateXToDateY'), $startDateToLocal, $endDateToLocal);
6587
+            $result = sprintf(get_lang('FromDateXToDateY'), $startDateToLocal, $endDateToLocal);
6588 6588
         } else {
6589 6589
             if (!empty($startDateToLocal)) {
6590 6590
                 $result = get_lang('From').' '.$startDateToLocal;
@@ -6727,7 +6727,7 @@  discard block
 block discarded – undo
6727 6727
                     get_lang('CoachName'),
6728 6728
                     null,
6729 6729
                     [
6730
-                        'url' => api_get_path(WEB_AJAX_PATH) . 'session.ajax.php?a=search_general_coach',
6730
+                        'url' => api_get_path(WEB_AJAX_PATH).'session.ajax.php?a=search_general_coach',
6731 6731
                         'width' => '100%',
6732 6732
                     ]
6733 6733
                 );
@@ -6738,7 +6738,7 @@  discard block
 block discarded – undo
6738 6738
         $form->addHtml('<div id="ajax_list_coachs"></div>');
6739 6739
 
6740 6740
         $form->addButtonAdvancedSettings('advanced_params');
6741
-        $form->addElement('html','<div id="advanced_params_options" style="display:none">');
6741
+        $form->addElement('html', '<div id="advanced_params_options" style="display:none">');
6742 6742
 
6743 6743
         $form->addSelect('session_category', get_lang('SessionCategory'), $categoriesOptions, array(
6744 6744
             'id' => 'session_category'
@@ -6876,7 +6876,7 @@  discard block
 block discarded – undo
6876 6876
         $extra_field = new ExtraField('session');
6877 6877
         $extra = $extra_field->addElements($form, $sessionId);
6878 6878
 
6879
-        $form->addElement('html','</div>');
6879
+        $form->addElement('html', '</div>');
6880 6880
 
6881 6881
         $js = $extra['jquery_ready_content'];
6882 6882
 
@@ -6907,16 +6907,16 @@  discard block
 block discarded – undo
6907 6907
         if (api_is_session_admin() &&
6908 6908
             api_get_setting('allow_session_admins_to_see_all_sessions') == 'false'
6909 6909
         ) {
6910
-            $where.=" WHERE s.session_admin_id = $user_id ";
6910
+            $where .= " WHERE s.session_admin_id = $user_id ";
6911 6911
         }
6912 6912
 
6913 6913
         if (!empty($options['where'])) {
6914 6914
             $options['where'] = str_replace('course_title', 'c.title', $options['where']);
6915
-            $options['where'] = str_replace("( session_active = '0' )", '1=1',  $options['where']);
6915
+            $options['where'] = str_replace("( session_active = '0' )", '1=1', $options['where']);
6916 6916
 
6917 6917
             $options['where'] = str_replace(
6918 6918
                 array("AND session_active = '1'  )", " AND (  session_active = '1'  )"),
6919
-                array(') GROUP BY s.name HAVING session_active = 1 ', " GROUP BY s.name HAVING session_active = 1 " )
6919
+                array(') GROUP BY s.name HAVING session_active = 1 ', " GROUP BY s.name HAVING session_active = 1 ")
6920 6920
                 , $options['where']
6921 6921
             );
6922 6922
 
@@ -6958,10 +6958,10 @@  discard block
 block discarded – undo
6958 6958
                        $where ";
6959 6959
 
6960 6960
         if (api_is_multiple_url_enabled()) {
6961
-            $table_access_url_rel_session= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
6961
+            $table_access_url_rel_session = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
6962 6962
             $access_url_id = api_get_current_access_url_id();
6963 6963
             if ($access_url_id != -1) {
6964
-                $where.= " AND ar.access_url_id = $access_url_id ";
6964
+                $where .= " AND ar.access_url_id = $access_url_id ";
6965 6965
 
6966 6966
                 $query_rows = "SELECT count(*) as total_rows
6967 6967
                                FROM $tbl_session s
@@ -7006,12 +7006,12 @@  discard block
 block discarded – undo
7006 7006
                     //get_lang('CourseTitle'),
7007 7007
                     get_lang('Visibility'),
7008 7008
                 );
7009
-                $column_model = array (
7010
-                    array('name'=>'name', 'index'=>'s.name', 'width'=>'160',  'align'=>'left', 'search' => 'true', 'searchoptions' => array('sopt' => $operators)),
7011
-                    array('name'=>'category_name', 'index'=>'category_name', 'width'=>'40',  'align'=>'left', 'search' => 'true', 'searchoptions' => array('sopt' => $operators)),
7012
-                    array('name'=>'display_start_date', 'index'=>'display_start_date', 'width'=>'50',   'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_today', 'sopt' => $date_operators)),
7013
-                    array('name'=>'display_end_date', 'index'=>'display_end_date', 'width'=>'50',   'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_one_month', 'sopt' => $date_operators)),
7014
-                    array('name'=>'visibility', 'index'=>'visibility',      'width'=>'40',   'align'=>'left', 'search' => 'false'),
7009
+                $column_model = array(
7010
+                    array('name'=>'name', 'index'=>'s.name', 'width'=>'160', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('sopt' => $operators)),
7011
+                    array('name'=>'category_name', 'index'=>'category_name', 'width'=>'40', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('sopt' => $operators)),
7012
+                    array('name'=>'display_start_date', 'index'=>'display_start_date', 'width'=>'50', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_today', 'sopt' => $date_operators)),
7013
+                    array('name'=>'display_end_date', 'index'=>'display_end_date', 'width'=>'50', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_one_month', 'sopt' => $date_operators)),
7014
+                    array('name'=>'visibility', 'index'=>'visibility', 'width'=>'40', 'align'=>'left', 'search' => 'false'),
7015 7015
                 );
7016 7016
                 break;
7017 7017
             case 'complete':
@@ -7024,12 +7024,12 @@  discard block
 block discarded – undo
7024 7024
                     get_lang('Visibility'),
7025 7025
                     get_lang('CourseTitle'),
7026 7026
                 );
7027
-                $column_model = array (
7028
-                    array('name'=>'name', 'index'=>'s.name', 'width'=>'200',  'align'=>'left', 'search' => 'true', 'searchoptions' => array('sopt' => $operators)),
7029
-                    array('name'=>'display_start_date', 'index'=>'display_start_date', 'width'=>'70',   'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_today', 'sopt' => $date_operators)),
7030
-                    array('name'=>'display_end_date', 'index'=>'display_end_date', 'width'=>'70',   'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_one_month', 'sopt' => $date_operators)),
7031
-                    array('name'=>'coach_name', 'index'=>'coach_name',     'width'=>'70',   'align'=>'left', 'search' => 'false', 'searchoptions' => array('sopt' => $operators)),
7032
-                    array('name'=>'session_active', 'index'=>'session_active', 'width'=>'25',   'align'=>'left', 'search' => 'true', 'stype'=>'select',
7027
+                $column_model = array(
7028
+                    array('name'=>'name', 'index'=>'s.name', 'width'=>'200', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('sopt' => $operators)),
7029
+                    array('name'=>'display_start_date', 'index'=>'display_start_date', 'width'=>'70', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_today', 'sopt' => $date_operators)),
7030
+                    array('name'=>'display_end_date', 'index'=>'display_end_date', 'width'=>'70', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_one_month', 'sopt' => $date_operators)),
7031
+                    array('name'=>'coach_name', 'index'=>'coach_name', 'width'=>'70', 'align'=>'left', 'search' => 'false', 'searchoptions' => array('sopt' => $operators)),
7032
+                    array('name'=>'session_active', 'index'=>'session_active', 'width'=>'25', 'align'=>'left', 'search' => 'true', 'stype'=>'select',
7033 7033
                         // for the bottom bar
7034 7034
                         'searchoptions' => array(
7035 7035
                             'defaultValue'  => '1',
@@ -7037,8 +7037,8 @@  discard block
 block discarded – undo
7037 7037
                         // for the top bar
7038 7038
                         'editoptions' => array('value' => '" ":'.get_lang('All').';1:'.get_lang('Active').';0:'.get_lang('Inactive')),
7039 7039
                     ),
7040
-                    array('name'=>'visibility',     'index'=>'visibility',      'width'=>'40',   'align'=>'left', 'search' => 'false'),
7041
-                    array('name'=>'course_title',    'index'=>'course_title',   'width'=>'50',   'hidden' => 'true', 'search' => 'true', 'searchoptions' => array('searchhidden' =>'true','sopt' => $operators)),
7040
+                    array('name'=>'visibility', 'index'=>'visibility', 'width'=>'40', 'align'=>'left', 'search' => 'false'),
7041
+                    array('name'=>'course_title', 'index'=>'course_title', 'width'=>'50', 'hidden' => 'true', 'search' => 'true', 'searchoptions' => array('searchhidden' =>'true', 'sopt' => $operators)),
7042 7042
                 );
7043 7043
                 break;
7044 7044
         }
@@ -7047,14 +7047,14 @@  discard block
 block discarded – undo
7047 7047
         $session_field = new ExtraField('session');
7048 7048
         $rules = $session_field->getRules($columns, $column_model);
7049 7049
 
7050
-        $column_model[] = array('name'=>'actions', 'index'=>'actions', 'width'=>'80',  'align'=>'left','formatter'=>'action_formatter','sortable'=>'false', 'search' => 'false');
7050
+        $column_model[] = array('name'=>'actions', 'index'=>'actions', 'width'=>'80', 'align'=>'left', 'formatter'=>'action_formatter', 'sortable'=>'false', 'search' => 'false');
7051 7051
         $columns[] = get_lang('Actions');
7052 7052
 
7053 7053
         foreach ($column_model as $col_model) {
7054 7054
             $simple_column_name[] = $col_model['name'];
7055 7055
         }
7056 7056
 
7057
-        $return_array =  array(
7057
+        $return_array = array(
7058 7058
             'columns' => $columns,
7059 7059
             'column_model' => $column_model,
7060 7060
             'rules' => $rules,
@@ -7143,7 +7143,7 @@  discard block
 block discarded – undo
7143 7143
             if (api_is_session_admin() &&
7144 7144
                 api_get_setting('allow_session_admins_to_manage_all_sessions') == 'false'
7145 7145
             ) {
7146
-                $where.=" AND s.session_admin_id = $user_id ";
7146
+                $where .= " AND s.session_admin_id = $user_id ";
7147 7147
             }
7148 7148
         }
7149 7149
 
@@ -7226,11 +7226,11 @@  discard block
 block discarded – undo
7226 7226
             }
7227 7227
             $options['where'] = str_replace('course_title', 'c.title', $options['where']);
7228 7228
 
7229
-            $options['where'] = str_replace("( session_active = '0' )", '1=1',  $options['where']);
7229
+            $options['where'] = str_replace("( session_active = '0' )", '1=1', $options['where']);
7230 7230
 
7231 7231
             $options['where'] = str_replace(
7232 7232
                 array("AND session_active = '1'  )", " AND (  session_active = '1'  )"),
7233
-                array(') GROUP BY s.name HAVING session_active = 1 ', " GROUP BY s.name HAVING session_active = 1 " )
7233
+                array(') GROUP BY s.name HAVING session_active = 1 ', " GROUP BY s.name HAVING session_active = 1 ")
7234 7234
                 , $options['where']
7235 7235
             );
7236 7236
 
@@ -7265,10 +7265,10 @@  discard block
 block discarded – undo
7265 7265
             $where;
7266 7266
 
7267 7267
         if (api_is_multiple_url_enabled()) {
7268
-            $table_access_url_rel_session= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
7268
+            $table_access_url_rel_session = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
7269 7269
             $access_url_id = api_get_current_access_url_id();
7270 7270
             if ($access_url_id != -1) {
7271
-                $where.= " AND ar.access_url_id = $access_url_id ";
7271
+                $where .= " AND ar.access_url_id = $access_url_id ";
7272 7272
                 $query = "$select
7273 7273
                     FROM $tbl_session s
7274 7274
                     LEFT JOIN $tbl_session_field_values fv ON (fv.session_id = s.id)
@@ -7295,7 +7295,7 @@  discard block
 block discarded – undo
7295 7295
         $formatted_sessions = array();
7296 7296
 
7297 7297
         if (Database::num_rows($result)) {
7298
-            $sessions   = Database::store_result($result, 'ASSOC');
7298
+            $sessions = Database::store_result($result, 'ASSOC');
7299 7299
             foreach ($sessions as $session) {
7300 7300
                 $session_id = $session['id'];
7301 7301
                 $session['name'] = Display::url($session['name'], "resume_session.php?id_session=".$session['id']);
@@ -7310,14 +7310,14 @@  discard block
 block discarded – undo
7310 7310
 
7311 7311
                 switch ($session['visibility']) {
7312 7312
                     case SESSION_VISIBLE_READ_ONLY: //1
7313
-                        $session['visibility'] =  get_lang('ReadOnly');
7313
+                        $session['visibility'] = get_lang('ReadOnly');
7314 7314
                         break;
7315 7315
                     case SESSION_VISIBLE:           //2
7316 7316
                     case SESSION_AVAILABLE:         //4
7317
-                        $session['visibility'] =  get_lang('Visible');
7317
+                        $session['visibility'] = get_lang('Visible');
7318 7318
                         break;
7319 7319
                     case SESSION_INVISIBLE:         //3
7320
-                        $session['visibility'] =  api_ucfirst(get_lang('Invisible'));
7320
+                        $session['visibility'] = api_ucfirst(get_lang('Invisible'));
7321 7321
                         break;
7322 7322
                 }
7323 7323
 
@@ -7393,7 +7393,7 @@  discard block
 block discarded – undo
7393 7393
         if (empty($session)) {
7394 7394
             return false;
7395 7395
         }
7396
-        return api_get_path(WEB_CODE_PATH) . 'session/resume_session.php?id_session=' . $id;
7396
+        return api_get_path(WEB_CODE_PATH).'session/resume_session.php?id_session='.$id;
7397 7397
     }
7398 7398
 
7399 7399
     /**
@@ -7411,7 +7411,7 @@  discard block
 block discarded – undo
7411 7411
             return false;
7412 7412
         }
7413 7413
         if (empty($courseId)) {
7414
-            return api_get_path(WEB_CODE_PATH) . 'session/index.php?session_id=' . $id;
7414
+            return api_get_path(WEB_CODE_PATH).'session/index.php?session_id='.$id;
7415 7415
         } else {
7416 7416
             $courseInfo = api_get_course_info_by_id($courseId);
7417 7417
             if ($courseInfo) {
@@ -7657,7 +7657,7 @@  discard block
 block discarded – undo
7657 7657
             // sort $listCat by catSessionName
7658 7658
             usort($listCat, 'self::compareBySessionName');
7659 7659
             // in each catSession sort sessionList by sessionName
7660
-            foreach($listCat as $i => $listCatSessionInfo) {
7660
+            foreach ($listCat as $i => $listCatSessionInfo) {
7661 7661
                 $listSessionList = $listCatSessionInfo['sessionList'];
7662 7662
                 usort($listSessionList, 'self::compareCatSessionInfo');
7663 7663
                 $listCat[$i]['sessionList'] = $listSessionList;
@@ -7672,8 +7672,8 @@  discard block
 block discarded – undo
7672 7672
             );
7673 7673
 
7674 7674
             $userCatId = intval($userCatId);
7675
-            $listResults[$userCatId]['courseInUserCategoryId'] =  $userCatId;
7676
-            $listResults[$userCatId]['courseInUserCategoryTitle'] =  $userCatTitle;
7675
+            $listResults[$userCatId]['courseInUserCategoryId'] = $userCatId;
7676
+            $listResults[$userCatId]['courseInUserCategoryTitle'] = $userCatTitle;
7677 7677
             $listResults[$userCatId]['courseInUserCatList'][] = $listOneCourse;
7678 7678
         }
7679 7679
 
@@ -7699,7 +7699,7 @@  discard block
 block discarded – undo
7699 7699
     {
7700 7700
         if ($listA['sessionName'] == $listB['sessionName']) {
7701 7701
             return 0;
7702
-        } else if($listA['sessionName'] > $listB['sessionName']) {
7702
+        } else if ($listA['sessionName'] > $listB['sessionName']) {
7703 7703
             return 1;
7704 7704
         } else {
7705 7705
             return -1;
@@ -7719,7 +7719,7 @@  discard block
 block discarded – undo
7719 7719
             return 1;
7720 7720
         } else if ($listA['catSessionName'] == $listB['catSessionName']) {
7721 7721
             return 0;
7722
-        } else if($listA['catSessionName'] > $listB['catSessionName']) {
7722
+        } else if ($listA['catSessionName'] > $listB['catSessionName']) {
7723 7723
             return 1;
7724 7724
         } else {
7725 7725
             return -1;
@@ -7735,7 +7735,7 @@  discard block
 block discarded – undo
7735 7735
     {
7736 7736
         if ($listA['courseInUserCategoryTitle'] == $listB['courseInUserCategoryTitle']) {
7737 7737
             return 0;
7738
-        } else if($listA['courseInUserCategoryTitle'] > $listB['courseInUserCategoryTitle']) {
7738
+        } else if ($listA['courseInUserCategoryTitle'] > $listB['courseInUserCategoryTitle']) {
7739 7739
             return 1;
7740 7740
         } else {
7741 7741
             return -1;
@@ -7751,7 +7751,7 @@  discard block
 block discarded – undo
7751 7751
     {
7752 7752
         if ($listA['title'] == $listB['title']) {
7753 7753
             return 0;
7754
-        } else if($listA['title'] > $listB['title']) {
7754
+        } else if ($listA['title'] > $listB['title']) {
7755 7755
             return 1;
7756 7756
         } else {
7757 7757
             return -1;
@@ -7797,8 +7797,8 @@  discard block
 block discarded – undo
7797 7797
 
7798 7798
                 $marginShift = 20;
7799 7799
                 if ($catSessionName != '') {
7800
-                    $htmlCatSessions .= '<div style="margin-left:'.$marginShift.'px;">' .
7801
-                        CourseManager::course_item_html($listParamsCatSession, true) . '</div>';
7800
+                    $htmlCatSessions .= '<div style="margin-left:'.$marginShift.'px;">'.
7801
+                        CourseManager::course_item_html($listParamsCatSession, true).'</div>';
7802 7802
                     $marginShift = 40;
7803 7803
                 }
7804 7804
 
Please login to merge, or discard this patch.
main/inc/lib/skill.lib.php 3 patches
Doc Comments   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -326,6 +326,7 @@  discard block
 block discarded – undo
326 326
 
327 327
     /**
328 328
      * Gets an element
329
+     * @param integer $gradebook_id
329 330
      */
330 331
     public function get_skill_info($skill_id, $gradebook_id)
331 332
     {
@@ -544,7 +545,7 @@  discard block
 block discarded – undo
544 545
      * Gets an element
545 546
      * @param int $id
546 547
      *
547
-     * @return array|mixed
548
+     * @return integer
548 549
      */
549 550
     public function get($id)
550 551
     {
@@ -885,7 +886,7 @@  discard block
 block discarded – undo
885 886
     /**
886 887
      * Get user's skills
887 888
      *
888
-     * @param int $userId User's id
889
+     * @param integer $user_id User's id
889 890
      * @param bool $get_skill_data
890 891
      */
891 892
     public function get_user_skills($user_id, $get_skill_data = false)
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -33,11 +33,11 @@  discard block
 block discarded – undo
33 33
     }
34 34
 
35 35
     /**
36
-    * This function is for editing profile info from profile_id.
37
-    * @param int    $profileId
38
-    * @param string $name
39
-    * @param string $description
40
-    */
36
+     * This function is for editing profile info from profile_id.
37
+     * @param int    $profileId
38
+     * @param string $name
39
+     * @param string $description
40
+     */
41 41
     public function updateProfileInfo($profileId, $name, $description)
42 42
     {
43 43
         $profileId = intval($profileId);
@@ -128,9 +128,9 @@  discard block
 block discarded – undo
128 128
     }
129 129
 
130 130
     /**
131
-    * This function is for getting profile info from profile_id.
132
-    * @param int $profileId
133
-    */
131
+     * This function is for getting profile info from profile_id.
132
+     * @param int $profileId
133
+     */
134 134
 
135 135
     public function getProfileInfo($profileId)
136 136
     {
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -734,7 +734,7 @@  discard block
 block discarded – undo
734 734
     {
735 735
         $skill_rel_skill = new SkillRelSkill();
736 736
         $skills = $skill_rel_skill->get_direct_parents($skill_id, true);
737
-        foreach($skills as &$skill) {
737
+        foreach ($skills as &$skill) {
738 738
             $skill['data'] = self::get($skill['skill_id']);
739 739
             $skill_info2 = $skill_rel_skill->get_skill_info($skill['skill_id']);
740 740
             $skill['data']['parent_id'] = $skill_info2['parent_id'];
@@ -772,7 +772,7 @@  discard block
 block discarded – undo
772 772
                     $attributes = array(
773 773
                         'skill_id'      => $skill_id,
774 774
                         'parent_id'     => $parent_id,
775
-                        'relation_type' => (isset($params['relation_type'])?$params['relation_type']:0),
775
+                        'relation_type' => (isset($params['relation_type']) ? $params['relation_type'] : 0),
776 776
                         //'level'         => $params['level'],
777 777
                     );
778 778
                     $skill_rel_skill->save($attributes);
@@ -969,8 +969,8 @@  discard block
 block discarded – undo
969 969
                     // 2nd node
970 970
                     $skills[$skill_id] = $skill_info;
971 971
                     // Uncomment code below to hide the searched skill
972
-                    $skills[$skill_id]['data']['parent_id'] =  $skill_info['extra']['parent_id'];
973
-                    $skills[$skill_id]['parent_id'] =  1;
972
+                    $skills[$skill_id]['data']['parent_id'] = $skill_info['extra']['parent_id'];
973
+                    $skills[$skill_id]['parent_id'] = 1;
974 974
                 }
975 975
             }
976 976
         }
@@ -1033,7 +1033,7 @@  discard block
 block discarded – undo
1033 1033
                     $skill['data']['skill_has_gradebook'] = true;
1034 1034
                 }
1035 1035
                 $refs[$skill['id']] = &$skill;
1036
-                $flat_array[$skill['id']] =  &$skill;
1036
+                $flat_array[$skill['id']] = &$skill;
1037 1037
             }
1038 1038
 
1039 1039
             // Checking family value
@@ -1054,7 +1054,7 @@  discard block
 block discarded – undo
1054 1054
                 $refs['root']['children'][0] = $skills[1];
1055 1055
                 $skills[$skill_id]['data']['family_id'] = 1;
1056 1056
                 $refs['root']['children'][0]['children'][0] = $skills[$skill_id];
1057
-                $flat_array[$skill_id] =  $skills[$skill_id];
1057
+                $flat_array[$skill_id] = $skills[$skill_id];
1058 1058
             } else {
1059 1059
                 // Moving node to the children index of their parents
1060 1060
 
@@ -1063,7 +1063,7 @@  discard block
 block discarded – undo
1063 1063
                         $skill['data']['family_id'] = $new_family_array[$skill['id']];
1064 1064
                     }
1065 1065
                     $refs[$skill['parent_id']]['children'][] = &$skill;
1066
-                    $flat_array[$my_skill_id] =  $skill;
1066
+                    $flat_array[$my_skill_id] = $skill;
1067 1067
                 }
1068 1068
             }
1069 1069
 
@@ -1161,7 +1161,7 @@  discard block
 block discarded – undo
1161 1161
                 INNER JOIN {$this->table_skill_rel_user} su
1162 1162
                 ON (s.id = su.skill_id)
1163 1163
                 WHERE user_id = $user_id";
1164
-        $result  = Database::query($sql);
1164
+        $result = Database::query($sql);
1165 1165
         if (Database::num_rows($result)) {
1166 1166
             $result = Database::fetch_row($result);
1167 1167
             return $result[0];
@@ -1203,7 +1203,7 @@  discard block
 block discarded – undo
1203 1203
      */
1204 1204
     public function get_user_list_skill_ranking_count()
1205 1205
     {
1206
-        $sql    = "SELECT count(*) FROM (
1206
+        $sql = "SELECT count(*) FROM (
1207 1207
                         SELECT count(distinct 1)
1208 1208
                         FROM {$this->table} s
1209 1209
                         INNER JOIN {$this->table_skill_rel_user} su
@@ -1256,7 +1256,7 @@  discard block
 block discarded – undo
1256 1256
                 ON c.code = g.course_code
1257 1257
                 WHERE sg.skill_id = $skill_id
1258 1258
                 AND (g.session_id IS NULL OR g.session_id = 0)";
1259
-        $result   = Database::query($sql);
1259
+        $result = Database::query($sql);
1260 1260
 
1261 1261
         return Database::store_result($result, 'ASSOC');
1262 1262
     }
@@ -1443,7 +1443,7 @@  discard block
 block discarded – undo
1443 1443
                 WHERE sg.skill_id = $skillId
1444 1444
                 AND g.session_id > 0";
1445 1445
 
1446
-        $result   = Database::query($sql);
1446
+        $result = Database::query($sql);
1447 1447
 
1448 1448
         return Database::store_result($result, 'ASSOC');
1449 1449
     }
Please login to merge, or discard this patch.
main/inc/lib/skill.visualizer.lib.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -30,6 +30,9 @@
 block discarded – undo
30 30
         $this->center_x = intval($offset_x + $this->canvas_x/2 - $this->block_size/2);
31 31
     }
32 32
 
33
+    /**
34
+     * @param string $class
35
+     */
33 36
     function prepare_skill_box($skill, $position, $class)
34 37
     {
35 38
         $block_id = $skill['id'];
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
     {
28 28
         $this->skills   = $skills;
29 29
         $this->type     = $type;
30
-        $this->center_x = intval($offset_x + $this->canvas_x/2 - $this->block_size/2);
30
+        $this->center_x = intval($offset_x + $this->canvas_x / 2 - $this->block_size / 2);
31 31
     }
32 32
 
33 33
     function prepare_skill_box($skill, $position, $class)
@@ -39,9 +39,9 @@  discard block
 block discarded – undo
39 39
             $extra_class = 'second_window';
40 40
         }
41 41
 
42
-        $this->html .= '<div id="block_'.$block_id.'" class = "open_block window '.$extra_class.'  '.$class.'" style = "top:' . $position['y'] . 'px; left:' . $position['x'] . 'px;">';
42
+        $this->html .= '<div id="block_'.$block_id.'" class = "open_block window '.$extra_class.'  '.$class.'" style = "top:'.$position['y'].'px; left:'.$position['x'].'px;">';
43 43
 
44
-        $content =  $skill['name'];
44
+        $content = $skill['name'];
45 45
         $content .= '<div class="btn-group">';
46 46
         $content .= Display::url(get_lang('Edit'), '#', array('id'=>'edit_block_'.$block_id, 'class'=>'edit_block btn'));
47 47
         $content .= Display::url('+', '#', array('id'=>'edit_block_'.$block_id, 'class'=>'edit_block btn'));
@@ -87,9 +87,9 @@  discard block
 block discarded – undo
87 87
         }
88 88
         //default_arrow_color
89 89
 
90
-        $this->js .= 'var e'.$block_id.' = prepare("block_' . $block_id.'",  '.$end_point.');'."\n";
91
-        $this->js .= 'var e'.$skill['parent_id'].' = prepare("block_' . $skill['parent_id'].'",  '.$end_point.');'."\n";
92
-        $this->js .= 'jsPlumb.connect({source: e'.$block_id.', target:e'.$skill['parent_id'].'});'."\n";;
90
+        $this->js .= 'var e'.$block_id.' = prepare("block_'.$block_id.'",  '.$end_point.');'."\n";
91
+        $this->js .= 'var e'.$skill['parent_id'].' = prepare("block_'.$skill['parent_id'].'",  '.$end_point.');'."\n";
92
+        $this->js .= 'jsPlumb.connect({source: e'.$block_id.', target:e'.$skill['parent_id'].'});'."\n"; ;
93 93
     }
94 94
 
95 95
     /**
@@ -125,10 +125,10 @@  discard block
 block discarded – undo
125 125
         $brothers = array();
126 126
 
127 127
         foreach ($this->skills as &$skill) {
128
-            if (!in_array($skill['parent_id'], array(0,1))) {
128
+            if (!in_array($skill['parent_id'], array(0, 1))) {
129 129
                 continue;
130 130
             }
131
-            $childs = isset($skill['children']) ? count($skill['children']) : 0 ;
131
+            $childs = isset($skill['children']) ? count($skill['children']) : 0;
132 132
 
133 133
             //$x = round($this->offsetX * sin(deg2rad($corner * $count)));
134 134
             //$y = round($this->offsetY * cos(deg2rad($corner * $count)));
@@ -144,10 +144,10 @@  discard block
 block discarded – undo
144 144
             if ($skill['parent_id'] == 0) {
145 145
                 //$x = 130*$childs/2;
146 146
                 //$x = $this->space_between_blocks_x*$childs/2;
147
-                $x = $this->canvas_x/2  - $this->block_size/2;
147
+                $x = $this->canvas_x / 2 - $this->block_size / 2;
148 148
             } else {
149 149
                 $max = isset($this->skills[$skill['parent_id']]['children']) ? count($this->skills[$skill['parent_id']]['children']) : 0;
150
-                foreach($this->skills[$skill['parent_id']]['children'] as  $id => $sk) {
150
+                foreach ($this->skills[$skill['parent_id']]['children'] as  $id => $sk) {
151 151
                     if ($skill['id'] == $sk['id']) {
152 152
                         break;
153 153
                     }
@@ -155,17 +155,17 @@  discard block
 block discarded – undo
155 155
                 }
156 156
                 $parent_x = isset($this->skills[$skill['parent_id']]['x']) ? $this->skills[$skill['parent_id']]['x'] : 0;
157 157
                 //$x = $my_count*$this->space_between_blocks_x + $parent_x  + $this->block_size - ($this->space_between_blocks_x*$max/2) ;
158
-                $x = $my_count*$this->space_between_blocks_x + $parent_x  + $this->block_size - ($this->canvas_x/2 ) ;
158
+                $x = $my_count * $this->space_between_blocks_x + $parent_x + $this->block_size - ($this->canvas_x / 2);
159 159
             }
160 160
 
161
-            $y = $skill['level']*$this->space_between_blocks_y;
161
+            $y = $skill['level'] * $this->space_between_blocks_y;
162 162
 
163 163
             $skill['x'] = $x;
164 164
             $skill['y'] = $y;
165 165
 
166 166
             //$skill['description']  = "{$brothers[$skill['parent_id']]} $x - $y";
167 167
             //$skill['name']  =  $skill['name']."  |  $x = $my_count * 150  +  $parent_x - (150* $max/2) - 10*$childs ";
168
-            $this->add_item($skill, array('x' => $this->offset_x + $x, 'y' => $this->offset_y +$y));
168
+            $this->add_item($skill, array('x' => $this->offset_x + $x, 'y' => $this->offset_y + $y));
169 169
         }
170 170
         return $this->get_html();
171 171
     }
Please login to merge, or discard this patch.
main/inc/lib/social.lib.php 4 patches
Doc Comments   +14 added lines, -4 removed lines patch added patch discarded remove patch
@@ -63,6 +63,8 @@  discard block
 block discarded – undo
63 63
      * @param int user id
64 64
      * @param int user friend id
65 65
      * @param string
66
+     * @param integer $user_id
67
+     * @param integer $user_friend
66 68
      * @author isaac flores paz
67 69
      */
68 70
     public static function get_relation_between_contacts($user_id, $user_friend)
@@ -94,6 +96,8 @@  discard block
 block discarded – undo
94 96
      * @param int group id
95 97
      * @param string name to search
96 98
      * @param bool true will load firstname, lastname, and image name
99
+     * @param integer $user_id
100
+     * @param integer $id_group
97 101
      * @return array
98 102
      * @author Julio Montoya <[email protected]> Cleaning code, function renamed, $load_extra_info option added
99 103
      * @author isaac flores paz
@@ -170,6 +174,9 @@  discard block
 block discarded – undo
170 174
      * @param int user friend id
171 175
      * @param string title of the message
172 176
      * @param string content of the message
177
+     * @param integer $user_id
178
+     * @param string $message_title
179
+     * @param string $message_content
173 180
      * @return boolean
174 181
      * @author isaac flores paz
175 182
      * @author Julio Montoya <[email protected]> Cleaning code
@@ -241,6 +248,7 @@  discard block
 block discarded – undo
241 248
      * Get number messages of the inbox
242 249
      * @author isaac flores paz
243 250
      * @param int user receiver id
251
+     * @param integer $user_receiver_id
244 252
      * @return int
245 253
      */
246 254
     public static function get_message_number_invitation_by_user_id($user_receiver_id)
@@ -283,6 +291,7 @@  discard block
 block discarded – undo
283 291
      * Get invitation list sent by user
284 292
      * @author Julio Montoya <[email protected]>
285 293
      * @param int user id
294
+     * @param integer $user_id
286 295
      * @return array()
287 296
      */
288 297
     public static function get_list_invitation_sent_by_user_id($user_id)
@@ -325,6 +334,7 @@  discard block
 block discarded – undo
325 334
      * Denies invitation
326 335
      * @param int user sender id
327 336
      * @param int user receiver id
337
+     * @param integer $user_receiver_id
328 338
      * @author isaac flores paz
329 339
      * @author Julio Montoya <[email protected]> Cleaning code
330 340
      */
@@ -360,7 +370,7 @@  discard block
 block discarded – undo
360 370
      * @author Isaac Flores Paz <[email protected]>
361 371
      * @author Julio Montoya <[email protected]> Cleaning code
362 372
      * @param void
363
-     * @return string message invitation
373
+     * @return false|null message invitation
364 374
      */
365 375
     public static function send_invitation_friend_user($userfriend_id, $subject_message = '', $content_message = '')
366 376
     {
@@ -1229,7 +1239,7 @@  discard block
 block discarded – undo
1229 1239
      * @param string $messageContent of the message
1230 1240
      * @param int $messageId id parent
1231 1241
      * @param string $messageStatus status type of message
1232
-     * @return boolean
1242
+     * @return false|string
1233 1243
      * @author Yannick Warnier
1234 1244
      */
1235 1245
     public static function sendWallMessage($userId, $friendId, $messageContent, $messageId = 0, $messageStatus = '')
@@ -1318,7 +1328,7 @@  discard block
 block discarded – undo
1318 1328
      * Gets all messages from someone's wall (within specific limits)
1319 1329
      * @param int $userId id of wall shown
1320 1330
      * @param string $messageStatus status wall message
1321
-     * @param int|string $parentId id message (Post main)
1331
+     * @param integer|null $parentId id message (Post main)
1322 1332
      * @param date $start Date from which we want to show the messages, in UTC time
1323 1333
      * @param int $limit Limit for the number of parent messages we want to show
1324 1334
      * @param int $offset Wall message query offset
@@ -1647,7 +1657,7 @@  discard block
 block discarded – undo
1647 1657
     /**
1648 1658
     * Delete messages delete logic
1649 1659
     * @param int $id id message to delete.
1650
-    * @return bool status query
1660
+    * @return Statement|null status query
1651 1661
     */
1652 1662
     public static function deleteMessage($id)
1653 1663
     {
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
         if ($course_visibility != COURSE_VISIBILITY_HIDDEN &&
511 511
             ($course_visibility != COURSE_VISIBILITY_CLOSED || $user_in_course_status == COURSEMANAGER)
512 512
         ) {
513
-           $result .= '<span class="title">' . $course_title . '<span>';
513
+            $result .= '<span class="title">' . $course_title . '<span>';
514 514
         } else {
515 515
             $result .= $course_title." "." ".get_lang('CourseClosed')."";
516 516
         }
@@ -1414,7 +1414,7 @@  discard block
 block discarded – undo
1414 1414
             }
1415 1415
             $media .= '<div class="user-image">';
1416 1416
             $media .= '<a href="'.$url.'" ><img src="'. $users[$userIdLoop]['avatar'] .
1417
-                       '" alt="'.$users[$userIdLoop]['complete_name'].'" class="avatar-thumb"></a>';
1417
+                        '" alt="'.$users[$userIdLoop]['complete_name'].'" class="avatar-thumb"></a>';
1418 1418
             $media .= '</div>';
1419 1419
             $media .= '<div class="user-data">';
1420 1420
             $media .= '<div class="username">' . '<a href="'.$url.'">'.$nameComplete.'</a></div>';
@@ -1645,10 +1645,10 @@  discard block
 block discarded – undo
1645 1645
         return $name;
1646 1646
     }
1647 1647
     /**
1648
-    * Delete messages delete logic
1649
-    * @param int $id id message to delete.
1650
-    * @return bool status query
1651
-    */
1648
+     * Delete messages delete logic
1649
+     * @param int $id id message to delete.
1650
+     * @return bool status query
1651
+     */
1652 1652
     public static function deleteMessage($id)
1653 1653
     {
1654 1654
         $id = intval($id);
Please login to merge, or discard this patch.
Spacing   +116 added lines, -116 removed lines patch added patch discarded remove patch
@@ -109,12 +109,12 @@  discard block
 block discarded – undo
109 109
                     friend_user_id<>'.((int) $user_id).' AND
110 110
                     user_id='.((int) $user_id);
111 111
         if (isset($id_group) && $id_group > 0) {
112
-            $sql.=' AND relation_type='.$id_group;
112
+            $sql .= ' AND relation_type='.$id_group;
113 113
         }
114 114
         if (isset($search_name)) {
115 115
             $search_name = trim($search_name);
116 116
             $search_name = str_replace(' ', '', $search_name);
117
-            $sql.=' AND friend_user_id IN (
117
+            $sql .= ' AND friend_user_id IN (
118 118
                 SELECT user_id FROM '.$tbl_my_user.'
119 119
                 WHERE
120 120
                     firstName LIKE "%'.Database::escape_string($search_name).'%" OR
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
 
369 369
         $user_info = api_get_user_info($userfriend_id);
370 370
         $succes = get_lang('MessageSentTo');
371
-        $succes.= ' : '.api_get_person_name($user_info['firstName'], $user_info['lastName']);
371
+        $succes .= ' : '.api_get_person_name($user_info['firstName'], $user_info['lastName']);
372 372
 
373 373
         if (isset($subject_message) && isset($content_message) && isset($userfriend_id)) {
374 374
             $send_message = MessageManager::send_message($userfriend_id, $subject_message, $content_message);
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
         $user_in_course_status = CourseManager :: get_user_in_course_status(api_get_user_id(), $course_code);
486 486
 
487 487
         //$valor = api_get_settings_params();
488
-        $course_path = api_get_path(SYS_COURSE_PATH).$course_directory;   // course path
488
+        $course_path = api_get_path(SYS_COURSE_PATH).$course_directory; // course path
489 489
         if (api_get_setting('course_images_in_courses_list') === 'true') {
490 490
             if (file_exists($course_path.'/course-pic85x85.png')) {
491 491
                 $image = $my_course['course_info']['course_image'];
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
         if ($course_visibility != COURSE_VISIBILITY_HIDDEN &&
511 511
             ($course_visibility != COURSE_VISIBILITY_CLOSED || $user_in_course_status == COURSEMANAGER)
512 512
         ) {
513
-           $result .= '<span class="title">' . $course_title . '<span>';
513
+           $result .= '<span class="title">'.$course_title.'<span>';
514 514
         } else {
515 515
             $result .= $course_title." "." ".get_lang('CourseClosed')."";
516 516
         }
@@ -729,57 +729,57 @@  discard block
 block discarded – undo
729 729
             $links = '<ul class="nav nav-pills nav-stacked">';
730 730
             $active = $show == 'home' ? 'active' : null;
731 731
             $links .= '
732
-                <li class="home-icon ' . $active . '">
733
-                    <a href="' . api_get_path(WEB_CODE_PATH) . 'social/home.php">
734
-                        ' . $homeIcon . ' ' . get_lang('Home') . '
732
+                <li class="home-icon ' . $active.'">
733
+                    <a href="' . api_get_path(WEB_CODE_PATH).'social/home.php">
734
+                        ' . $homeIcon.' '.get_lang('Home').'
735 735
                     </a>
736 736
                 </li>';
737 737
             $active = $show == 'messages' ? 'active' : null;
738 738
             $links .= '
739
-                <li class="messages-icon ' . $active . '">
740
-                    <a href="' . api_get_path(WEB_CODE_PATH) . 'messages/inbox.php?f=social">
741
-                        ' . $messagesIcon . ' ' . get_lang('Messages') . $count_unread_message . '
739
+                <li class="messages-icon ' . $active.'">
740
+                    <a href="' . api_get_path(WEB_CODE_PATH).'messages/inbox.php?f=social">
741
+                        ' . $messagesIcon.' '.get_lang('Messages').$count_unread_message.'
742 742
                     </a>
743 743
                 </li>';
744 744
 
745 745
             //Invitations
746 746
             $active = $show == 'invitations' ? 'active' : null;
747 747
             $links .= '
748
-                <li class="invitations-icon ' . $active . '">
749
-                    <a href="' . api_get_path(WEB_CODE_PATH) . 'social/invitations.php">
750
-                        ' . $invitationsIcon . ' ' . get_lang('Invitations') . $total_invitations . '
748
+                <li class="invitations-icon ' . $active.'">
749
+                    <a href="' . api_get_path(WEB_CODE_PATH).'social/invitations.php">
750
+                        ' . $invitationsIcon.' '.get_lang('Invitations').$total_invitations.'
751 751
                     </a>
752 752
                 </li>';
753 753
 
754 754
             //Shared profile and groups
755 755
             $active = $show == 'shared_profile' ? 'active' : null;
756 756
             $links .= '
757
-                <li class="shared-profile-icon' . $active . '">
758
-                    <a href="' . api_get_path(WEB_CODE_PATH) . 'social/profile.php">
759
-                        ' . $sharedProfileIcon . ' ' . get_lang('ViewMySharedProfile') . '
757
+                <li class="shared-profile-icon' . $active.'">
758
+                    <a href="' . api_get_path(WEB_CODE_PATH).'social/profile.php">
759
+                        ' . $sharedProfileIcon.' '.get_lang('ViewMySharedProfile').'
760 760
                     </a>
761 761
                 </li>';
762 762
             $active = $show == 'friends' ? 'active' : null;
763 763
             $links .= '
764
-                <li class="friends-icon ' . $active . '">
765
-                    <a href="' . api_get_path(WEB_CODE_PATH) . 'social/friends.php">
766
-                        ' . $friendsIcon . ' ' . get_lang('Friends') . '
764
+                <li class="friends-icon ' . $active.'">
765
+                    <a href="' . api_get_path(WEB_CODE_PATH).'social/friends.php">
766
+                        ' . $friendsIcon.' '.get_lang('Friends').'
767 767
                     </a>
768 768
                 </li>';
769 769
             $active = $show == 'browse_groups' ? 'active' : null;
770 770
             $links .= '
771
-                <li class="browse-groups-icon ' . $active . '">
772
-                    <a href="' . api_get_path(WEB_CODE_PATH) . 'social/groups.php">
773
-                        ' . $groupsIcon . ' ' . get_lang('SocialGroups') . '
771
+                <li class="browse-groups-icon ' . $active.'">
772
+                    <a href="' . api_get_path(WEB_CODE_PATH).'social/groups.php">
773
+                        ' . $groupsIcon.' '.get_lang('SocialGroups').'
774 774
                     </a>
775 775
                 </li>';
776 776
 
777 777
             //Search users
778 778
             $active = $show == 'search' ? 'active' : null;
779 779
             $links .= '
780
-                <li class="search-icon ' . $active . '">
781
-                    <a href="' . api_get_path(WEB_CODE_PATH) . 'social/search.php">
782
-                        ' . $searchIcon . ' ' . get_lang('Search') . '
780
+                <li class="search-icon ' . $active.'">
781
+                    <a href="' . api_get_path(WEB_CODE_PATH).'social/search.php">
782
+                        ' . $searchIcon.' '.get_lang('Search').'
783 783
                     </a>
784 784
                 </li>';
785 785
 
@@ -787,9 +787,9 @@  discard block
 block discarded – undo
787 787
             $active = $show == 'myfiles' ? 'active' : null;
788 788
 
789 789
             $myFiles = '
790
-                <li class="myfiles-icon ' . $active . '">
791
-                    <a href="' . api_get_path(WEB_CODE_PATH) . 'social/myfiles.php">
792
-                        ' . $filesIcon . ' ' . get_lang('MyFiles') . '
790
+                <li class="myfiles-icon ' . $active.'">
791
+                    <a href="' . api_get_path(WEB_CODE_PATH).'social/myfiles.php">
792
+                        ' . $filesIcon.' '.get_lang('MyFiles').'
793 793
                     </a>
794 794
                 </li>';
795 795
 
@@ -798,7 +798,7 @@  discard block
 block discarded – undo
798 798
             }
799 799
             $links .= $myFiles;
800 800
 
801
-            $links .='</ul>';
801
+            $links .= '</ul>';
802 802
             
803 803
             $html .= Display::panelCollapse(
804 804
                     get_lang('SocialNetwork'),
@@ -819,57 +819,57 @@  discard block
 block discarded – undo
819 819
         }
820 820
 
821 821
         if ($show == 'shared_profile') {
822
-            $links =  '<ul class="nav nav-pills nav-stacked">';
822
+            $links = '<ul class="nav nav-pills nav-stacked">';
823 823
             // My own profile
824 824
             if ($show_full_profile && $user_id == intval(api_get_user_id())) {
825 825
                 $links .= '
826
-                    <li class="home-icon ' . $active . '">
827
-                        <a href="' . api_get_path(WEB_CODE_PATH) . 'social/home.php">
828
-                            ' . $homeIcon . ' ' . get_lang('Home') . '
826
+                    <li class="home-icon ' . $active.'">
827
+                        <a href="' . api_get_path(WEB_CODE_PATH).'social/home.php">
828
+                            ' . $homeIcon.' '.get_lang('Home').'
829 829
                         </a>
830 830
                     </li>
831
-                    <li class="messages-icon ' . $active . '">
832
-                        <a href="' . api_get_path(WEB_CODE_PATH) . 'messages/inbox.php?f=social">
833
-                            ' . $messagesIcon . ' ' . get_lang('Messages') . $count_unread_message . '
831
+                    <li class="messages-icon ' . $active.'">
832
+                        <a href="' . api_get_path(WEB_CODE_PATH).'messages/inbox.php?f=social">
833
+                            ' . $messagesIcon.' '.get_lang('Messages').$count_unread_message.'
834 834
                         </a>
835 835
                     </li>';
836 836
                 $active = $show == 'invitations' ? 'active' : null;
837 837
                 $links .= '
838
-                    <li class="invitations-icon' . $active . '">
839
-                        <a href="' . api_get_path(WEB_CODE_PATH) . 'social/invitations.php">
840
-                            ' . $invitationsIcon . ' ' . get_lang('Invitations') . $total_invitations . '
838
+                    <li class="invitations-icon' . $active.'">
839
+                        <a href="' . api_get_path(WEB_CODE_PATH).'social/invitations.php">
840
+                            ' . $invitationsIcon.' '.get_lang('Invitations').$total_invitations.'
841 841
                         </a>
842 842
                     </li>';
843 843
 
844 844
                 $links .= '
845 845
                     <li class="shared-profile-icon active">
846
-                        <a href="' . api_get_path(WEB_CODE_PATH) . 'social/profile.php">
847
-                            ' . $sharedProfileIcon . ' ' . get_lang('ViewMySharedProfile') . '
846
+                        <a href="' . api_get_path(WEB_CODE_PATH).'social/profile.php">
847
+                            ' . $sharedProfileIcon.' '.get_lang('ViewMySharedProfile').'
848 848
                         </a>
849 849
                     </li>
850 850
                     <li class="friends-icon">
851
-                        <a href="' . api_get_path(WEB_CODE_PATH) . 'social/friends.php">
852
-                            ' . $friendsIcon . ' ' . get_lang('Friends') . '
851
+                        <a href="' . api_get_path(WEB_CODE_PATH).'social/friends.php">
852
+                            ' . $friendsIcon.' '.get_lang('Friends').'
853 853
                         </a>
854 854
                     </li>
855 855
                     <li class="browse-groups-icon">
856
-                        <a href="' . api_get_path(WEB_CODE_PATH) . 'social/groups.php">
857
-                            ' . $groupsIcon . ' ' . get_lang('SocialGroups') . '
856
+                        <a href="' . api_get_path(WEB_CODE_PATH).'social/groups.php">
857
+                            ' . $groupsIcon.' '.get_lang('SocialGroups').'
858 858
                         </a>
859 859
                     </li>';
860 860
                 $active = $show == 'search' ? 'active' : null;
861 861
                 $links .= '
862
-                    <li class="search-icon ' . $active . '">
863
-                        <a href="' . api_get_path(WEB_CODE_PATH) . 'social/search.php">
864
-                            ' . $searchIcon . ' ' . get_lang('Search') . '
862
+                    <li class="search-icon ' . $active.'">
863
+                        <a href="' . api_get_path(WEB_CODE_PATH).'social/search.php">
864
+                            ' . $searchIcon.' '.get_lang('Search').'
865 865
                         </a>
866 866
                     </li>';
867 867
                 $active = $show == 'myfiles' ? 'active' : null;
868 868
 
869 869
                 $myFiles = '
870
-                    <li class="myfiles-icon ' . $active . '">
871
-                     <a href="' . api_get_path(WEB_CODE_PATH) . 'social/myfiles.php">
872
-                            ' . $filesIcon . ' ' . get_lang('MyFiles') . '
870
+                    <li class="myfiles-icon ' . $active.'">
871
+                     <a href="' . api_get_path(WEB_CODE_PATH).'social/myfiles.php">
872
+                            ' . $filesIcon.' '.get_lang('MyFiles').'
873 873
                         </a>
874 874
                     </li>';
875 875
 
@@ -915,7 +915,7 @@  discard block
 block discarded – undo
915 915
                 $links .= '<li><a href="'.api_get_path(WEB_CODE_PATH).'social/invitations.php">'.Display::return_icon('invitation.png', get_lang('YouAlreadySentAnInvitation')).'&nbsp;&nbsp;'.get_lang('YouAlreadySentAnInvitation').'</a></li>';
916 916
             } else {
917 917
                 if (!$show_full_profile) {
918
-                    $links .= '<li><a class="btn-to-send-invitation" href="#" data-send-to="' . $user_id . '" title="'.get_lang('SendInvitation').'">'.Display :: return_icon('invitation.png', get_lang('SocialInvitationToFriends')).'&nbsp;'.get_lang('SendInvitation').'</a></li>';
918
+                    $links .= '<li><a class="btn-to-send-invitation" href="#" data-send-to="'.$user_id.'" title="'.get_lang('SendInvitation').'">'.Display :: return_icon('invitation.png', get_lang('SocialInvitationToFriends')).'&nbsp;'.get_lang('SendInvitation').'</a></li>';
919 919
                 }
920 920
             }
921 921
 
@@ -1025,10 +1025,10 @@  discard block
 block discarded – undo
1025 1025
         foreach ($user_list as $uid) {
1026 1026
             $user_info = api_get_user_info($uid, $checkIfUserOnline = true);
1027 1027
             $lastname = $user_info['lastname'];
1028
-            $firstname =  $user_info['firstname'];
1028
+            $firstname = $user_info['firstname'];
1029 1029
             $completeName = $firstname.', '.$lastname;
1030 1030
 
1031
-            $user_rol = $user_info['status'] == 1 ? Display::return_icon('teacher.png',get_lang('Teacher'),null,ICON_SIZE_TINY) : Display::return_icon('user.png',get_lang('Student'),null,ICON_SIZE_TINY);
1031
+            $user_rol = $user_info['status'] == 1 ? Display::return_icon('teacher.png', get_lang('Teacher'), null, ICON_SIZE_TINY) : Display::return_icon('user.png', get_lang('Student'), null, ICON_SIZE_TINY);
1032 1032
             $status_icon_chat = null;
1033 1033
             if ($user_info['user_is_online_in_chat'] == 1) {
1034 1034
                 $status_icon_chat = Display::return_icon('online.png', get_lang('Online'));
@@ -1039,7 +1039,7 @@  discard block
 block discarded – undo
1039 1039
             $userPicture = $user_info['avatar'];
1040 1040
             $img = '<img class="img-responsive img-circle" title="'.$completeName.'" alt="'.$completeName.'" src="'.$userPicture.'">';
1041 1041
 
1042
-            $url =  null;
1042
+            $url = null;
1043 1043
             // Anonymous users can't have access to the profile
1044 1044
             if (!api_is_anonymous()) {
1045 1045
                 if (api_get_setting('allow_social_tool') == 'true') {
@@ -1205,13 +1205,13 @@  discard block
 block discarded – undo
1205 1205
             case SOCIAL_CENTER_PLUGIN:
1206 1206
                 $social_plugins = array(1, 2);
1207 1207
                 if (is_array($social_plugins) && count($social_plugins) > 0) {
1208
-                    $content.= '<div id="social-plugins">';
1208
+                    $content .= '<div id="social-plugins">';
1209 1209
                     foreach ($social_plugins as $plugin) {
1210
-                        $content.= '<div class="social-plugin-item">';
1211
-                        $content.= $plugin;
1212
-                        $content.= '</div>';
1210
+                        $content .= '<div class="social-plugin-item">';
1211
+                        $content .= $plugin;
1212
+                        $content .= '</div>';
1213 1213
                     }
1214
-                    $content.= '</div>';
1214
+                    $content .= '</div>';
1215 1215
                 }
1216 1216
                 break;
1217 1217
             case SOCIAL_LEFT_PLUGIN:
@@ -1279,12 +1279,12 @@  discard block
 block discarded – undo
1279 1279
         if (!in_array($extension, $allowedTypes)) {
1280 1280
             $flag = false;
1281 1281
         } else {
1282
-            $newFileName = uniqid('') . '.' . $extension;
1282
+            $newFileName = uniqid('').'.'.$extension;
1283 1283
             if (!file_exists($pathMessageAttach)) {
1284 1284
                 @mkdir($pathMessageAttach, api_get_permissions_for_new_directories(), true);
1285 1285
             }
1286 1286
 
1287
-            $newPath = $pathMessageAttach . $newFileName;
1287
+            $newPath = $pathMessageAttach.$newFileName;
1288 1288
             if (is_uploaded_file($fileAttach['tmp_name'])) {
1289 1289
                 @copy($fileAttach['tmp_name'], $newPath);
1290 1290
             }
@@ -1293,9 +1293,9 @@  discard block
 block discarded – undo
1293 1293
             $medium = self::resize_picture($newPath, IMAGE_WALL_MEDIUM_SIZE);
1294 1294
 
1295 1295
             $big = new Image($newPath);
1296
-            $ok = $small && $small->send_image($pathMessageAttach . IMAGE_WALL_SMALL . '_' . $newFileName) &&
1297
-                $medium && $medium->send_image($pathMessageAttach . IMAGE_WALL_MEDIUM .'_' . $newFileName) &&
1298
-                $big && $big->send_image($pathMessageAttach . IMAGE_WALL_BIG . '_' . $newFileName);
1296
+            $ok = $small && $small->send_image($pathMessageAttach.IMAGE_WALL_SMALL.'_'.$newFileName) &&
1297
+                $medium && $medium->send_image($pathMessageAttach.IMAGE_WALL_MEDIUM.'_'.$newFileName) &&
1298
+                $big && $big->send_image($pathMessageAttach.IMAGE_WALL_BIG.'_'.$newFileName);
1299 1299
 
1300 1300
             // Insert
1301 1301
             $newFileName = $social.$newFileName;
@@ -1386,7 +1386,7 @@  discard block
 block discarded – undo
1386 1386
             $start = '0000-00-00';
1387 1387
         }
1388 1388
 
1389
-        $isOwnWall = (api_get_user_id() == $userId  && $userId == $friendId);
1389
+        $isOwnWall = (api_get_user_id() == $userId && $userId == $friendId);
1390 1390
         $messages = self::getWallMessages($userId, MESSAGE_STATUS_WALL, $idMessage, $start, $limit, $offset);
1391 1391
         $formattedList = '<div class="sub-mediapost">';
1392 1392
         $users = array();
@@ -1401,8 +1401,8 @@  discard block
 block discarded – undo
1401 1401
             }
1402 1402
 
1403 1403
             $nameComplete = api_is_western_name_order()
1404
-                ? $users[$userIdLoop]['firstname'] .' ' . $users[$userIdLoop]['lastname']
1405
-                : $users[$userIdLoop]['lastname'] . ' ' . $users[$userIdLoop]['firstname'];
1404
+                ? $users[$userIdLoop]['firstname'].' '.$users[$userIdLoop]['lastname']
1405
+                : $users[$userIdLoop]['lastname'].' '.$users[$userIdLoop]['firstname'];
1406 1406
             $url = api_get_path(WEB_CODE_PATH).'social/profile.php?u='.$userIdLoop;
1407 1407
             $media = '';
1408 1408
             $media .= '<div class="rep-post">';
@@ -1413,11 +1413,11 @@  discard block
 block discarded – undo
1413 1413
                 $media .= '</div>';
1414 1414
             }
1415 1415
             $media .= '<div class="user-image">';
1416
-            $media .= '<a href="'.$url.'" ><img src="'. $users[$userIdLoop]['avatar'] .
1416
+            $media .= '<a href="'.$url.'" ><img src="'.$users[$userIdLoop]['avatar'].
1417 1417
                        '" alt="'.$users[$userIdLoop]['complete_name'].'" class="avatar-thumb"></a>';
1418 1418
             $media .= '</div>';
1419 1419
             $media .= '<div class="user-data">';
1420
-            $media .= '<div class="username">' . '<a href="'.$url.'">'.$nameComplete.'</a></div>';
1420
+            $media .= '<div class="username">'.'<a href="'.$url.'">'.$nameComplete.'</a></div>';
1421 1421
             $media .= '<div class="time timeago" title="'.$date.'">'.$date.'</div>';
1422 1422
             $media .= '</div>';
1423 1423
             $media .= '<div class="msg-content">';
@@ -1452,12 +1452,12 @@  discard block
 block discarded – undo
1452 1452
      * @param   int     $offset     Wall messages offset
1453 1453
      * @return  array   $data       return user's starting wall messages along with message extra data
1454 1454
      */
1455
-    public static function getWallMessagesPostHTML($userId, $friendId = 0, $start = null, $limit = 10, $offset= 0)
1455
+    public static function getWallMessagesPostHTML($userId, $friendId = 0, $start = null, $limit = 10, $offset = 0)
1456 1456
     {
1457 1457
         if (empty($start)) {
1458 1458
             $start = '0000-00-00';
1459 1459
         }
1460
-        $isOwnWall = (api_get_user_id() == $userId  && $userId == $friendId);
1460
+        $isOwnWall = (api_get_user_id() == $userId && $userId == $friendId);
1461 1461
         $messages = self::getWallMessages($userId, MESSAGE_STATUS_WALL_POST, null, $start, $limit, $offset);
1462 1462
         $users = array();
1463 1463
         $data = array();
@@ -1516,7 +1516,7 @@  discard block
 block discarded – undo
1516 1516
 
1517 1517
         $htmlReceiver = '';
1518 1518
         if ($authorId != $receiverId) {
1519
-            $htmlReceiver = ' > <a href="'.$urlReceiver.'">' . $nameCompleteReceiver . '</a> ';
1519
+            $htmlReceiver = ' > <a href="'.$urlReceiver.'">'.$nameCompleteReceiver.'</a> ';
1520 1520
         }
1521 1521
 
1522 1522
         $wallImage = '';
@@ -1551,7 +1551,7 @@  discard block
 block discarded – undo
1551 1551
         $html .= '<div class="img-post">';
1552 1552
         $html .= $wallImage;
1553 1553
         $html .= '</div>';
1554
-        $html .= '<p>'. Security::remove_XSS($message['content']).'</p>';
1554
+        $html .= '<p>'.Security::remove_XSS($message['content']).'</p>';
1555 1555
         $html .= '</div>';
1556 1556
         $html .= '</div>'; // end mediaPost
1557 1557
 
@@ -1574,11 +1574,11 @@  discard block
 block discarded – undo
1574 1574
         $domain = empty($url) ? parse_url($link) : parse_url($url);
1575 1575
         $domain = $domain['scheme'].'://'.$domain['host'];
1576 1576
         // Trick to verify if the Image Url Exist because of some bad metatag dev
1577
-        if (self::verifyUrl($image) == false){
1578
-            if (!($image[0] == '/')){
1579
-                $domain = $domain . '/';
1577
+        if (self::verifyUrl($image) == false) {
1578
+            if (!($image[0] == '/')) {
1579
+                $domain = $domain.'/';
1580 1580
             }
1581
-            $image = $domain . $image;
1581
+            $image = $domain.$image;
1582 1582
         }
1583 1583
         $title = $graph->title;
1584 1584
         
@@ -1630,16 +1630,16 @@  discard block
 block discarded – undo
1630 1630
         if (isset($array[2]) && !empty($array[2])) {
1631 1631
 
1632 1632
             if ($size == IMAGE_WALL_SMALL) {
1633
-                $name = IMAGE_WALL_SMALL. '_' . $array[2];
1634
-            }else if($size == IMAGE_WALL_MEDIUM){
1635
-                $name = IMAGE_WALL_MEDIUM. '_' . $array[2];
1636
-            }else if($size == IMAGE_WALL_BIG){
1637
-                $name = IMAGE_WALL_BIG. '_' . $array[2];
1638
-            }else {
1639
-                $name = IMAGE_WALL_SMALL. '_' . $array[2];
1633
+                $name = IMAGE_WALL_SMALL.'_'.$array[2];
1634
+            } else if ($size == IMAGE_WALL_MEDIUM) {
1635
+                $name = IMAGE_WALL_MEDIUM.'_'.$array[2];
1636
+            } else if ($size == IMAGE_WALL_BIG) {
1637
+                $name = IMAGE_WALL_BIG.'_'.$array[2];
1638
+            } else {
1639
+                $name = IMAGE_WALL_SMALL.'_'.$array[2];
1640 1640
             }
1641 1641
             $lessImage = str_replace($array[2], '', $path);
1642
-            $name = $lessImage . $name;
1642
+            $name = $lessImage.$name;
1643 1643
         }
1644 1644
 
1645 1645
         return $name;
@@ -1747,18 +1747,18 @@  discard block
 block discarded – undo
1747 1747
         if ($number_friends != 0) {
1748 1748
             if ($number_friends > $number_of_images) {
1749 1749
                 if (api_get_user_id() == $user_id) {
1750
-                    $friendHtml.= ' <span><a href="friends.php">'.get_lang('SeeAll').'</a></span>';
1750
+                    $friendHtml .= ' <span><a href="friends.php">'.get_lang('SeeAll').'</a></span>';
1751 1751
                 } else {
1752
-                    $friendHtml.= ' <span>'
1752
+                    $friendHtml .= ' <span>'
1753 1753
                         .'<a href="'.api_get_path(WEB_CODE_PATH).'social/profile_friends_and_groups.inc.php'
1754 1754
                         .'?view=friends&height=390&width=610&user_id='.$user_id.'"'
1755 1755
                         .'class="ajax" data-title="'.get_lang('SeeAll').'" title="'.get_lang('SeeAll').'" >'.get_lang('SeeAll').'</a></span>';
1756 1756
                 }
1757 1757
             }
1758 1758
 
1759
-            $friendHtml.= '<ul class="nav nav-list">';
1759
+            $friendHtml .= '<ul class="nav nav-list">';
1760 1760
             $j = 1;
1761
-            for ($k=0; $k < $number_friends; $k++) {
1761
+            for ($k = 0; $k < $number_friends; $k++) {
1762 1762
                 if ($j > $number_of_images) break;
1763 1763
 
1764 1764
                 if (isset($friends[$k])) {
@@ -1772,26 +1772,26 @@  discard block
 block discarded – undo
1772 1772
                         $statusIcon = Display::span('', array('class' => 'offline_user_in_text'));
1773 1773
                     }
1774 1774
 
1775
-                    $friendHtml.= '<li>';
1776
-                    $friendHtml.= '<div>';
1775
+                    $friendHtml .= '<li>';
1776
+                    $friendHtml .= '<div>';
1777 1777
 
1778 1778
                     // the height = 92 must be the same in the image_friend_network span style in default.css
1779 1779
                     $friends_profile = UserManager::getUserPicture($friend['friend_user_id'], USER_IMAGE_SIZE_SMALL);
1780
-                    $friendHtml.= '<img src="'.$friends_profile.'" id="imgfriend_'.$friend['friend_user_id'].'" title="'.$name_user.'"/>';
1780
+                    $friendHtml .= '<img src="'.$friends_profile.'" id="imgfriend_'.$friend['friend_user_id'].'" title="'.$name_user.'"/>';
1781 1781
                     $link_shared = (empty($link_shared)) ? '' : '&'.$link_shared;
1782
-                    $friendHtml.= $statusIcon .'<a href="profile.php?' .'u=' . $friend['friend_user_id'] . $link_shared . '">' . $name_user .'</a>';
1783
-                    $friendHtml.= '</div>';
1784
-                    $friendHtml.= '</li>';
1782
+                    $friendHtml .= $statusIcon.'<a href="profile.php?'.'u='.$friend['friend_user_id'].$link_shared.'">'.$name_user.'</a>';
1783
+                    $friendHtml .= '</div>';
1784
+                    $friendHtml .= '</li>';
1785 1785
                 }
1786 1786
                 $j++;
1787 1787
             }
1788
-            $friendHtml.='</ul>';
1788
+            $friendHtml .= '</ul>';
1789 1789
         } else {
1790
-            $friendHtml.= '<div class="">'.get_lang('NoFriendsInYourContactList').'<br />'
1791
-                .'<a class="btn btn-primary" href="'.api_get_path(WEB_PATH).'whoisonline.php"><em class="fa fa-search"></em> '. get_lang('TryAndFindSomeFriends').'</a></div>';
1790
+            $friendHtml .= '<div class="">'.get_lang('NoFriendsInYourContactList').'<br />'
1791
+                .'<a class="btn btn-primary" href="'.api_get_path(WEB_PATH).'whoisonline.php"><em class="fa fa-search"></em> '.get_lang('TryAndFindSomeFriends').'</a></div>';
1792 1792
         }
1793 1793
 
1794
-        $friendHtml = Display::panel($friendHtml, get_lang('SocialFriend').' (' . $number_friends . ')' );
1794
+        $friendHtml = Display::panel($friendHtml, get_lang('SocialFriend').' ('.$number_friends.')');
1795 1795
 
1796 1796
         return $friendHtml;
1797 1797
     }
@@ -1812,9 +1812,9 @@  discard block
 block discarded – undo
1812 1812
 
1813 1813
         if ($number_friends != 0) {
1814 1814
 
1815
-            $friendHtml.= '<div class="list-group">';
1815
+            $friendHtml .= '<div class="list-group">';
1816 1816
             $j = 1;
1817
-            for ($k=0; $k < $number_friends; $k++) {
1817
+            for ($k = 0; $k < $number_friends; $k++) {
1818 1818
                 if ($j > $number_of_images) break;
1819 1819
 
1820 1820
                 if (isset($friends[$k])) {
@@ -1823,11 +1823,11 @@  discard block
 block discarded – undo
1823 1823
                     $user_info_friend = api_get_user_info($friend['friend_user_id'], true);
1824 1824
 
1825 1825
                     if ($user_info_friend['user_is_online']) {
1826
-                        $statusIcon = Display::return_icon('statusonline.png',get_lang('Online'));
1827
-                        $status=1;
1826
+                        $statusIcon = Display::return_icon('statusonline.png', get_lang('Online'));
1827
+                        $status = 1;
1828 1828
                     } else {
1829
-                        $statusIcon = Display::return_icon('statusoffline.png',get_lang('Offline'));
1830
-                        $status=0;
1829
+                        $statusIcon = Display::return_icon('statusoffline.png', get_lang('Offline'));
1830
+                        $status = 0;
1831 1831
                     }
1832 1832
 
1833 1833
                     $friendAvatarMedium = UserManager::getUserPicture($friend['friend_user_id'], USER_IMAGE_SIZE_MEDIUM);
@@ -1836,24 +1836,24 @@  discard block
 block discarded – undo
1836 1836
                     $showLinkToChat = api_is_global_chat_enabled() &&
1837 1837
                         $friend['friend_user_id'] != api_get_user_id();
1838 1838
 
1839
-                    if ($showLinkToChat){
1839
+                    if ($showLinkToChat) {
1840 1840
                         $friendHtml .= '<a onclick="javascript:chatWith(\''.$friend['friend_user_id'].'\', \''.$name_user.'\', \''.$status.'\',\''.$friendAvatarSmall.'\')" href="javascript:void(0);" class="list-group-item">';
1841
-                        $friendHtml .=  $friend_avatar.' <span class="username">' . $name_user . '</span>';
1842
-                        $friendHtml .= '<span class="status">' . $statusIcon . '</span>';
1841
+                        $friendHtml .= $friend_avatar.' <span class="username">'.$name_user.'</span>';
1842
+                        $friendHtml .= '<span class="status">'.$statusIcon.'</span>';
1843 1843
                     } else {
1844 1844
                         $link_shared = (empty($link_shared)) ? '' : '&'.$link_shared;
1845
-                        $friendHtml .= '<a href="profile.php?' .'u=' . $friend['friend_user_id'] . $link_shared . '" class="list-group-item">';
1846
-                        $friendHtml .=  $friend_avatar.' <span class="username-all">' . $name_user . '</span>';
1845
+                        $friendHtml .= '<a href="profile.php?'.'u='.$friend['friend_user_id'].$link_shared.'" class="list-group-item">';
1846
+                        $friendHtml .= $friend_avatar.' <span class="username-all">'.$name_user.'</span>';
1847 1847
                     }
1848 1848
 
1849 1849
                     $friendHtml .= '</a>';
1850 1850
                 }
1851 1851
                 $j++;
1852 1852
             }
1853
-            $friendHtml.='</div>';
1853
+            $friendHtml .= '</div>';
1854 1854
         } else {
1855
-            $friendHtml.= '<div class="help">'.get_lang('NoFriendsInYourContactList').' '
1856
-                .'<a href="'.api_get_path(WEB_PATH).'whoisonline.php"><em class="fa fa-search"></em> '. get_lang('TryAndFindSomeFriends').'</a></div>';
1855
+            $friendHtml .= '<div class="help">'.get_lang('NoFriendsInYourContactList').' '
1856
+                .'<a href="'.api_get_path(WEB_PATH).'whoisonline.php"><em class="fa fa-search"></em> '.get_lang('TryAndFindSomeFriends').'</a></div>';
1857 1857
         }
1858 1858
 
1859 1859
         return $friendHtml;
@@ -1871,7 +1871,7 @@  discard block
 block discarded – undo
1871 1871
                 'post',
1872 1872
                 api_get_path(WEB_CODE_PATH).'social/profile.php'.$userId,
1873 1873
                 null,
1874
-                array('enctype' => 'multipart/form-data') ,
1874
+                array('enctype' => 'multipart/form-data'),
1875 1875
                 FormValidator::LAYOUT_HORIZONTAL    
1876 1876
             );
1877 1877
 
Please login to merge, or discard this patch.
Braces   +9 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1631,11 +1631,11 @@  discard block
 block discarded – undo
1631 1631
 
1632 1632
             if ($size == IMAGE_WALL_SMALL) {
1633 1633
                 $name = IMAGE_WALL_SMALL. '_' . $array[2];
1634
-            }else if($size == IMAGE_WALL_MEDIUM){
1634
+            } else if($size == IMAGE_WALL_MEDIUM){
1635 1635
                 $name = IMAGE_WALL_MEDIUM. '_' . $array[2];
1636
-            }else if($size == IMAGE_WALL_BIG){
1636
+            } else if($size == IMAGE_WALL_BIG){
1637 1637
                 $name = IMAGE_WALL_BIG. '_' . $array[2];
1638
-            }else {
1638
+            } else {
1639 1639
                 $name = IMAGE_WALL_SMALL. '_' . $array[2];
1640 1640
             }
1641 1641
             $lessImage = str_replace($array[2], '', $path);
@@ -1759,7 +1759,9 @@  discard block
 block discarded – undo
1759 1759
             $friendHtml.= '<ul class="nav nav-list">';
1760 1760
             $j = 1;
1761 1761
             for ($k=0; $k < $number_friends; $k++) {
1762
-                if ($j > $number_of_images) break;
1762
+                if ($j > $number_of_images) {
1763
+                    break;
1764
+                }
1763 1765
 
1764 1766
                 if (isset($friends[$k])) {
1765 1767
                     $friend = $friends[$k];
@@ -1815,7 +1817,9 @@  discard block
 block discarded – undo
1815 1817
             $friendHtml.= '<div class="list-group">';
1816 1818
             $j = 1;
1817 1819
             for ($k=0; $k < $number_friends; $k++) {
1818
-                if ($j > $number_of_images) break;
1820
+                if ($j > $number_of_images) {
1821
+                    break;
1822
+                }
1819 1823
 
1820 1824
                 if (isset($friends[$k])) {
1821 1825
                     $friend = $friends[$k];
Please login to merge, or discard this patch.
main/inc/lib/sortable_table.class.php 4 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -443,6 +443,7 @@
 block discarded – undo
443 443
      * @param bool       hide navigation optionally
444 444
      * @param int        content per page when show navigation (optional)
445 445
      * @param bool       sort data optionally
446
+     * @param boolean $visibility_options
446 447
      * @return string    grid html
447 448
      */
448 449
     public function display_simple_grid($visibility_options, $hide_navigation = true, $per_page = 20, $sort_data = true, $grid_class = array())
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -339,9 +339,9 @@  discard block
 block discarded – undo
339 339
     }
340 340
 
341 341
     /**
342
-    * This function shows the content of a table in a grid.
343
-    * Should not be use to edit information (edit/delete rows) only.
344
-    **/
342
+     * This function shows the content of a table in a grid.
343
+     * Should not be use to edit information (edit/delete rows) only.
344
+     **/
345 345
     public function display_grid()
346 346
     {
347 347
 
@@ -790,7 +790,7 @@  discard block
 block discarded – undo
790 790
                 //$param[$tablename.'_direction'] = $_GET[$tablename.'_direction'];
791 791
                 $my_get_direction = $_GET[$tablename.'_direction'];
792 792
                 if (!in_array($my_get_direction, array('ASC', 'DESC'))) {
793
-                     $param[$tablename.'_direction'] =  'ASC';
793
+                        $param[$tablename.'_direction'] =  'ASC';
794 794
                 } else {
795 795
                     $param[$tablename.'_direction'] = $my_get_direction;
796 796
                 }
@@ -917,7 +917,7 @@  discard block
 block discarded – undo
917 917
         if (is_array($row)) {
918 918
             foreach ($row as & $value) {
919 919
                 if (empty($value)) {
920
-                     $value = '-';
920
+                        $value = '-';
921 921
                 }
922 922
             }
923 923
         }
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
         $this->per_page = isset($_GET[$this->param_prefix.'per_page']) ? intval($_GET[$this->param_prefix.'per_page']) : $this->per_page;
176 176
 
177 177
         $_SESSION[$this->param_prefix.'per_page']  = $this->per_page;
178
-        $_SESSION[$this->param_prefix.'direction'] = $this->direction ;
178
+        $_SESSION[$this->param_prefix.'direction'] = $this->direction;
179 179
         $_SESSION[$this->param_prefix.'page_nr']   = $this->page_nr;
180 180
         $_SESSION[$this->param_prefix.'column']    = $this->column;
181 181
         $this->pager                               = null;
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
             $params['spacesBeforeSeparator'] = '';
216 216
             $params['spacesAfterSeparator']  = '';
217 217
             $query_vars = array_keys($_GET);
218
-            $query_vars_needed = array ($this->param_prefix.'column', $this->param_prefix.'direction', $this->param_prefix.'per_page');
218
+            $query_vars_needed = array($this->param_prefix.'column', $this->param_prefix.'direction', $this->param_prefix.'per_page');
219 219
             if (count($this->additional_parameters) > 0) {
220 220
                 $query_vars_needed = array_merge($query_vars_needed, array_keys($this->additional_parameters));
221 221
             }
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 
288 288
         if (!$empty_table) {
289 289
             if (!empty($this->additional_parameters)) {
290
-                foreach($this->additional_parameters as $key => $value) {
290
+                foreach ($this->additional_parameters as $key => $value) {
291 291
                     $html .= '<input type="hidden" name ="'.Security::remove_XSS($key).'" value ="'.Security::remove_XSS($value).'" />';
292 292
                 }
293 293
             }
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
                         $html .= '<li><a data-action ="'.$action.'" href="#" onclick="javascript:action_click(this, \''.$table_id.'\');">'.$label.'</a></li>';
313 313
                     }
314 314
                     $html .= '</ul>';
315
-                    $html .= '</div>';//btn-group
315
+                    $html .= '</div>'; //btn-group
316 316
                 $html .= '</div>'; //toolbar
317 317
             } else {
318 318
                 $html .= $form;
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
 
391 391
             $html .= '<div class="clear"></div>';
392 392
             if (count($this->form_actions) > 0) {
393
-                $script= '<script>
393
+                $script = '<script>
394 394
                             /*<![CDATA[*/
395 395
                             function setCheckbox(value) {
396 396
                                  d = document.form_'.$this->table_name.';
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
             }
413 413
         }
414 414
         // Getting the items of the table
415
-        $items = $this->get_clean_html(false);    //no sort
415
+        $items = $this->get_clean_html(false); //no sort
416 416
 
417 417
         // Generation of style classes must be improved. Maybe we need a a table name to create style on the fly:
418 418
         // i.e: .whoisonline_table_grid_container instead of  .grid_container
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
 
481 481
             $html .= '<div class="clear"></div>';
482 482
             if (count($this->form_actions) > 0) {
483
-                $script= '<script>
483
+                $script = '<script>
484 484
                             /*<![CDATA[*/
485 485
                             function setCheckbox(value) {
486 486
                                  d = document.form_'.$this->table_name.';
@@ -586,7 +586,7 @@  discard block
 block discarded – undo
586 586
                     $counter = 0;
587 587
                     foreach ($row as $index => $rowInfo) {
588 588
                         if (!isset($this->columnsToHide[$index])) {
589
-                            $newRow[$counter] = $rowInfo ;
589
+                            $newRow[$counter] = $rowInfo;
590 590
                             $counter++;
591 591
                         }
592 592
                     }
@@ -601,7 +601,7 @@  discard block
 block discarded – undo
601 601
         }
602 602
 
603 603
         if ($this->odd_even_rows_enabled == true) {
604
-            $this->altRowAttributes(0, array ('class' => 'row_odd'), array ('class' => 'row_even'), true);
604
+            $this->altRowAttributes(0, array('class' => 'row_odd'), array('class' => 'row_even'), true);
605 605
         }
606 606
 
607 607
         foreach ($this->th_attributes as $column => $attributes) {
@@ -661,11 +661,11 @@  discard block
 block discarded – undo
661 661
         }
662 662
         $result[] = '<select name="'.$this->param_prefix.'per_page" onchange="javascript: this.form.submit();">';
663 663
         for ($nr = 10; $nr <= min(50, $total_number_of_items); $nr += 10) {
664
-            $result[] = '<option value="'.$nr.'" '. ($nr == $this->per_page ? 'selected="selected"' : '').'>'.$nr.'</option>';
664
+            $result[] = '<option value="'.$nr.'" '.($nr == $this->per_page ? 'selected="selected"' : '').'>'.$nr.'</option>';
665 665
         }
666 666
         // @todo no limits
667 667
         //if ($total_number_of_items < 500) {
668
-            $result[] = '<option value="'.$total_number_of_items.'" '. ($total_number_of_items == $this->per_page ? 'selected="selected"' : '').'>'.api_ucfirst(get_lang('All')).'</option>';
668
+            $result[] = '<option value="'.$total_number_of_items.'" '.($total_number_of_items == $this->per_page ? 'selected="selected"' : '').'>'.api_ucfirst(get_lang('All')).'</option>';
669 669
         //}
670 670
         $result[] = '</select>';
671 671
         $result[] = '<noscript>';
@@ -777,7 +777,7 @@  discard block
 block discarded – undo
777 777
      */
778 778
     public function get_additional_url_paramstring()
779 779
     {
780
-        $param_string_parts = array ();
780
+        $param_string_parts = array();
781 781
         if (is_array($this->additional_parameters) && count($this->additional_parameters) > 0) {
782 782
             foreach ($this->additional_parameters as $key => & $value) {
783 783
                 $param_string_parts[] = urlencode($key).'='.urlencode($value);
@@ -790,7 +790,7 @@  discard block
 block discarded – undo
790 790
                 //$param[$tablename.'_direction'] = $_GET[$tablename.'_direction'];
791 791
                 $my_get_direction = $_GET[$tablename.'_direction'];
792 792
                 if (!in_array($my_get_direction, array('ASC', 'DESC'))) {
793
-                     $param[$tablename.'_direction'] =  'ASC';
793
+                     $param[$tablename.'_direction'] = 'ASC';
794 794
                 } else {
795 795
                     $param[$tablename.'_direction'] = $my_get_direction;
796 796
                 }
@@ -804,7 +804,7 @@  discard block
 block discarded – undo
804 804
             if (isset($_GET[$tablename.'_column'])) {
805 805
                 $param[$tablename.'_column'] = intval($_GET[$tablename.'_column']);
806 806
             }
807
-            $param_string_parts = array ();
807
+            $param_string_parts = array();
808 808
             foreach ($param as $key => & $value) {
809 809
                 $param_string_parts[] = urlencode($key).'='.urlencode($value);
810 810
             }
@@ -824,7 +824,7 @@  discard block
 block discarded – undo
824 824
         $param[$this->param_prefix.'page_nr'] = $this->page_nr;
825 825
         $param[$this->param_prefix.'per_page'] = $this->per_page;
826 826
         $param[$this->param_prefix.'column'] = $this->column;
827
-        $param_string_parts = array ();
827
+        $param_string_parts = array();
828 828
         foreach ($param as $key => & $value) {
829 829
             $param_string_parts[] = urlencode($key).'='.urlencode($value);
830 830
         }
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -808,8 +808,9 @@
 block discarded – undo
808 808
             foreach ($param as $key => & $value) {
809 809
                 $param_string_parts[] = urlencode($key).'='.urlencode($value);
810 810
             }
811
-            if (count($param_string_parts) > 0)
812
-                $result .= '&amp;'.implode('&amp;', $param_string_parts);
811
+            if (count($param_string_parts) > 0) {
812
+                            $result .= '&amp;'.implode('&amp;', $param_string_parts);
813
+            }
813 814
         }
814 815
         return $result;
815 816
     }
Please login to merge, or discard this patch.
main/inc/lib/specific_fields_manager.lib.php 3 patches
Doc Comments   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 
101 101
 /**
102 102
  * @param array $conditions a list of condition (exemple : status=>STUDENT)
103
- * @param array $order_by a list of fields on which sort
103
+ * @param string[] $order_by a list of fields on which sort
104 104
  * @return array An array with all users of the platform.
105 105
  */
106 106
 function get_specific_field_values_list(
@@ -235,6 +235,7 @@  discard block
 block discarded – undo
235 235
  * @param   string  Course code
236 236
  * @param   string  Tool ID
237 237
  * @param   int     Internal ID used in specific tool table
238
+ * @param string $tool_id
238 239
  */
239 240
 function delete_all_values_for_item($course_id, $tool_id, $ref_id) {
240 241
   $table_sf_values = Database :: get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
@@ -248,6 +249,7 @@  discard block
 block discarded – undo
248 249
  * Defaults to the first letter of the name, otherwise iterate through available
249 250
  * letters
250 251
  * @param   string  Name
252
+ * @param string $name
251 253
  * @return  string  One-letter code, upper-case
252 254
  */
253 255
 function get_specific_field_code_from_name($name) {
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Manage specific tools
4
- * @package chamilo.library
5
- */
3
+     * Manage specific tools
4
+     * @package chamilo.library
5
+     */
6 6
 
7 7
 // Database table definitions
8 8
 $table_sf = Database :: get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
@@ -237,10 +237,10 @@  discard block
 block discarded – undo
237 237
  * @param   int     Internal ID used in specific tool table
238 238
  */
239 239
 function delete_all_values_for_item($course_id, $tool_id, $ref_id) {
240
-  $table_sf_values = Database :: get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
241
-  $sql = 'DELETE FROM %s WHERE course_code = \'%s\' AND tool_id = \'%s\' AND ref_id = %s';
242
-  $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id);
243
-  Database::query($sql);
240
+    $table_sf_values = Database :: get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
241
+    $sql = 'DELETE FROM %s WHERE course_code = \'%s\' AND tool_id = \'%s\' AND ref_id = %s';
242
+    $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id);
243
+    Database::query($sql);
244 244
 }
245 245
 
246 246
 /**
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 function delete_specific_field($id)
43 43
 {
44 44
     $table_sf = Database:: get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
45
-    $id = (int)$id;
45
+    $id = (int) $id;
46 46
     if (!is_numeric($id)) {
47 47
         return false;
48 48
     }
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 function edit_specific_field($id, $name)
61 61
 {
62 62
     $table_sf = Database:: get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
63
-    $id = (int)$id;
63
+    $id = (int) $id;
64 64
     if (!is_numeric($id)) {
65 65
         return false;
66 66
     }
Please login to merge, or discard this patch.
main/inc/lib/statsUtils.lib.inc.php 3 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -85,6 +85,7 @@
 block discarded – undo
85 85
     /**
86 86
      * @author Sebastien Piraux <[email protected]>
87 87
      * @param sql : a sql query (as a string)
88
+     * @param integer $X
88 89
      * @desc Return many results of a query in a X column tab
89 90
      * in $resu[$i][0], $resu[$i][1],$resu[$i][2],...
90 91
      * this function is more 'standard' but use a little
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -107,14 +107,14 @@
 block discarded – undo
107 107
         return $resu;
108 108
     }
109 109
 
110
-	/**
111
-	 * @author Sebastien Piraux <[email protected]>
112
-	 * @param sql : a sql query (as a string)
113
-	 * @return hours_array
114
-	 * @desc        Return an assoc array.  Keys are the hours, values are
115
-	 * the number of time this hours was found.
116
-	 * key 'total' return the sum of all number of time hours
117
-	 * appear
110
+    /**
111
+     * @author Sebastien Piraux <[email protected]>
112
+     * @param sql : a sql query (as a string)
113
+     * @return hours_array
114
+     * @desc        Return an assoc array.  Keys are the hours, values are
115
+     * the number of time this hours was found.
116
+     * key 'total' return the sum of all number of time hours
117
+     * appear
118 118
      */
119 119
     public static function hoursTab($sql)
120 120
     {
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
             $last_day = -1;
156 156
             while ($row = Database::fetch_row($res)) {
157 157
                 $date_array = getdate($row[0]);
158
-                $display_date = $date_array['mday'] . ' ' . $MonthsShort[$date_array['mon'] - 1] . ' ' . $date_array['year'];
158
+                $display_date = $date_array['mday'].' '.$MonthsShort[$date_array['mon'] - 1].' '.$date_array['year'];
159 159
                 if ($date_array['mday'] == $last_day) {
160 160
                     $days_array[$display_date]++;
161 161
                 } else {
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
                     &nbsp;
222 222
                 </td>
223 223
                 <td width='10%'>
224
-                    <b>" . get_lang('Hits') . "</b>
224
+                    <b>".get_lang('Hits')."</b>
225 225
                 </td>
226 226
                 <td width='15%'>
227 227
                     <b>%</b>
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
                     echo "<img src='../img/bar_1m.gif' width='1' height='12' alt='$periodPiece : $cpt hits &ndash; $pourcent %' />";
250 250
                 }
251 251
                 if ($pourcent != 100) {
252
-                    echo "<img src='../img/bar_1r.gif' width='" . ($maxSize - $barwidth) . "' height='12' alt='$periodPiece : $cpt hits &ndash; $pourcent %' />";
252
+                    echo "<img src='../img/bar_1r.gif' width='".($maxSize - $barwidth)."' height='12' alt='$periodPiece : $cpt hits &ndash; $pourcent %' />";
253 253
                 }
254 254
                 echo "<img src='../img/bar_1.gif' width='1' height='12' alt='$periodPiece : $cpt hits &ndash; $pourcent %' />
255 255
                     </td>
@@ -265,13 +265,13 @@  discard block
 block discarded – undo
265 265
         }
266 266
         echo "<tr bgcolor='#E6E6E6'>
267 267
                 <td width='15%' align='center'>
268
-                    " . get_lang('Total') . "
268
+                    " . get_lang('Total')."
269 269
                 </td>
270 270
                 <td align='right' width='60%'>
271 271
                     &nbsp;
272 272
                 </td>
273 273
                 <td align='center' width='10%'>
274
-                    " . $period_array['total'] . "
274
+                    " . $period_array['total']."
275 275
                 </td>
276 276
                 <td width='15%'>
277 277
                     &nbsp;
Please login to merge, or discard this patch.