@@ -550,17 +550,17 @@ discard block |
||
550 | 550 | } |
551 | 551 | } |
552 | 552 | $max_cols_per_page = 12; //10 dates + 2 name and number |
553 | - $max_dates_per_page = $max_dates_per_page_original = $max_cols_per_page - 2;//10 |
|
553 | + $max_dates_per_page = $max_dates_per_page_original = $max_cols_per_page - 2; //10 |
|
554 | 554 | $rows = count($data_table); |
555 | 555 | |
556 | 556 | if ($cols > $max_cols_per_page) { |
557 | - $number_tables = round(($cols-2)/$max_dates_per_page); |
|
557 | + $number_tables = round(($cols - 2) / $max_dates_per_page); |
|
558 | 558 | $headers = $data_table[0]; |
559 | 559 | $all = array(); |
560 | 560 | $tables = array(); |
561 | 561 | $changed = 1; |
562 | 562 | |
563 | - for ($i= 0; $i <= $rows; $i++) { |
|
563 | + for ($i = 0; $i <= $rows; $i++) { |
|
564 | 564 | $row = isset($data_table[$i]) ? $data_table[$i] : null; |
565 | 565 | $key = 1; |
566 | 566 | $max_dates_per_page = 10; |
@@ -571,7 +571,7 @@ discard block |
||
571 | 571 | foreach ($item as $value) { |
572 | 572 | if ($count_j >= $max_dates_per_page) { |
573 | 573 | $key++; |
574 | - $max_dates_per_page = $max_dates_per_page_original*$key; |
|
574 | + $max_dates_per_page = $max_dates_per_page_original * $key; |
|
575 | 575 | //magic hack |
576 | 576 | $tables[$key][$i][] = $tables[1][$i][0]; |
577 | 577 | $tables[$key][$i][] = $tables[1][$i][1]; |
@@ -628,8 +628,8 @@ discard block |
||
628 | 628 | $form = new FormValidator( |
629 | 629 | 'search', |
630 | 630 | 'post', |
631 | - api_get_self() . '?' . api_get_cidreq( |
|
632 | - ) . '&action=calendar_logins' |
|
631 | + api_get_self().'?'.api_get_cidreq( |
|
632 | + ).'&action=calendar_logins' |
|
633 | 633 | ); |
634 | 634 | $form->addDateRangePicker('range', get_lang('DateRange')); |
635 | 635 | $form->addButton('submit', get_lang('Submit')); |
@@ -50,9 +50,9 @@ discard block |
||
50 | 50 | $learnpath_item_id = intval($_REQUEST['learnpath_item_id']); |
51 | 51 | } |
52 | 52 | |
53 | -$_SESSION['hotspot_coord']=array(); |
|
54 | -$newquestionList= isset($_SESSION['newquestionList']) ? $_SESSION['newquestionList'] : []; |
|
55 | -$questionList = $_SESSION['questionList']; |
|
53 | +$_SESSION['hotspot_coord'] = array(); |
|
54 | +$newquestionList = isset($_SESSION['newquestionList']) ? $_SESSION['newquestionList'] : []; |
|
55 | +$questionList = $_SESSION['questionList']; |
|
56 | 56 | |
57 | 57 | $exerciseId = intval($_GET['exerciseId']); |
58 | 58 | $exerciseType = intval($_GET['exerciseType']); |
@@ -82,9 +82,9 @@ discard block |
||
82 | 82 | |
83 | 83 | $choice_value = ''; |
84 | 84 | |
85 | -$user_array = substr($user_array,0,-1); |
|
85 | +$user_array = substr($user_array, 0, -1); |
|
86 | 86 | |
87 | -if (isset($_GET['choice'])){ |
|
87 | +if (isset($_GET['choice'])) { |
|
88 | 88 | $choice_value = intval($_GET['choice']); |
89 | 89 | } |
90 | 90 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | } |
132 | 132 | |
133 | 133 | $choice = array(); |
134 | -$questionid= $questionList[$questionNum]; |
|
134 | +$questionid = $questionList[$questionNum]; |
|
135 | 135 | // $choice_value => value of the user selection |
136 | 136 | $choice[$questionid] = isset($choice_value) ? $choice_value : null; |
137 | 137 | |
@@ -148,11 +148,11 @@ discard block |
||
148 | 148 | $exerciseResult = $choice; |
149 | 149 | } else { |
150 | 150 | // gets the question ID from $choice. It is the key of the array |
151 | - list($key)=array_keys($choice); |
|
151 | + list($key) = array_keys($choice); |
|
152 | 152 | // if the user didn't already answer this question |
153 | - if(!isset($exerciseResult[$key])) { |
|
153 | + if (!isset($exerciseResult[$key])) { |
|
154 | 154 | // stores the user answer into the array |
155 | - $exerciseResult[$key]=$choice[$key]; |
|
155 | + $exerciseResult[$key] = $choice[$key]; |
|
156 | 156 | } |
157 | 157 | } |
158 | 158 | } |
@@ -178,26 +178,26 @@ discard block |
||
178 | 178 | |
179 | 179 | // creates a temporary Question object |
180 | 180 | if (in_array($questionid, $questionList)) { |
181 | - $objQuestionTmp = Question :: read($questionid); |
|
182 | - $questionName =$objQuestionTmp->selectTitle(); |
|
183 | - $questionDescription=$objQuestionTmp->selectDescription(); |
|
184 | - $questionWeighting =$objQuestionTmp->selectWeighting(); |
|
185 | - $answerType =$objQuestionTmp->selectType(); |
|
186 | - $quesId =$objQuestionTmp->selectId(); //added by priya saini |
|
181 | + $objQuestionTmp = Question :: read($questionid); |
|
182 | + $questionName = $objQuestionTmp->selectTitle(); |
|
183 | + $questionDescription = $objQuestionTmp->selectDescription(); |
|
184 | + $questionWeighting = $objQuestionTmp->selectWeighting(); |
|
185 | + $answerType = $objQuestionTmp->selectType(); |
|
186 | + $quesId = $objQuestionTmp->selectId(); //added by priya saini |
|
187 | 187 | } |
188 | 188 | |
189 | -$objAnswerTmp=new Answer($questionid); |
|
190 | -$nbrAnswers=$objAnswerTmp->selectNbrAnswers(); |
|
189 | +$objAnswerTmp = new Answer($questionid); |
|
190 | +$nbrAnswers = $objAnswerTmp->selectNbrAnswers(); |
|
191 | 191 | //echo 'answe_type '.$answerType;echo '<br />'; |
192 | 192 | |
193 | 193 | $choice = $exerciseResult[$questionid]; |
194 | -$destination=array(); |
|
195 | -$comment=''; |
|
196 | -$next=1; |
|
194 | +$destination = array(); |
|
195 | +$comment = ''; |
|
196 | +$next = 1; |
|
197 | 197 | $_SESSION['hotspot_coord'] = array(); |
198 | 198 | $_SESSION['hotspot_dest'] = array(); |
199 | 199 | |
200 | -$overlap_color = $missing_color = $excess_color=false; |
|
200 | +$overlap_color = $missing_color = $excess_color = false; |
|
201 | 201 | $organs_at_risk_hit = 0; |
202 | 202 | $wrong_results = false; |
203 | 203 | $hot_spot_load = false; |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | $totalScore = 0; |
207 | 207 | |
208 | 208 | if (!empty($choice_value)) { |
209 | - for ($answerId=1;$answerId <= $nbrAnswers;$answerId++) { |
|
209 | + for ($answerId = 1; $answerId <= $nbrAnswers; $answerId++) { |
|
210 | 210 | $answer = $objAnswerTmp->selectAnswer($answerId); |
211 | 211 | $answerComment = $objAnswerTmp->selectComment($answerId); |
212 | 212 | $answerDestination = $objAnswerTmp->selectDestination($answerId); |
@@ -217,29 +217,29 @@ discard block |
||
217 | 217 | |
218 | 218 | //delineation |
219 | 219 | $delineation_cord = $objAnswerTmp->selectHotspotCoordinates(1); |
220 | - $answer_delineation_destination=$objAnswerTmp->selectDestination(1); |
|
221 | - if ($dbg_local>0) { error_log(__LINE__.' answerId: '.$answerId.'('.$answerType.') - user delineation_cord: '.$delineation_cord.' - $answer_delineation_destination: '.$answer_delineation_destination,0);} |
|
220 | + $answer_delineation_destination = $objAnswerTmp->selectDestination(1); |
|
221 | + if ($dbg_local > 0) { error_log(__LINE__.' answerId: '.$answerId.'('.$answerType.') - user delineation_cord: '.$delineation_cord.' - $answer_delineation_destination: '.$answer_delineation_destination, 0); } |
|
222 | 222 | |
223 | - switch($answerType) { |
|
223 | + switch ($answerType) { |
|
224 | 224 | // for unique answer |
225 | 225 | case UNIQUE_ANSWER : |
226 | - $studentChoice = ($choice_value == $numAnswer)?1:0; |
|
226 | + $studentChoice = ($choice_value == $numAnswer) ? 1 : 0; |
|
227 | 227 | if ($studentChoice) { |
228 | - $questionScore +=$answerWeighting; |
|
229 | - $totalScore +=$answerWeighting; |
|
230 | - $newquestionList[]=$questionid; |
|
228 | + $questionScore += $answerWeighting; |
|
229 | + $totalScore += $answerWeighting; |
|
230 | + $newquestionList[] = $questionid; |
|
231 | 231 | } |
232 | 232 | break; |
233 | 233 | case HOT_SPOT_DELINEATION : |
234 | - $studentChoice=$choice[$answerId]; |
|
234 | + $studentChoice = $choice[$answerId]; |
|
235 | 235 | if ($studentChoice) { |
236 | - $newquestionList[]=$questionid; |
|
236 | + $newquestionList[] = $questionid; |
|
237 | 237 | } |
238 | - if ($answerId===1) { |
|
239 | - $questionScore +=$answerWeighting; |
|
240 | - $totalScore +=$answerWeighting; |
|
241 | - $_SESSION['hotspot_coord'][1] =$delineation_cord; |
|
242 | - $_SESSION['hotspot_dest'][1] =$answer_delineation_destination; |
|
238 | + if ($answerId === 1) { |
|
239 | + $questionScore += $answerWeighting; |
|
240 | + $totalScore += $answerWeighting; |
|
241 | + $_SESSION['hotspot_coord'][1] = $delineation_cord; |
|
242 | + $_SESSION['hotspot_dest'][1] = $answer_delineation_destination; |
|
243 | 243 | } |
244 | 244 | break; |
245 | 245 | } |
@@ -251,27 +251,27 @@ discard block |
||
251 | 251 | $destination = $answerDestination; |
252 | 252 | $comment = $answerComment; |
253 | 253 | } |
254 | - } elseif($answerType == HOT_SPOT_DELINEATION) { |
|
254 | + } elseif ($answerType == HOT_SPOT_DELINEATION) { |
|
255 | 255 | if ($next) { |
256 | - if ($dbg_local>0) { error_log(__LINE__.' - next',0);} |
|
256 | + if ($dbg_local > 0) { error_log(__LINE__.' - next', 0); } |
|
257 | 257 | $hot_spot_load = true; //apparently the script is called twice |
258 | 258 | $user_answer = $user_array; |
259 | - $_SESSION['exerciseResultCoordinates'][$questionid]=$user_answer; //needed for exercise_result.php |
|
259 | + $_SESSION['exerciseResultCoordinates'][$questionid] = $user_answer; //needed for exercise_result.php |
|
260 | 260 | |
261 | 261 | // we compare only the delineation not the other points |
262 | - $answer_question = $_SESSION['hotspot_coord'][1]; |
|
263 | - $answerDestination = $_SESSION['hotspot_dest'][1]; |
|
262 | + $answer_question = $_SESSION['hotspot_coord'][1]; |
|
263 | + $answerDestination = $_SESSION['hotspot_dest'][1]; |
|
264 | 264 | |
265 | - $poly_user = convert_coordinates($user_answer,'/'); |
|
266 | - $poly_answer = convert_coordinates($answer_question,'|'); |
|
267 | - $max_coord = poly_get_max($poly_user,$poly_answer); |
|
265 | + $poly_user = convert_coordinates($user_answer, '/'); |
|
266 | + $poly_answer = convert_coordinates($answer_question, '|'); |
|
267 | + $max_coord = poly_get_max($poly_user, $poly_answer); |
|
268 | 268 | |
269 | 269 | if (empty($_GET['hotspot'])) { //no user response |
270 | 270 | $overlap = -2; |
271 | 271 | } else { |
272 | - $poly_user_compiled = poly_compile($poly_user,$max_coord); |
|
273 | - $poly_answer_compiled = poly_compile($poly_answer,$max_coord); |
|
274 | - $poly_results = poly_result($poly_answer_compiled,$poly_user_compiled,$max_coord); |
|
272 | + $poly_user_compiled = poly_compile($poly_user, $max_coord); |
|
273 | + $poly_answer_compiled = poly_compile($poly_answer, $max_coord); |
|
274 | + $poly_results = poly_result($poly_answer_compiled, $poly_user_compiled, $max_coord); |
|
275 | 275 | |
276 | 276 | $overlap = $poly_results['both']; |
277 | 277 | $poly_answer_area = $poly_results['s1']; |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | } |
282 | 282 | |
283 | 283 | //$overlap = round(polygons_overlap($poly_answer,$poly_user)); //this is an area in pixels |
284 | - if ($dbg_local>0) { error_log(__LINE__.' - Polygons results are '.print_r($poly_results,1),0);} |
|
284 | + if ($dbg_local > 0) { error_log(__LINE__.' - Polygons results are '.print_r($poly_results, 1), 0); } |
|
285 | 285 | if ($overlap < 1) { |
286 | 286 | //shortcut to avoid complicated calculations |
287 | 287 | $final_overlap = 0; |
@@ -289,27 +289,27 @@ discard block |
||
289 | 289 | $final_excess = 100; |
290 | 290 | } else { |
291 | 291 | // the final overlap is the percentage of the initial polygon that is overlapped by the user's polygon |
292 | - $final_overlap = round(((float)$overlap / (float)$poly_answer_area)*100); |
|
293 | - if ($dbg_local>1) { error_log(__LINE__.' - Final overlap is '.$final_overlap,0);} |
|
292 | + $final_overlap = round(((float) $overlap / (float) $poly_answer_area) * 100); |
|
293 | + if ($dbg_local > 1) { error_log(__LINE__.' - Final overlap is '.$final_overlap, 0); } |
|
294 | 294 | // the final missing area is the percentage of the initial polygon that is not overlapped by the user's polygon |
295 | 295 | $final_missing = 100 - $final_overlap; |
296 | - if ($dbg_local>1) { error_log(__LINE__.' - Final missing is '.$final_missing,0);} |
|
296 | + if ($dbg_local > 1) { error_log(__LINE__.' - Final missing is '.$final_missing, 0); } |
|
297 | 297 | // the final excess area is the percentage of the initial polygon's size that is covered by the user's polygon outside of the initial polygon |
298 | - $final_excess = round((((float)$poly_user_area-(float)$overlap)/(float)$poly_answer_area)*100); |
|
299 | - if ($dbg_local>1) { error_log(__LINE__.' - Final excess is '.$final_excess,0);} |
|
298 | + $final_excess = round((((float) $poly_user_area - (float) $overlap) / (float) $poly_answer_area) * 100); |
|
299 | + if ($dbg_local > 1) { error_log(__LINE__.' - Final excess is '.$final_excess, 0); } |
|
300 | 300 | } |
301 | 301 | |
302 | - $destination_items= explode('@@', $answerDestination); |
|
302 | + $destination_items = explode('@@', $answerDestination); |
|
303 | 303 | $threadhold_total = $destination_items[0]; |
304 | - $threadhold_items=explode(';',$threadhold_total); |
|
304 | + $threadhold_items = explode(';', $threadhold_total); |
|
305 | 305 | $threadhold1 = $threadhold_items[0]; // overlap |
306 | 306 | $threadhold2 = $threadhold_items[1]; // excess |
307 | - $threadhold3 = $threadhold_items[2]; //missing |
|
307 | + $threadhold3 = $threadhold_items[2]; //missing |
|
308 | 308 | |
309 | 309 | // echo $final_overlap.' '.$threadhold1 .' - '. $final_missing.' '. $threadhold2 .' - '. $final_excess.' '. $threadhold3; |
310 | 310 | |
311 | 311 | // if is delineation |
312 | - if ($answerId===1) { |
|
312 | + if ($answerId === 1) { |
|
313 | 313 | //setting colors |
314 | 314 | if ($final_overlap >= $threadhold1) { |
315 | 315 | $overlap_color = true; //echo 'a'; |
@@ -325,40 +325,40 @@ discard block |
||
325 | 325 | |
326 | 326 | // if pass |
327 | 327 | //if ($final_overlap>=$threadhold1 && $final_missing<=$threadhold2 && $final_excess<=$threadhold3) { |
328 | - if ($final_overlap>=$threadhold1 && $final_missing<=$threadhold3 && $final_excess<=$threadhold2) { |
|
329 | - $next=1; //go to the oars |
|
330 | - $result_comment=get_lang('Acceptable'); |
|
328 | + if ($final_overlap >= $threadhold1 && $final_missing <= $threadhold3 && $final_excess <= $threadhold2) { |
|
329 | + $next = 1; //go to the oars |
|
330 | + $result_comment = get_lang('Acceptable'); |
|
331 | 331 | } else { |
332 | - $next=1; //Go to the oars. If $next = 0 we will show this message: "One (or more) area at risk has been hit" instead of the table resume with the results |
|
332 | + $next = 1; //Go to the oars. If $next = 0 we will show this message: "One (or more) area at risk has been hit" instead of the table resume with the results |
|
333 | 333 | $wrong_results = true; |
334 | - $result_comment=get_lang('Unacceptable'); |
|
335 | - $special_comment = $comment=$answerDestination=$objAnswerTmp->selectComment(1); |
|
336 | - $answerDestination=$objAnswerTmp->selectDestination(1); |
|
337 | - $destination_items= explode('@@', $answerDestination); |
|
338 | - $try_hotspot=$destination_items[1]; |
|
339 | - $lp_hotspot=$destination_items[2]; |
|
340 | - $select_question_hotspot=$destination_items[3]; |
|
341 | - $url_hotspot=$destination_items[4]; |
|
334 | + $result_comment = get_lang('Unacceptable'); |
|
335 | + $special_comment = $comment = $answerDestination = $objAnswerTmp->selectComment(1); |
|
336 | + $answerDestination = $objAnswerTmp->selectDestination(1); |
|
337 | + $destination_items = explode('@@', $answerDestination); |
|
338 | + $try_hotspot = $destination_items[1]; |
|
339 | + $lp_hotspot = $destination_items[2]; |
|
340 | + $select_question_hotspot = $destination_items[3]; |
|
341 | + $url_hotspot = $destination_items[4]; |
|
342 | 342 | //echo 'show the feedback'; |
343 | 343 | } |
344 | - } elseif($answerId>1) { |
|
344 | + } elseif ($answerId > 1) { |
|
345 | 345 | if ($objAnswerTmp->selectHotspotType($answerId) == 'noerror') { |
346 | - if ($dbg_local>0) { error_log(__LINE__.' - answerId is of type noerror',0);} |
|
346 | + if ($dbg_local > 0) { error_log(__LINE__.' - answerId is of type noerror', 0); } |
|
347 | 347 | //type no error shouldn't be treated |
348 | 348 | $next = 1; |
349 | 349 | continue; |
350 | 350 | } |
351 | - if ($dbg_local>0) { error_log(__LINE__.' - answerId is >1 so we\'re probably in OAR',0);} |
|
351 | + if ($dbg_local > 0) { error_log(__LINE__.' - answerId is >1 so we\'re probably in OAR', 0); } |
|
352 | 352 | //check the intersection between the oar and the user |
353 | 353 | //echo 'user'; print_r($x_user_list); print_r($y_user_list); |
354 | 354 | //echo 'official';print_r($x_list);print_r($y_list); |
355 | 355 | //$result = get_intersection_data($x_list,$y_list,$x_user_list,$y_user_list); |
356 | 356 | |
357 | 357 | //$delineation_cord=$objAnswerTmp->selectHotspotCoordinates($answerId); |
358 | - $delineation_cord=$objAnswerTmp->selectHotspotCoordinates($answerId); //getting the oars coordinates |
|
358 | + $delineation_cord = $objAnswerTmp->selectHotspotCoordinates($answerId); //getting the oars coordinates |
|
359 | 359 | |
360 | - $poly_answer = convert_coordinates($delineation_cord,'|'); |
|
361 | - $max_coord = poly_get_max($poly_user,$poly_answer); //getting max coordinates |
|
360 | + $poly_answer = convert_coordinates($delineation_cord, '|'); |
|
361 | + $max_coord = poly_get_max($poly_user, $poly_answer); //getting max coordinates |
|
362 | 362 | $test = false; |
363 | 363 | // if ($answerId == 2 ){$test = true;} for test oars |
364 | 364 | |
@@ -366,9 +366,9 @@ discard block |
||
366 | 366 | $overlap = false; |
367 | 367 | } else { |
368 | 368 | // poly_compile really works tested with gnuplot |
369 | - $poly_user_compiled = poly_compile($poly_user,$max_coord,$test);//$poly_user is already set when answerid = 1 |
|
370 | - $poly_answer_compiled = poly_compile($poly_answer,$max_coord,$test); |
|
371 | - $overlap = poly_touch($poly_user_compiled, $poly_answer_compiled,$max_coord); |
|
369 | + $poly_user_compiled = poly_compile($poly_user, $max_coord, $test); //$poly_user is already set when answerid = 1 |
|
370 | + $poly_answer_compiled = poly_compile($poly_answer, $max_coord, $test); |
|
371 | + $overlap = poly_touch($poly_user_compiled, $poly_answer_compiled, $max_coord); |
|
372 | 372 | } |
373 | 373 | |
374 | 374 | if ($overlap == false) { |
@@ -376,42 +376,42 @@ discard block |
||
376 | 376 | $next = 1; |
377 | 377 | continue; |
378 | 378 | } else { |
379 | - if ($dbg_local>0) { error_log(__LINE__.' - Overlap is '.$overlap.': OAR hit',0);} |
|
379 | + if ($dbg_local > 0) { error_log(__LINE__.' - Overlap is '.$overlap.': OAR hit', 0); } |
|
380 | 380 | |
381 | 381 | $organs_at_risk_hit++; |
382 | 382 | //show the feedback |
383 | - $next=1; |
|
384 | - $comment=$answerDestination=$objAnswerTmp->selectComment($answerId); |
|
385 | - $answerDestination=$objAnswerTmp->selectDestination($answerId); |
|
386 | - $destination_items= explode('@@', $answerDestination); |
|
387 | - $try_hotspot=$destination_items[1]; |
|
388 | - $lp_hotspot=$destination_items[2]; |
|
389 | - $select_question_hotspot=$destination_items[3]; |
|
390 | - $url_hotspot=$destination_items[4]; |
|
383 | + $next = 1; |
|
384 | + $comment = $answerDestination = $objAnswerTmp->selectComment($answerId); |
|
385 | + $answerDestination = $objAnswerTmp->selectDestination($answerId); |
|
386 | + $destination_items = explode('@@', $answerDestination); |
|
387 | + $try_hotspot = $destination_items[1]; |
|
388 | + $lp_hotspot = $destination_items[2]; |
|
389 | + $select_question_hotspot = $destination_items[3]; |
|
390 | + $url_hotspot = $destination_items[4]; |
|
391 | 391 | } |
392 | 392 | } |
393 | 393 | } else { |
394 | 394 | // the first delineation feedback |
395 | - if ($dbg_local>0) { error_log(__LINE__.' first',0);} |
|
395 | + if ($dbg_local > 0) { error_log(__LINE__.' first', 0); } |
|
396 | 396 | //we send the error |
397 | 397 | } |
398 | 398 | } |
399 | 399 | } |
400 | 400 | |
401 | 401 | if ($overlap_color) { |
402 | - $overlap_color='green'; |
|
402 | + $overlap_color = 'green'; |
|
403 | 403 | } else { |
404 | - $overlap_color='red'; |
|
404 | + $overlap_color = 'red'; |
|
405 | 405 | } |
406 | 406 | if ($missing_color) { |
407 | - $missing_color='green'; |
|
407 | + $missing_color = 'green'; |
|
408 | 408 | } else { |
409 | - $missing_color='red'; |
|
409 | + $missing_color = 'red'; |
|
410 | 410 | } |
411 | 411 | if ($excess_color) { |
412 | - $excess_color='green'; |
|
412 | + $excess_color = 'green'; |
|
413 | 413 | } else { |
414 | - $excess_color='red'; |
|
414 | + $excess_color = 'red'; |
|
415 | 415 | } |
416 | 416 | |
417 | 417 | if (!is_numeric($final_overlap)) { |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | $final_excess = 0; |
426 | 426 | } |
427 | 427 | |
428 | - if ($final_excess>100) { |
|
428 | + if ($final_excess > 100) { |
|
429 | 429 | $final_excess = 100; |
430 | 430 | } |
431 | 431 | |
@@ -440,26 +440,26 @@ discard block |
||
440 | 440 | <tr class="row_even"> |
441 | 441 | <td><b>'.get_lang('Overlap').'</b></td> |
442 | 442 | <td>'.get_lang('Min').' '.$threadhold1.'</td> |
443 | - <td><div style="color:'.$overlap_color.'">'.(($final_overlap < 0)?0:intval($final_overlap)).'</div></td> |
|
443 | + <td><div style="color:'.$overlap_color.'">'.(($final_overlap < 0) ? 0 : intval($final_overlap)).'</div></td> |
|
444 | 444 | </tr> |
445 | 445 | |
446 | 446 | <tr> |
447 | 447 | <td><b>'.get_lang('Excess').'</b></td> |
448 | 448 | <td>'.get_lang('Max').' '.$threadhold2.'</td> |
449 | - <td><div style="color:'.$excess_color.'">'.(($final_excess < 0)?0:intval($final_excess)).'</div></td> |
|
449 | + <td><div style="color:'.$excess_color.'">'.(($final_excess < 0) ? 0 : intval($final_excess)).'</div></td> |
|
450 | 450 | </tr> |
451 | 451 | |
452 | 452 | <tr class="row_even"> |
453 | 453 | <td><b>'.get_lang('Missing').'</b></td> |
454 | 454 | <td>'.get_lang('Max').' '.$threadhold3.'</td> |
455 | - <td><div style="color:'.$missing_color.'">'.(($final_missing < 0)?0:intval($final_missing)).'</div></td> |
|
455 | + <td><div style="color:'.$missing_color.'">'.(($final_missing < 0) ? 0 : intval($final_missing)).'</div></td> |
|
456 | 456 | </tr> |
457 | 457 | </table>'; |
458 | 458 | //var_dump($final_overlap, $threadhold1 , $final_missing, $threadhold2 , $final_excess, $threadhold3); |
459 | 459 | } |
460 | 460 | $_SESSION['newquestionList'] = $newquestionList; |
461 | 461 | |
462 | -$links=''; |
|
462 | +$links = ''; |
|
463 | 463 | |
464 | 464 | if (isset($choice_value) && $choice_value == -1) { |
465 | 465 | if ($answerType != HOT_SPOT_DELINEATION) { |
@@ -471,32 +471,32 @@ discard block |
||
471 | 471 | |
472 | 472 | if ($answerType != HOT_SPOT_DELINEATION) { |
473 | 473 | if (!empty($destination)) { |
474 | - $item_list = explode('@@',$destination); |
|
474 | + $item_list = explode('@@', $destination); |
|
475 | 475 | //print_R($item_list); |
476 | 476 | $try = $item_list[0]; |
477 | 477 | $lp = $item_list[1]; |
478 | - $destinationid= $item_list[2]; |
|
479 | - $url=$item_list[3]; |
|
478 | + $destinationid = $item_list[2]; |
|
479 | + $url = $item_list[3]; |
|
480 | 480 | } |
481 | - $table_resume=''; |
|
481 | + $table_resume = ''; |
|
482 | 482 | } else { |
483 | 483 | $try = $try_hotspot; |
484 | 484 | $lp = $lp_hotspot; |
485 | - $destinationid= $select_question_hotspot; |
|
486 | - $url=$url_hotspot; |
|
487 | - if ($organs_at_risk_hit==0 && $wrong_results==false ) { |
|
485 | + $destinationid = $select_question_hotspot; |
|
486 | + $url = $url_hotspot; |
|
487 | + if ($organs_at_risk_hit == 0 && $wrong_results == false) { |
|
488 | 488 | // no error = no oar and no wrong result for delineation |
489 | 489 | //show if no error |
490 | 490 | //echo 'no error'; |
491 | - $comment= $answerComment = $objAnswerTmp->selectComment($nbrAnswers); |
|
492 | - $answerDestination = $objAnswerTmp->selectDestination($nbrAnswers); |
|
491 | + $comment = $answerComment = $objAnswerTmp->selectComment($nbrAnswers); |
|
492 | + $answerDestination = $objAnswerTmp->selectDestination($nbrAnswers); |
|
493 | 493 | |
494 | 494 | //we send the error |
495 | - $destination_items= explode('@@', $answerDestination); |
|
496 | - $try=$destination_items[1]; |
|
497 | - $lp=$destination_items[2]; |
|
498 | - $destinationid=$destination_items[3]; |
|
499 | - $url=$destination_items[4]; |
|
495 | + $destination_items = explode('@@', $answerDestination); |
|
496 | + $try = $destination_items[1]; |
|
497 | + $lp = $destination_items[2]; |
|
498 | + $destinationid = $destination_items[3]; |
|
499 | + $url = $destination_items[4]; |
|
500 | 500 | $exerciseResult[$questionid] = 1; |
501 | 501 | } else { |
502 | 502 | $exerciseResult[$questionid] = 0; |
@@ -504,35 +504,35 @@ discard block |
||
504 | 504 | } |
505 | 505 | |
506 | 506 | // the link to retry the question |
507 | -if (isset($try) && $try==1) { |
|
508 | - $num_value_array= (array_keys($questionList, $questionid)); |
|
509 | - $links.= Display :: return_icon('reload.gif', '', array ('style' => 'padding-left:0px;padding-right:5px;')).'<a onclick="SendEx('.$num_value_array[0].');" href="#">'.get_lang('TryAgain').'</a><br /><br />'; |
|
507 | +if (isset($try) && $try == 1) { |
|
508 | + $num_value_array = (array_keys($questionList, $questionid)); |
|
509 | + $links .= Display :: return_icon('reload.gif', '', array('style' => 'padding-left:0px;padding-right:5px;')).'<a onclick="SendEx('.$num_value_array[0].');" href="#">'.get_lang('TryAgain').'</a><br /><br />'; |
|
510 | 510 | } |
511 | 511 | |
512 | 512 | // the link to theory (a learning path) |
513 | 513 | if (!empty($lp)) { |
514 | - $lp_url= api_get_path(WEB_CODE_PATH) . 'lp/lp_controller.php?'.api_get_cidreq().'&action=view&lp_id='.$lp; |
|
514 | + $lp_url = api_get_path(WEB_CODE_PATH).'lp/lp_controller.php?'.api_get_cidreq().'&action=view&lp_id='.$lp; |
|
515 | 515 | $list = new LearnpathList(api_get_user_id()); |
516 | 516 | $flat_list = $list->get_flat_list(); |
517 | - $links.= Display :: return_icon('theory.gif', '', array ('style' => 'padding-left:0px;padding-right:5px;')).'<a target="_blank" href="'.$lp_url.'">'.get_lang('SeeTheory').'</a><br />'; |
|
517 | + $links .= Display :: return_icon('theory.gif', '', array('style' => 'padding-left:0px;padding-right:5px;')).'<a target="_blank" href="'.$lp_url.'">'.get_lang('SeeTheory').'</a><br />'; |
|
518 | 518 | } |
519 | -$links.='<br />'; |
|
519 | +$links .= '<br />'; |
|
520 | 520 | |
521 | 521 | // the link to an external website or link |
522 | 522 | if (!empty($url)) { |
523 | - $links.= Display :: return_icon('link.gif', '', array ('style' => 'padding-left:0px;padding-right:5px;')).'<a target="_blank" href="'.$url.'">'.get_lang('VisitUrl').'</a><br /><br />'; |
|
523 | + $links .= Display :: return_icon('link.gif', '', array('style' => 'padding-left:0px;padding-right:5px;')).'<a target="_blank" href="'.$url.'">'.get_lang('VisitUrl').'</a><br /><br />'; |
|
524 | 524 | } |
525 | 525 | |
526 | 526 | // the link to finish the test |
527 | -if ($destinationid==-1) { |
|
528 | - $links.= Display :: return_icon('finish.gif', '', array ('style' => 'width:22px; height:22px; padding-left:0px;padding-right:5px;')).'<a onclick="SendEx(-1);" href="#">'.get_lang('EndActivity').'</a><br /><br />'; |
|
527 | +if ($destinationid == -1) { |
|
528 | + $links .= Display :: return_icon('finish.gif', '', array('style' => 'width:22px; height:22px; padding-left:0px;padding-right:5px;')).'<a onclick="SendEx(-1);" href="#">'.get_lang('EndActivity').'</a><br /><br />'; |
|
529 | 529 | } else { |
530 | 530 | // the link to other question |
531 | - if (in_array($destinationid,$questionList)) { |
|
531 | + if (in_array($destinationid, $questionList)) { |
|
532 | 532 | $objQuestionTmp = Question :: read($destinationid); |
533 | - $questionName=$objQuestionTmp->selectTitle(); |
|
534 | - $num_value_array= (array_keys($questionList, $destinationid)); |
|
535 | - $links.= Display :: return_icon('quiz.png', '', array ('style' => 'padding-left:0px;padding-right:5px;')).'<a onclick="SendEx('.$num_value_array[0].');" href="#">'.get_lang('GoToQuestion').' '.$num_value_array[0].'</a><br /><br />'; |
|
533 | + $questionName = $objQuestionTmp->selectTitle(); |
|
534 | + $num_value_array = (array_keys($questionList, $destinationid)); |
|
535 | + $links .= Display :: return_icon('quiz.png', '', array('style' => 'padding-left:0px;padding-right:5px;')).'<a onclick="SendEx('.$num_value_array[0].');" href="#">'.get_lang('GoToQuestion').' '.$num_value_array[0].'</a><br /><br />'; |
|
536 | 536 | } |
537 | 537 | } |
538 | 538 | |
@@ -549,7 +549,7 @@ discard block |
||
549 | 549 | } |
550 | 550 | </script>'; |
551 | 551 | |
552 | -if ($links!='') { |
|
552 | +if ($links != '') { |
|
553 | 553 | /*echo '<div id="ModalContent" style="padding-bottom:30px;padding-top:10px;padding-left:20px;padding-right:20px;"> |
554 | 554 | <a onclick="self.parent.tb_remove();" href="#" style="float:right; margin-top:-10px;">'.api_ucfirst(get_lang('Close')).'</a>';*/ |
555 | 555 | echo '<h1><div style="color:#333;">'.get_lang('Feedback').'</div></h1>'; |
@@ -558,15 +558,15 @@ discard block |
||
558 | 558 | if ($organs_at_risk_hit > 0) { |
559 | 559 | //$message='<p>'.get_lang('YourDelineation').'</p>'; |
560 | 560 | //$message.=$table_resume; |
561 | - $message.='<br />'.get_lang('ResultIs').' <b>'.get_lang('Unacceptable').'</b><br />'; |
|
561 | + $message .= '<br />'.get_lang('ResultIs').' <b>'.get_lang('Unacceptable').'</b><br />'; |
|
562 | 562 | //if ($wrong_results) { } |
563 | - $message.='<p style="color:#DC0A0A;"><b>'.get_lang('OARHit').'</b></p>'; |
|
564 | - $message.='<p>'.$comment.'</p>'; |
|
563 | + $message .= '<p style="color:#DC0A0A;"><b>'.get_lang('OARHit').'</b></p>'; |
|
564 | + $message .= '<p>'.$comment.'</p>'; |
|
565 | 565 | } else { |
566 | - $message='<p>'.get_lang('YourDelineation').'</p>'; |
|
567 | - $message.=$table_resume; |
|
568 | - $message.='<br />'.get_lang('ResultIs').' <b>'.$result_comment.'</b><br />'; |
|
569 | - $message.='<p>'.$comment.'</p>'; |
|
566 | + $message = '<p>'.get_lang('YourDelineation').'</p>'; |
|
567 | + $message .= $table_resume; |
|
568 | + $message .= '<br />'.get_lang('ResultIs').' <b>'.$result_comment.'</b><br />'; |
|
569 | + $message .= '<p>'.$comment.'</p>'; |
|
570 | 570 | } |
571 | 571 | echo $message; |
572 | 572 | } else { |
@@ -575,10 +575,10 @@ discard block |
||
575 | 575 | echo '<h3>'.$links.'</h3>'; |
576 | 576 | echo '</div>'; |
577 | 577 | |
578 | - $_SESSION['hot_spot_result']=$message; |
|
578 | + $_SESSION['hot_spot_result'] = $message; |
|
579 | 579 | $_SESSION['hotspot_delineation_result'][$exerciseId][$questionid] = array($message, $exerciseResult[$questionid]); |
580 | 580 | //reseting the exerciseResult variable |
581 | - Session::write('exerciseResult',$exerciseResult); |
|
581 | + Session::write('exerciseResult', $exerciseResult); |
|
582 | 582 | |
583 | 583 | //save this variables just in case the exercise loads an LP with other exercise |
584 | 584 | $_SESSION['objExerciseExtra'.$exerciseId] = $_SESSION['objExercise']; |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | Display::return_message($plugin->get_lang('OrderCancelled'), 'error', false) |
23 | 23 | ); |
24 | 24 | |
25 | - header('Location: '. api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/service_catalog.php'); |
|
25 | + header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/service_catalog.php'); |
|
26 | 26 | exit; |
27 | 27 | } |
28 | 28 | |
@@ -30,6 +30,6 @@ discard block |
||
30 | 30 | Display::return_message($plugin->get_lang('ErrorOccurred'), 'error', false) |
31 | 31 | ); |
32 | 32 | |
33 | -header('Location: '. api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/service_catalog.php'); |
|
33 | +header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/service_catalog.php'); |
|
34 | 34 | |
35 | 35 | exit; |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | $toolbar .= Display::toolbarButton( |
62 | 62 | $plugin->get_lang('PaypalPayoutCommissions'), |
63 | - api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/paypal_payout.php', |
|
63 | + api_get_path(WEB_PLUGIN_PATH).'buycourses/src/paypal_payout.php', |
|
64 | 64 | 'paypal', |
65 | 65 | 'primary', |
66 | 66 | ['title' => $plugin->get_lang('PaypalPayoutCommissions')] |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | |
75 | 75 | $toolbar .= Display::toolbarButton( |
76 | 76 | $plugin->get_lang('PayoutReport'), |
77 | - api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/payout_report.php', |
|
77 | + api_get_path(WEB_PLUGIN_PATH).'buycourses/src/payout_report.php', |
|
78 | 78 | 'money', |
79 | 79 | 'info', |
80 | 80 | ['title' => $plugin->get_lang('PayoutReport')] |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | self::getHostName($_configuration); |
30 | 30 | |
31 | 31 | // We are on physical chamilo. Let original config play |
32 | - $virtualChamiloWebRoot = rtrim($_configuration['vchamilo_web_root'], '/') . '/'; |
|
32 | + $virtualChamiloWebRoot = rtrim($_configuration['vchamilo_web_root'], '/').'/'; |
|
33 | 33 | |
34 | 34 | $virtualChamilo = []; |
35 | 35 | if ($_configuration['root_web'] == $virtualChamiloWebRoot) { |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | if (preg_match('#https?://#', $url)) { |
225 | 225 | header('location: '.$url); |
226 | 226 | } else { |
227 | - header('location: ' . api_get_path(WEB_PATH).$url); |
|
227 | + header('location: '.api_get_path(WEB_PATH).$url); |
|
228 | 228 | } |
229 | 229 | exit; |
230 | 230 | } |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | } |
408 | 408 | |
409 | 409 | // Making the command line (see 'vconfig.php' file for defining the right paths). |
410 | - $sqlcmd = $pgm.' -h'.$vchamilodata->db_host.(isset($vchamilodata->db_port) ? ' -P'.$vchamilodata->db_port.' ' : ' ' ); |
|
410 | + $sqlcmd = $pgm.' -h'.$vchamilodata->db_host.(isset($vchamilodata->db_port) ? ' -P'.$vchamilodata->db_port.' ' : ' '); |
|
411 | 411 | $sqlcmd .= '-u'.$vchamilodata->db_user.' '.$databasePassword; |
412 | 412 | $sqlcmd .= '%DATABASE% < '; |
413 | 413 | |
@@ -487,10 +487,10 @@ discard block |
||
487 | 487 | //if ($CFG->ostype == 'WINDOWS') { |
488 | 488 | if (false) { |
489 | 489 | $cmd_main = "-h{$host} -P{$port} -u{$vchamilo->db_user} {$pass} {$vchamilo->main_database}"; |
490 | - $cmds[] = $cmd_main . ' > ' . $outputfilerad; |
|
490 | + $cmds[] = $cmd_main.' > '.$outputfilerad; |
|
491 | 491 | } else { |
492 | 492 | $cmd_main = "-h{$host} -P{$port} -u{$vchamilo->db_user} {$pass} {$vchamilo->main_database}"; |
493 | - $cmds[] = $cmd_main . ' > ' . escapeshellarg($outputfilerad); |
|
493 | + $cmds[] = $cmd_main.' > '.escapeshellarg($outputfilerad); |
|
494 | 494 | } |
495 | 495 | |
496 | 496 | $mysqldumpcmd = self::getConfig('vchamilo', 'cmd_mysqldump', true); |
@@ -937,7 +937,7 @@ discard block |
||
937 | 937 | Display::return_message('You cannot use the same database as the chamilo master', 'error') |
938 | 938 | ); |
939 | 939 | |
940 | - return ; |
|
940 | + return; |
|
941 | 941 | } |
942 | 942 | |
943 | 943 | $databaseName = $data->main_database; |
@@ -951,7 +951,7 @@ discard block |
||
951 | 951 | 'error' |
952 | 952 | ) |
953 | 953 | ); |
954 | - return ; |
|
954 | + return; |
|
955 | 955 | } |
956 | 956 | |
957 | 957 | $data->root_web = api_add_trailing_slash($data->root_web); |
@@ -975,7 +975,7 @@ discard block |
||
975 | 975 | Display::addFlash( |
976 | 976 | Display::return_message('Cannot create slug from url: '.$data->root_web, 'error') |
977 | 977 | ); |
978 | - return ; |
|
978 | + return; |
|
979 | 979 | } |
980 | 980 | Database::insert($tablename, (array) $data); |
981 | 981 | } |
@@ -1117,7 +1117,7 @@ discard block |
||
1117 | 1117 | $newDatabase->sitename = $siteName; |
1118 | 1118 | $newDatabase->institution = $institution; |
1119 | 1119 | $slug = $newDatabase->slug = $data->slug = Virtual::getSlugFromUrl($data->root_web); |
1120 | - $id = Database::insert($table, (array)$newDatabase); |
|
1120 | + $id = Database::insert($table, (array) $newDatabase); |
|
1121 | 1121 | } |
1122 | 1122 | } |
1123 | 1123 | |
@@ -1294,7 +1294,7 @@ discard block |
||
1294 | 1294 | $id = (int) $id; |
1295 | 1295 | $sql = "SELECT * FROM vchamilo WHERE id = $id"; |
1296 | 1296 | $result = Database::query($sql); |
1297 | - $vhost = (object) Database::fetch_array($result, 'ASSOC'); |
|
1297 | + $vhost = (object) Database::fetch_array($result, 'ASSOC'); |
|
1298 | 1298 | } |
1299 | 1299 | |
1300 | 1300 | return $vhost; |
@@ -29,7 +29,7 @@ |
||
29 | 29 | } |
30 | 30 | |
31 | 31 | $template = new Template(false); |
32 | -$template->assign('pageUrl', api_get_path(WEB_PATH) . "service/{$serviceId}/information/"); |
|
32 | +$template->assign('pageUrl', api_get_path(WEB_PATH)."service/{$serviceId}/information/"); |
|
33 | 33 | $template->assign('service', $service); |
34 | 34 | $template->assign('essence', Essence\Essence::instance()); |
35 | 35 |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | Display::return_message($plugin->get_lang('OrderCancelled'), 'error', false) |
52 | 52 | ); |
53 | 53 | |
54 | - header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/service_catalog.php'); |
|
54 | + header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/service_catalog.php'); |
|
55 | 55 | exit; |
56 | 56 | } |
57 | 57 | |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | Display::return_message($erroMessage, 'error', false) |
67 | 67 | ); |
68 | 68 | unset($_SESSION['wizard']); |
69 | - header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/service_catalog.php'); |
|
69 | + header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/service_catalog.php'); |
|
70 | 70 | exit; |
71 | 71 | } |
72 | 72 | |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | |
151 | 151 | unset($_SESSION['bc_service_sale_id']); |
152 | 152 | |
153 | - header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/service_catalog.php'); |
|
153 | + header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/service_catalog.php'); |
|
154 | 154 | |
155 | 155 | exit; |
156 | 156 | } |
@@ -71,7 +71,7 @@ |
||
71 | 71 | function sort_files($table) |
72 | 72 | { |
73 | 73 | $tablename_direction = isset($_GET['tablename_direction']) ? Security::remove_XSS($_GET['tablename_direction']) : 'ASC'; |
74 | - $accepted_extensions = array('.jpg', '.jpeg', '.gif', '.png', '.bmp','.svg'); |
|
74 | + $accepted_extensions = array('.jpg', '.jpeg', '.gif', '.png', '.bmp', '.svg'); |
|
75 | 75 | $temp = array(); |
76 | 76 | |
77 | 77 | foreach ($table as & $file_array) { |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | if (!is_array($result)) { |
409 | 409 | $result = array(); |
410 | 410 | $exceptions = array('.', '..', 'CVS', '.svn'); |
411 | - $search = array('_latin', '_unicode', '_corporate', '_org' , '_KM', '_'); |
|
411 | + $search = array('_latin', '_unicode', '_corporate', '_org', '_KM', '_'); |
|
412 | 412 | $replace_with = array(' (Latin)', ' (unicode)', ' (corporate)', ' (org)', ' (KM)', ' '); |
413 | 413 | $dirname = api_get_path(SYS_LANG_PATH); |
414 | 414 | $handle = opendir($dirname); |
@@ -443,9 +443,9 @@ discard block |
||
443 | 443 | if ($handle = opendir($directory)) { |
444 | 444 | while (false !== ($file = readdir($handle))) { |
445 | 445 | if ($file != "." && $file != "..") { |
446 | - if (is_dir($directory. "/" . $file)) { |
|
447 | - $array_items = array_merge($array_items, my_directory_to_array($directory. '/' . $file)); |
|
448 | - $file = $directory . "/" . $file; |
|
446 | + if (is_dir($directory."/".$file)) { |
|
447 | + $array_items = array_merge($array_items, my_directory_to_array($directory.'/'.$file)); |
|
448 | + $file = $directory."/".$file; |
|
449 | 449 | $array_items[] = preg_replace("/\/\//si", '/', $file); |
450 | 450 | } |
451 | 451 | } |
@@ -490,7 +490,7 @@ discard block |
||
490 | 490 | // try to recover config file from Chamilo 1.9.x |
491 | 491 | if (file_exists($updatePath.'main/inc/conf/configuration.php')) { |
492 | 492 | $updateFromConfigFile = 'main/inc/conf/configuration.php'; |
493 | - } elseif (file_exists($updatePath . 'app/config/configuration.php')) { |
|
493 | + } elseif (file_exists($updatePath.'app/config/configuration.php')) { |
|
494 | 494 | $updateFromConfigFile = 'app/config/configuration.php'; |
495 | 495 | } else { |
496 | 496 | // Give up recovering. |
@@ -651,7 +651,7 @@ discard block |
||
651 | 651 | <h2><?php get_lang('WelcomeToTheChamiloInstaller'); ?></h2> |
652 | 652 | <div class="RequirementHeading"> |
653 | 653 | <h2><?php echo display_step_sequence(); ?> |
654 | - <?php echo get_lang('InstallationLanguage');?> |
|
654 | + <?php echo get_lang('InstallationLanguage'); ?> |
|
655 | 655 | </h2> |
656 | 656 | <p><?php echo get_lang('PleaseSelectInstallationProcessLanguage'); ?>:</p> |
657 | 657 | <form id="lang_form" method="post" action="<?php echo api_get_self(); ?>"> |
@@ -705,14 +705,14 @@ discard block |
||
705 | 705 | } |
706 | 706 | echo '</div>'; |
707 | 707 | |
708 | - $properlyAccessUrl = checkAccessUrl(); |
|
708 | + $properlyAccessUrl = checkAccessUrl(); |
|
709 | 709 | |
710 | 710 | if (!$properlyAccessUrl) { |
711 | 711 | echo ' |
712 | 712 | <div class="alert alert-danger"> |
713 | - ' . Display::return_icon('error.png', get_lang('Error'), [], ICON_SIZE_MEDIUM) . |
|
714 | - ' ' . |
|
715 | - sprintf(get_lang('InstallMultiURLDetectedNotMainURL'), api_get_configuration_value('root_web')) . ' |
|
713 | + ' . Display::return_icon('error.png', get_lang('Error'), [], ICON_SIZE_MEDIUM). |
|
714 | + ' '. |
|
715 | + sprintf(get_lang('InstallMultiURLDetectedNotMainURL'), api_get_configuration_value('root_web')).' |
|
716 | 716 | </div> |
717 | 717 | '; |
718 | 718 | } |
@@ -736,7 +736,7 @@ discard block |
||
736 | 736 | if (phpversion() < REQUIRED_PHP_VERSION) { |
737 | 737 | echo '<strong><font color="red">'.get_lang('PHPVersionError').'</font></strong>'; |
738 | 738 | } else { |
739 | - echo '<strong><font color="green">'.get_lang('PHPVersionOK'). ' '.phpversion().'</font></strong>'; |
|
739 | + echo '<strong><font color="green">'.get_lang('PHPVersionOK').' '.phpversion().'</font></strong>'; |
|
740 | 740 | } |
741 | 741 | echo '</td> |
742 | 742 | </tr> |
@@ -1094,9 +1094,9 @@ discard block |
||
1094 | 1094 | } |
1095 | 1095 | |
1096 | 1096 | $deprecated = [ |
1097 | - api_get_path(SYS_CODE_PATH) . 'exercice/', |
|
1098 | - api_get_path(SYS_CODE_PATH) . 'newscorm/', |
|
1099 | - api_get_path(SYS_PLUGIN_PATH) . 'ticket/' |
|
1097 | + api_get_path(SYS_CODE_PATH).'exercice/', |
|
1098 | + api_get_path(SYS_CODE_PATH).'newscorm/', |
|
1099 | + api_get_path(SYS_PLUGIN_PATH).'ticket/' |
|
1100 | 1100 | ]; |
1101 | 1101 | $deprecatedToRemove = []; |
1102 | 1102 | |
@@ -1206,7 +1206,7 @@ discard block |
||
1206 | 1206 | function get_contact_registration_form() |
1207 | 1207 | { |
1208 | 1208 | |
1209 | - $html =' |
|
1209 | + $html = ' |
|
1210 | 1210 | <div class="form-horizontal"> |
1211 | 1211 | <div class="panel panel-default"> |
1212 | 1212 | <div class="panel-body"> |
@@ -1303,7 +1303,7 @@ discard block |
||
1303 | 1303 | <div class="col-sm-9"> |
1304 | 1304 | <div class="radio"> |
1305 | 1305 | <label> |
1306 | - <input type="radio" name="financial_decision" id="financial_decision1" value="1" checked /> ' . get_lang('Yes') . ' |
|
1306 | + <input type="radio" name="financial_decision" id="financial_decision1" value="1" checked /> ' . get_lang('Yes').' |
|
1307 | 1307 | </label> |
1308 | 1308 | </div> |
1309 | 1309 | <div class="radio"> |
@@ -1362,8 +1362,8 @@ discard block |
||
1362 | 1362 | echo '<input type="hidden" name="'.$formFieldName.'" id="'.$formFieldName.'" value="'.api_htmlentities($parameterValue).'" />'; |
1363 | 1363 | echo api_htmlentities($parameterValue); |
1364 | 1364 | } else { |
1365 | - echo '<div class="col-sm-5"><input type="' . $inputType . '" class="form-control" size="' . DATABASE_FORM_FIELD_DISPLAY_LENGTH . '" maxlength="' . $maxLength . '" name="' . $formFieldName . '" id="' . $formFieldName . '" value="' . api_htmlentities($parameterValue) . '" />' . "</div>"; |
|
1366 | - echo '<div class="col-sm-3">' . $extra_notice . '</div>'; |
|
1365 | + echo '<div class="col-sm-5"><input type="'.$inputType.'" class="form-control" size="'.DATABASE_FORM_FIELD_DISPLAY_LENGTH.'" maxlength="'.$maxLength.'" name="'.$formFieldName.'" id="'.$formFieldName.'" value="'.api_htmlentities($parameterValue).'" />'."</div>"; |
|
1366 | + echo '<div class="col-sm-3">'.$extra_notice.'</div>'; |
|
1367 | 1367 | } |
1368 | 1368 | } |
1369 | 1369 | } |
@@ -1397,12 +1397,12 @@ discard block |
||
1397 | 1397 | $dbNameForm = $_configuration['main_database']; |
1398 | 1398 | $dbPortForm = isset($_configuration['db_port']) ? $_configuration['db_port'] : ''; |
1399 | 1399 | |
1400 | - echo '<div class="RequirementHeading"><h2>' . display_step_sequence() .get_lang('DBSetting') . '</h2></div>'; |
|
1400 | + echo '<div class="RequirementHeading"><h2>'.display_step_sequence().get_lang('DBSetting').'</h2></div>'; |
|
1401 | 1401 | echo '<div class="RequirementContent">'; |
1402 | 1402 | echo get_lang('DBSettingUpgradeIntro'); |
1403 | 1403 | echo '</div>'; |
1404 | 1404 | } else { |
1405 | - echo '<div class="RequirementHeading"><h2>' . display_step_sequence() .get_lang('DBSetting') . '</h2></div>'; |
|
1405 | + echo '<div class="RequirementHeading"><h2>'.display_step_sequence().get_lang('DBSetting').'</h2></div>'; |
|
1406 | 1406 | echo '<div class="RequirementContent">'; |
1407 | 1407 | echo get_lang('DBSettingIntro'); |
1408 | 1408 | echo '</div>'; |
@@ -1412,12 +1412,12 @@ discard block |
||
1412 | 1412 | <div class="panel-body"> |
1413 | 1413 | <div class="form-group"> |
1414 | 1414 | <label class="col-sm-4"><?php echo get_lang('DBHost'); ?> </label> |
1415 | - <?php if ($installType == 'update'){ ?> |
|
1415 | + <?php if ($installType == 'update') { ?> |
|
1416 | 1416 | <div class="col-sm-5"> |
1417 | 1417 | <input type="hidden" name="dbHostForm" value="<?php echo htmlentities($dbHostForm); ?>" /><?php echo $dbHostForm; ?> |
1418 | 1418 | </div> |
1419 | 1419 | <div class="col-sm-3"></div> |
1420 | - <?php }else{ ?> |
|
1420 | + <?php } else { ?> |
|
1421 | 1421 | <div class="col-sm-5"> |
1422 | 1422 | <input type="text" class="form-control" size="25" maxlength="50" name="dbHostForm" value="<?php echo htmlentities($dbHostForm); ?>" /> |
1423 | 1423 | </div> |
@@ -1426,12 +1426,12 @@ discard block |
||
1426 | 1426 | </div> |
1427 | 1427 | <div class="form-group"> |
1428 | 1428 | <label class="col-sm-4"><?php echo get_lang('DBPort'); ?> </label> |
1429 | - <?php if ($installType == 'update'){ ?> |
|
1429 | + <?php if ($installType == 'update') { ?> |
|
1430 | 1430 | <div class="col-sm-5"> |
1431 | 1431 | <input type="hidden" name="dbPortForm" value="<?php echo htmlentities($dbPortForm); ?>" /><?php echo $dbPortForm; ?> |
1432 | 1432 | </div> |
1433 | 1433 | <div class="col-sm-3"></div> |
1434 | - <?php }else{ ?> |
|
1434 | + <?php } else { ?> |
|
1435 | 1435 | <div class="col-sm-5"> |
1436 | 1436 | <input type="text" class="form-control" size="25" maxlength="50" name="dbPortForm" value="<?php echo htmlentities($dbPortForm); ?>" /> |
1437 | 1437 | </div> |
@@ -1457,7 +1457,7 @@ discard block |
||
1457 | 1457 | <?php |
1458 | 1458 | //Database Name fix replace weird chars |
1459 | 1459 | if ($installType != INSTALL_TYPE_UPDATE) { |
1460 | - $dbNameForm = str_replace(array('-','*', '$', ' ', '.'), '', $dbNameForm); |
|
1460 | + $dbNameForm = str_replace(array('-', '*', '$', ' ', '.'), '', $dbNameForm); |
|
1461 | 1461 | } |
1462 | 1462 | |
1463 | 1463 | displayDatabaseParameter( |
@@ -1550,7 +1550,7 @@ discard block |
||
1550 | 1550 | if (!empty($title)) { |
1551 | 1551 | $panelTitle = Display::div($title, array('class' => 'panel-heading')); |
1552 | 1552 | $panelBody = Display::div($content, array('class' => 'panel-body')); |
1553 | - $panelParent = Display::div($panelTitle . $panelBody, array('id' => $id, 'class' => 'panel panel-'.$style)); |
|
1553 | + $panelParent = Display::div($panelTitle.$panelBody, array('id' => $id, 'class' => 'panel panel-'.$style)); |
|
1554 | 1554 | } else { |
1555 | 1555 | $panelBody = Display::div($html, array('class' => 'panel-body')); |
1556 | 1556 | $panelParent = Display::div($panelBody, array('id' => $id, 'class' => 'panel panel-'.$style)); |
@@ -1576,9 +1576,9 @@ discard block |
||
1576 | 1576 | $displayWhenUpdate = 'true' |
1577 | 1577 | ) { |
1578 | 1578 | $html = '<div class="form-group">'; |
1579 | - $html .= '<label class="col-sm-6 control-label">' . $parameterName . '</label>'; |
|
1579 | + $html .= '<label class="col-sm-6 control-label">'.$parameterName.'</label>'; |
|
1580 | 1580 | if ($installType == INSTALL_TYPE_UPDATE && $displayWhenUpdate) { |
1581 | - $html .= '<input type="hidden" name="' . $formFieldName . '" value="'. api_htmlentities($parameterValue, ENT_QUOTES). '" />' . $parameterValue; |
|
1581 | + $html .= '<input type="hidden" name="'.$formFieldName.'" value="'.api_htmlentities($parameterValue, ENT_QUOTES).'" />'.$parameterValue; |
|
1582 | 1582 | } else { |
1583 | 1583 | $html .= '<div class="col-sm-6"><input class="form-control" type="text" size="'.FORM_FIELD_DISPLAY_LENGTH.'" maxlength="'.MAX_FORM_FIELD_LENGTH.'" name="'.$formFieldName.'" value="'.api_htmlentities($parameterValue, ENT_QUOTES).'" />'."</div>"; |
1584 | 1584 | } |
@@ -1626,7 +1626,7 @@ discard block |
||
1626 | 1626 | $languageForm = $_SESSION['install_language']; |
1627 | 1627 | } |
1628 | 1628 | echo '<div class="RequirementHeading">'; |
1629 | - echo "<h2>" . display_step_sequence() . get_lang("CfgSetting") . "</h2>"; |
|
1629 | + echo "<h2>".display_step_sequence().get_lang("CfgSetting")."</h2>"; |
|
1630 | 1630 | echo '</div>'; |
1631 | 1631 | |
1632 | 1632 | echo '<p>'.get_lang('ConfigSettingsInfo').' <strong>app/config/configuration.php</strong></p>'; |
@@ -1644,14 +1644,14 @@ discard block |
||
1644 | 1644 | |
1645 | 1645 | // Parameters 3 and 4: administrator's names |
1646 | 1646 | |
1647 | - $html .= display_configuration_parameter($installType, get_lang('AdminFirstName'), 'adminFirstName', $adminFirstName); |
|
1648 | - $html .= display_configuration_parameter($installType, get_lang('AdminLastName'), 'adminLastName', $adminLastName); |
|
1647 | + $html .= display_configuration_parameter($installType, get_lang('AdminFirstName'), 'adminFirstName', $adminFirstName); |
|
1648 | + $html .= display_configuration_parameter($installType, get_lang('AdminLastName'), 'adminLastName', $adminLastName); |
|
1649 | 1649 | |
1650 | 1650 | //Parameter 3: administrator's email |
1651 | - $html .= display_configuration_parameter($installType, get_lang('AdminEmail'), 'emailForm', $emailForm); |
|
1651 | + $html .= display_configuration_parameter($installType, get_lang('AdminEmail'), 'emailForm', $emailForm); |
|
1652 | 1652 | |
1653 | 1653 | //Parameter 6: administrator's telephone |
1654 | - $html .= display_configuration_parameter($installType, get_lang('AdminPhone'), 'adminPhoneForm', $adminPhoneForm); |
|
1654 | + $html .= display_configuration_parameter($installType, get_lang('AdminPhone'), 'adminPhoneForm', $adminPhoneForm); |
|
1655 | 1655 | |
1656 | 1656 | |
1657 | 1657 | echo panel($html, get_lang('Administrator'), 'administrator'); |
@@ -1670,12 +1670,12 @@ discard block |
||
1670 | 1670 | $html .= display_language_selection_box('languageForm', $languageForm); |
1671 | 1671 | $html .= '</div>'; |
1672 | 1672 | } |
1673 | - $html.= "</div>"; |
|
1673 | + $html .= "</div>"; |
|
1674 | 1674 | |
1675 | 1675 | |
1676 | 1676 | //Second parameter: Chamilo URL |
1677 | 1677 | $html .= '<div class="form-group">'; |
1678 | - $html .= '<label class="col-sm-6 control-label">'.get_lang('ChamiloURL') .get_lang('ThisFieldIsRequired').'</label>'; |
|
1678 | + $html .= '<label class="col-sm-6 control-label">'.get_lang('ChamiloURL').get_lang('ThisFieldIsRequired').'</label>'; |
|
1679 | 1679 | |
1680 | 1680 | |
1681 | 1681 | |
@@ -1699,34 +1699,34 @@ discard block |
||
1699 | 1699 | |
1700 | 1700 | |
1701 | 1701 | $html .= '<div class="form-group"> |
1702 | - <label class="col-sm-6 control-label">' . get_lang("EncryptMethodUserPass") . '</label> |
|
1702 | + <label class="col-sm-6 control-label">' . get_lang("EncryptMethodUserPass").'</label> |
|
1703 | 1703 | <div class="col-sm-6">'; |
1704 | 1704 | if ($installType == 'update') { |
1705 | - $html .= '<input type="hidden" name="encryptPassForm" value="'. $encryptPassForm .'" />'. $encryptPassForm; |
|
1705 | + $html .= '<input type="hidden" name="encryptPassForm" value="'.$encryptPassForm.'" />'.$encryptPassForm; |
|
1706 | 1706 | } else { |
1707 | 1707 | |
1708 | 1708 | $html .= '<div class="checkbox"> |
1709 | 1709 | <label> |
1710 | - <input type="radio" name="encryptPassForm" value="bcrypt" id="encryptPass1" '. ($encryptPassForm == 'bcrypt' ? 'checked="checked" ':'') .'/> bcrypt |
|
1710 | + <input type="radio" name="encryptPassForm" value="bcrypt" id="encryptPass1" '. ($encryptPassForm == 'bcrypt' ? 'checked="checked" ' : '').'/> bcrypt |
|
1711 | 1711 | </label>'; |
1712 | 1712 | |
1713 | 1713 | $html .= '<label> |
1714 | - <input type="radio" name="encryptPassForm" value="sha1" id="encryptPass1" '. ($encryptPassForm == 'sha1' ? 'checked="checked" ':'') .'/> sha1 |
|
1714 | + <input type="radio" name="encryptPassForm" value="sha1" id="encryptPass1" '. ($encryptPassForm == 'sha1' ? 'checked="checked" ' : '').'/> sha1 |
|
1715 | 1715 | </label>'; |
1716 | 1716 | |
1717 | 1717 | $html .= '<label> |
1718 | - <input type="radio" name="encryptPassForm" value="md5" id="encryptPass0" '. ($encryptPassForm == 'md5' ? 'checked="checked" ':'') .'/> md5 |
|
1718 | + <input type="radio" name="encryptPassForm" value="md5" id="encryptPass0" '. ($encryptPassForm == 'md5' ? 'checked="checked" ' : '').'/> md5 |
|
1719 | 1719 | </label>'; |
1720 | 1720 | |
1721 | 1721 | $html .= '<label> |
1722 | - <input type="radio" name="encryptPassForm" value="none" id="encryptPass2" '. ($encryptPassForm == 'none' ? 'checked="checked" ':'') .'/>'. get_lang('None').' |
|
1722 | + <input type="radio" name="encryptPassForm" value="none" id="encryptPass2" '. ($encryptPassForm == 'none' ? 'checked="checked" ' : '').'/>'.get_lang('None').' |
|
1723 | 1723 | </label>'; |
1724 | 1724 | $html .= '</div>'; |
1725 | 1725 | } |
1726 | 1726 | $html .= '</div></div>'; |
1727 | 1727 | |
1728 | 1728 | $html .= '<div class="form-group"> |
1729 | - <label class="col-sm-6 control-label">' . get_lang('AllowSelfReg') . '</label> |
|
1729 | + <label class="col-sm-6 control-label">' . get_lang('AllowSelfReg').'</label> |
|
1730 | 1730 | <div class="col-sm-6">'; |
1731 | 1731 | if ($installType == 'update') { |
1732 | 1732 | if ($allowSelfReg == 'true') { |
@@ -1736,17 +1736,17 @@ discard block |
||
1736 | 1736 | } else { |
1737 | 1737 | $label = get_lang('AfterApproval'); |
1738 | 1738 | } |
1739 | - $html .= '<input type="hidden" name="allowSelfReg" value="'. $allowSelfReg .'" />'. $label; |
|
1739 | + $html .= '<input type="hidden" name="allowSelfReg" value="'.$allowSelfReg.'" />'.$label; |
|
1740 | 1740 | } else { |
1741 | 1741 | $html .= '<div class="control-group">'; |
1742 | 1742 | $html .= '<label class="checkbox-inline"> |
1743 | - <input type="radio" name="allowSelfReg" value="true" id="allowSelfReg1" '. ($allowSelfReg == 'true' ? 'checked="checked" ' : '') . ' /> '. get_lang('Yes') .' |
|
1743 | + <input type="radio" name="allowSelfReg" value="true" id="allowSelfReg1" '. ($allowSelfReg == 'true' ? 'checked="checked" ' : '').' /> '.get_lang('Yes').' |
|
1744 | 1744 | </label>'; |
1745 | 1745 | $html .= '<label class="checkbox-inline"> |
1746 | - <input type="radio" name="allowSelfReg" value="false" id="allowSelfReg0" '. ($allowSelfReg == 'false' ? '' : 'checked="checked" ') .' /> '. get_lang('No') .' |
|
1746 | + <input type="radio" name="allowSelfReg" value="false" id="allowSelfReg0" '. ($allowSelfReg == 'false' ? '' : 'checked="checked" ').' /> '.get_lang('No').' |
|
1747 | 1747 | </label>'; |
1748 | 1748 | $html .= '<label class="checkbox-inline"> |
1749 | - <input type="radio" name="allowSelfReg" value="approval" id="allowSelfReg2" '. ($allowSelfReg == 'approval' ? '' : 'checked="checked" ') .' /> '. get_lang('AfterApproval') .' |
|
1749 | + <input type="radio" name="allowSelfReg" value="approval" id="allowSelfReg2" '. ($allowSelfReg == 'approval' ? '' : 'checked="checked" ').' /> '.get_lang('AfterApproval').' |
|
1750 | 1750 | </label>'; |
1751 | 1751 | $html .= '</div>'; |
1752 | 1752 | } |
@@ -1754,7 +1754,7 @@ discard block |
||
1754 | 1754 | $html .= '</div>'; |
1755 | 1755 | |
1756 | 1756 | $html .= '<div class="form-group">'; |
1757 | - $html .= '<label class="col-sm-6 control-label">'. get_lang('AllowSelfRegProf') .'</label> |
|
1757 | + $html .= '<label class="col-sm-6 control-label">'.get_lang('AllowSelfRegProf').'</label> |
|
1758 | 1758 | <div class="col-sm-6">'; |
1759 | 1759 | if ($installType == 'update') { |
1760 | 1760 | if ($allowSelfRegProf == 'true') { |
@@ -1762,16 +1762,16 @@ discard block |
||
1762 | 1762 | } else { |
1763 | 1763 | $label = get_lang('No'); |
1764 | 1764 | } |
1765 | - $html .= '<input type="hidden" name="allowSelfRegProf" value="'. $allowSelfRegProf.'" />'. $label; |
|
1765 | + $html .= '<input type="hidden" name="allowSelfRegProf" value="'.$allowSelfRegProf.'" />'.$label; |
|
1766 | 1766 | } else { |
1767 | 1767 | $html .= '<div class="control-group"> |
1768 | 1768 | <label class="checkbox-inline"> |
1769 | - <input type="radio" name="allowSelfRegProf" value="1" id="allowSelfRegProf1" '. ($allowSelfRegProf ? 'checked="checked" ' : '') .'/> |
|
1770 | - ' . get_lang('Yes') .' |
|
1769 | + <input type="radio" name="allowSelfRegProf" value="1" id="allowSelfRegProf1" '. ($allowSelfRegProf ? 'checked="checked" ' : '').'/> |
|
1770 | + ' . get_lang('Yes').' |
|
1771 | 1771 | </label>'; |
1772 | 1772 | $html .= '<label class="checkbox-inline"> |
1773 | - <input type="radio" name="allowSelfRegProf" value="0" id="allowSelfRegProf0" '. ($allowSelfRegProf ? '' : 'checked="checked" ') .' /> |
|
1774 | - '. get_lang('No') .' |
|
1773 | + <input type="radio" name="allowSelfRegProf" value="0" id="allowSelfRegProf0" '. ($allowSelfRegProf ? '' : 'checked="checked" ').' /> |
|
1774 | + '. get_lang('No').' |
|
1775 | 1775 | </label>'; |
1776 | 1776 | $html .= '</div>'; |
1777 | 1777 | } |
@@ -1836,7 +1836,7 @@ discard block |
||
1836 | 1836 | "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Mauritania", "Mauritius", "Mexico", "Micronesia", "Moldova", "Monaco", "Mongolia", "Morocco", "Mozambique", "Myanmar", |
1837 | 1837 | "Namibia", "Nauru", "Nepa", "Netherlands", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Norway", |
1838 | 1838 | "Oman", |
1839 | - "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland","Portugal", |
|
1839 | + "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal", |
|
1840 | 1840 | "Qatar", |
1841 | 1841 | "Romania", "Russia", "Rwanda", |
1842 | 1842 | "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Serbia and Montenegro", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "Spain", "Sri Lanka", "Sudan", "Suriname", "Swaziland", "Sweden", "Switzerland", "Syria", |
@@ -1883,11 +1883,11 @@ discard block |
||
1883 | 1883 | $permissions_for_new_directories = isset($_SESSION['permissions_for_new_directories']) ? $_SESSION['permissions_for_new_directories'] : 0770; |
1884 | 1884 | $permissions_for_new_files = isset($_SESSION['permissions_for_new_files']) ? $_SESSION['permissions_for_new_files'] : 0660; |
1885 | 1885 | // use decoct() to store as string |
1886 | - $sql = "UPDATE $table SET selected_value = '0" . decoct($permissions_for_new_directories) . "' |
|
1886 | + $sql = "UPDATE $table SET selected_value = '0".decoct($permissions_for_new_directories)."' |
|
1887 | 1887 | WHERE variable = 'permissions_for_new_directories'"; |
1888 | 1888 | Database::query($sql); |
1889 | 1889 | |
1890 | - $sql = "UPDATE $table SET selected_value = '0" . decoct($permissions_for_new_files) . "' WHERE variable = 'permissions_for_new_files'"; |
|
1890 | + $sql = "UPDATE $table SET selected_value = '0".decoct($permissions_for_new_files)."' WHERE variable = 'permissions_for_new_files'"; |
|
1891 | 1891 | Database::query($sql); |
1892 | 1892 | |
1893 | 1893 | if (isset($_SESSION['permissions_for_new_directories'])) { |
@@ -1907,8 +1907,8 @@ discard block |
||
1907 | 1907 | function compare_setting_values($current_value, $wanted_value) |
1908 | 1908 | { |
1909 | 1909 | $current_value_string = $current_value; |
1910 | - $current_value = (float)$current_value; |
|
1911 | - $wanted_value = (float)$wanted_value; |
|
1910 | + $current_value = (float) $current_value; |
|
1911 | + $wanted_value = (float) $wanted_value; |
|
1912 | 1912 | |
1913 | 1913 | if ($current_value >= $wanted_value) { |
1914 | 1914 | return Display::label($current_value_string, 'success'); |
@@ -1971,7 +1971,7 @@ discard block |
||
1971 | 1971 | |
1972 | 1972 | fwrite($fp, $out); |
1973 | 1973 | while (!feof($fp)) { |
1974 | - $result = str_replace("\r\n", '',fgets($fp, 128)); |
|
1974 | + $result = str_replace("\r\n", '', fgets($fp, 128)); |
|
1975 | 1975 | if (!empty($result) && $result == '123') { |
1976 | 1976 | $output = true; |
1977 | 1977 | } |
@@ -1994,7 +1994,7 @@ discard block |
||
1994 | 1994 | curl_setopt($ch, CURLOPT_URL, $url); |
1995 | 1995 | //curl_setopt($ch, CURLOPT_TIMEOUT, 30); |
1996 | 1996 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
1997 | - $result = curl_exec ($ch); |
|
1997 | + $result = curl_exec($ch); |
|
1998 | 1998 | if (!empty($result) && $result == '123') { |
1999 | 1999 | $output = true; |
2000 | 2000 | } |
@@ -2755,12 +2755,12 @@ discard block |
||
2755 | 2755 | $adminPhoneForm, |
2756 | 2756 | '', //$picture_uri = '', |
2757 | 2757 | PLATFORM_AUTH_SOURCE, |
2758 | - '',//$expirationDate, |
|
2758 | + '', //$expirationDate, |
|
2759 | 2759 | 1, |
2760 | 2760 | 0, |
2761 | 2761 | null, |
2762 | 2762 | '', |
2763 | - false, //$send_mail = false, |
|
2763 | + false, //$send_mail = false, |
|
2764 | 2764 | true //$isAdmin = false |
2765 | 2765 | ); |
2766 | 2766 | |
@@ -2782,7 +2782,7 @@ discard block |
||
2782 | 2782 | 0, |
2783 | 2783 | null, |
2784 | 2784 | '', |
2785 | - false, //$send_mail = false, |
|
2785 | + false, //$send_mail = false, |
|
2786 | 2786 | false //$isAdmin = false |
2787 | 2787 | ); |
2788 | 2788 | |
@@ -2817,7 +2817,7 @@ discard block |
||
2817 | 2817 | Database::query($sql); |
2818 | 2818 | |
2819 | 2819 | foreach ($files as $version) { |
2820 | - $version = str_replace(['Version', '.php' ], '', $version->getFilename()); |
|
2820 | + $version = str_replace(['Version', '.php'], '', $version->getFilename()); |
|
2821 | 2821 | $sql = "INSERT INTO version (version) VALUES ('$version')"; |
2822 | 2822 | Database::query($sql); |
2823 | 2823 | } |
@@ -2863,7 +2863,7 @@ discard block |
||
2863 | 2863 | SET selected_value = '".$param->selected_value."' |
2864 | 2864 | WHERE variable = '".$param->variable."'"; |
2865 | 2865 | if (!empty($param->subkey)) { |
2866 | - $sql .= " AND subkey='" . $param->subkey . "'"; |
|
2866 | + $sql .= " AND subkey='".$param->subkey."'"; |
|
2867 | 2867 | } |
2868 | 2868 | Database::query($sql); |
2869 | 2869 | } |