Completed
Push — 1.11.x ( 69878b...1da93a )
by José
64:32 queued 39:16
created
main/inc/lib/add_courses_to_session_functions.lib.php 2 patches
Indentation   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -6,47 +6,47 @@  discard block
 block discarded – undo
6 6
  */
7 7
 class AddCourseToSession
8 8
 {
9
-	/**
10
-	 * Searches a course, given a search string and a type of search box
11
-	 * @param string $needle Search string
12
-	 * @param string $type Type of search box ('single' or anything else)
13
-	 * @return xajaxResponse XajaxResponse
14
-	 * @assert ('abc', 'single') !== null
15
-	 * @assert ('abc', 'multiple') !== null
16
-	 */
17
-	public static function search_courses($needle, $type)
18
-	{
19
-		global $tbl_session_rel_course, $id_session;
9
+    /**
10
+     * Searches a course, given a search string and a type of search box
11
+     * @param string $needle Search string
12
+     * @param string $type Type of search box ('single' or anything else)
13
+     * @return xajaxResponse XajaxResponse
14
+     * @assert ('abc', 'single') !== null
15
+     * @assert ('abc', 'multiple') !== null
16
+     */
17
+    public static function search_courses($needle, $type)
18
+    {
19
+        global $tbl_session_rel_course, $id_session;
20 20
         $tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
21
-		$course_title = null;
22
-		$xajax_response = new xajaxResponse();
23
-		$return = '';
24
-		if(!empty($needle) && !empty($type)) {
25
-			// xajax send utf8 datas... datas in db can be non-utf8 datas
26
-			$charset = api_get_system_encoding();
27
-			$needle = api_convert_encoding($needle, $charset, 'utf-8');
21
+        $course_title = null;
22
+        $xajax_response = new xajaxResponse();
23
+        $return = '';
24
+        if(!empty($needle) && !empty($type)) {
25
+            // xajax send utf8 datas... datas in db can be non-utf8 datas
26
+            $charset = api_get_system_encoding();
27
+            $needle = api_convert_encoding($needle, $charset, 'utf-8');
28 28
 
29
-			$cond_course_code = '';
30
-			if (!empty($id_session)) {
31
-				$id_session = intval($id_session);
32
-				// check course_code from session_rel_course table
33
-				$sql = 'SELECT c_id FROM '.$tbl_session_rel_course.'
29
+            $cond_course_code = '';
30
+            if (!empty($id_session)) {
31
+                $id_session = intval($id_session);
32
+                // check course_code from session_rel_course table
33
+                $sql = 'SELECT c_id FROM '.$tbl_session_rel_course.'
34 34
 						WHERE session_id = '.$id_session;
35
-				$res = Database::query($sql);
36
-				$course_codes = '';
37
-				if (Database::num_rows($res) > 0) {
38
-					while ($row = Database::fetch_row($res)) {
39
-						$course_codes .= '\''.$row[0].'\',';
40
-					}
41
-					$course_codes = substr($course_codes,0,(strlen($course_codes)-1));
35
+                $res = Database::query($sql);
36
+                $course_codes = '';
37
+                if (Database::num_rows($res) > 0) {
38
+                    while ($row = Database::fetch_row($res)) {
39
+                        $course_codes .= '\''.$row[0].'\',';
40
+                    }
41
+                    $course_codes = substr($course_codes,0,(strlen($course_codes)-1));
42 42
 
43
-					$cond_course_code = ' AND course.id NOT IN('.$course_codes.') ';
44
-				}
45
-			}
43
+                    $cond_course_code = ' AND course.id NOT IN('.$course_codes.') ';
44
+                }
45
+            }
46 46
 
47 47
             if ($type == 'single') {
48
-				// search users where username or firstname or lastname begins likes $needle
49
-				$sql = 'SELECT
48
+                // search users where username or firstname or lastname begins likes $needle
49
+                $sql = 'SELECT
50 50
                             course.id,
51 51
 						 	course.visual_code,
52 52
 						 	course.title,
@@ -58,21 +58,21 @@  discard block
 block discarded – undo
58 58
 						WHERE
59 59
 							course.visual_code LIKE "'.$needle.'%" OR
60 60
 							course.title LIKE "'.$needle.'%"';
61
-			} else {
61
+            } else {
62 62
                 $sql = 'SELECT course.id, course.visual_code, course.title
63 63
 						FROM '.$tbl_course.' course
64 64
 						WHERE
65 65
 							course.visual_code LIKE "'.$needle.'%" '.$cond_course_code.'
66 66
 						ORDER BY course.code ';
67
-			}
67
+            }
68 68
 
69
-			if (api_is_multiple_url_enabled()) {
70
-				$tbl_course_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
71
-				$access_url_id = api_get_current_access_url_id();
72
-				if ($access_url_id != -1){
69
+            if (api_is_multiple_url_enabled()) {
70
+                $tbl_course_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
71
+                $access_url_id = api_get_current_access_url_id();
72
+                if ($access_url_id != -1){
73 73
 
74
-					if ($type=='single') {
75
-						$sql = 'SELECT
74
+                    if ($type=='single') {
75
+                        $sql = 'SELECT
76 76
                                     course.id,
77 77
 						            course.visual_code,
78 78
 						            course.title,
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 									access_url_id = '.$access_url_id.' AND
88 88
 									(course.visual_code LIKE "'.$needle.'%" OR
89 89
 									course.title LIKE "'.$needle.'%" )';
90
-					} else {
90
+                    } else {
91 91
                         $sql = 'SELECT course.id, course.visual_code, course.title
92 92
 								FROM '.$tbl_course.' course, '.$tbl_course_rel_access_url.' url_course
93 93
 								WHERE
@@ -95,32 +95,32 @@  discard block
 block discarded – undo
95 95
 									access_url_id = '.$access_url_id.' AND
96 96
 									course.visual_code LIKE "'.$needle.'%" '.$cond_course_code.'
97 97
 								ORDER BY course.code ';
98
-					}
99
-				}
100
-			}
98
+                    }
99
+                }
100
+            }
101 101
 
102
-			$rs = Database::query($sql);
103
-			$course_list = array();
102
+            $rs = Database::query($sql);
103
+            $course_list = array();
104 104
             if ($type == 'single') {
105
-				while ($course = Database :: fetch_array($rs)) {
106
-					$course_list[] = $course['code'];
107
-					$course_title=str_replace("'","\'",$course_title);
105
+                while ($course = Database :: fetch_array($rs)) {
106
+                    $course_list[] = $course['code'];
107
+                    $course_title=str_replace("'","\'",$course_title);
108 108
                     $return .= '<a href="javascript: void(0);" onclick="javascript: add_course_to_session(\''.$course['id'].'\',\''.$course_title.' ('.$course['visual_code'].')'.'\')">'.$course['title'].' ('.$course['visual_code'].')</a><br />';
109
-				}
110
-				$xajax_response -> addAssign('ajax_list_courses_single','innerHTML',api_utf8_encode($return));
111
-			} else {
112
-				$return .= '<select id="origin" name="NoSessionCoursesList[]" multiple="multiple" size="20" style="width:340px;">';
113
-				while($course = Database :: fetch_array($rs)) {
114
-					$course_list[] = $course['code'];
115
-					$course_title=str_replace("'","\'",$course_title);
109
+                }
110
+                $xajax_response -> addAssign('ajax_list_courses_single','innerHTML',api_utf8_encode($return));
111
+            } else {
112
+                $return .= '<select id="origin" name="NoSessionCoursesList[]" multiple="multiple" size="20" style="width:340px;">';
113
+                while($course = Database :: fetch_array($rs)) {
114
+                    $course_list[] = $course['code'];
115
+                    $course_title=str_replace("'","\'",$course_title);
116 116
                     $return .= '<option value="'.$course['id'].'" title="'.htmlspecialchars($course['title'].' ('.$course['visual_code'].')',ENT_QUOTES).'">'.$course['title'].' ('.$course['visual_code'].')</option>';
117
-				}
118
-				$return .= '</select>';
119
-				$xajax_response -> addAssign('ajax_list_courses_multiple','innerHTML',api_utf8_encode($return));
120
-			}
121
-		}
122
-		$_SESSION['course_list'] = $course_list;
117
+                }
118
+                $return .= '</select>';
119
+                $xajax_response -> addAssign('ajax_list_courses_multiple','innerHTML',api_utf8_encode($return));
120
+            }
121
+        }
122
+        $_SESSION['course_list'] = $course_list;
123 123
 
124
-		return $xajax_response;
125
-	}
124
+        return $xajax_response;
125
+    }
126 126
 }
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 		$course_title = null;
22 22
 		$xajax_response = new xajaxResponse();
23 23
 		$return = '';
24
-		if(!empty($needle) && !empty($type)) {
24
+		if (!empty($needle) && !empty($type)) {
25 25
 			// xajax send utf8 datas... datas in db can be non-utf8 datas
26 26
 			$charset = api_get_system_encoding();
27 27
 			$needle = api_convert_encoding($needle, $charset, 'utf-8');
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 					while ($row = Database::fetch_row($res)) {
39 39
 						$course_codes .= '\''.$row[0].'\',';
40 40
 					}
41
-					$course_codes = substr($course_codes,0,(strlen($course_codes)-1));
41
+					$course_codes = substr($course_codes, 0, (strlen($course_codes) - 1));
42 42
 
43 43
 					$cond_course_code = ' AND course.id NOT IN('.$course_codes.') ';
44 44
 				}
@@ -69,9 +69,9 @@  discard block
 block discarded – undo
69 69
 			if (api_is_multiple_url_enabled()) {
70 70
 				$tbl_course_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
71 71
 				$access_url_id = api_get_current_access_url_id();
72
-				if ($access_url_id != -1){
72
+				if ($access_url_id != -1) {
73 73
 
74
-					if ($type=='single') {
74
+					if ($type == 'single') {
75 75
 						$sql = 'SELECT
76 76
                                     course.id,
77 77
 						            course.visual_code,
@@ -104,19 +104,19 @@  discard block
 block discarded – undo
104 104
             if ($type == 'single') {
105 105
 				while ($course = Database :: fetch_array($rs)) {
106 106
 					$course_list[] = $course['code'];
107
-					$course_title=str_replace("'","\'",$course_title);
107
+					$course_title = str_replace("'", "\'", $course_title);
108 108
                     $return .= '<a href="javascript: void(0);" onclick="javascript: add_course_to_session(\''.$course['id'].'\',\''.$course_title.' ('.$course['visual_code'].')'.'\')">'.$course['title'].' ('.$course['visual_code'].')</a><br />';
109 109
 				}
110
-				$xajax_response -> addAssign('ajax_list_courses_single','innerHTML',api_utf8_encode($return));
110
+				$xajax_response -> addAssign('ajax_list_courses_single', 'innerHTML', api_utf8_encode($return));
111 111
 			} else {
112 112
 				$return .= '<select id="origin" name="NoSessionCoursesList[]" multiple="multiple" size="20" style="width:340px;">';
113
-				while($course = Database :: fetch_array($rs)) {
113
+				while ($course = Database :: fetch_array($rs)) {
114 114
 					$course_list[] = $course['code'];
115
-					$course_title=str_replace("'","\'",$course_title);
116
-                    $return .= '<option value="'.$course['id'].'" title="'.htmlspecialchars($course['title'].' ('.$course['visual_code'].')',ENT_QUOTES).'">'.$course['title'].' ('.$course['visual_code'].')</option>';
115
+					$course_title = str_replace("'", "\'", $course_title);
116
+                    $return .= '<option value="'.$course['id'].'" title="'.htmlspecialchars($course['title'].' ('.$course['visual_code'].')', ENT_QUOTES).'">'.$course['title'].' ('.$course['visual_code'].')</option>';
117 117
 				}
118 118
 				$return .= '</select>';
119
-				$xajax_response -> addAssign('ajax_list_courses_multiple','innerHTML',api_utf8_encode($return));
119
+				$xajax_response -> addAssign('ajax_list_courses_multiple', 'innerHTML', api_utf8_encode($return));
120 120
 			}
121 121
 		}
122 122
 		$_SESSION['course_list'] = $course_list;
Please login to merge, or discard this patch.
plugin/bbb/start.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
  * @package chamilo.plugin.bigbluebutton
5 5
  */
6 6
 
7
-require __DIR__ . '/../../vendor/autoload.php';
7
+require __DIR__.'/../../vendor/autoload.php';
8 8
 
9 9
 $course_plugin = 'bbb'; //needed in order to load the plugin lang variables
10 10
 require_once __DIR__.'/config.php';
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 $host = '';
17 17
 $salt = '';
18 18
 $isGlobal = isset($_GET['global']) ? true : false;
19
-$isGlobalPerUser = isset($_GET['user_id']) ? (int) $_GET['user_id']: false;
19
+$isGlobalPerUser = isset($_GET['user_id']) ? (int) $_GET['user_id'] : false;
20 20
 $bbb = new bbb('', '', $isGlobal, $isGlobalPerUser);
21 21
 
22 22
 if ($bbb->pluginEnabled) {
@@ -24,16 +24,16 @@  discard block
 block discarded – undo
24 24
 
25 25
         if (isset($_GET['launch']) && $_GET['launch'] == 1) {
26 26
 
27
-            if (file_exists(__DIR__ . '/config.vm.php')) {
28
-                $config = require __DIR__ . '/config.vm.php';
27
+            if (file_exists(__DIR__.'/config.vm.php')) {
28
+                $config = require __DIR__.'/config.vm.php';
29 29
                 $vmIsEnabled = true;
30 30
                 $host = '';
31 31
                 $salt = '';
32 32
 
33
-                require __DIR__ . '/lib/vm/AbstractVM.php';
34
-                require __DIR__ . '/lib/vm/VMInterface.php';
35
-                require __DIR__ . '/lib/vm/DigitalOceanVM.php';
36
-                require __DIR__ . '/lib/VM.php';
33
+                require __DIR__.'/lib/vm/AbstractVM.php';
34
+                require __DIR__.'/lib/vm/VMInterface.php';
35
+                require __DIR__.'/lib/vm/DigitalOceanVM.php';
36
+                require __DIR__.'/lib/VM.php';
37 37
 
38 38
                 $vm = new VM($config);
39 39
 
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
             }
70 70
         } else {
71 71
             $url = $bbb->getListingUrl();
72
-            header('Location: ' . $url);
72
+            header('Location: '.$url);
73 73
             exit;
74 74
         }
75 75
     } else {
Please login to merge, or discard this patch.
main/exercise/hotpotatoes_exercise_report.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 }
45 45
 
46 46
 if (!$is_allowedToEdit) {
47
-   // api_not_allowed();
47
+    // api_not_allowed();
48 48
 }
49 49
 
50 50
 if (!empty($_REQUEST['path'])) {
@@ -189,8 +189,8 @@  discard block
 block discarded – undo
189 189
         get_lang('Actions')
190 190
     );
191 191
 
192
-  // Column config
193
-  // @todo fix search firstname/lastname that doesn't work. rmove search for the moment
192
+    // Column config
193
+    // @todo fix search firstname/lastname that doesn't work. rmove search for the moment
194 194
     $column_model = array(
195 195
         array('name' => 'firstname', 'index' => 'firstname', 'width' => '50', 'align' => 'left', 'search' => 'false'),
196 196
         array(
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -73,11 +73,11 @@  discard block
 block discarded – undo
73 73
     // the form
74 74
     if (api_is_platform_admin() || api_is_course_admin() || api_is_course_tutor() || api_is_course_coach()) {
75 75
         $actions .= '<a id="export_opener" href="'.api_get_self().'?export_report=1&path='.$hotpotatoes_path.' ">'.
76
-            Display::return_icon('save.png',   get_lang('Export'),'',ICON_SIZE_MEDIUM).'</a>';
76
+            Display::return_icon('save.png', get_lang('Export'), '', ICON_SIZE_MEDIUM).'</a>';
77 77
     }
78 78
 } else {
79
-    $actions .= '<a href="exercise.php">' .
80
-        Display :: return_icon('back.png', get_lang('GoBackToQuestionList'),'',ICON_SIZE_MEDIUM).'</a>';
79
+    $actions .= '<a href="exercise.php">'.
80
+        Display :: return_icon('back.png', get_lang('GoBackToQuestionList'), '', ICON_SIZE_MEDIUM).'</a>';
81 81
 }
82 82
 
83 83
 if ($is_allowedToEdit) {
@@ -99,13 +99,13 @@  discard block
 block discarded – undo
99 99
 
100 100
 if ($is_allowedToEdit || $is_tutor) {
101 101
     $nameTools = get_lang('StudentScore');
102
-    $interbreadcrumb[] = array("url" => "exercise.php","name" => get_lang('Exercises'));
102
+    $interbreadcrumb[] = array("url" => "exercise.php", "name" => get_lang('Exercises'));
103 103
     $objExerciseTmp = new Exercise();
104 104
     /*if ($objExerciseTmp->read($exercise_id)) {
105 105
         $interbreadcrumb[] = array("url" => "admin.php?exerciseId=".$exercise_id, "name" => $objExerciseTmp->name);
106 106
     }*/
107 107
 } else {
108
-    $interbreadcrumb[] = array("url" => "exercise.php","name" => get_lang('Exercises'));
108
+    $interbreadcrumb[] = array("url" => "exercise.php", "name" => get_lang('Exercises'));
109 109
     $objExerciseTmp = new Exercise();
110 110
     /*if ($objExerciseTmp->read($exercise_id)) {
111 111
         $nameTools = get_lang('Results').': '.$objExerciseTmp->name;
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 // Generating group list
169 169
 
170 170
 $group_list = GroupManager::get_group_list();
171
-$group_parameters = array('group_all:'.get_lang('All'),'group_none:'.get_lang('None'));
171
+$group_parameters = array('group_all:'.get_lang('All'), 'group_none:'.get_lang('None'));
172 172
 
173 173
 foreach ($group_list as $group) {
174 174
     $group_parameters[] = $group['id'].':'.$group['name'];
Please login to merge, or discard this patch.
main/work/work.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  **/
9 9
 
10 10
 require_once '../inc/global.inc.php';
11
-$current_course_tool  = TOOL_STUDENTPUBLICATION;
11
+$current_course_tool = TOOL_STUDENTPUBLICATION;
12 12
 
13 13
 api_protect_course_script(true);
14 14
 
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 $item_id = isset($_REQUEST['item_id']) ? intval($_REQUEST['item_id']) : null;
39 39
 $origin = isset($_REQUEST['origin']) ? Security::remove_XSS($_REQUEST['origin']) : '';
40 40
 $course_dir = api_get_path(SYS_COURSE_PATH).$courseInfo['path'];
41
-$base_work_dir = $course_dir . '/work';
41
+$base_work_dir = $course_dir.'/work';
42 42
 $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'list';
43 43
 
44 44
 //Download folder
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         'url' => api_get_path(WEB_CODE_PATH).'work/work.php?'.api_get_cidreq(),
76 76
         'name' => get_lang('StudentPublications'),
77 77
     );
78
-    $url_dir = api_get_path(WEB_CODE_PATH).'work/work.php?&id=' . $work_id.'&'.api_get_cidreq();
78
+    $url_dir = api_get_path(WEB_CODE_PATH).'work/work.php?&id='.$work_id.'&'.api_get_cidreq();
79 79
     if (!empty($my_folder_data)) {
80 80
         $interbreadcrumb[] = array('url' => $url_dir, 'name' =>  $my_folder_data['title']);
81 81
     }
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
             $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('EditToolOptions'));
119 119
         }
120 120
         if ($action == 'create_dir') {
121
-            $interbreadcrumb[] = array('url' => '#','name' => get_lang('CreateAssignment'));
121
+            $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('CreateAssignment'));
122 122
         }
123 123
     }
124 124
 }
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
         $form = new FormValidator(
169 169
             'form1',
170 170
             'post',
171
-            api_get_path(WEB_CODE_PATH) . 'work/work.php?action=create_dir&' . api_get_cidreq()
171
+            api_get_path(WEB_CODE_PATH).'work/work.php?action=create_dir&'.api_get_cidreq()
172 172
         );
173 173
         $form->addElement('header', get_lang('CreateAssignment'));
174 174
         $form->addElement('hidden', 'action', 'add');
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
             $result = deleteDirWork($_REQUEST['id']);
206 206
             if ($result) {
207 207
                 $message = Display::return_message(
208
-                    get_lang('DirDeleted') . ': ' . $work_to_delete['title'],
208
+                    get_lang('DirDeleted').': '.$work_to_delete['title'],
209 209
                     'success'
210 210
                 );
211 211
                 Display::addFlash($message);
@@ -236,16 +236,16 @@  discard block
 block discarded – undo
236 236
             if ($move_to_path == -1) {
237 237
                 $move_to_path = '/';
238 238
             } elseif (substr($move_to_path, -1, 1) != '/') {
239
-                $move_to_path = $move_to_path .'/';
239
+                $move_to_path = $move_to_path.'/';
240 240
             }
241 241
 
242 242
             // Security fix: make sure they can't move files that are not in the document table
243 243
             if ($path = get_work_path($item_id)) {
244
-                if (move($course_dir.'/'.$path, $base_work_dir . $move_to_path)) {
244
+                if (move($course_dir.'/'.$path, $base_work_dir.$move_to_path)) {
245 245
                     // Update db
246 246
                     updateWorkUrl(
247 247
                         $item_id,
248
-                        'work' . $move_to_path,
248
+                        'work'.$move_to_path,
249 249
                         $_REQUEST['move_to_id']
250 250
                     );
251 251
 
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
             $content .= '</div>';
345 345
             $content .= '</div>';
346 346
             $content .= '<div id="student-list-work" style="display: none" class="table-responsive">';
347
-            $content .= '<div class="toolbar"><a id="closed-view-list" href="#"><em class="fa fa-times-circle"></em> ' .get_lang('Close'). '</a></div>';
347
+            $content .= '<div class="toolbar"><a id="closed-view-list" href="#"><em class="fa fa-times-circle"></em> '.get_lang('Close').'</a></div>';
348 348
             $content .= showStudentList($work_id);
349 349
             $content .= '</div>';
350 350
         } else {
Please login to merge, or discard this patch.
app/SymfonyRequirements.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
      * Adds a mandatory requirement in form of a php.ini configuration.
221 221
      *
222 222
      * @param string        $cfgName           The configuration name used for ini_get()
223
-     * @param bool|callback $evaluation        Either a boolean indicating whether the configuration should evaluate to true or false,
223
+     * @param boolean|string $evaluation        Either a boolean indicating whether the configuration should evaluate to true or false,
224 224
      *                                         or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
225 225
      * @param bool          $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
226 226
      *                                         This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
      * Adds an optional recommendation in form of a php.ini configuration.
239 239
      *
240 240
      * @param string        $cfgName           The configuration name used for ini_get()
241
-     * @param bool|callback $evaluation        Either a boolean indicating whether the configuration should evaluate to true or false,
241
+     * @param string|false $evaluation        Either a boolean indicating whether the configuration should evaluate to true or false,
242 242
      *                                         or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
243 243
      * @param bool          $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
244 244
      *                                         This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
Please login to merge, or discard this patch.
main/lp/learnpathItem.class.php 2 patches
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1869,7 +1869,7 @@  discard block
 block discarded – undo
1869 1869
 
1870 1870
     /**
1871 1871
      * Get the extra terms (tags) that identify this item
1872
-     * @return mixed
1872
+     * @return string
1873 1873
      */
1874 1874
     public function get_terms()
1875 1875
     {
@@ -2069,7 +2069,7 @@  discard block
 block discarded – undo
2069 2069
 
2070 2070
     /**
2071 2071
      * Opens/launches the item. Initialises runtime values.
2072
-     * @return    boolean    True on success, false on failure.
2072
+     * @return    boolean|null    True on success, false on failure.
2073 2073
      */
2074 2074
     public function open($allow_new_attempt = false)
2075 2075
     {
@@ -3504,7 +3504,7 @@  discard block
 block discarded – undo
3504 3504
 
3505 3505
     /**
3506 3506
      * Checks if the current status is part of the list of status given
3507
-     * @param  array  $list  An array of status to check for.
3507
+     * @param  string[]  $list  An array of status to check for.
3508 3508
      * If the current status is one of the strings, return true
3509 3509
      *
3510 3510
      * @return boolean True if the status was one of the given strings,
@@ -3681,7 +3681,7 @@  discard block
 block discarded – undo
3681 3681
     /**
3682 3682
      * Write objectives to DB. This method is separate from write_to_db() because otherwise
3683 3683
      * objectives are lost as a side effect to AJAX and session concurrent access
3684
-     * @return    boolean        True or false on error
3684
+     * @return    boolean|null        True or false on error
3685 3685
      */
3686 3686
     public function write_objectives_to_db()
3687 3687
     {
@@ -4322,7 +4322,7 @@  discard block
 block discarded – undo
4322 4322
      * Removes the relation between the current item and an audio file. The file
4323 4323
      * is only removed from the lp_item table, but remains in the document table
4324 4324
      * and directory
4325
-     * @return bool
4325
+     * @return false|null
4326 4326
      */
4327 4327
     public function remove_audio()
4328 4328
     {
Please login to merge, or discard this patch.
Spacing   +243 added lines, -243 removed lines patch added patch discarded remove patch
@@ -199,13 +199,13 @@  discard block
 block discarded – undo
199 199
             $res = Database::query($sql);
200 200
             if (Database::num_rows($res) > 0) {
201 201
                 $se_ref = Database::fetch_array($res);
202
-                $this->search_did = (int)$se_ref['search_did'];
202
+                $this->search_did = (int) $se_ref['search_did'];
203 203
             }
204 204
         }
205 205
         $this->audio = $row['audio'];
206 206
         if (self::debug > 0) {
207 207
             error_log(
208
-                'New LP - End of learnpathItem constructor for item ' . $id,
208
+                'New LP - End of learnpathItem constructor for item '.$id,
209 209
                 0
210 210
             );
211 211
         }
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
     public function delete()
315 315
     {
316 316
         if (self::debug > 0) {
317
-            error_log('learnpath_item::delete() for item ' . $this->db_id, 0);
317
+            error_log('learnpath_item::delete() for item '.$this->db_id, 0);
318 318
         }
319 319
         $lp_item_view = Database::get_course_table(TABLE_LP_ITEM_VIEW);
320 320
         $lp_item = Database::get_course_table(TABLE_LP_ITEM);
@@ -322,29 +322,29 @@  discard block
 block discarded – undo
322 322
         $course_id = api_get_course_int_id();
323 323
 
324 324
         $sql = "DELETE FROM $lp_item_view
325
-                WHERE c_id = $course_id AND lp_item_id = " . $this->db_id;
325
+                WHERE c_id = $course_id AND lp_item_id = ".$this->db_id;
326 326
         if (self::debug > 0) {
327
-            error_log('Deleting from lp_item_view: ' . $sql, 0);
327
+            error_log('Deleting from lp_item_view: '.$sql, 0);
328 328
         }
329 329
         Database::query($sql);
330 330
 
331 331
         $sql = "SELECT * FROM $lp_item
332
-                WHERE c_id = $course_id AND id = " . $this->db_id;
332
+                WHERE c_id = $course_id AND id = ".$this->db_id;
333 333
         $res_sel = Database::query($sql);
334 334
         if (Database::num_rows($res_sel) < 1) {
335 335
             return false;
336 336
         }
337 337
 
338 338
         $sql = "DELETE FROM $lp_item
339
-                WHERE c_id = $course_id AND id = " . $this->db_id;
339
+                WHERE c_id = $course_id AND id = ".$this->db_id;
340 340
         Database::query($sql);
341 341
         if (self::debug > 0) {
342
-            error_log('Deleting from lp_item: ' . $sql);
342
+            error_log('Deleting from lp_item: '.$sql);
343 343
         }
344 344
 
345 345
         if (api_get_setting('search_enabled') == 'true') {
346 346
             if (!is_null($this->search_did)) {
347
-                require_once api_get_path(LIBRARY_PATH) . 'search/ChamiloIndexer.class.php';
347
+                require_once api_get_path(LIBRARY_PATH).'search/ChamiloIndexer.class.php';
348 348
                 $di = new ChamiloIndexer();
349 349
                 $di->remove_document($this->search_did);
350 350
             }
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
     {
381 381
         if (self::debug > 0) {
382 382
             error_log(
383
-                'learnpathItem::get_attempt_id() on item ' . $this->db_id,
383
+                'learnpathItem::get_attempt_id() on item '.$this->db_id,
384 384
                 0
385 385
             );
386 386
         }
@@ -390,8 +390,8 @@  discard block
 block discarded – undo
390 390
         }
391 391
         if (self::debug > 0) {
392 392
             error_log(
393
-                'New LP - End of learnpathItem::get_attempt_id() on item ' .
394
-                $this->db_id . ' - Returning ' . $res,
393
+                'New LP - End of learnpathItem::get_attempt_id() on item '.
394
+                $this->db_id.' - Returning '.$res,
395 395
                 0
396 396
             );
397 397
         }
@@ -453,12 +453,12 @@  discard block
 block discarded – undo
453 453
             if (self::debug > 2) {
454 454
                 error_log(
455 455
                     'learnpathItem::get_credit() - get_prevent_reinit!=0 and '.
456
-                    'status is ' . $status,
456
+                    'status is '.$status,
457 457
                     0
458 458
                 );
459 459
             }
460 460
             //0=not attempted - 1 = incomplete
461
-            if ($status != $this->possible_status[0]&&
461
+            if ($status != $this->possible_status[0] &&
462 462
                 $status != $this->possible_status[1]
463 463
             ) {
464 464
                 $credit = 'no-credit';
@@ -530,13 +530,13 @@  discard block
 block discarded – undo
530 530
                 case TOOL_DOCUMENT:
531 531
                     $table_doc = Database::get_course_table(TABLE_DOCUMENT);
532 532
                     $sql = 'SELECT path
533
-                            FROM ' . $table_doc . '
533
+                            FROM ' . $table_doc.'
534 534
                             WHERE
535
-                                c_id = ' . $course_id . ' AND
535
+                                c_id = ' . $course_id.' AND
536 536
                                 id = ' . $path;
537 537
                     $res = Database::query($sql);
538 538
                     $row = Database::fetch_array($res);
539
-                    $real_path = 'document' . $row['path'];
539
+                    $real_path = 'document'.$row['path'];
540 540
                     return $real_path;
541 541
                 case TOOL_STUDENTPUBLICATION:
542 542
                 case TOOL_QUIZ:
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
             }
549 549
         } else {
550 550
             if (!empty($path_to_scorm_dir)) {
551
-                $path = $path_to_scorm_dir . $path;
551
+                $path = $path_to_scorm_dir.$path;
552 552
             }
553 553
             return $path;
554 554
         }
@@ -584,8 +584,8 @@  discard block
 block discarded – undo
584 584
         $sql = "SELECT id FROM $tbl
585 585
                 WHERE
586 586
                     c_id = $course_id AND
587
-                    lp_item_id = " . $this->db_id . " AND
588
-                    lp_view_id = " . $this->view_id . " AND
587
+                    lp_item_id = ".$this->db_id." AND
588
+                    lp_view_id = " . $this->view_id." AND
589 589
                     view_count = " . $this->attempt_id;
590 590
         $res = Database::query($sql);
591 591
         if (Database::num_rows($res) > 0) {
@@ -628,8 +628,8 @@  discard block
 block discarded – undo
628 628
             $sql = "SELECT id FROM $tbl
629 629
                     WHERE
630 630
                         c_id = $course_id AND
631
-                        lp_item_id = " . $this->db_id . " AND
632
-                        lp_view_id = " . $this->view_id ." AND
631
+                        lp_item_id = ".$this->db_id." AND
632
+                        lp_view_id = " . $this->view_id." AND
633 633
                         view_count = " . $this->get_attempt_id();
634 634
             $res = Database::query($sql);
635 635
             if (Database::num_rows($res) > 0) {
@@ -669,13 +669,13 @@  discard block
 block discarded – undo
669 669
         foreach ($this->interactions as $id => $in) {
670 670
             $return .= "[
671 671
                 '$id',
672
-                '" . $in[1] . "',
673
-                '" . $in[2] . "',
674
-                '" . $in[3] . "',
675
-                '" . $in[4] . "',
676
-                '" . $in[5] . "',
677
-                '" . $in[6] . "',
678
-                '" . $in[7] . "'],";
672
+                '".$in[1]."',
673
+                '" . $in[2]."',
674
+                '" . $in[3]."',
675
+                '" . $in[4]."',
676
+                '" . $in[5]."',
677
+                '" . $in[6]."',
678
+                '" . $in[7]."'],";
679 679
         }
680 680
         if (!empty($return)) {
681 681
             $return = substr($return, 0, -1);
@@ -917,7 +917,7 @@  discard block
 block discarded – undo
917 917
                 $table = Database::get_course_table(TABLE_LP_MAIN);
918 918
                 $sql = "SELECT prevent_reinit
919 919
                     FROM $table
920
-                    WHERE c_id = $course_id AND id = " . $this->lp_id;
920
+                    WHERE c_id = $course_id AND id = ".$this->lp_id;
921 921
                 $res = Database::query($sql);
922 922
                 if (Database::num_rows($res) < 1) {
923 923
                     $this->error = "Could not find parent learnpath in lp table";
@@ -939,7 +939,7 @@  discard block
 block discarded – undo
939 939
         }
940 940
         if (self::debug > 2) {
941 941
             error_log(
942
-                'New LP - End of learnpathItem::get_prevent_reinit() - Returned ' . $this->prevent_reinit,
942
+                'New LP - End of learnpathItem::get_prevent_reinit() - Returned '.$this->prevent_reinit,
943 943
                 0
944 944
             );
945 945
         }
@@ -964,7 +964,7 @@  discard block
 block discarded – undo
964 964
                 $table = Database::get_course_table(TABLE_LP_MAIN);
965 965
                 $sql = "SELECT seriousgame_mode
966 966
                         FROM $table
967
-                        WHERE c_id = $course_id AND id = " . $this->lp_id;
967
+                        WHERE c_id = $course_id AND id = ".$this->lp_id;
968 968
                 $res = Database::query($sql);
969 969
                 if (Database::num_rows($res) < 1) {
970 970
                     $this->error = "Could not find parent learnpath in learnpath table";
@@ -985,7 +985,7 @@  discard block
 block discarded – undo
985 985
         }
986 986
         if (self::debug > 2) {
987 987
             error_log(
988
-                'New LP - End of learnpathItem::get_seriousgame_mode() - Returned ' . $this->seriousgame_mode,
988
+                'New LP - End of learnpathItem::get_seriousgame_mode() - Returned '.$this->seriousgame_mode,
989 989
                 0
990 990
             );
991 991
         }
@@ -1030,7 +1030,7 @@  discard block
 block discarded – undo
1030 1030
         }
1031 1031
         if (!isset($abs_path)) {
1032 1032
             $path = $this->get_file_path();
1033
-            $abs_path = api_get_path(SYS_COURSE_PATH) . api_get_course_path() . '/' . $path;
1033
+            $abs_path = api_get_path(SYS_COURSE_PATH).api_get_course_path().'/'.$path;
1034 1034
         }
1035 1035
 
1036 1036
         $files_list = array();
@@ -1305,7 +1305,7 @@  discard block
 block discarded – undo
1305 1305
                                                             $abs_path
1306 1306
                                                         );
1307 1307
                                                         $new_abs_path = realpath(
1308
-                                                            $dir . '/' . $second_part
1308
+                                                            $dir.'/'.$second_part
1309 1309
                                                         );
1310 1310
                                                         $in_files_list[] = learnpathItem::get_resources_from_source(
1311 1311
                                                             TOOL_DOCUMENT,
@@ -1343,7 +1343,7 @@  discard block
 block discarded – undo
1343 1343
                                                             $abs_path
1344 1344
                                                         );
1345 1345
                                                         $new_abs_path = realpath(
1346
-                                                            $dir . '/' . $second_part
1346
+                                                            $dir.'/'.$second_part
1347 1347
                                                         );
1348 1348
                                                         $in_files_list[] = learnpathItem::get_resources_from_source(
1349 1349
                                                             TOOL_DOCUMENT,
@@ -1450,7 +1450,7 @@  discard block
 block discarded – undo
1450 1450
                                                             $abs_path
1451 1451
                                                         );
1452 1452
                                                         $new_abs_path = realpath(
1453
-                                                            $dir . '/' . $source
1453
+                                                            $dir.'/'.$source
1454 1454
                                                         );
1455 1455
                                                         $in_files_list[] = learnpathItem::get_resources_from_source(
1456 1456
                                                             TOOL_DOCUMENT,
@@ -1488,7 +1488,7 @@  discard block
 block discarded – undo
1488 1488
                                                             $abs_path
1489 1489
                                                         );
1490 1490
                                                         $new_abs_path = realpath(
1491
-                                                            $dir . '/' . $source
1491
+                                                            $dir.'/'.$source
1492 1492
                                                         );
1493 1493
                                                         $in_files_list[] = learnpathItem::get_resources_from_source(
1494 1494
                                                             TOOL_DOCUMENT,
@@ -1572,7 +1572,7 @@  discard block
 block discarded – undo
1572 1572
                                                 );
1573 1573
                                                 $dir = dirname($abs_path);
1574 1574
                                                 $new_abs_path = realpath(
1575
-                                                    $dir . '/' . $source
1575
+                                                    $dir.'/'.$source
1576 1576
                                                 );
1577 1577
                                                 $in_files_list[] = learnpathItem::get_resources_from_source(
1578 1578
                                                     TOOL_DOCUMENT,
@@ -1617,7 +1617,7 @@  discard block
 block discarded – undo
1617 1617
                                                 );
1618 1618
                                                 $dir = dirname($abs_path);
1619 1619
                                                 $new_abs_path = realpath(
1620
-                                                    $dir . '/' . $source
1620
+                                                    $dir.'/'.$source
1621 1621
                                                 );
1622 1622
                                                 $in_files_list[] = learnpathItem::get_resources_from_source(
1623 1623
                                                     TOOL_DOCUMENT,
@@ -1677,7 +1677,7 @@  discard block
 block discarded – undo
1677 1677
         }
1678 1678
         if (self::debug > 1) {
1679 1679
             error_log(
1680
-                'New LP - Out of learnpathItem::get_score() - returning ' . $res,
1680
+                'New LP - Out of learnpathItem::get_score() - returning '.$res,
1681 1681
                 0
1682 1682
             );
1683 1683
         }
@@ -1697,7 +1697,7 @@  discard block
 block discarded – undo
1697 1697
         $course_id = api_get_course_int_id();
1698 1698
         $debug = self::debug;
1699 1699
         if ($debug > 0) {
1700
-            error_log('learnpathItem::get_status() on item ' . $this->db_id, 0);
1700
+            error_log('learnpathItem::get_status() on item '.$this->db_id, 0);
1701 1701
         }
1702 1702
         if ($check_db) {
1703 1703
             if ($debug > 2) {
@@ -1708,12 +1708,12 @@  discard block
 block discarded – undo
1708 1708
                 $sql = "SELECT status FROM $table
1709 1709
                         WHERE
1710 1710
                             c_id = $course_id AND
1711
-                            id = '" . $this->db_item_view_id . "' AND
1712
-                            view_count = '" . $this->get_attempt_id() . "'";
1711
+                            id = '".$this->db_item_view_id."' AND
1712
+                            view_count = '" . $this->get_attempt_id()."'";
1713 1713
 
1714 1714
                 if ($debug > 2) {
1715 1715
                     error_log(
1716
-                        'learnpathItem::get_status() - Checking DB: ' . $sql,
1716
+                        'learnpathItem::get_status() - Checking DB: '.$sql,
1717 1717
                         0
1718 1718
                     );
1719 1719
                 }
@@ -1724,7 +1724,7 @@  discard block
 block discarded – undo
1724 1724
                     if ($update_local) {
1725 1725
                         if ($debug > 2) {
1726 1726
                             error_log(
1727
-                                'learnpathItem::set_status() :' . $row['status'],
1727
+                                'learnpathItem::set_status() :'.$row['status'],
1728 1728
                                 0
1729 1729
                             );
1730 1730
                         }
@@ -1732,7 +1732,7 @@  discard block
 block discarded – undo
1732 1732
                     }
1733 1733
                     if ($debug > 2) {
1734 1734
                         error_log(
1735
-                            'learnpathItem::get_status() - Returning db value ' . $row['status'],
1735
+                            'learnpathItem::get_status() - Returning db value '.$row['status'],
1736 1736
                             0
1737 1737
                         );
1738 1738
                     }
@@ -1749,7 +1749,7 @@  discard block
 block discarded – undo
1749 1749
             if (!empty($this->status)) {
1750 1750
                 if ($debug > 2) {
1751 1751
                     error_log(
1752
-                        'learnpathItem::get_status() - Returning attrib: ' . $this->status,
1752
+                        'learnpathItem::get_status() - Returning attrib: '.$this->status,
1753 1753
                         0
1754 1754
                     );
1755 1755
                 }
@@ -1759,7 +1759,7 @@  discard block
 block discarded – undo
1759 1759
 
1760 1760
         if ($debug > 2) {
1761 1761
             error_log(
1762
-                'learnpathItem::get_status() - Returning default ' . $this->possible_status[0],
1762
+                'learnpathItem::get_status() - Returning default '.$this->possible_status[0],
1763 1763
                 0
1764 1764
             );
1765 1765
         }
@@ -1799,7 +1799,7 @@  discard block
 block discarded – undo
1799 1799
             if ($origin == 'js') {
1800 1800
                 return '00 : 00: 00';
1801 1801
             } else {
1802
-                return '00 ' . $h . ' 00 \' 00"';
1802
+                return '00 '.$h.' 00 \' 00"';
1803 1803
             }
1804 1804
         } else {
1805 1805
             return api_format_time($time, $origin);
@@ -1824,7 +1824,7 @@  discard block
 block discarded – undo
1824 1824
         if (!isset($given_time)) {
1825 1825
             if (self::debug > 2) {
1826 1826
                 error_log(
1827
-                    'learnpathItem::get_scorm_time(): given time empty, current_start_time = ' . $this->current_start_time,
1827
+                    'learnpathItem::get_scorm_time(): given time empty, current_start_time = '.$this->current_start_time,
1828 1828
                     0
1829 1829
                 );
1830 1830
             }
@@ -1834,8 +1834,8 @@  discard block
 block discarded – undo
1834 1834
                         FROM $table
1835 1835
                         WHERE
1836 1836
                             c_id = $course_id AND
1837
-                            id = '" . $this->db_item_view_id . "' AND
1838
-                            view_count = '" . $this->get_attempt_id() . "'";
1837
+                            id = '".$this->db_item_view_id."' AND
1838
+                            view_count = '" . $this->get_attempt_id()."'";
1839 1839
                 $res = Database::query($sql);
1840 1840
                 $row = Database::fetch_array($res);
1841 1841
                 $start = $row['start_time'];
@@ -1856,7 +1856,7 @@  discard block
 block discarded – undo
1856 1856
         }
1857 1857
         if (self::debug > 2) {
1858 1858
             error_log(
1859
-                'learnpathItem::get_scorm_time(): intermediate = ' . $time,
1859
+                'learnpathItem::get_scorm_time(): intermediate = '.$time,
1860 1860
                 0
1861 1861
             );
1862 1862
         }
@@ -1876,7 +1876,7 @@  discard block
 block discarded – undo
1876 1876
         $sql = "SELECT * FROM $lp_item
1877 1877
                 WHERE
1878 1878
                     c_id = $course_id AND
1879
-                    id='" . intval($this->db_id) . "'";
1879
+                    id='".intval($this->db_id)."'";
1880 1880
         $res = Database::query($sql);
1881 1881
         $row = Database::fetch_array($res);
1882 1882
         return $row['terms'];
@@ -1905,9 +1905,9 @@  discard block
 block discarded – undo
1905 1905
     {
1906 1906
         if (self::debug > 0) {
1907 1907
             error_log(
1908
-                'learnpathItem::get_total_time() for item ' . $this->db_id .
1909
-                ' - Initially, current_start_time = ' . $this->current_start_time .
1910
-                ' and current_stop_time = ' . $this->current_stop_time,
1908
+                'learnpathItem::get_total_time() for item '.$this->db_id.
1909
+                ' - Initially, current_start_time = '.$this->current_start_time.
1910
+                ' and current_stop_time = '.$this->current_stop_time,
1911 1911
                 0
1912 1912
             );
1913 1913
         }
@@ -1948,9 +1948,9 @@  discard block
 block discarded – undo
1948 1948
         } else {
1949 1949
             if (self::debug > 2) {
1950 1950
                 error_log(
1951
-                    'learnpathItem::get_total_time() - Current start time = ' .
1952
-                    $this->current_start_time . ', current stop time = ' .
1953
-                    $this->current_stop_time . ' Returning ' . $time . "-----------\n",
1951
+                    'learnpathItem::get_total_time() - Current start time = '.
1952
+                    $this->current_start_time.', current stop time = '.
1953
+                    $this->current_stop_time.' Returning '.$time."-----------\n",
1954 1954
                     0
1955 1955
                 );
1956 1956
             }
@@ -1970,7 +1970,7 @@  discard block
 block discarded – undo
1970 1970
         }
1971 1971
         if (self::debug > 2) {
1972 1972
             error_log(
1973
-                'learnpathItem::get_type() - Returning ' . $res . ' for item ' . $this->db_id,
1973
+                'learnpathItem::get_type() - Returning '.$res.' for item '.$this->db_id,
1974 1974
                 0
1975 1975
             );
1976 1976
         }
@@ -2010,8 +2010,8 @@  discard block
 block discarded – undo
2010 2010
         if ($this->status_is($completedStatusList)) {
2011 2011
             if (self::debug > 2) {
2012 2012
                 error_log(
2013
-                    'learnpath::is_done() - Item ' . $this->get_id(
2014
-                    ) . ' is complete',
2013
+                    'learnpath::is_done() - Item '.$this->get_id(
2014
+                    ).' is complete',
2015 2015
                     0
2016 2016
                 );
2017 2017
             }
@@ -2020,8 +2020,8 @@  discard block
 block discarded – undo
2020 2020
         } else {
2021 2021
             if (self::debug > 2) {
2022 2022
                 error_log(
2023
-                    'learnpath::is_done() - Item ' . $this->get_id(
2024
-                    ) . ' is not complete',
2023
+                    'learnpath::is_done() - Item '.$this->get_id(
2024
+                    ).' is not complete',
2025 2025
                     0
2026 2026
                 );
2027 2027
             }
@@ -2058,7 +2058,7 @@  discard block
 block discarded – undo
2058 2058
         }
2059 2059
         if (self::debug > 2) {
2060 2060
             error_log(
2061
-                'New LP - End of learnpathItem::is_restart_allowed() - Returning ' . $restart,
2061
+                'New LP - End of learnpathItem::is_restart_allowed() - Returning '.$restart,
2062 2062
                 0
2063 2063
             );
2064 2064
         }
@@ -2137,7 +2137,7 @@  discard block
 block discarded – undo
2137 2137
     {
2138 2138
         if (self::debug > 0) {
2139 2139
             error_log(
2140
-                'learnpathItem::parse_prereq() for learnpath ' . $this->lp_id . ' with string ' . $prereqs_string,
2140
+                'learnpathItem::parse_prereq() for learnpath '.$this->lp_id.' with string '.$prereqs_string,
2141 2141
                 0
2142 2142
             );
2143 2143
         }
@@ -2338,7 +2338,7 @@  discard block
 block discarded – undo
2338 2338
                                 // Strange...
2339 2339
                                 if (self::debug > 1) {
2340 2340
                                     error_log(
2341
-                                        'New LP - Found ~ but strange string: ' . $prereqs_string,
2341
+                                        'New LP - Found ~ but strange string: '.$prereqs_string,
2342 2342
                                         0
2343 2343
                                     );
2344 2344
                                 }
@@ -2366,7 +2366,7 @@  discard block
 block discarded – undo
2366 2366
                                     //  the big brackets-enclosed condition.
2367 2367
                                     if (self::debug > 1) {
2368 2368
                                         error_log(
2369
-                                            'New LP - Dealing with group ' . $gr,
2369
+                                            'New LP - Dealing with group '.$gr,
2370 2370
                                             0
2371 2371
                                         );
2372 2372
                                     }
@@ -2380,7 +2380,7 @@  discard block
 block discarded – undo
2380 2380
                                     ) {
2381 2381
                                         if (self::debug > 1) {
2382 2382
                                             error_log(
2383
-                                                'New LP - Found multiplier ' . $multi[0],
2383
+                                                'New LP - Found multiplier '.$multi[0],
2384 2384
                                                 0
2385 2385
                                             );
2386 2386
                                         }
@@ -2396,7 +2396,7 @@  discard block
 block discarded – undo
2396 2396
                                                     $mytrue++;
2397 2397
                                                     if (self::debug > 1) {
2398 2398
                                                         error_log(
2399
-                                                            'New LP - Found true item, counting.. (' . ($mytrue) . ')',
2399
+                                                            'New LP - Found true item, counting.. ('.($mytrue).')',
2400 2400
                                                             0
2401 2401
                                                         );
2402 2402
                                                     }
@@ -2404,7 +2404,7 @@  discard block
 block discarded – undo
2404 2404
                                             } else {
2405 2405
                                                 if (self::debug > 1) {
2406 2406
                                                     error_log(
2407
-                                                        'New LP - item ' . $cond . ' does not exist in items list',
2407
+                                                        'New LP - item '.$cond.' does not exist in items list',
2408 2408
                                                         0
2409 2409
                                                     );
2410 2410
                                                 }
@@ -2451,7 +2451,7 @@  discard block
 block discarded – undo
2451 2451
                                                 } else {
2452 2452
                                                     if (self::debug > 1) {
2453 2453
                                                         error_log(
2454
-                                                            'New LP - ' .
2454
+                                                            'New LP - '.
2455 2455
                                                             ' Found false item, the set is not true, return false',
2456 2456
                                                             0
2457 2457
                                                         );
@@ -2462,7 +2462,7 @@  discard block
 block discarded – undo
2462 2462
                                             } else {
2463 2463
                                                 if (self::debug > 1) {
2464 2464
                                                     error_log(
2465
-                                                        'New LP - item ' . $cond . ' does not exist in items list',
2465
+                                                        'New LP - item '.$cond.' does not exist in items list',
2466 2466
                                                         0
2467 2467
                                                     );
2468 2468
                                                 }
@@ -2488,7 +2488,7 @@  discard block
 block discarded – undo
2488 2488
                                 //  value of the corresponding resource completion status.
2489 2489
                                 if (self::debug > 1) {
2490 2490
                                     error_log(
2491
-                                        'New LP - Didnt find any group, returning value for ' . $prereqs_string,
2491
+                                        'New LP - Didnt find any group, returning value for '.$prereqs_string,
2492 2492
                                         0
2493 2493
                                     );
2494 2494
                                 }
@@ -2505,14 +2505,14 @@  discard block
 block discarded – undo
2505 2505
                                         if (!$returnstatus) {
2506 2506
                                             if (self::debug > 1) {
2507 2507
                                                 error_log(
2508
-                                                    'New LP - Prerequisite ' . $prereqs_string . ' not complete',
2508
+                                                    'New LP - Prerequisite '.$prereqs_string.' not complete',
2509 2509
                                                     0
2510 2510
                                                 );
2511 2511
                                             }
2512 2512
                                         } else {
2513 2513
                                             if (self::debug > 1) {
2514 2514
                                                 error_log(
2515
-                                                    'New LP - Prerequisite ' . $prereqs_string . ' complete',
2515
+                                                    'New LP - Prerequisite '.$prereqs_string.' complete',
2516 2516
                                                     0
2517 2517
                                                 );
2518 2518
                                             }
@@ -2524,12 +2524,12 @@  discard block
 block discarded – undo
2524 2524
                                             if ($returnstatus) {
2525 2525
                                                 //AND origin_lp_item_id = '.$user_id.'
2526 2526
                                                 $sql = 'SELECT exe_result, exe_weighting
2527
-                                                        FROM ' . Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES) . '
2527
+                                                        FROM ' . Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES).'
2528 2528
                                                         WHERE
2529
-                                                            exe_exo_id = ' . $items[$refs_list[$prereqs_string]]->path . ' AND
2530
-                                                            exe_user_id = ' . $user_id . ' AND
2531
-                                                            orig_lp_id = ' . $this->lp_id . ' AND
2532
-                                                            orig_lp_item_id = ' . $prereqs_string . ' AND
2529
+                                                            exe_exo_id = ' . $items[$refs_list[$prereqs_string]]->path.' AND
2530
+                                                            exe_user_id = ' . $user_id.' AND
2531
+                                                            orig_lp_id = ' . $this->lp_id.' AND
2532
+                                                            orig_lp_item_id = ' . $prereqs_string.' AND
2533 2533
                                                             status <> "incomplete"
2534 2534
                                                         ORDER BY exe_date DESC
2535 2535
                                                         LIMIT 0, 1';
@@ -2567,12 +2567,12 @@  discard block
 block discarded – undo
2567 2567
 
2568 2568
                                             // Checking in the database.
2569 2569
                                             $sql = 'SELECT exe_result, exe_weighting
2570
-                                                    FROM ' . Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES) . '
2570
+                                                    FROM ' . Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES).'
2571 2571
                                                     WHERE
2572
-                                                        exe_exo_id = ' . $items[$refs_list[$prereqs_string]]->path . ' AND
2573
-                                                        exe_user_id = ' . $user_id . ' AND
2574
-                                                        orig_lp_id = ' . $this->lp_id . ' AND
2575
-                                                        orig_lp_item_id = ' . $prereqs_string . ' ';
2572
+                                                        exe_exo_id = ' . $items[$refs_list[$prereqs_string]]->path.' AND
2573
+                                                        exe_user_id = ' . $user_id.' AND
2574
+                                                        orig_lp_id = ' . $this->lp_id.' AND
2575
+                                                        orig_lp_item_id = ' . $prereqs_string.' ';
2576 2576
 
2577 2577
                                             $rs_quiz = Database::query($sql);
2578 2578
                                             if (Database::num_rows($rs_quiz) > 0) {
@@ -2619,14 +2619,14 @@  discard block
 block discarded – undo
2619 2619
                                         if (!$returnstatus) {
2620 2620
                                             if (self::debug > 1) {
2621 2621
                                                 error_log(
2622
-                                                    'New LP - Prerequisite ' . $prereqs_string . ' not complete',
2622
+                                                    'New LP - Prerequisite '.$prereqs_string.' not complete',
2623 2623
                                                     0
2624 2624
                                                 );
2625 2625
                                             }
2626 2626
                                         } else {
2627 2627
                                             if (self::debug > 1) {
2628 2628
                                                 error_log(
2629
-                                                    'New LP - Prerequisite ' . $prereqs_string . ' complete',
2629
+                                                    'New LP - Prerequisite '.$prereqs_string.' complete',
2630 2630
                                                     0
2631 2631
                                                 );
2632 2632
                                             }
@@ -2641,11 +2641,11 @@  discard block
 block discarded – undo
2641 2641
                                                 TABLE_LP_VIEW
2642 2642
                                             );
2643 2643
 
2644
-                                            $sql = 'SELECT id FROM ' . $lp_view . '
2644
+                                            $sql = 'SELECT id FROM '.$lp_view.'
2645 2645
                                                     WHERE
2646
-                                                        c_id = ' . $course_id . ' AND
2647
-                                                        user_id = ' . $user_id . '  AND
2648
-                                                        lp_id = ' . $this->lp_id . ' AND
2646
+                                                        c_id = ' . $course_id.' AND
2647
+                                                        user_id = ' . $user_id.'  AND
2648
+                                                        lp_id = ' . $this->lp_id.' AND
2649 2649
                                                         session_id = '.$sessionId.'
2650 2650
                                                     LIMIT 0, 1';
2651 2651
                                             $rs_lp = Database::query($sql);
@@ -2654,11 +2654,11 @@  discard block
 block discarded – undo
2654 2654
                                             );
2655 2655
                                             $my_lp_id = $lp_id[0];
2656 2656
 
2657
-                                            $sql = 'SELECT status FROM ' . $lp_item_view . '
2657
+                                            $sql = 'SELECT status FROM '.$lp_item_view.'
2658 2658
                                                    WHERE
2659
-                                                        c_id = ' . $course_id . ' AND
2660
-                                                        lp_view_id = ' . $my_lp_id . ' AND
2661
-                                                        lp_item_id = ' . $refs_list[$prereqs_string] . '
2659
+                                                        c_id = ' . $course_id.' AND
2660
+                                                        lp_view_id = ' . $my_lp_id.' AND
2661
+                                                        lp_item_id = ' . $refs_list[$prereqs_string].'
2662 2662
                                                     LIMIT 0, 1';
2663 2663
                                             $rs_lp = Database::query($sql);
2664 2664
                                             $status_array = Database :: fetch_row(
@@ -2675,14 +2675,14 @@  discard block
 block discarded – undo
2675 2675
                                             if (!$returnstatus) {
2676 2676
                                                 if (self::debug > 1) {
2677 2677
                                                     error_log(
2678
-                                                        'New LP - Prerequisite ' . $prereqs_string . ' not complete',
2678
+                                                        'New LP - Prerequisite '.$prereqs_string.' not complete',
2679 2679
                                                         0
2680 2680
                                                     );
2681 2681
                                                 }
2682 2682
                                             } else {
2683 2683
                                                 if (self::debug > 1) {
2684 2684
                                                     error_log(
2685
-                                                        'New LP - Prerequisite ' . $prereqs_string . ' complete',
2685
+                                                        'New LP - Prerequisite '.$prereqs_string.' complete',
2686 2686
                                                         0
2687 2687
                                                     );
2688 2688
                                                 }
@@ -2693,7 +2693,7 @@  discard block
 block discarded – undo
2693 2693
                                 } else {
2694 2694
                                     if (self::debug > 1) {
2695 2695
                                         error_log(
2696
-                                            'New LP - Could not find ' . $prereqs_string . ' in ' . print_r(
2696
+                                            'New LP - Could not find '.$prereqs_string.' in '.print_r(
2697 2697
                                                 $refs_list,
2698 2698
                                                 true
2699 2699
                                             ),
@@ -2716,7 +2716,7 @@  discard block
 block discarded – undo
2716 2716
                 foreach ($list as $condition) {
2717 2717
                     if (self::debug > 1) {
2718 2718
                         error_log(
2719
-                            'New LP - Found OR, adding it (' . $condition . ')',
2719
+                            'New LP - Found OR, adding it ('.$condition.')',
2720 2720
                             0
2721 2721
                         );
2722 2722
                     }
@@ -2770,7 +2770,7 @@  discard block
 block discarded – undo
2770 2770
 
2771 2771
         if (self::debug > 1) {
2772 2772
             error_log(
2773
-                'New LP - End of parse_prereq. Error code is now ' . $this->prereq_alert,
2773
+                'New LP - End of parse_prereq. Error code is now '.$this->prereq_alert,
2774 2774
                 0
2775 2775
             );
2776 2776
         }
@@ -2888,7 +2888,7 @@  discard block
 block discarded – undo
2888 2888
                                 $this->set_score($value);
2889 2889
                                 if (self::debug > 2) {
2890 2890
                                     error_log(
2891
-                                        'learnpathItem::save() - setting score to ' . $value,
2891
+                                        'learnpathItem::save() - setting score to '.$value,
2892 2892
                                         0
2893 2893
                                     );
2894 2894
                                 }
@@ -2897,7 +2897,7 @@  discard block
 block discarded – undo
2897 2897
                                 $this->set_max_score($value);
2898 2898
                                 if (self::debug > 2) {
2899 2899
                                     error_log(
2900
-                                        'learnpathItem::save() - setting view_max_score to ' . $value,
2900
+                                        'learnpathItem::save() - setting view_max_score to '.$value,
2901 2901
                                         0
2902 2902
                                     );
2903 2903
                                 }
@@ -2906,7 +2906,7 @@  discard block
 block discarded – undo
2906 2906
                                 $this->min_score = $value;
2907 2907
                                 if (self::debug > 2) {
2908 2908
                                     error_log(
2909
-                                        'learnpathItem::save() - setting min_score to ' . $value,
2909
+                                        'learnpathItem::save() - setting min_score to '.$value,
2910 2910
                                         0
2911 2911
                                     );
2912 2912
                                 }
@@ -2916,7 +2916,7 @@  discard block
 block discarded – undo
2916 2916
                                     $this->set_status($value);
2917 2917
                                     if (self::debug > 2) {
2918 2918
                                         error_log(
2919
-                                            'learnpathItem::save() - setting status to ' . $value,
2919
+                                            'learnpathItem::save() - setting status to '.$value,
2920 2920
                                             0
2921 2921
                                         );
2922 2922
                                     }
@@ -2926,7 +2926,7 @@  discard block
 block discarded – undo
2926 2926
                                 $this->set_time($value);
2927 2927
                                 if (self::debug > 2) {
2928 2928
                                     error_log(
2929
-                                        'learnpathItem::save() - setting time to ' . $value,
2929
+                                        'learnpathItem::save() - setting time to '.$value,
2930 2930
                                         0
2931 2931
                                     );
2932 2932
                                 }
@@ -2935,7 +2935,7 @@  discard block
 block discarded – undo
2935 2935
                                 $this->current_data = $value;
2936 2936
                                 if (self::debug > 2) {
2937 2937
                                     error_log(
2938
-                                        'learnpathItem::save() - setting suspend_data to ' . $value,
2938
+                                        'learnpathItem::save() - setting suspend_data to '.$value,
2939 2939
                                         0
2940 2940
                                     );
2941 2941
                                 }
@@ -2944,7 +2944,7 @@  discard block
 block discarded – undo
2944 2944
                                 $this->set_lesson_location($value);
2945 2945
                                 if (self::debug > 2) {
2946 2946
                                     error_log(
2947
-                                        'learnpathItem::save() - setting lesson_location to ' . $value,
2947
+                                        'learnpathItem::save() - setting lesson_location to '.$value,
2948 2948
                                         0
2949 2949
                                     );
2950 2950
                                 }
@@ -2953,7 +2953,7 @@  discard block
 block discarded – undo
2953 2953
                                 $this->set_core_exit($value);
2954 2954
                                 if (self::debug > 2) {
2955 2955
                                     error_log(
2956
-                                        'learnpathItem::save() - setting core_exit to ' . $value,
2956
+                                        'learnpathItem::save() - setting core_exit to '.$value,
2957 2957
                                         0
2958 2958
                                     );
2959 2959
                                 }
@@ -3100,7 +3100,7 @@  discard block
 block discarded – undo
3100 3100
     public function set_level($int = 0)
3101 3101
     {
3102 3102
         if (self::debug > 0) {
3103
-            error_log('learnpathItem::set_level(' . $int . ')', 0);
3103
+            error_log('learnpathItem::set_level('.$int.')', 0);
3104 3104
         }
3105 3105
         if (!empty($int) AND $int == strval(intval($int))) {
3106 3106
             $this->level = $int;
@@ -3129,7 +3129,7 @@  discard block
 block discarded – undo
3129 3129
         if (empty($lpItemId)) {
3130 3130
             if (self::debug > 0) {
3131 3131
                 error_log(
3132
-                    'learnpathItem::set_lp_view(' . $lp_view_id . ') $lpItemId is empty',
3132
+                    'learnpathItem::set_lp_view('.$lp_view_id.') $lpItemId is empty',
3133 3133
                     0
3134 3134
                 );
3135 3135
             }
@@ -3140,7 +3140,7 @@  discard block
 block discarded – undo
3140 3140
         if (empty($lp_view_id)) {
3141 3141
             if (self::debug > 0) {
3142 3142
                 error_log(
3143
-                    'learnpathItem::set_lp_view(' . $lp_view_id . ') $lp_view_id is empty',
3143
+                    'learnpathItem::set_lp_view('.$lp_view_id.') $lp_view_id is empty',
3144 3144
                     0
3145 3145
                 );
3146 3146
             }
@@ -3149,7 +3149,7 @@  discard block
 block discarded – undo
3149 3149
         }
3150 3150
 
3151 3151
         if (self::debug > 0) {
3152
-            error_log('learnpathItem::set_lp_view(' . $lp_view_id . ')', 0);
3152
+            error_log('learnpathItem::set_lp_view('.$lp_view_id.')', 0);
3153 3153
         }
3154 3154
 
3155 3155
         $this->view_id = $lp_view_id;
@@ -3159,13 +3159,13 @@  discard block
 block discarded – undo
3159 3159
         $sql = "SELECT * FROM $item_view_table
3160 3160
                 WHERE
3161 3161
                     c_id = $course_id AND
3162
-                    lp_item_id = " . $lpItemId . " AND
3163
-                    lp_view_id = " . $lp_view_id . "
3162
+                    lp_item_id = ".$lpItemId." AND
3163
+                    lp_view_id = " . $lp_view_id."
3164 3164
                 ORDER BY view_count DESC";
3165 3165
 
3166 3166
         if (self::debug > 2) {
3167 3167
             error_log(
3168
-                'learnpathItem::set_lp_view() - Querying lp_item_view: ' . $sql,
3168
+                'learnpathItem::set_lp_view() - Querying lp_item_view: '.$sql,
3169 3169
                 0
3170 3170
             );
3171 3171
         }
@@ -3197,7 +3197,7 @@  discard block
 block discarded – undo
3197 3197
             $sql = "SELECT * FROM $item_view_interaction_table
3198 3198
                     WHERE
3199 3199
                         c_id = $course_id AND
3200
-                        lp_iv_id = '" . $this->db_item_view_id . "'";
3200
+                        lp_iv_id = '".$this->db_item_view_id."'";
3201 3201
 
3202 3202
             $res = Database::query($sql);
3203 3203
             if ($res !== false) {
@@ -3212,7 +3212,7 @@  discard block
 block discarded – undo
3212 3212
             $sql = "SELECT * FROM $item_view_objective_table
3213 3213
                     WHERE
3214 3214
                         c_id = $course_id AND
3215
-                        lp_iv_id = '" . $this->db_item_view_id . "'";
3215
+                        lp_iv_id = '".$this->db_item_view_id."'";
3216 3216
 
3217 3217
             $res = Database::query($sql);
3218 3218
             if ($res !== false) {
@@ -3273,7 +3273,7 @@  discard block
 block discarded – undo
3273 3273
     {
3274 3274
         $debug = self::debug;
3275 3275
         if ($debug > 0) {
3276
-            error_log('learnpathItem::set_score(' . $score . ')', 0);
3276
+            error_log('learnpathItem::set_score('.$score.')', 0);
3277 3277
         }
3278 3278
         if (($this->max_score <= 0 || $score <= $this->max_score) && ($score >= $this->min_score)) {
3279 3279
             $this->current_score = $score;
@@ -3286,9 +3286,9 @@  discard block
 block discarded – undo
3286 3286
             }
3287 3287
 
3288 3288
             if ($debug > 0) {
3289
-                error_log('get_mastery_score: ' . $masteryScore);
3290
-                error_log('current_status: ' . $current_status);
3291
-                error_log('current score : ' . $this->current_score);
3289
+                error_log('get_mastery_score: '.$masteryScore);
3290
+                error_log('current_status: '.$current_status);
3291
+                error_log('current score : '.$this->current_score);
3292 3292
             }
3293 3293
 
3294 3294
             // If mastery_score is set AND the current score reaches the mastery
@@ -3316,15 +3316,15 @@  discard block
 block discarded – undo
3316 3316
     public function set_max_score($score)
3317 3317
     {
3318 3318
         if (self::debug > 0) {
3319
-            error_log('learnpathItem::set_max_score(' . $score . ')', 0);
3319
+            error_log('learnpathItem::set_max_score('.$score.')', 0);
3320 3320
         }
3321 3321
         if (is_int($score) || $score == '') {
3322 3322
             $this->view_max_score = $score;
3323 3323
             if (self::debug > 1) {
3324 3324
                 error_log(
3325
-                    'learnpathItem::set_max_score() - ' .
3326
-                    'Updated object score of item ' . $this->db_id .
3327
-                    ' to ' . $this->view_max_score,
3325
+                    'learnpathItem::set_max_score() - '.
3326
+                    'Updated object score of item '.$this->db_id.
3327
+                    ' to '.$this->view_max_score,
3328 3328
                     0
3329 3329
                 );
3330 3330
             }
@@ -3342,12 +3342,12 @@  discard block
 block discarded – undo
3342 3342
     public function set_status($status)
3343 3343
     {
3344 3344
         if (self::debug > 0) {
3345
-            error_log('learnpathItem::set_status(' . $status . ')', 0);
3345
+            error_log('learnpathItem::set_status('.$status.')', 0);
3346 3346
         }
3347 3347
 
3348 3348
         $found = false;
3349 3349
         foreach ($this->possible_status as $possible) {
3350
-            if (preg_match('/^' . $possible . '$/i', $status)) {
3350
+            if (preg_match('/^'.$possible.'$/i', $status)) {
3351 3351
                 $found = true;
3352 3352
             }
3353 3353
         }
@@ -3357,8 +3357,8 @@  discard block
 block discarded – undo
3357 3357
             if (self::debug > 1) {
3358 3358
                 error_log(
3359 3359
                     'learnpathItem::set_status() - '.
3360
-                        'Updated object status of item ' . $this->db_id .
3361
-                        ' to ' . $this->status,
3360
+                        'Updated object status of item '.$this->db_id.
3361
+                        ' to '.$this->status,
3362 3362
                     0
3363 3363
                 );
3364 3364
             }
@@ -3380,7 +3380,7 @@  discard block
 block discarded – undo
3380 3380
         global $charset;
3381 3381
         $course_id = api_get_course_int_id();
3382 3382
         $lp_item = Database::get_course_table(TABLE_LP_ITEM);
3383
-        require_once api_get_path(LIBRARY_PATH) . 'search/ChamiloIndexer.class.php';
3383
+        require_once api_get_path(LIBRARY_PATH).'search/ChamiloIndexer.class.php';
3384 3384
         $a_terms = preg_split('/,/', $terms);
3385 3385
         $i_terms = preg_split('/,/', $this->get_terms());
3386 3386
         foreach ($i_terms as $term) {
@@ -3397,7 +3397,7 @@  discard block
 block discarded – undo
3397 3397
                 SET terms = '$terms'
3398 3398
                 WHERE
3399 3399
                     c_id = $course_id AND
3400
-                    id=" . $this->get_id();
3400
+                    id=".$this->get_id();
3401 3401
         Database::query($sql);
3402 3402
         // Save it to search engine.
3403 3403
         if (api_get_setting('search_enabled') == 'true') {
@@ -3425,7 +3425,7 @@  discard block
 block discarded – undo
3425 3425
     public function set_time($scorm_time, $format = 'scorm')
3426 3426
     {
3427 3427
         if (self::debug > 0) {
3428
-            error_log('learnpathItem::set_time(' . $scorm_time . ')', 0);
3428
+            error_log('learnpathItem::set_time('.$scorm_time.')', 0);
3429 3429
         }
3430 3430
         if ($scorm_time == '0'
3431 3431
                 and ($this->type != 'sco')
@@ -3436,8 +3436,8 @@  discard block
 block discarded – undo
3436 3436
                 $this->update_time($my_time);
3437 3437
                 if (self::debug > 0) {
3438 3438
                     error_log(
3439
-                        'learnpathItem::set_time(' . $scorm_time . ') - ' .
3440
-                            'found asset - set time to ' . $my_time,
3439
+                        'learnpathItem::set_time('.$scorm_time.') - '.
3440
+                            'found asset - set time to '.$my_time,
3441 3441
                         0
3442 3442
                     );
3443 3443
                 }
@@ -3510,10 +3510,10 @@  discard block
 block discarded – undo
3510 3510
     {
3511 3511
         if (self::debug > 1) {
3512 3512
             error_log(
3513
-                'learnpathItem::status_is(' . print_r(
3513
+                'learnpathItem::status_is('.print_r(
3514 3514
                     $list,
3515 3515
                     true
3516
-                ) . ') on item ' . $this->db_id,
3516
+                ).') on item '.$this->db_id,
3517 3517
                 0
3518 3518
             );
3519 3519
         }
@@ -3523,11 +3523,11 @@  discard block
 block discarded – undo
3523 3523
         }
3524 3524
         $found = false;
3525 3525
         foreach ($list as $status) {
3526
-            if (preg_match('/^' . $status . '$/i', $currentStatus)) {
3526
+            if (preg_match('/^'.$status.'$/i', $currentStatus)) {
3527 3527
                 if (self::debug > 2) {
3528 3528
                     error_log(
3529
-                        'New LP - learnpathItem::status_is() - Found status ' .
3530
-                            $status . ' corresponding to current status',
3529
+                        'New LP - learnpathItem::status_is() - Found status '.
3530
+                            $status.' corresponding to current status',
3531 3531
                         0
3532 3532
                     );
3533 3533
                 }
@@ -3538,8 +3538,8 @@  discard block
 block discarded – undo
3538 3538
         }
3539 3539
         if (self::debug > 2) {
3540 3540
             error_log(
3541
-                'New LP - learnpathItem::status_is() - Status ' .
3542
-                    $currentStatus . ' did not match request',
3541
+                'New LP - learnpathItem::status_is() - Status '.
3542
+                    $currentStatus.' did not match request',
3543 3543
                 0
3544 3544
             );
3545 3545
         }
@@ -3556,7 +3556,7 @@  discard block
 block discarded – undo
3556 3556
     public function update_time($total_sec = 0)
3557 3557
     {
3558 3558
         if (self::debug > 0) {
3559
-            error_log('learnpathItem::update_time(' . $total_sec . ')', 0);
3559
+            error_log('learnpathItem::update_time('.$total_sec.')', 0);
3560 3560
         }
3561 3561
         if ($total_sec >= 0) {
3562 3562
             // Getting start time from finish time. The only problem in the calculation is it might be
@@ -3606,12 +3606,12 @@  discard block
 block discarded – undo
3606 3606
         $item_view_table = Database::get_course_table(TABLE_LP_ITEM_VIEW);
3607 3607
         $course_id = api_get_course_int_id();
3608 3608
 
3609
-        $sql = 'SELECT total_time, status FROM ' . $item_view_table . '
3609
+        $sql = 'SELECT total_time, status FROM '.$item_view_table.'
3610 3610
                  WHERE 
3611
-                    c_id = ' . $course_id . ' AND 
3612
-                    lp_item_id="' . $this->db_id . '" AND 
3613
-                    lp_view_id="' . $this->view_id . '" AND 
3614
-                    view_count="' . $this->get_attempt_id() . '"';
3611
+                    c_id = ' . $course_id.' AND 
3612
+                    lp_item_id="' . $this->db_id.'" AND 
3613
+                    lp_view_id="' . $this->view_id.'" AND 
3614
+                    view_count="' . $this->get_attempt_id().'"';
3615 3615
         $result = Database::query($sql);
3616 3616
         $row = Database::fetch_array($result);
3617 3617
 
@@ -3681,13 +3681,13 @@  discard block
 block discarded – undo
3681 3681
     {
3682 3682
         $item_view_table = Database::get_course_table(TABLE_LP_ITEM_VIEW);
3683 3683
         $course_id = api_get_course_int_id();
3684
-        $sql = 'UPDATE ' . $item_view_table . '
3684
+        $sql = 'UPDATE '.$item_view_table.'
3685 3685
                 SET total_time = 0, 
3686
-                    start_time=' . time() . '
3687
-                WHERE c_id = ' . $course_id . '
3688
-                    AND lp_item_id="' . $this->db_id . '"
3689
-                    AND lp_view_id="' . $this->view_id . '"
3690
-                    AND view_count="' . $this->attempt_id . '" ;';
3686
+                    start_time=' . time().'
3687
+                WHERE c_id = ' . $course_id.'
3688
+                    AND lp_item_id="' . $this->db_id.'"
3689
+                    AND lp_view_id="' . $this->view_id.'"
3690
+                    AND view_count="' . $this->attempt_id.'" ;';
3691 3691
         Database::query($sql);
3692 3692
     }
3693 3693
 
@@ -3709,8 +3709,8 @@  discard block
 block discarded – undo
3709 3709
                     FROM $tbl
3710 3710
                     WHERE
3711 3711
                         c_id = $course_id AND
3712
-                        lp_item_id = " . $this->db_id . " AND
3713
-                        lp_view_id = " . $this->view_id . " AND
3712
+                        lp_item_id = ".$this->db_id." AND
3713
+                        lp_view_id = " . $this->view_id." AND
3714 3714
                         view_count = " . $this->attempt_id;
3715 3715
             $res = Database::query($sql);
3716 3716
             if (Database::num_rows($res) > 0) {
@@ -3718,8 +3718,8 @@  discard block
 block discarded – undo
3718 3718
                 $lp_iv_id = $row[0];
3719 3719
                 if (self::debug > 2) {
3720 3720
                     error_log(
3721
-                        'learnpathItem::write_to_db() - Got item_view_id ' .
3722
-                            $lp_iv_id . ', now checking objectives ',
3721
+                        'learnpathItem::write_to_db() - Got item_view_id '.
3722
+                            $lp_iv_id.', now checking objectives ',
3723 3723
                         0
3724 3724
                     );
3725 3725
                 }
@@ -3731,7 +3731,7 @@  discard block
 block discarded – undo
3731 3731
                                 WHERE
3732 3732
                                     c_id = $course_id AND
3733 3733
                                     lp_iv_id = $lp_iv_id AND
3734
-                                    objective_id = '" . Database::escape_string($objective[0]) . "'";
3734
+                                    objective_id = '".Database::escape_string($objective[0])."'";
3735 3735
                     $iva_res = Database::query($iva_sql);
3736 3736
                     // id(0), type(1), time(2), weighting(3),
3737 3737
                     // correct_responses(4), student_response(5),
@@ -3740,12 +3740,12 @@  discard block
 block discarded – undo
3740 3740
                         // Update (or don't).
3741 3741
                         $iva_row = Database::fetch_array($iva_res);
3742 3742
                         $iva_id = $iva_row[0];
3743
-                        $ivau_sql = "UPDATE $iva_table " .
3744
-                            "SET objective_id = '" . Database::escape_string($objective[0]) . "'," .
3745
-                            "status = '" . Database::escape_string($objective[1]) . "'," .
3746
-                            "score_raw = '" . Database::escape_string($objective[2]) . "'," .
3747
-                            "score_min = '" . Database::escape_string($objective[4]) . "'," .
3748
-                            "score_max = '" . Database::escape_string($objective[3]) . "' " .
3743
+                        $ivau_sql = "UPDATE $iva_table ".
3744
+                            "SET objective_id = '".Database::escape_string($objective[0])."',".
3745
+                            "status = '".Database::escape_string($objective[1])."',".
3746
+                            "score_raw = '".Database::escape_string($objective[2])."',".
3747
+                            "score_min = '".Database::escape_string($objective[4])."',".
3748
+                            "score_max = '".Database::escape_string($objective[3])."' ".
3749 3749
                             "WHERE c_id = $course_id AND id = $iva_id";
3750 3750
                         Database::query($ivau_sql);
3751 3751
                     } else {
@@ -3797,12 +3797,12 @@  discard block
 block discarded – undo
3797 3797
         $my_status = ' ';
3798 3798
 
3799 3799
         $item_view_table = Database::get_course_table(TABLE_LP_ITEM_VIEW);
3800
-        $sql = 'SELECT status FROM ' . $item_view_table . '
3800
+        $sql = 'SELECT status FROM '.$item_view_table.'
3801 3801
                 WHERE
3802
-                    c_id = ' . $course_id . ' AND
3803
-                    lp_item_id="' . $this->db_id . '" AND
3804
-                    lp_view_id="' . $this->view_id . '" AND
3805
-                    view_count="' . $this->get_attempt_id() . '" ';
3802
+                    c_id = ' . $course_id.' AND
3803
+                    lp_item_id="' . $this->db_id.'" AND
3804
+                    lp_view_id="' . $this->view_id.'" AND
3805
+                    view_count="' . $this->get_attempt_id().'" ';
3806 3806
         $rs_verified = Database::query($sql);
3807 3807
         $row_verified = Database::fetch_array($rs_verified);
3808 3808
 
@@ -3830,8 +3830,8 @@  discard block
 block discarded – undo
3830 3830
                     "This info shouldn't be saved as the credit or lesson mode info prevent it"
3831 3831
                 );
3832 3832
                 error_log(
3833
-                    'learnpathItem::write_to_db() - credit(' . $credit . ') or'.
3834
-                        ' lesson_mode(' . $mode . ') prevent recording!',
3833
+                    'learnpathItem::write_to_db() - credit('.$credit.') or'.
3834
+                        ' lesson_mode('.$mode.') prevent recording!',
3835 3835
                     0
3836 3836
                 );
3837 3837
             }
@@ -3855,14 +3855,14 @@  discard block
 block discarded – undo
3855 3855
                     "max_score" => $this->get_max(),
3856 3856
                     "lp_item_id" => $this->db_id,
3857 3857
                     "lp_view_id" => $this->view_id,
3858
-                    "view_count" => $this->get_attempt_id() ,
3858
+                    "view_count" => $this->get_attempt_id(),
3859 3859
                     "suspend_data" => $this->current_data,
3860 3860
                     //"max_time_allowed" => ,
3861 3861
                     "lesson_location" => $this->lesson_location
3862 3862
                 );
3863 3863
                 if (self::debug > 2) {
3864 3864
                     error_log(
3865
-                        'learnpathItem::write_to_db() - Inserting into item_view forced: ' . print_r($params, 1),
3865
+                        'learnpathItem::write_to_db() - Inserting into item_view forced: '.print_r($params, 1),
3866 3866
                         0
3867 3867
                     );
3868 3868
                 }
@@ -3870,7 +3870,7 @@  discard block
 block discarded – undo
3870 3870
 
3871 3871
                 if ($this->db_item_view_id) {
3872 3872
                     $sql = "UPDATE $item_view_table SET id = iid
3873
-                            WHERE iid = " . $this->db_item_view_id;
3873
+                            WHERE iid = ".$this->db_item_view_id;
3874 3874
                     Database::query($sql);
3875 3875
                     $inserted = true;
3876 3876
                 }
@@ -3880,12 +3880,12 @@  discard block
 block discarded – undo
3880 3880
             $sql = "SELECT * FROM $item_view_table
3881 3881
                     WHERE
3882 3882
                         c_id = $course_id AND
3883
-                        lp_item_id = " . $this->db_id . " AND
3884
-                        lp_view_id = " . $this->view_id . " AND
3883
+                        lp_item_id = ".$this->db_id." AND
3884
+                        lp_view_id = " . $this->view_id." AND
3885 3885
                         view_count = " . intval($this->get_attempt_id());
3886 3886
             if (self::debug > 2) {
3887 3887
                 error_log(
3888
-                    'learnpathItem::write_to_db() - Querying item_view: ' . $sql,
3888
+                    'learnpathItem::write_to_db() - Querying item_view: '.$sql,
3889 3889
                     0
3890 3890
                 );
3891 3891
             }
@@ -3902,7 +3902,7 @@  discard block
 block discarded – undo
3902 3902
                     "max_score" => $this->get_max(),
3903 3903
                     "lp_item_id" => $this->db_id,
3904 3904
                     "lp_view_id" => $this->view_id,
3905
-                    "view_count" => $this->get_attempt_id() ,
3905
+                    "view_count" => $this->get_attempt_id(),
3906 3906
                     "suspend_data" => $this->current_data,
3907 3907
                     //"max_time_allowed" => ,$this->get_max_time_allowed()
3908 3908
                     "lesson_location" => $this->lesson_location
@@ -3910,7 +3910,7 @@  discard block
 block discarded – undo
3910 3910
 
3911 3911
                 if (self::debug > 2) {
3912 3912
                     error_log(
3913
-                        'learnpathItem::write_to_db() - Inserting into item_view forced: ' . print_r($params, 1),
3913
+                        'learnpathItem::write_to_db() - Inserting into item_view forced: '.print_r($params, 1),
3914 3914
                         0
3915 3915
                     );
3916 3916
                 }
@@ -3919,7 +3919,7 @@  discard block
 block discarded – undo
3919 3919
 
3920 3920
                 if ($this->db_item_view_id) {
3921 3921
                     $sql = "UPDATE $item_view_table SET id = iid
3922
-                            WHERE iid = " . $this->db_item_view_id;
3922
+                            WHERE iid = ".$this->db_item_view_id;
3923 3923
                     Database::query($sql);
3924 3924
                 }
3925 3925
             } else {
@@ -3959,8 +3959,8 @@  discard block
 block discarded – undo
3959 3959
                             $time_exe_date = convert_sql_date(
3960 3960
                                 $row_dates['exe_date']
3961 3961
                             );
3962
-                            $mytime = ((int)$time_exe_date - (int)$time_start_date);
3963
-                            $total_time = " total_time = " . $mytime . ", ";
3962
+                            $mytime = ((int) $time_exe_date - (int) $time_start_date);
3963
+                            $total_time = " total_time = ".$mytime.", ";
3964 3964
                         }
3965 3965
                     } else {
3966 3966
                         $my_type_lp = learnpath::get_type_static($this->lp_id);
@@ -3974,16 +3974,16 @@  discard block
 block discarded – undo
3974 3974
 
3975 3975
                         // Is not multiple attempts
3976 3976
                         if ($this->seriousgame_mode == 1 && $this->type == 'sco') {
3977
-                            $total_time = " total_time = total_time +" . $this->get_total_time() . ", ";
3978
-                            $my_status = " status = '" . $this->get_status(false) . "' ,";
3977
+                            $total_time = " total_time = total_time +".$this->get_total_time().", ";
3978
+                            $my_status = " status = '".$this->get_status(false)."' ,";
3979 3979
                         } elseif ($this->get_prevent_reinit() == 1) {
3980 3980
                             // Process of status verified into data base.
3981
-                            $sql = 'SELECT status FROM ' . $item_view_table . '
3981
+                            $sql = 'SELECT status FROM '.$item_view_table.'
3982 3982
                                     WHERE
3983
-                                        c_id = ' . $course_id . ' AND
3984
-                                        lp_item_id="' . $this->db_id . '" AND
3985
-                                        lp_view_id="' . $this->view_id . '" AND
3986
-                                        view_count="' . $this->get_attempt_id() . '"
3983
+                                        c_id = ' . $course_id.' AND
3984
+                                        lp_item_id="' . $this->db_id.'" AND
3985
+                                        lp_view_id="' . $this->view_id.'" AND
3986
+                                        view_count="' . $this->get_attempt_id().'"
3987 3987
                                     ';
3988 3988
                             $rs_verified = Database::query($sql);
3989 3989
                             $row_verified = Database::fetch_array($rs_verified);
@@ -3993,26 +3993,26 @@  discard block
 block discarded – undo
3993 3993
                             if (!in_array($this->get_status(false), $case_completed) &&
3994 3994
                                 $my_type_lp == 2
3995 3995
                             ) {
3996
-                                $total_time = " total_time = total_time +" . $this->get_total_time() . ", ";
3997
-                                $my_status = " status = '" . $this->get_status(false) . "' ,";
3996
+                                $total_time = " total_time = total_time +".$this->get_total_time().", ";
3997
+                                $my_status = " status = '".$this->get_status(false)."' ,";
3998 3998
                             } else {
3999 3999
                                 // Verified into database.
4000 4000
                                 if (!in_array($row_verified['status'], $case_completed) &&
4001 4001
                                     $my_type_lp == 2
4002 4002
                                 ) {
4003
-                                    $total_time = " total_time = total_time +" . $this->get_total_time() . ", ";
4004
-                                    $my_status = " status = '" . $this->get_status(false) . "' ,";
4005
-                                } elseif (in_array($row_verified['status'], $case_completed ) &&
4003
+                                    $total_time = " total_time = total_time +".$this->get_total_time().", ";
4004
+                                    $my_status = " status = '".$this->get_status(false)."' ,";
4005
+                                } elseif (in_array($row_verified['status'], $case_completed) &&
4006 4006
                                     $my_type_lp == 2 && $this->type != 'sco'
4007 4007
                                 ) {
4008
-                                    $total_time = " total_time = total_time +" . $this->get_total_time() . ", ";
4009
-                                    $my_status = " status = '" . $this->get_status(false) . "' ,";
4008
+                                    $total_time = " total_time = total_time +".$this->get_total_time().", ";
4009
+                                    $my_status = " status = '".$this->get_status(false)."' ,";
4010 4010
                                 } else {
4011 4011
                                     if (($my_type_lp == 3 && $this->type == 'au') ||
4012 4012
                                         ($my_type_lp == 1 && $this->type != 'dir')) {
4013 4013
                                         // Is AICC or Chamilo LP
4014
-                                        $total_time = " total_time = total_time + " . $this->get_total_time() . ", ";
4015
-                                        $my_status = " status = '" . $this->get_status(false) . "' ,";
4014
+                                        $total_time = " total_time = total_time + ".$this->get_total_time().", ";
4015
+                                        $my_status = " status = '".$this->get_status(false)."' ,";
4016 4016
                                     }
4017 4017
                                 }
4018 4018
                             }
@@ -4024,27 +4024,27 @@  discard block
 block discarded – undo
4024 4024
                                 ) && $my_type_lp == 2
4025 4025
                             ) {
4026 4026
                                 // Reset zero new attempt ?
4027
-                                $my_status = " status = '" . $this->get_status(false) . "' ,";
4027
+                                $my_status = " status = '".$this->get_status(false)."' ,";
4028 4028
                             } elseif (!in_array($this->get_status(false), $case_completed) &&
4029 4029
                                 $my_type_lp == 2
4030 4030
                             ) {
4031
-                                $total_time = " total_time = " . $this->get_total_time() . ", ";
4032
-                                $my_status = " status = '" . $this->get_status(false) . "' ,";
4031
+                                $total_time = " total_time = ".$this->get_total_time().", ";
4032
+                                $my_status = " status = '".$this->get_status(false)."' ,";
4033 4033
                             } else {
4034 4034
                                 // It is chamilo LP.
4035
-                                $total_time = " total_time = total_time +" . $this->get_total_time() . ", ";
4036
-                                $my_status = " status = '" . $this->get_status(false) . "' ,";
4035
+                                $total_time = " total_time = total_time +".$this->get_total_time().", ";
4036
+                                $my_status = " status = '".$this->get_status(false)."' ,";
4037 4037
                             }
4038 4038
 
4039 4039
                             // This code line fixes the problem of wrong status.
4040 4040
                             if ($my_type_lp == 2) {
4041 4041
                                 // Verify current status in multiples attempts.
4042
-                                $sql = 'SELECT status FROM ' . $item_view_table . '
4042
+                                $sql = 'SELECT status FROM '.$item_view_table.'
4043 4043
                                         WHERE
4044
-                                            c_id = ' . $course_id . ' AND
4045
-                                            lp_item_id="' . $this->db_id . '" AND
4046
-                                            lp_view_id="' . $this->view_id . '" AND
4047
-                                            view_count="' . $this->get_attempt_id() . '" ';
4044
+                                            c_id = ' . $course_id.' AND
4045
+                                            lp_item_id="' . $this->db_id.'" AND
4046
+                                            lp_view_id="' . $this->view_id.'" AND
4047
+                                            view_count="' . $this->get_attempt_id().'" ';
4048 4048
                                 $rs_status = Database::query($sql);
4049 4049
                                 $current_status = Database::result(
4050 4050
                                     $rs_status,
@@ -4055,7 +4055,7 @@  discard block
 block discarded – undo
4055 4055
                                     $my_status = '';
4056 4056
                                     $total_time = '';
4057 4057
                                 } else {
4058
-                                    $total_time = " total_time = total_time +" . $this->get_total_time() . ", ";
4058
+                                    $total_time = " total_time = total_time +".$this->get_total_time().", ";
4059 4059
                                 }
4060 4060
                             }
4061 4061
                         }
@@ -4066,38 +4066,38 @@  discard block
 block discarded – undo
4066 4066
                         //" . //start_time = ".$this->get_current_start_time().", " . //scorm_init_time does it
4067 4067
                         ////" max_time_allowed = '".$this->get_max_time_allowed()."'," .
4068 4068
                         $sql = "UPDATE $item_view_table SET
4069
-                                    score = " . $this->get_score() . ",
4069
+                                    score = ".$this->get_score().",
4070 4070
                                     $my_status
4071
-                                    max_score = '" . $this->get_max() . "',
4072
-                                    suspend_data = '" . Database::escape_string($this->current_data) . "',
4073
-                                    lesson_location = '" . $this->lesson_location . "'
4071
+                                    max_score = '".$this->get_max()."',
4072
+                                    suspend_data = '" . Database::escape_string($this->current_data)."',
4073
+                                    lesson_location = '" . $this->lesson_location."'
4074 4074
                                 WHERE
4075 4075
                                     c_id = $course_id AND
4076
-                                    lp_item_id = " . $this->db_id . " AND
4077
-                                    lp_view_id = " . $this->view_id . "  AND
4076
+                                    lp_item_id = ".$this->db_id." AND
4077
+                                    lp_view_id = " . $this->view_id."  AND
4078 4078
                                     view_count = " . $this->get_attempt_id();
4079 4079
 
4080 4080
                     } else {
4081 4081
                         //" max_time_allowed = '".$this->get_max_time_allowed()."'," .
4082 4082
                         $sql = "UPDATE $item_view_table SET
4083 4083
                                     $total_time
4084
-                                    start_time = " . $this->get_current_start_time() . ",
4085
-                                    score = " . $this->get_score() . ",
4084
+                                    start_time = ".$this->get_current_start_time().",
4085
+                                    score = " . $this->get_score().",
4086 4086
                                     $my_status
4087
-                                    max_score = '" . $this->get_max() . "',
4088
-                                    suspend_data = '" . Database::escape_string($this->current_data) . "',
4089
-                                    lesson_location = '" . $this->lesson_location . "'
4087
+                                    max_score = '".$this->get_max()."',
4088
+                                    suspend_data = '" . Database::escape_string($this->current_data)."',
4089
+                                    lesson_location = '" . $this->lesson_location."'
4090 4090
                                 WHERE
4091 4091
                                     c_id = $course_id AND
4092
-                                    lp_item_id = " . $this->db_id . " AND
4093
-                                    lp_view_id = " . $this->view_id . " AND
4092
+                                    lp_item_id = ".$this->db_id." AND
4093
+                                    lp_view_id = " . $this->view_id." AND
4094 4094
                                     view_count = " . $this->get_attempt_id();
4095 4095
                     }
4096 4096
                     $this->current_start_time = time();
4097 4097
                 }
4098 4098
                 if (self::debug > 2) {
4099 4099
                     error_log(
4100
-                        'learnpathItem::write_to_db() - Updating item_view: ' . $sql,
4100
+                        'learnpathItem::write_to_db() - Updating item_view: '.$sql,
4101 4101
                         0
4102 4102
                     );
4103 4103
                 }
@@ -4110,8 +4110,8 @@  discard block
 block discarded – undo
4110 4110
                 $sql = "SELECT id FROM $tbl
4111 4111
                         WHERE
4112 4112
                             c_id = $course_id AND
4113
-                            lp_item_id = " . $this->db_id . " AND
4114
-                            lp_view_id = " . $this->view_id . " AND
4113
+                            lp_item_id = ".$this->db_id." AND
4114
+                            lp_view_id = " . $this->view_id." AND
4115 4115
                             view_count = " . $this->get_attempt_id();
4116 4116
                 $res = Database::query($sql);
4117 4117
                 if (Database::num_rows($res) > 0) {
@@ -4119,16 +4119,16 @@  discard block
 block discarded – undo
4119 4119
                     $lp_iv_id = $row[0];
4120 4120
                     if (self::debug > 2) {
4121 4121
                         error_log(
4122
-                            'learnpathItem::write_to_db() - Got item_view_id ' .
4123
-                                $lp_iv_id . ', now checking interactions ',
4122
+                            'learnpathItem::write_to_db() - Got item_view_id '.
4123
+                                $lp_iv_id.', now checking interactions ',
4124 4124
                             0
4125 4125
                         );
4126 4126
                     }
4127 4127
                     foreach ($this->interactions as $index => $interaction) {
4128 4128
                         $correct_resp = '';
4129
-                        if (is_array($interaction[4] ) && !empty($interaction[4][0])) {
4129
+                        if (is_array($interaction[4]) && !empty($interaction[4][0])) {
4130 4130
                             foreach ($interaction[4] as $resp) {
4131
-                                $correct_resp .= $resp . ',';
4131
+                                $correct_resp .= $resp.',';
4132 4132
                             }
4133 4133
                             $correct_resp = substr(
4134 4134
                                 $correct_resp,
@@ -4147,7 +4147,7 @@  discard block
 block discarded – undo
4147 4147
                                         lp_iv_id = $lp_iv_id AND
4148 4148
                                         (
4149 4149
                                             order_id = $index OR
4150
-                                            interaction_id = '" . Database::escape_string($interaction[0]) . "'
4150
+                                            interaction_id = '".Database::escape_string($interaction[0])."'
4151 4151
                                         )
4152 4152
                                     ";
4153 4153
                         $iva_res = Database::query($iva_sql);
@@ -4229,11 +4229,11 @@  discard block
 block discarded – undo
4229 4229
     public function add_audio()
4230 4230
     {
4231 4231
         $course_info = api_get_course_info();
4232
-        $filepath = api_get_path(SYS_COURSE_PATH) . $course_info['path'] . '/document/';
4232
+        $filepath = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document/';
4233 4233
 
4234
-        if (!is_dir($filepath . 'audio')) {
4234
+        if (!is_dir($filepath.'audio')) {
4235 4235
             mkdir(
4236
-                $filepath . 'audio',
4236
+                $filepath.'audio',
4237 4237
                 api_get_permissions_for_new_directories()
4238 4238
             );
4239 4239
             $audio_id = add_document(
@@ -4292,10 +4292,10 @@  discard block
 block discarded – undo
4292 4292
             // Store the mp3 file in the lp_item table.
4293 4293
             $tbl_lp_item = Database::get_course_table(TABLE_LP_ITEM);
4294 4294
             $sql = "UPDATE $tbl_lp_item SET
4295
-                        audio = '" . Database::escape_string($file_path) . "'
4295
+                        audio = '".Database::escape_string($file_path)."'
4296 4296
                     WHERE
4297 4297
                         c_id = {$course_info['real_id']} AND
4298
-                        id = '" . intval($this->db_id) . "'";
4298
+                        id = '".intval($this->db_id)."'";
4299 4299
             Database::query($sql);
4300 4300
         }
4301 4301
 
@@ -4320,10 +4320,10 @@  discard block
 block discarded – undo
4320 4320
             // Store the mp3 file in the lp_item table.
4321 4321
             $tbl_lp_item = Database::get_course_table(TABLE_LP_ITEM);
4322 4322
             $sql = "UPDATE $tbl_lp_item SET
4323
-                        audio = '" . Database::escape_string($file_path) . "'
4323
+                        audio = '".Database::escape_string($file_path)."'
4324 4324
                     WHERE
4325 4325
                         c_id = {$course_info['real_id']} AND
4326
-                        id = " . intval($this->db_id);
4326
+                        id = ".intval($this->db_id);
4327 4327
             Database::query($sql);
4328 4328
         }
4329 4329
         return $file_path;
@@ -4344,7 +4344,7 @@  discard block
 block discarded – undo
4344 4344
         }
4345 4345
         $sql = "UPDATE $tbl_lp_item SET
4346 4346
                 audio = ''
4347
-                WHERE c_id = $course_id AND id IN (" . $this->db_id . ")";
4347
+                WHERE c_id = $course_id AND id IN (".$this->db_id.")";
4348 4348
         Database::query($sql);
4349 4349
     }
4350 4350
 
@@ -4390,7 +4390,7 @@  discard block
 block discarded – undo
4390 4390
 
4391 4391
         if ($type == 'simple') {
4392 4392
             if (in_array($status, array('failed', 'passed', 'browsed'))) {
4393
-                $myLessonStatus = get_lang('ScormIncomplete');;
4393
+                $myLessonStatus = get_lang('ScormIncomplete'); ;
4394 4394
                 $classStatus = 'warning';
4395 4395
             }
4396 4396
         }
@@ -4539,7 +4539,7 @@  discard block
 block discarded – undo
4539 4539
      */
4540 4540
     public function createForumThread($currentForumId)
4541 4541
     {
4542
-        require_once api_get_path(SYS_CODE_PATH) . '/forum/forumfunction.inc.php';
4542
+        require_once api_get_path(SYS_CODE_PATH).'/forum/forumfunction.inc.php';
4543 4543
 
4544 4544
         $em = Database::getManager();
4545 4545
         $threadRepo = $em->getRepository('ChamiloCourseBundle:CForumThread');
Please login to merge, or discard this patch.
main/group/group.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 $userId = api_get_user_id();
23 23
 
24 24
 $this_section = SECTION_COURSES;
25
-$current_course_tool  = TOOL_GROUP;
25
+$current_course_tool = TOOL_GROUP;
26 26
 
27 27
 // Notice for unauthorized people.
28 28
 api_protect_course_script(true);
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
         Display::return_icon('add-groups.png', get_lang('NewGroupCreate'), '', ICON_SIZE_MEDIUM).'</a>';
171 171
 
172 172
     if (api_get_setting('allow_group_categories') === 'true') {
173
-        $actionsLeft .=  '<a href="group_category.php?'.api_get_cidreq().'&action=add_category">'.
173
+        $actionsLeft .= '<a href="group_category.php?'.api_get_cidreq().'&action=add_category">'.
174 174
             Display::return_icon('new_folder.png', get_lang('AddCategory'), '', ICON_SIZE_MEDIUM).'</a>';
175 175
     } else {
176 176
         $actionsLeft .= '<a href="group_category.php?'.api_get_cidreq().'&id=2">'.
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
         $actions = null;
226 226
         if (api_is_allowed_to_edit(false, true) && !empty($categoryId)) {
227 227
             $actions .= '<a href="group_category.php?'.api_get_cidreq().'&id='.$categoryId.'" title="'.get_lang('Edit').'">'.
228
-                Display::return_icon('edit.png', get_lang('EditGroup'),'',ICON_SIZE_SMALL).'</a>';
228
+                Display::return_icon('edit.png', get_lang('EditGroup'), '', ICON_SIZE_SMALL).'</a>';
229 229
             $actions .=
230 230
                 Display::url(
231 231
                     Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL),
@@ -235,17 +235,17 @@  discard block
 block discarded – undo
235 235
                     )
236 236
                 );
237 237
             if ($index != 0) {
238
-                $actions .=  ' <a href="group.php?'.api_get_cidreq().'&action=swap_cat_order&id1='.$categoryId.'&id2='.$group_cats[$index -1]['id'].'">'.
239
-                    Display::return_icon('up.png','&nbsp;','',ICON_SIZE_SMALL).'</a>';
238
+                $actions .= ' <a href="group.php?'.api_get_cidreq().'&action=swap_cat_order&id1='.$categoryId.'&id2='.$group_cats[$index - 1]['id'].'">'.
239
+                    Display::return_icon('up.png', '&nbsp;', '', ICON_SIZE_SMALL).'</a>';
240 240
             }
241 241
             if ($index != count($group_cats) - 1) {
242
-                $actions .= ' <a href="group.php?'.api_get_cidreq().'&action=swap_cat_order&id1='.$categoryId.'&id2='.$group_cats[$index +1]['id'].'">'.
243
-                    Display::return_icon('down.png','&nbsp;','',ICON_SIZE_SMALL).'</a>';
242
+                $actions .= ' <a href="group.php?'.api_get_cidreq().'&action=swap_cat_order&id1='.$categoryId.'&id2='.$group_cats[$index + 1]['id'].'">'.
243
+                    Display::return_icon('down.png', '&nbsp;', '', ICON_SIZE_SMALL).'</a>';
244 244
             }
245 245
         }
246 246
 
247 247
         echo Display::page_header(
248
-            Security::remove_XSS($category['title'].' '. $label.' ').$actions,
248
+            Security::remove_XSS($category['title'].' '.$label.' ').$actions,
249 249
             null,
250 250
             'h4',
251 251
             false
Please login to merge, or discard this patch.
main/admin/archive_cleanup.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
 api_protect_admin_script(true);
17 17
 
18 18
 // setting breadcrumbs
19
-$interbreadcrumb[] = array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
19
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
20 20
 
21 21
 $form = new FormValidator('archive_cleanup_form', 'post', '', '', array(), FormValidator::LAYOUT_BOX);
22 22
 $form->addButtonSend(get_lang('ArchiveDirCleanupProceedButton'));
Please login to merge, or discard this patch.
main/admin/user_add.php 2 patches
Indentation   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -99,27 +99,27 @@  discard block
 block discarded – undo
99 99
 $form = new FormValidator('user_add');
100 100
 $form->addElement('header', '', $tool_name);
101 101
 if (api_is_western_name_order()) {
102
-	// Firstname
103
-	$form->addElement('text', 'firstname', get_lang('FirstName'));
104
-	$form->applyFilter('firstname', 'html_filter');
105
-	$form->applyFilter('firstname', 'trim');
106
-	$form->addRule('firstname', get_lang('ThisFieldIsRequired'), 'required');
107
-	// Lastname
108
-	$form->addElement('text', 'lastname', get_lang('LastName'));
109
-	$form->applyFilter('lastname', 'html_filter');
110
-	$form->applyFilter('lastname', 'trim');
111
-	$form->addRule('lastname', get_lang('ThisFieldIsRequired'), 'required');
102
+    // Firstname
103
+    $form->addElement('text', 'firstname', get_lang('FirstName'));
104
+    $form->applyFilter('firstname', 'html_filter');
105
+    $form->applyFilter('firstname', 'trim');
106
+    $form->addRule('firstname', get_lang('ThisFieldIsRequired'), 'required');
107
+    // Lastname
108
+    $form->addElement('text', 'lastname', get_lang('LastName'));
109
+    $form->applyFilter('lastname', 'html_filter');
110
+    $form->applyFilter('lastname', 'trim');
111
+    $form->addRule('lastname', get_lang('ThisFieldIsRequired'), 'required');
112 112
 } else {
113
-	// Lastname
114
-	$form->addElement('text', 'lastname', get_lang('LastName'));
115
-	$form->applyFilter('lastname', 'html_filter');
116
-	$form->applyFilter('lastname', 'trim');
117
-	$form->addRule('lastname', get_lang('ThisFieldIsRequired'), 'required');
118
-	// Firstname
119
-	$form->addElement('text', 'firstname', get_lang('FirstName'));
120
-	$form->applyFilter('firstname', 'html_filter');
121
-	$form->applyFilter('firstname', 'trim');
122
-	$form->addRule('firstname', get_lang('ThisFieldIsRequired'), 'required');
113
+    // Lastname
114
+    $form->addElement('text', 'lastname', get_lang('LastName'));
115
+    $form->applyFilter('lastname', 'html_filter');
116
+    $form->applyFilter('lastname', 'trim');
117
+    $form->addRule('lastname', get_lang('ThisFieldIsRequired'), 'required');
118
+    // Firstname
119
+    $form->addElement('text', 'firstname', get_lang('FirstName'));
120
+    $form->applyFilter('firstname', 'html_filter');
121
+    $form->applyFilter('firstname', 'trim');
122
+    $form->addRule('firstname', get_lang('ThisFieldIsRequired'), 'required');
123 123
 }
124 124
 // Official code
125 125
 $form->addElement('text', 'official_code', get_lang('OfficialCode'), array('size' => '40'));
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 $auth_sources = 0; //make available wider as we need it in case of form reset (see below)
164 164
 $nb_ext_auth_source_added = 0;
165 165
 if (isset($extAuthSource) && count($extAuthSource) > 0) {
166
-	$auth_sources = array();
166
+    $auth_sources = array();
167 167
     foreach ($extAuthSource as $key => $info) {
168 168
         // @todo : make uniform external authentification configuration (ex : cas and external_login ldap)
169 169
         // Special case for CAS. CAS is activated from Chamilo > Administration > Configuration > CAS
@@ -174,10 +174,10 @@  discard block
 block discarded – undo
174 174
             $nb_ext_auth_source_added++;
175 175
         }
176 176
     }
177
-	if ($nb_ext_auth_source_added > 0) {
178
-    	$group[] = $form->createElement('radio', 'password_auto', null, get_lang('ExternalAuthentication').' ', 2);
179
-    	$group[] = $form->createElement('select', 'auth_source', null, $auth_sources);
180
-    	$group[] = $form->createElement('static', '', '', '<br />');
177
+    if ($nb_ext_auth_source_added > 0) {
178
+        $group[] = $form->createElement('radio', 'password_auto', null, get_lang('ExternalAuthentication').' ', 2);
179
+        $group[] = $form->createElement('select', 'auth_source', null, $auth_sources);
180
+        $group[] = $form->createElement('static', '', '', '<br />');
181 181
     }
182 182
 }
183 183
 
@@ -246,12 +246,12 @@  discard block
 block discarded – undo
246 246
 $form->addElement('html', '<div id="drh_list" style="display:'.$display.';">');
247 247
 
248 248
 if (isset($drh_list) && is_array($drh_list)) {
249
-	foreach ($drh_list as $drh) {
249
+    foreach ($drh_list as $drh) {
250 250
         $drh_select->addOption(
251 251
             api_get_person_name($drh['firstname'], $drh['lastname']),
252 252
             $drh['user_id']
253 253
         );
254
-	}
254
+    }
255 255
 }
256 256
 $form->addElement('html', '</div>');
257 257
 
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
 
326 326
 // Validate form
327 327
 if ($form->validate()) {
328
-	$check = Security::check_token('post');
328
+    $check = Security::check_token('post');
329 329
     if ($check) {
330 330
         $user = $form->exportValues();
331 331
         $lastname = $user['lastname'];
@@ -341,15 +341,15 @@  discard block
 block discarded – undo
341 341
         $send_mail = intval($user['mail']['send_mail']);
342 342
         $hr_dept_id = isset($user['hr_dept_id']) ? intval($user['hr_dept_id']) : 0;
343 343
 
344
-		if (isset($extAuthSource) && count($extAuthSource) > 0 &&
344
+        if (isset($extAuthSource) && count($extAuthSource) > 0 &&
345 345
             $user['password']['password_auto'] == '2'
346 346
         ) {
347
-			$auth_source = $user['password']['auth_source'];
348
-			$password = 'PLACEHOLDER';
349
-		} else {
350
-			$auth_source = PLATFORM_AUTH_SOURCE;
351
-			$password = $user['password']['password_auto'] == '1' ? api_generate_password() : $user['password']['password'];
352
-		}
347
+            $auth_source = $user['password']['auth_source'];
348
+            $password = 'PLACEHOLDER';
349
+        } else {
350
+            $auth_source = PLATFORM_AUTH_SOURCE;
351
+            $password = $user['password']['password_auto'] == '1' ? api_generate_password() : $user['password']['password'];
352
+        }
353 353
 
354 354
         if ($user['radio_expiration_date'] == '1') {
355 355
             $expiration_date = $user['expiration_date'];
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
             $expiration_date = null;
358 358
         }
359 359
 
360
-		$active = intval($user['active']);
360
+        $active = intval($user['active']);
361 361
 
362 362
         if (api_get_setting('login_is_email') == 'true') {
363 363
             $username = $email;
@@ -388,12 +388,12 @@  discard block
 block discarded – undo
388 388
             $extra,
389 389
             null,
390 390
             $send_mail,
391
-			$platform_admin
391
+            $platform_admin
392 392
         );
393 393
 
394
-		Security::clear_token();
395
-		$tok = Security::get_token();
396
-		if (!empty($user_id)) {
394
+        Security::clear_token();
395
+        $tok = Security::get_token();
396
+        if (!empty($user_id)) {
397 397
             if (!empty($picture['name'])) {
398 398
                 $picture_uri = UserManager::update_user_picture(
399 399
                     $user_id,
@@ -420,37 +420,37 @@  discard block
 block discarded – undo
420 420
                     null,
421 421
                     $language
422 422
                 );
423
-			}
423
+            }
424 424
 
425 425
             $extraFieldValues = new ExtraFieldValue('user');
426 426
             $user['item_id'] = $user_id;
427 427
             $extraFieldValues->saveFieldValues($user);
428
-			$message = get_lang('UserAdded');
429
-		}
428
+            $message = get_lang('UserAdded');
429
+        }
430 430
 
431
-		if (isset($user['submit_plus'])) {
432
-			//we want to add more. Prepare report message and redirect to the same page (to clean the form)
431
+        if (isset($user['submit_plus'])) {
432
+            //we want to add more. Prepare report message and redirect to the same page (to clean the form)
433 433
             Display::addFlash(Display::return_message($message));
434
-			header('Location: user_add.php?sec_token='.$tok);
435
-			exit;
436
-		} else {
437
-			$tok = Security::get_token();
434
+            header('Location: user_add.php?sec_token='.$tok);
435
+            exit;
436
+        } else {
437
+            $tok = Security::get_token();
438 438
             Display::addFlash(Display::return_message($message));
439
-			header('Location: user_list.php?sec_token='.$tok);
440
-			exit;
441
-		}
442
-	}
439
+            header('Location: user_list.php?sec_token='.$tok);
440
+            exit;
441
+        }
442
+    }
443 443
 } else {
444
-	if (isset($_POST['submit'])) {
445
-		Security::clear_token();
446
-	}
447
-	$token = Security::get_token();
448
-	$form->addElement('hidden', 'sec_token');
449
-	$form->setConstants(array('sec_token' => $token));
444
+    if (isset($_POST['submit'])) {
445
+        Security::clear_token();
446
+    }
447
+    $token = Security::get_token();
448
+    $form->addElement('hidden', 'sec_token');
449
+    $form->setConstants(array('sec_token' => $token));
450 450
 }
451 451
 
452 452
 if (!empty($message)){
453
-	$message = Display::return_message(stripslashes($message));
453
+    $message = Display::return_message(stripslashes($message));
454 454
 }
455 455
 $content = $form->returnForm();
456 456
 
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 }
134 134
 
135 135
 if (api_get_setting('login_is_email') == 'true') {
136
-    $form->addRule('email', sprintf(get_lang('UsernameMaxXCharacters'), (string)USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
136
+    $form->addRule('email', sprintf(get_lang('UsernameMaxXCharacters'), (string) USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
137 137
     $form->addRule('email', get_lang('UserTaken'), 'username_available');
138 138
 }
139 139
 
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 if (api_get_setting('login_is_email') != 'true') {
154 154
     $form->addElement('text', 'username', get_lang('LoginName'), array('id'=> 'username', 'maxlength' => USERNAME_MAX_LENGTH, 'autocomplete' => 'off'));
155 155
     $form->addRule('username', get_lang('ThisFieldIsRequired'), 'required');
156
-    $form->addRule('username', sprintf(get_lang('UsernameMaxXCharacters'), (string)USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
156
+    $form->addRule('username', sprintf(get_lang('UsernameMaxXCharacters'), (string) USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
157 157
     $form->addRule('username', get_lang('OnlyLettersAndNumbersAllowed'), 'username');
158 158
     $form->addRule('username', get_lang('UserTaken'), 'username_available');
159 159
 }
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 );
241 241
 
242 242
 //drh list (display only if student)
243
-$display = isset($_POST['status']) && $_POST['status'] == STUDENT  || !isset($_POST['status']) ? 'block' : 'none';
243
+$display = isset($_POST['status']) && $_POST['status'] == STUDENT || !isset($_POST['status']) ? 'block' : 'none';
244 244
 
245 245
 //@todo remove the drh list here. This code is unused
246 246
 $form->addElement('html', '<div id="drh_list" style="display:'.$display.';">');
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 $form->addGroup($group, 'mail', get_lang('SendMailToNewUser'));
275 275
 // Expiration Date
276 276
 $form->addElement('radio', 'radio_expiration_date', get_lang('ExpirationDate'), get_lang('NeverExpires'), 0);
277
-$group = array ();
277
+$group = array();
278 278
 $group[] = $form->createElement('radio', 'radio_expiration_date', null, get_lang('Enabled'), 1);
279 279
 $group[] = $form->createElement(
280 280
     'DateTimePicker',
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 $jquery_ready_content = $returnParams['jquery_ready_content'];
296 296
 
297 297
 // the $jquery_ready_content variable collects all functions that will be load in the $(document).ready javascript function
298
-$htmlHeadXtra[] ='<script>
298
+$htmlHeadXtra[] = '<script>
299 299
 $(document).ready(function(){
300 300
 	'.$jquery_ready_content.'
301 301
 });
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
 	$form->setConstants(array('sec_token' => $token));
450 450
 }
451 451
 
452
-if (!empty($message)){
452
+if (!empty($message)) {
453 453
 	$message = Display::return_message(stripslashes($message));
454 454
 }
455 455
 $content = $form->returnForm();
Please login to merge, or discard this patch.