@@ -22,7 +22,7 @@ |
||
22 | 22 | { |
23 | 23 | $loader = new Loader\YamlFileLoader( |
24 | 24 | $container, |
25 | - new FileLocator(__DIR__ . '/../Resources/config') |
|
25 | + new FileLocator(__DIR__.'/../Resources/config') |
|
26 | 26 | ); |
27 | 27 | |
28 | 28 | $loader->load('services.yml'); |
@@ -222,14 +222,14 @@ |
||
222 | 222 | return \Display::return_icon('badges-default.png', null, null, ICON_SIZE_BIG, null, true); |
223 | 223 | } |
224 | 224 | |
225 | - return api_get_path(WEB_UPLOAD_PATH) . 'badges/' . sha1($this->name) . '-small.png'; |
|
225 | + return api_get_path(WEB_UPLOAD_PATH).'badges/'.sha1($this->name).'-small.png'; |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | if (empty($this->icon)) { |
229 | 229 | return \Display::return_icon('badges-default.png', null, null, ICON_SIZE_HUGE, null, true); |
230 | 230 | } |
231 | 231 | |
232 | - return api_get_path(WEB_UPLOAD_PATH) . "badges/{$this->icon}"; |
|
232 | + return api_get_path(WEB_UPLOAD_PATH)."badges/{$this->icon}"; |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | /** |
@@ -12,7 +12,7 @@ |
||
12 | 12 | $isDRH = api_is_drh(); |
13 | 13 | |
14 | 14 | if (!$isStudent && !$isStudentBoss && !$isDRH) { |
15 | - header('Location: ' . api_get_path(WEB_CODE_PATH) . 'social/skills_wheel.php'); |
|
15 | + header('Location: '.api_get_path(WEB_CODE_PATH).'social/skills_wheel.php'); |
|
16 | 16 | exit; |
17 | 17 | } |
18 | 18 |
@@ -47,15 +47,15 @@ |
||
47 | 47 | $form->addElement('hidden', 'description_type['.$id.']', $id); |
48 | 48 | $form->addText('title['.$id.']', get_lang('Title'), false, array('size'=>'50')); |
49 | 49 | $form->addHtmlEditor( |
50 | - 'description['.$id.']', |
|
51 | - get_lang('Description'), |
|
52 | - false, |
|
53 | - false, |
|
54 | - array( |
|
55 | - 'ToolbarStartExpanded' => 'false', |
|
56 | - 'ToolbarSet' => 'TrainingDescription', |
|
57 | - 'Height' => '150' |
|
58 | - ) |
|
50 | + 'description['.$id.']', |
|
51 | + get_lang('Description'), |
|
52 | + false, |
|
53 | + false, |
|
54 | + array( |
|
55 | + 'ToolbarStartExpanded' => 'false', |
|
56 | + 'ToolbarSet' => 'TrainingDescription', |
|
57 | + 'Height' => '150' |
|
58 | + ) |
|
59 | 59 | ); |
60 | 60 | |
61 | 61 | if (!empty($thematic_simple_list) && in_array($id, $thematic_simple_list)) { |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | // actions menu |
11 | 11 | $new_thematic_plan_data = array(); |
12 | 12 | if (!empty($thematic_plan_data)) |
13 | -foreach($thematic_plan_data as $thematic_item) { |
|
13 | +foreach ($thematic_plan_data as $thematic_item) { |
|
14 | 14 | $thematic_simple_list[] = $thematic_item['description_type']; |
15 | 15 | $new_thematic_plan_data[$thematic_item['description_type']] = $thematic_item; |
16 | 16 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | } |
26 | 26 | } |
27 | 27 | |
28 | -$i=1; |
|
28 | +$i = 1; |
|
29 | 29 | |
30 | 30 | echo Display::tag('h2', $thematic_data['title']); |
31 | 31 | echo $thematic_data['content']; |
@@ -67,8 +67,8 @@ discard block |
||
67 | 67 | $thematic_plan = null; |
68 | 68 | } else { |
69 | 69 | $thematic_plan = null; |
70 | - $default['title['.$id.']'] = $title; |
|
71 | - $default['description['.$id.']']= ''; |
|
70 | + $default['title['.$id.']'] = $title; |
|
71 | + $default['description['.$id.']'] = ''; |
|
72 | 72 | } |
73 | 73 | $form->setDefaults($default); |
74 | 74 | } |
@@ -9,9 +9,10 @@ |
||
9 | 9 | |
10 | 10 | // actions menu |
11 | 11 | $new_thematic_plan_data = array(); |
12 | -if (!empty($thematic_plan_data)) |
|
13 | -foreach($thematic_plan_data as $thematic_item) { |
|
12 | +if (!empty($thematic_plan_data)) { |
|
13 | + foreach($thematic_plan_data as $thematic_item) { |
|
14 | 14 | $thematic_simple_list[] = $thematic_item['description_type']; |
15 | +} |
|
15 | 16 | $new_thematic_plan_data[$thematic_item['description_type']] = $thematic_item; |
16 | 17 | } |
17 | 18 |
@@ -434,8 +434,7 @@ |
||
434 | 434 | } else { |
435 | 435 | echo $question->options[2]; |
436 | 436 | } |
437 | - } |
|
438 | - else { |
|
437 | + } else { |
|
439 | 438 | echo '-'; |
440 | 439 | } |
441 | 440 | ?> |
@@ -17,25 +17,25 @@ discard block |
||
17 | 17 | */ |
18 | 18 | class ExerciseShowFunctions |
19 | 19 | { |
20 | - /** |
|
21 | - * Shows the answer to a fill-in-the-blanks question, as HTML |
|
20 | + /** |
|
21 | + * Shows the answer to a fill-in-the-blanks question, as HTML |
|
22 | 22 | * @param int $feedbackType |
23 | - * @param string $answer |
|
24 | - * @param int $id Exercise ID |
|
25 | - * @param int $questionId Question ID |
|
23 | + * @param string $answer |
|
24 | + * @param int $id Exercise ID |
|
25 | + * @param int $questionId Question ID |
|
26 | 26 | * @param int $resultsDisabled |
27 | 27 | * @param string $originalStudentAnswer |
28 | 28 | * |
29 | - * @return void |
|
30 | - */ |
|
31 | - public static function display_fill_in_blanks_answer( |
|
32 | - $feedbackType, |
|
33 | - $answer, |
|
34 | - $id, |
|
35 | - $questionId, |
|
36 | - $resultsDisabled, |
|
37 | - $originalStudentAnswer = '', |
|
38 | - $showTotalScoreAndUserChoices |
|
29 | + * @return void |
|
30 | + */ |
|
31 | + public static function display_fill_in_blanks_answer( |
|
32 | + $feedbackType, |
|
33 | + $answer, |
|
34 | + $id, |
|
35 | + $questionId, |
|
36 | + $resultsDisabled, |
|
37 | + $originalStudentAnswer = '', |
|
38 | + $showTotalScoreAndUserChoices |
|
39 | 39 | ) { |
40 | 40 | $answerHTML = FillBlanks::getHtmlDisplayForAnswer($answer, $resultsDisabled, $showTotalScoreAndUserChoices); |
41 | 41 | if (strpos($originalStudentAnswer, 'font color') !== false) { |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | </tr> |
65 | 65 | <?php |
66 | 66 | } |
67 | - } |
|
67 | + } |
|
68 | 68 | |
69 | 69 | /** |
70 | 70 | * Shows the answer to a calculated question, as HTML |
@@ -105,20 +105,20 @@ discard block |
||
105 | 105 | } |
106 | 106 | } |
107 | 107 | |
108 | - /** |
|
109 | - * Shows the answer to a free-answer question, as HTML |
|
110 | - * @param string Answer text |
|
111 | - * @param int Exercise ID |
|
112 | - * @param int Question ID |
|
113 | - * @return void |
|
114 | - */ |
|
115 | - public static function display_free_answer( |
|
116 | - $feedback_type, |
|
117 | - $answer, |
|
118 | - $exe_id, |
|
119 | - $questionId, |
|
120 | - $questionScore = null, |
|
121 | - $results_disabled = 0 |
|
108 | + /** |
|
109 | + * Shows the answer to a free-answer question, as HTML |
|
110 | + * @param string Answer text |
|
111 | + * @param int Exercise ID |
|
112 | + * @param int Question ID |
|
113 | + * @return void |
|
114 | + */ |
|
115 | + public static function display_free_answer( |
|
116 | + $feedback_type, |
|
117 | + $answer, |
|
118 | + $exe_id, |
|
119 | + $questionId, |
|
120 | + $questionScore = null, |
|
121 | + $results_disabled = 0 |
|
122 | 122 | ) { |
123 | 123 | $comments = Event::get_comments($exe_id, $questionId); |
124 | 124 | |
@@ -136,17 +136,17 @@ discard block |
||
136 | 136 | echo '</tr>'; |
137 | 137 | } |
138 | 138 | } |
139 | - } |
|
139 | + } |
|
140 | 140 | |
141 | 141 | /** |
142 | - * @param $feedback_type |
|
143 | - * @param $answer |
|
144 | - * @param $id |
|
145 | - * @param $questionId |
|
146 | - * @param null $nano |
|
147 | - * @param int $results_disabled |
|
142 | + * @param $feedback_type |
|
143 | + * @param $answer |
|
144 | + * @param $id |
|
145 | + * @param $questionId |
|
146 | + * @param null $nano |
|
147 | + * @param int $results_disabled |
|
148 | 148 | */ |
149 | - public static function display_oral_expression_answer($feedback_type, $answer, $id, $questionId, $fileUrl = null, $results_disabled = 0) |
|
149 | + public static function display_oral_expression_answer($feedback_type, $answer, $id, $questionId, $fileUrl = null, $results_disabled = 0) |
|
150 | 150 | { |
151 | 151 | if (isset($fileUrl)) { |
152 | 152 | echo ' |
@@ -184,8 +184,8 @@ discard block |
||
184 | 184 | } |
185 | 185 | } |
186 | 186 | |
187 | - /** |
|
188 | - * Displays the answer to a hotspot question |
|
187 | + /** |
|
188 | + * Displays the answer to a hotspot question |
|
189 | 189 | * @param int $feedback_type |
190 | 190 | * @param int $answerId |
191 | 191 | * @param string $answer |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | * @param int $resultsDisabled |
195 | 195 | * @param int $orderColor |
196 | 196 | */ |
197 | - public static function display_hotspot_answer( |
|
197 | + public static function display_hotspot_answer( |
|
198 | 198 | $feedback_type, |
199 | 199 | $answerId, |
200 | 200 | $answer, |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | } |
218 | 218 | } |
219 | 219 | |
220 | - $hotspot_colors = array( |
|
220 | + $hotspot_colors = array( |
|
221 | 221 | "", // $i starts from 1 on next loop (ugly fix) |
222 | 222 | "#4271B5", |
223 | 223 | "#FE8E16", |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | "#F7BDE2" |
235 | 235 | ); |
236 | 236 | |
237 | - ?> |
|
237 | + ?> |
|
238 | 238 | <table class="data_table"> |
239 | 239 | <tr> |
240 | 240 | <td class="text-center" width="5%"> |
@@ -246,10 +246,10 @@ discard block |
||
246 | 246 | <td class="text-left" width="10%"> |
247 | 247 | <?php |
248 | 248 | if (!$hide_expected_answer) { |
249 | - $my_choice = $studentChoice ? get_lang('Correct') : get_lang('Fault'); |
|
250 | - echo $my_choice; |
|
249 | + $my_choice = $studentChoice ? get_lang('Correct') : get_lang('Fault'); |
|
250 | + echo $my_choice; |
|
251 | 251 | } |
252 | - ?> |
|
252 | + ?> |
|
253 | 253 | </td> |
254 | 254 | <?php if ($feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) { ?> |
255 | 255 | <td class="text-left" width="60%"> |
@@ -257,29 +257,29 @@ discard block |
||
257 | 257 | if ($studentChoice) { |
258 | 258 | echo '<span style="font-weight: bold; color: #008000;">'.nl2br($answerComment).'</span>'; |
259 | 259 | } |
260 | - ?> |
|
260 | + ?> |
|
261 | 261 | </td> |
262 | 262 | <?php } else { ?> |
263 | 263 | <td class="text-left" width="60%"> </td> |
264 | 264 | <?php } ?> |
265 | 265 | </tr> |
266 | 266 | <?php |
267 | - } |
|
268 | - |
|
269 | - /** |
|
270 | - * Display the answers to a multiple choice question |
|
271 | - * @param int $feedback_type Feedback type |
|
272 | - * @param integer Answer type |
|
273 | - * @param integer Student choice |
|
274 | - * @param string Textual answer |
|
275 | - * @param string Comment on answer |
|
276 | - * @param string Correct answer comment |
|
277 | - * @param integer Exercise ID |
|
278 | - * @param integer Question ID |
|
279 | - * @param boolean Whether to show the answer comment or not |
|
280 | - * @return void |
|
281 | - */ |
|
282 | - public static function display_unique_or_multiple_answer( |
|
267 | + } |
|
268 | + |
|
269 | + /** |
|
270 | + * Display the answers to a multiple choice question |
|
271 | + * @param int $feedback_type Feedback type |
|
272 | + * @param integer Answer type |
|
273 | + * @param integer Student choice |
|
274 | + * @param string Textual answer |
|
275 | + * @param string Comment on answer |
|
276 | + * @param string Correct answer comment |
|
277 | + * @param integer Exercise ID |
|
278 | + * @param integer Question ID |
|
279 | + * @param boolean Whether to show the answer comment or not |
|
280 | + * @return void |
|
281 | + */ |
|
282 | + public static function display_unique_or_multiple_answer( |
|
283 | 283 | $feedback_type, |
284 | 284 | $answerType, |
285 | 285 | $studentChoice, |
@@ -307,14 +307,14 @@ discard block |
||
307 | 307 | } |
308 | 308 | |
309 | 309 | $icon = in_array($answerType, array(UNIQUE_ANSWER, UNIQUE_ANSWER_NO_OPTION)) ? 'radio':'checkbox'; |
310 | - $icon .= $studentChoice?'_on':'_off'; |
|
311 | - $icon .= '.gif'; |
|
310 | + $icon .= $studentChoice?'_on':'_off'; |
|
311 | + $icon .= '.gif'; |
|
312 | 312 | |
313 | - $iconAnswer = in_array($answerType, array(UNIQUE_ANSWER, UNIQUE_ANSWER_NO_OPTION)) ? 'radio':'checkbox'; |
|
314 | - $iconAnswer .= $answerCorrect?'_on':'_off'; |
|
315 | - $iconAnswer .= '.gif'; |
|
313 | + $iconAnswer = in_array($answerType, array(UNIQUE_ANSWER, UNIQUE_ANSWER_NO_OPTION)) ? 'radio':'checkbox'; |
|
314 | + $iconAnswer .= $answerCorrect?'_on':'_off'; |
|
315 | + $iconAnswer .= '.gif'; |
|
316 | 316 | |
317 | - ?> |
|
317 | + ?> |
|
318 | 318 | <tr> |
319 | 319 | <td width="5%"> |
320 | 320 | <?php echo Display::return_icon($icon); ?> |
@@ -328,39 +328,39 @@ discard block |
||
328 | 328 | </td> |
329 | 329 | <td width="40%"> |
330 | 330 | <?php |
331 | - echo $answer; |
|
332 | - ?> |
|
331 | + echo $answer; |
|
332 | + ?> |
|
333 | 333 | </td> |
334 | 334 | |
335 | 335 | <?php if ($feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) { ?> |
336 | 336 | <td width="20%"> |
337 | 337 | <?php |
338 | 338 | if ($studentChoice) { |
339 | - if ($answerCorrect) { |
|
339 | + if ($answerCorrect) { |
|
340 | 340 | $color = 'green'; |
341 | - //echo '<span style="font-weight: bold; color: #008000;">'.nl2br($answerComment).'</span>'; |
|
342 | - } else { |
|
341 | + //echo '<span style="font-weight: bold; color: #008000;">'.nl2br($answerComment).'</span>'; |
|
342 | + } else { |
|
343 | 343 | $color = 'black'; |
344 | 344 | //echo '<span style="font-weight: bold; color: #FF0000;">'.nl2br($answerComment).'</span>'; |
345 | - } |
|
346 | - if ($hide_expected_answer) { |
|
347 | - $color = ''; |
|
348 | - } |
|
345 | + } |
|
346 | + if ($hide_expected_answer) { |
|
347 | + $color = ''; |
|
348 | + } |
|
349 | 349 | echo '<span style="font-weight: bold; color: '.$color.';">'.nl2br($answerComment).'</span>'; |
350 | - } |
|
351 | - ?> |
|
350 | + } |
|
351 | + ?> |
|
352 | 352 | </td> |
353 | 353 | <?php |
354 | - if ($ans==1) { |
|
355 | - $comm = Event::get_comments($id,$questionId); |
|
356 | - } |
|
357 | - ?> |
|
354 | + if ($ans==1) { |
|
355 | + $comm = Event::get_comments($id,$questionId); |
|
356 | + } |
|
357 | + ?> |
|
358 | 358 | <?php } else { ?> |
359 | 359 | <td> </td> |
360 | 360 | <?php } ?> |
361 | 361 | </tr> |
362 | 362 | <?php |
363 | - } |
|
363 | + } |
|
364 | 364 | |
365 | 365 | /** |
366 | 366 | * Display the answers to a multiple choice question |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | if (isset($new_options[$studentChoice])) { |
414 | 414 | echo get_lang($new_options[$studentChoice]['name']); |
415 | 415 | } else { |
416 | - echo '-'; |
|
416 | + echo '-'; |
|
417 | 417 | } |
418 | 418 | |
419 | 419 | ?> |
@@ -421,7 +421,7 @@ discard block |
||
421 | 421 | <td width="5%"> |
422 | 422 | <?php |
423 | 423 | |
424 | - //Expected choice |
|
424 | + //Expected choice |
|
425 | 425 | if (!$hide_expected_answer) { |
426 | 426 | if (isset($new_options[$answerCorrect])) { |
427 | 427 | echo get_lang($new_options[$answerCorrect]['name']); |
@@ -447,8 +447,8 @@ discard block |
||
447 | 447 | } |
448 | 448 | |
449 | 449 | if ($hide_expected_answer) { |
450 | - $color = ''; |
|
451 | - } |
|
450 | + $color = ''; |
|
451 | + } |
|
452 | 452 | |
453 | 453 | echo '<span style="font-weight: bold; color: '.$color.';">'.nl2br($answerComment).'</span>'; |
454 | 454 | } |
@@ -466,19 +466,19 @@ discard block |
||
466 | 466 | <?php |
467 | 467 | } |
468 | 468 | |
469 | - /** |
|
470 | - * Display the answers to a multiple choice question |
|
471 | - * |
|
472 | - * @param integer Answer type |
|
473 | - * @param integer Student choice |
|
474 | - * @param string Textual answer |
|
475 | - * @param string Comment on answer |
|
476 | - * @param string Correct answer comment |
|
477 | - * @param integer Exercise ID |
|
478 | - * @param integer Question ID |
|
479 | - * @param boolean Whether to show the answer comment or not |
|
480 | - * @return void |
|
481 | - */ |
|
469 | + /** |
|
470 | + * Display the answers to a multiple choice question |
|
471 | + * |
|
472 | + * @param integer Answer type |
|
473 | + * @param integer Student choice |
|
474 | + * @param string Textual answer |
|
475 | + * @param string Comment on answer |
|
476 | + * @param string Correct answer comment |
|
477 | + * @param integer Exercise ID |
|
478 | + * @param integer Question ID |
|
479 | + * @param boolean Whether to show the answer comment or not |
|
480 | + * @return void |
|
481 | + */ |
|
482 | 482 | public static function display_multiple_answer_combination_true_false( |
483 | 483 | $feedback_type, |
484 | 484 | $answerType, |
@@ -509,7 +509,7 @@ discard block |
||
509 | 509 | <tr> |
510 | 510 | <td width="5%"> |
511 | 511 | <?php |
512 | - //Your choice |
|
512 | + //Your choice |
|
513 | 513 | $question = new MultipleAnswerCombinationTrueFalse(); |
514 | 514 | if (isset($question->options[$studentChoice])) { |
515 | 515 | echo $question->options[$studentChoice]; |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | </td> |
521 | 521 | <td width="5%"> |
522 | 522 | <?php |
523 | - //Expected choice |
|
523 | + //Expected choice |
|
524 | 524 | if (!$hide_expected_answer) { |
525 | 525 | if (isset($question->options[$answerCorrect])) { |
526 | 526 | echo $question->options[$answerCorrect]; |
@@ -545,14 +545,14 @@ discard block |
||
545 | 545 | <?php |
546 | 546 | //@todo replace this harcoded value |
547 | 547 | if ($studentChoice) { |
548 | - $color = "black"; |
|
548 | + $color = "black"; |
|
549 | 549 | if ($studentChoice == $answerCorrect) { |
550 | 550 | $color = "green"; |
551 | 551 | } |
552 | - //echo '<span style="font-weight: bold; color: #000;">'.nl2br($answerComment).'</span>'; |
|
552 | + //echo '<span style="font-weight: bold; color: #000;">'.nl2br($answerComment).'</span>'; |
|
553 | 553 | if ($hide_expected_answer) { |
554 | 554 | $color = ''; |
555 | - } |
|
555 | + } |
|
556 | 556 | echo '<span style="font-weight: bold; color: '.$color.';">'.nl2br($answerComment).'</span>'; |
557 | 557 | } |
558 | 558 | ?> |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | </td> |
55 | 55 | |
56 | 56 | <?php |
57 | - if (!api_is_allowed_to_edit(null,true) && $feedbackType != EXERCISE_FEEDBACK_TYPE_EXAM) { ?> |
|
57 | + if (!api_is_allowed_to_edit(null, true) && $feedbackType != EXERCISE_FEEDBACK_TYPE_EXAM) { ?> |
|
58 | 58 | <td> |
59 | 59 | <?php |
60 | 60 | $comm = Event::get_comments($id, $questionId); |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $showTotalScoreAndUserChoices |
83 | 83 | ) { |
84 | 84 | if (empty($id)) { |
85 | - echo '<tr><td>'. Security::remove_XSS($answer).'</td></tr>'; |
|
85 | + echo '<tr><td>'.Security::remove_XSS($answer).'</td></tr>'; |
|
86 | 86 | } else { |
87 | 87 | ?> |
88 | 88 | <tr> |
@@ -93,10 +93,10 @@ discard block |
||
93 | 93 | </td> |
94 | 94 | |
95 | 95 | <?php |
96 | - if (!api_is_allowed_to_edit(null,true) && $feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) { ?> |
|
96 | + if (!api_is_allowed_to_edit(null, true) && $feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) { ?> |
|
97 | 97 | <td> |
98 | 98 | <?php |
99 | - $comm = Event::get_comments($id,$questionId); |
|
99 | + $comm = Event::get_comments($id, $questionId); |
|
100 | 100 | ?> |
101 | 101 | </td> |
102 | 102 | <?php } ?> |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | if (isset($fileUrl)) { |
152 | 152 | echo ' |
153 | 153 | <tr> |
154 | - <td><audio src="' . $fileUrl . '" controls></audio></td> |
|
154 | + <td><audio src="' . $fileUrl.'" controls></audio></td> |
|
155 | 155 | </tr> |
156 | 156 | '; |
157 | 157 | } |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | echo '</tr>'; |
163 | 163 | if ($feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) { |
164 | 164 | echo '<tr>'; |
165 | - echo Display::tag('td',get_lang('notCorrectedYet'), array('width'=>'45%')); |
|
165 | + echo Display::tag('td', get_lang('notCorrectedYet'), array('width'=>'45%')); |
|
166 | 166 | echo '</tr>'; |
167 | 167 | } else { |
168 | 168 | echo '<tr><td> </td></tr>'; |
@@ -175,9 +175,9 @@ discard block |
||
175 | 175 | } |
176 | 176 | echo '</td>'; |
177 | 177 | |
178 | - if (!api_is_allowed_to_edit(null,true) && $feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) { |
|
178 | + if (!api_is_allowed_to_edit(null, true) && $feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) { |
|
179 | 179 | echo '<td>'; |
180 | - $comm = Event::get_comments($id,$questionId); |
|
180 | + $comm = Event::get_comments($id, $questionId); |
|
181 | 181 | echo '</td>'; |
182 | 182 | } |
183 | 183 | echo '</tr>'; |
@@ -306,12 +306,12 @@ discard block |
||
306 | 306 | } |
307 | 307 | } |
308 | 308 | |
309 | - $icon = in_array($answerType, array(UNIQUE_ANSWER, UNIQUE_ANSWER_NO_OPTION)) ? 'radio':'checkbox'; |
|
310 | - $icon .= $studentChoice?'_on':'_off'; |
|
309 | + $icon = in_array($answerType, array(UNIQUE_ANSWER, UNIQUE_ANSWER_NO_OPTION)) ? 'radio' : 'checkbox'; |
|
310 | + $icon .= $studentChoice ? '_on' : '_off'; |
|
311 | 311 | $icon .= '.gif'; |
312 | 312 | |
313 | - $iconAnswer = in_array($answerType, array(UNIQUE_ANSWER, UNIQUE_ANSWER_NO_OPTION)) ? 'radio':'checkbox'; |
|
314 | - $iconAnswer .= $answerCorrect?'_on':'_off'; |
|
313 | + $iconAnswer = in_array($answerType, array(UNIQUE_ANSWER, UNIQUE_ANSWER_NO_OPTION)) ? 'radio' : 'checkbox'; |
|
314 | + $iconAnswer .= $answerCorrect ? '_on' : '_off'; |
|
315 | 315 | $iconAnswer .= '.gif'; |
316 | 316 | |
317 | 317 | ?> |
@@ -351,8 +351,8 @@ discard block |
||
351 | 351 | ?> |
352 | 352 | </td> |
353 | 353 | <?php |
354 | - if ($ans==1) { |
|
355 | - $comm = Event::get_comments($id,$questionId); |
|
354 | + if ($ans == 1) { |
|
355 | + $comm = Event::get_comments($id, $questionId); |
|
356 | 356 | } |
357 | 357 | ?> |
358 | 358 | <?php } else { ?> |
@@ -455,7 +455,7 @@ discard block |
||
455 | 455 | ?> |
456 | 456 | </td> |
457 | 457 | <?php |
458 | - if ($ans==1) { |
|
458 | + if ($ans == 1) { |
|
459 | 459 | $comm = Event::get_comments($id, $questionId); |
460 | 460 | } |
461 | 461 | ?> |
@@ -558,8 +558,8 @@ discard block |
||
558 | 558 | ?> |
559 | 559 | </td> |
560 | 560 | <?php |
561 | - if ($ans==1) { |
|
562 | - $comm = Event::get_comments($id,$questionId); |
|
561 | + if ($ans == 1) { |
|
562 | + $comm = Event::get_comments($id, $questionId); |
|
563 | 563 | } |
564 | 564 | ?> |
565 | 565 | <?php } else { ?> |
@@ -25,6 +25,7 @@ discard block |
||
25 | 25 | * @param int $questionId Question ID |
26 | 26 | * @param int $resultsDisabled |
27 | 27 | * @param string $originalStudentAnswer |
28 | + * @param boolean $showTotalScoreAndUserChoices |
|
28 | 29 | * |
29 | 30 | * @return void |
30 | 31 | */ |
@@ -71,6 +72,11 @@ discard block |
||
71 | 72 | * @param string Answer text |
72 | 73 | * @param int Exercise ID |
73 | 74 | * @param int Question ID |
75 | + * @param integer $feedback_type |
|
76 | + * @param string $answer |
|
77 | + * @param integer $id |
|
78 | + * @param integer $questionId |
|
79 | + * @param boolean|string $showTotalScoreAndUserChoices |
|
74 | 80 | * @return void |
75 | 81 | */ |
76 | 82 | public static function display_calculated_answer( |
@@ -110,6 +116,9 @@ discard block |
||
110 | 116 | * @param string Answer text |
111 | 117 | * @param int Exercise ID |
112 | 118 | * @param int Question ID |
119 | + * @param integer $feedback_type |
|
120 | + * @param integer $exe_id |
|
121 | + * @param integer $questionId |
|
113 | 122 | * @return void |
114 | 123 | */ |
115 | 124 | public static function display_free_answer( |
@@ -139,11 +148,10 @@ discard block |
||
139 | 148 | } |
140 | 149 | |
141 | 150 | /** |
142 | - * @param $feedback_type |
|
151 | + * @param integer $feedback_type |
|
143 | 152 | * @param $answer |
144 | - * @param $id |
|
145 | - * @param $questionId |
|
146 | - * @param null $nano |
|
153 | + * @param integer $id |
|
154 | + * @param integer $questionId |
|
147 | 155 | * @param int $results_disabled |
148 | 156 | */ |
149 | 157 | public static function display_oral_expression_answer($feedback_type, $answer, $id, $questionId, $fileUrl = null, $results_disabled = 0) |
@@ -193,6 +201,7 @@ discard block |
||
193 | 201 | * @param string $answerComment |
194 | 202 | * @param int $resultsDisabled |
195 | 203 | * @param int $orderColor |
204 | + * @param boolean $showTotalScoreAndUserChoices |
|
196 | 205 | */ |
197 | 206 | public static function display_hotspot_answer( |
198 | 207 | $feedback_type, |
@@ -277,6 +286,13 @@ discard block |
||
277 | 286 | * @param integer Exercise ID |
278 | 287 | * @param integer Question ID |
279 | 288 | * @param boolean Whether to show the answer comment or not |
289 | + * @param integer $answerType |
|
290 | + * @param string $answer |
|
291 | + * @param string $answerComment |
|
292 | + * @param integer $answerCorrect |
|
293 | + * @param integer $id |
|
294 | + * @param integer $questionId |
|
295 | + * @param boolean $showTotalScoreAndUserChoices |
|
280 | 296 | * @return void |
281 | 297 | */ |
282 | 298 | public static function display_unique_or_multiple_answer( |
@@ -373,6 +389,14 @@ discard block |
||
373 | 389 | * @param integer Exercise ID |
374 | 390 | * @param integer Question ID |
375 | 391 | * @param boolean Whether to show the answer comment or not |
392 | + * @param integer $feedback_type |
|
393 | + * @param integer $answerType |
|
394 | + * @param string $answer |
|
395 | + * @param string $answerComment |
|
396 | + * @param integer $answerCorrect |
|
397 | + * @param integer $id |
|
398 | + * @param integer $questionId |
|
399 | + * @param boolean $showTotalScoreAndUserChoices |
|
376 | 400 | * @return void |
377 | 401 | */ |
378 | 402 | public static function display_multiple_answer_true_false( |
@@ -477,6 +501,14 @@ discard block |
||
477 | 501 | * @param integer Exercise ID |
478 | 502 | * @param integer Question ID |
479 | 503 | * @param boolean Whether to show the answer comment or not |
504 | + * @param integer $feedback_type |
|
505 | + * @param integer $answerType |
|
506 | + * @param string $answer |
|
507 | + * @param string $answerComment |
|
508 | + * @param integer $answerCorrect |
|
509 | + * @param integer $id |
|
510 | + * @param integer $questionId |
|
511 | + * @param boolean $showTotalScoreAndUserChoices |
|
480 | 512 | * @return void |
481 | 513 | */ |
482 | 514 | public static function display_multiple_answer_combination_true_false( |
@@ -14,9 +14,9 @@ discard block |
||
14 | 14 | |
15 | 15 | // load templates |
16 | 16 | function reports_loadTemplates() { |
17 | - global $reports_enabled_templates, $reports_template; |
|
18 | - foreach ($reports_enabled_templates as $t) |
|
19 | - require_once 'templates/'.$t.'.reports.php'; |
|
17 | + global $reports_enabled_templates, $reports_template; |
|
18 | + foreach ($reports_enabled_templates as $t) |
|
19 | + require_once 'templates/'.$t.'.reports.php'; |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | |
@@ -149,18 +149,18 @@ discard block |
||
149 | 149 | */ |
150 | 150 | // return tools ID (parametre is a constant from main_api |
151 | 151 | function reports_getToolId($tool) { |
152 | - $tools = array_flip(api_get_tools_lists()); |
|
153 | - if (array_key_exists($tool, $tools)) |
|
154 | - return $tools[$tool]; |
|
155 | - else |
|
156 | - return null; |
|
152 | + $tools = array_flip(api_get_tools_lists()); |
|
153 | + if (array_key_exists($tool, $tools)) |
|
154 | + return $tools[$tool]; |
|
155 | + else |
|
156 | + return null; |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | // return a sql clause returning triplet of (course, $session, $uid) the |
160 | 160 | // current user is authorized to reed |
161 | 161 | function reports_getVisibilitySQL () { |
162 | - return "select cru.user_id from ".Database::get_main_table(TABLE_MAIN_COURSE_USER).' cru'; |
|
163 | - // fixme sessions |
|
162 | + return "select cru.user_id from ".Database::get_main_table(TABLE_MAIN_COURSE_USER).' cru'; |
|
163 | + // fixme sessions |
|
164 | 164 | } |
165 | 165 | |
166 | 166 | // this function execute keys_query (SQL statement) |
@@ -15,9 +15,10 @@ discard block |
||
15 | 15 | // load templates |
16 | 16 | function reports_loadTemplates() { |
17 | 17 | global $reports_enabled_templates, $reports_template; |
18 | - foreach ($reports_enabled_templates as $t) |
|
19 | - require_once 'templates/'.$t.'.reports.php'; |
|
20 | -} |
|
18 | + foreach ($reports_enabled_templates as $t) { |
|
19 | + require_once 'templates/'.$t.'.reports.php'; |
|
20 | + } |
|
21 | + } |
|
21 | 22 | |
22 | 23 | |
23 | 24 | // clear all reporting data |
@@ -150,11 +151,12 @@ discard block |
||
150 | 151 | // return tools ID (parametre is a constant from main_api |
151 | 152 | function reports_getToolId($tool) { |
152 | 153 | $tools = array_flip(api_get_tools_lists()); |
153 | - if (array_key_exists($tool, $tools)) |
|
154 | - return $tools[$tool]; |
|
155 | - else |
|
156 | - return null; |
|
157 | -} |
|
154 | + if (array_key_exists($tool, $tools)) { |
|
155 | + return $tools[$tool]; |
|
156 | + } else { |
|
157 | + return null; |
|
158 | + } |
|
159 | + } |
|
158 | 160 | |
159 | 161 | // return a sql clause returning triplet of (course, $session, $uid) the |
160 | 162 | // current user is authorized to reed |
@@ -3,11 +3,11 @@ discard block |
||
3 | 3 | require_once __DIR__.'/../inc/global.inc.php'; |
4 | 4 | |
5 | 5 | |
6 | -define ('REPORTS_PROGRESS_COMPLETED', 1); |
|
6 | +define('REPORTS_PROGRESS_COMPLETED', 1); |
|
7 | 7 | |
8 | 8 | $reports_modules = array(); |
9 | 9 | |
10 | -$reports_enabled_modules = array('quiz','course','scorm'); |
|
10 | +$reports_enabled_modules = array('quiz', 'course', 'scorm'); |
|
11 | 11 | |
12 | 12 | $reports_enabled_templates = array('exercicesMultiCourses', 'courseTime', 'courseArticulate'); |
13 | 13 | |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | |
159 | 159 | // return a sql clause returning triplet of (course, $session, $uid) the |
160 | 160 | // current user is authorized to reed |
161 | -function reports_getVisibilitySQL () { |
|
161 | +function reports_getVisibilitySQL() { |
|
162 | 162 | return "select cru.user_id from ".Database::get_main_table(TABLE_MAIN_COURSE_USER).' cru'; |
163 | 163 | // fixme sessions |
164 | 164 | } |
@@ -33,7 +33,7 @@ |
||
33 | 33 | $result = Database::query($sql); |
34 | 34 | |
35 | 35 | if (Database::num_rows($result)) { |
36 | - $files = Database::store_result($result); |
|
36 | + $files = Database::store_result($result); |
|
37 | 37 | $rows = array(); |
38 | 38 | foreach ($files as $file) { |
39 | 39 | //Check if I have this file: |
@@ -65,8 +65,10 @@ discard block |
||
65 | 65 | $bords = array_fill(0, $bord_lenght, array()); // building this array |
66 | 66 | |
67 | 67 | /* adding the first point of the polygone */ |
68 | - if (is_array($bords[$poly[0]['y']])) //avoid warning |
|
68 | + if (is_array($bords[$poly[0]['y']])) { |
|
69 | + //avoid warning |
|
69 | 70 | array_push($bords[$poly[0]['y']], $poly[0]['x']); |
71 | + } |
|
70 | 72 | |
71 | 73 | $i = 1; // we re-use $i and $old_pente bellow the loop |
72 | 74 | $old_pente=0; |
@@ -75,11 +77,14 @@ discard block |
||
75 | 77 | |
76 | 78 | /* special cases */ |
77 | 79 | if ($poly[$i-1]['y'] == $poly[$i]['y']) { |
78 | - if ($poly[$i-1]['x'] == $poly[$i]['x']) |
|
79 | - continue; // twice the same point |
|
80 | + if ($poly[$i-1]['x'] == $poly[$i]['x']) { |
|
81 | + continue; |
|
82 | + } |
|
83 | + // twice the same point |
|
80 | 84 | else { // infinite elevation of the edge |
81 | - if (is_array($bords[$poly[$i]['y']])) |
|
82 | - array_push($bords[$poly[$i]['y']],$poly[$i]['x']); |
|
85 | + if (is_array($bords[$poly[$i]['y']])) { |
|
86 | + array_push($bords[$poly[$i]['y']],$poly[$i]['x']); |
|
87 | + } |
|
83 | 88 | $old_pente=0; |
84 | 89 | continue; |
85 | 90 | } |
@@ -87,9 +92,13 @@ discard block |
||
87 | 92 | |
88 | 93 | //echo 'point:'.$poly[$i]['y']; bug here |
89 | 94 | // adding the point as a part of an edge |
90 | - if (is_array($bords[$poly[$i]['y']])) //avoid warning |
|
95 | + if (is_array($bords[$poly[$i]['y']])) { |
|
96 | + //avoid warning |
|
91 | 97 | array_push($bords[$poly[$i]['y']], $poly[$i]['x']); |
92 | - if (DEBUG) echo '('.$poly[$i]['x'].';'.$poly[$i]['y'].') '; |
|
98 | + } |
|
99 | + if (DEBUG) { |
|
100 | + echo '('.$poly[$i]['x'].';'.$poly[$i]['y'].') '; |
|
101 | + } |
|
93 | 102 | |
94 | 103 | /* computing the elevation of the edge going */ |
95 | 104 | // from $poly[$i-1] to $poly[$i] |
@@ -99,15 +108,17 @@ discard block |
||
99 | 108 | // if the sign of the elevation change from the one of the |
100 | 109 | // previous edge, the point must be added a second time inside |
101 | 110 | // $bords |
102 | - if ($i>1) |
|
103 | - if (($old_pente<0 && $pente>0) |
|
111 | + if ($i>1) { |
|
112 | + if (($old_pente<0 && $pente>0) |
|
104 | 113 | || ($old_pente>0 && $pente<0)) { |
105 | 114 | if (is_array($bords[$poly[$i]['y']])) //avoid warning |
106 | 115 | array_push($bords[$poly[$i]['y']],$poly[$i]['x']); |
116 | + } |
|
107 | 117 | |
108 | - if (DEBUG) |
|
109 | - echo '*('.$poly[$i]['x']. |
|
118 | + if (DEBUG) { |
|
119 | + echo '*('.$poly[$i]['x']. |
|
110 | 120 | ';'.$poly[$i]['y'].') '; |
121 | + } |
|
111 | 122 | } |
112 | 123 | |
113 | 124 | /* detect the direction of the elevation in Y */ |
@@ -136,10 +147,11 @@ discard block |
||
136 | 147 | |
137 | 148 | // elevation between $poly[0]['x'] and $poly[1]['x']) |
138 | 149 | $rest = $poly[0]['y']-$poly[1]['y']; |
139 | - if ($rest!=0) |
|
140 | - $pente1 = ($poly[0]['x']-$poly[1]['x'])/($rest); |
|
141 | - else |
|
142 | - $pente1 = 0; |
|
150 | + if ($rest!=0) { |
|
151 | + $pente1 = ($poly[0]['x']-$poly[1]['x'])/($rest); |
|
152 | + } else { |
|
153 | + $pente1 = 0; |
|
154 | + } |
|
143 | 155 | |
144 | 156 | // elevation between $poly[$i-1]['x'] and $poly[0]['x']) |
145 | 157 | $pente = ($poly[$i-1]['x']-$poly[0]['x'])/ |
@@ -151,14 +163,17 @@ discard block |
||
151 | 163 | |
152 | 164 | // doubling the first point if needed (see above) |
153 | 165 | if (($pente1<0 && $pente>0) || ($pente1>0 && $pente<0)) { |
154 | - if (is_array($bords[$poly[$i - 1]['y']])) |
|
155 | - array_push($bords[$poly[$i - 1]['y']], round($poly[$i - 1]['x'])); |
|
166 | + if (is_array($bords[$poly[$i - 1]['y']])) { |
|
167 | + array_push($bords[$poly[$i - 1]['y']], round($poly[$i - 1]['x'])); |
|
168 | + } |
|
156 | 169 | //if (DEBUG) echo '('.$poly[$i-1]['x'].';'.$poly[$i-1]['y'].') '; |
157 | 170 | } |
158 | 171 | // doubling the last point if neededd |
159 | 172 | if (($old_pente<0 && $pente>0) || ($old_pente>0 && $pente<0)) { |
160 | - if (is_array($bords[$poly[$i-1]['y']])) //avoid warning |
|
173 | + if (is_array($bords[$poly[$i-1]['y']])) { |
|
174 | + //avoid warning |
|
161 | 175 | array_push($bords[$poly[$i-1]['y']], round($poly[$i-1]['x'])); |
176 | + } |
|
162 | 177 | //if (DEBUG) echo '*('.$poly[$i-1]['x'].';'.$poly[$i-1]['y'].') '; |
163 | 178 | } |
164 | 179 | |
@@ -227,11 +242,13 @@ discard block |
||
227 | 242 | $s = "<div style='font-size: 8px; line-height:3px'><pre>\n"; |
228 | 243 | } |
229 | 244 | for ($i=0; $i<$max['y']; $i++) { |
230 | - for($j=0; $j<$max['x']; $j++) |
|
231 | - if($poly[$j][$i] == TRUE) |
|
245 | + for($j=0; $j<$max['x']; $j++) { |
|
246 | + if($poly[$j][$i] == TRUE) |
|
232 | 247 | $s .= ($format=='html'?"<b>1</b>":'1'); |
233 | - else |
|
234 | - $s .= "0"; |
|
248 | + } |
|
249 | + else { |
|
250 | + $s .= "0"; |
|
251 | + } |
|
235 | 252 | $s .= ($format=='html'?"<br />\n":"\n"); |
236 | 253 | } |
237 | 254 | $s .= ($format=='html'?"</pre></div>\n":"\n"); |
@@ -252,15 +269,19 @@ discard block |
||
252 | 269 | $surfaceOf1 = 0; |
253 | 270 | $surfaceOf2 = 0; |
254 | 271 | |
255 | - for ($i=0; $i<$max['x']; $i++) |
|
256 | - for($j=0; $j<$max['y']; $j++) { |
|
272 | + for ($i=0; $i<$max['x']; $i++) { |
|
273 | + for($j=0; |
|
274 | + } |
|
275 | + $j<$max['y']; $j++) { |
|
257 | 276 | if (isset($poly1[$i][$j]) && ($poly1[$i][$j] == TRUE)) { |
258 | 277 | $surfaceOf1++; |
259 | - if (isset($poly2[$i][$j]) && ($poly2[$i][$j] == FALSE)) |
|
260 | - $onlyIn1++; |
|
278 | + if (isset($poly2[$i][$j]) && ($poly2[$i][$j] == FALSE)) { |
|
279 | + $onlyIn1++; |
|
280 | + } |
|
281 | + } |
|
282 | + if (isset($poly2[$i][$j]) && ($poly2[$i][$j] == TRUE)) { |
|
283 | + $surfaceOf2++; |
|
261 | 284 | } |
262 | - if (isset($poly2[$i][$j]) && ($poly2[$i][$j] == TRUE)) |
|
263 | - $surfaceOf2++; |
|
264 | 285 | } |
265 | 286 | |
266 | 287 | return array ( |
@@ -56,9 +56,9 @@ discard block |
||
56 | 56 | * for all j in [O..max[y][ : for all i in bords[$j] : |
57 | 57 | * (i,j) is a point inside an edge of the polygone |
58 | 58 | */ |
59 | - $bord_lenght = $max['x']; |
|
59 | + $bord_lenght = $max['x']; |
|
60 | 60 | if ($max['y'] > $bord_lenght) { |
61 | - $bord_lenght = $max['y']; |
|
61 | + $bord_lenght = $max['y']; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | //$bords = array_fill(0, $bord_lenght-1, array()); // building this array |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | |
67 | 67 | /* adding the first point of the polygone */ |
68 | 68 | if (is_array($bords[$poly[0]['y']])) //avoid warning |
69 | - array_push($bords[$poly[0]['y']], $poly[0]['x']); |
|
69 | + array_push($bords[$poly[0]['y']], $poly[0]['x']); |
|
70 | 70 | |
71 | 71 | $i = 1; // we re-use $i and $old_pente bellow the loop |
72 | 72 | $old_pente=0; |
@@ -78,14 +78,14 @@ discard block |
||
78 | 78 | if ($poly[$i-1]['x'] == $poly[$i]['x']) |
79 | 79 | continue; // twice the same point |
80 | 80 | else { // infinite elevation of the edge |
81 | - if (is_array($bords[$poly[$i]['y']])) |
|
82 | - array_push($bords[$poly[$i]['y']],$poly[$i]['x']); |
|
81 | + if (is_array($bords[$poly[$i]['y']])) |
|
82 | + array_push($bords[$poly[$i]['y']],$poly[$i]['x']); |
|
83 | 83 | $old_pente=0; |
84 | 84 | continue; |
85 | 85 | } |
86 | 86 | } |
87 | 87 | |
88 | - //echo 'point:'.$poly[$i]['y']; bug here |
|
88 | + //echo 'point:'.$poly[$i]['y']; bug here |
|
89 | 89 | // adding the point as a part of an edge |
90 | 90 | if (is_array($bords[$poly[$i]['y']])) //avoid warning |
91 | 91 | array_push($bords[$poly[$i]['y']], $poly[$i]['x']); |
@@ -102,13 +102,13 @@ discard block |
||
102 | 102 | if ($i>1) |
103 | 103 | if (($old_pente<0 && $pente>0) |
104 | 104 | || ($old_pente>0 && $pente<0)) { |
105 | - if (is_array($bords[$poly[$i]['y']])) //avoid warning |
|
106 | - array_push($bords[$poly[$i]['y']],$poly[$i]['x']); |
|
105 | + if (is_array($bords[$poly[$i]['y']])) //avoid warning |
|
106 | + array_push($bords[$poly[$i]['y']],$poly[$i]['x']); |
|
107 | 107 | |
108 | 108 | if (DEBUG) |
109 | 109 | echo '*('.$poly[$i]['x']. |
110 | 110 | ';'.$poly[$i]['y'].') '; |
111 | - } |
|
111 | + } |
|
112 | 112 | |
113 | 113 | /* detect the direction of the elevation in Y */ |
114 | 114 | $dy_inc = ($poly[$i]['y']-$poly[$i-1]['y']) > 0 ? 1 : -1; |
@@ -137,9 +137,9 @@ discard block |
||
137 | 137 | // elevation between $poly[0]['x'] and $poly[1]['x']) |
138 | 138 | $rest = $poly[0]['y']-$poly[1]['y']; |
139 | 139 | if ($rest!=0) |
140 | - $pente1 = ($poly[0]['x']-$poly[1]['x'])/($rest); |
|
140 | + $pente1 = ($poly[0]['x']-$poly[1]['x'])/($rest); |
|
141 | 141 | else |
142 | - $pente1 = 0; |
|
142 | + $pente1 = 0; |
|
143 | 143 | |
144 | 144 | // elevation between $poly[$i-1]['x'] and $poly[0]['x']) |
145 | 145 | $pente = ($poly[$i-1]['x']-$poly[0]['x'])/ |
@@ -151,14 +151,14 @@ discard block |
||
151 | 151 | |
152 | 152 | // doubling the first point if needed (see above) |
153 | 153 | if (($pente1<0 && $pente>0) || ($pente1>0 && $pente<0)) { |
154 | - if (is_array($bords[$poly[$i - 1]['y']])) |
|
155 | - array_push($bords[$poly[$i - 1]['y']], round($poly[$i - 1]['x'])); |
|
154 | + if (is_array($bords[$poly[$i - 1]['y']])) |
|
155 | + array_push($bords[$poly[$i - 1]['y']], round($poly[$i - 1]['x'])); |
|
156 | 156 | //if (DEBUG) echo '('.$poly[$i-1]['x'].';'.$poly[$i-1]['y'].') '; |
157 | 157 | } |
158 | 158 | // doubling the last point if neededd |
159 | 159 | if (($old_pente<0 && $pente>0) || ($old_pente>0 && $pente<0)) { |
160 | - if (is_array($bords[$poly[$i-1]['y']])) //avoid warning |
|
161 | - array_push($bords[$poly[$i-1]['y']], round($poly[$i-1]['x'])); |
|
160 | + if (is_array($bords[$poly[$i-1]['y']])) //avoid warning |
|
161 | + array_push($bords[$poly[$i-1]['y']], round($poly[$i-1]['x'])); |
|
162 | 162 | //if (DEBUG) echo '*('.$poly[$i-1]['x'].';'.$poly[$i-1]['y'].') '; |
163 | 163 | } |
164 | 164 | |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | for ($i = 0; $i<$n; $i++) { // Y |
186 | 186 | //error_log(__FILE__.' - Border Num '.$i,0); |
187 | 187 | if (is_array($bords[$i])) { |
188 | - sort($bords[$i]); |
|
188 | + sort($bords[$i]); |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | for ($j = 0; $j<sizeof($bords[$i]);$j+=2) { // bords |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | for ($k = round($bords[$i][$j]); $k<=$bords[$i][$j+1];$k++) { |
197 | 197 | $res[$k][$i] = true; //filling the array with trues |
198 | 198 | if ($test == 1) { |
199 | - /*how to draw the polygon in a human way: |
|
199 | + /*how to draw the polygon in a human way: |
|
200 | 200 | In ubuntu : sudo apt-get install gnuplot |
201 | 201 | Create an empty file with all points with the result of this echos (No commas, no point, no headers) |
202 | 202 | In gnuplot: |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | For 2 polygons: plot "/home/jmontoya/test", "/home/jmontoya/test2" |
205 | 205 | A new window will appear with the plot |
206 | 206 | */ |
207 | - echo $k.' '.$i; echo '<br />'; |
|
207 | + echo $k.' '.$i; echo '<br />'; |
|
208 | 208 | } |
209 | 209 | } |
210 | 210 | } |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | list($x,$y) = explode(';',$pcoord); |
309 | 309 | $points[] = array('x'=>$x,'y'=>$y); |
310 | 310 | } |
311 | - return $points; |
|
311 | + return $points; |
|
312 | 312 | } |
313 | 313 | |
314 | 314 | /** |
@@ -321,11 +321,11 @@ discard block |
||
321 | 321 | $mx = 0; |
322 | 322 | $my = 0; |
323 | 323 | foreach ($coords1 as $coord) { |
324 | - if ($coord['x'] > $mx) { |
|
324 | + if ($coord['x'] > $mx) { |
|
325 | 325 | $mx = $coord['x']; |
326 | - } |
|
326 | + } |
|
327 | 327 | if ($coord['y'] > $my) { |
328 | - $my = $coord['y']; |
|
328 | + $my = $coord['y']; |
|
329 | 329 | } |
330 | 330 | } |
331 | 331 | foreach ($coords2 as $coord) { |
@@ -13,8 +13,8 @@ discard block |
||
13 | 13 | * @returns an array such as: for all i in [0..max[x][ : for all j in [0..max[y][ : array[i][j] = FALSE |
14 | 14 | */ |
15 | 15 | function poly_init($max) { |
16 | - return array_fill(0, $max["x"]-1, |
|
17 | - array_fill(0, $max["y"]-1, FALSE)); |
|
16 | + return array_fill(0, $max["x"] - 1, |
|
17 | + array_fill(0, $max["y"] - 1, FALSE)); |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | |
@@ -69,18 +69,18 @@ discard block |
||
69 | 69 | array_push($bords[$poly[0]['y']], $poly[0]['x']); |
70 | 70 | |
71 | 71 | $i = 1; // we re-use $i and $old_pente bellow the loop |
72 | - $old_pente=0; |
|
73 | - for ( ; // for each points of the polygon but the first |
|
74 | - $i<sizeof($poly) && (!empty($poly[$i]['x']) && !empty($poly[$i]['y'])); $i++) { |
|
72 | + $old_pente = 0; |
|
73 | + for (; // for each points of the polygon but the first |
|
74 | + $i < sizeof($poly) && (!empty($poly[$i]['x']) && !empty($poly[$i]['y'])); $i++) { |
|
75 | 75 | |
76 | 76 | /* special cases */ |
77 | - if ($poly[$i-1]['y'] == $poly[$i]['y']) { |
|
78 | - if ($poly[$i-1]['x'] == $poly[$i]['x']) |
|
77 | + if ($poly[$i - 1]['y'] == $poly[$i]['y']) { |
|
78 | + if ($poly[$i - 1]['x'] == $poly[$i]['x']) |
|
79 | 79 | continue; // twice the same point |
80 | 80 | else { // infinite elevation of the edge |
81 | 81 | if (is_array($bords[$poly[$i]['y']])) |
82 | - array_push($bords[$poly[$i]['y']],$poly[$i]['x']); |
|
83 | - $old_pente=0; |
|
82 | + array_push($bords[$poly[$i]['y']], $poly[$i]['x']); |
|
83 | + $old_pente = 0; |
|
84 | 84 | continue; |
85 | 85 | } |
86 | 86 | } |
@@ -93,17 +93,17 @@ discard block |
||
93 | 93 | |
94 | 94 | /* computing the elevation of the edge going */ |
95 | 95 | // from $poly[$i-1] to $poly[$i] |
96 | - $pente = ($poly[$i-1]['x']-$poly[$i]['x'])/ |
|
97 | - ($poly[$i-1]['y']-$poly[$i]['y']); |
|
96 | + $pente = ($poly[$i - 1]['x'] - $poly[$i]['x']) / |
|
97 | + ($poly[$i - 1]['y'] - $poly[$i]['y']); |
|
98 | 98 | |
99 | 99 | // if the sign of the elevation change from the one of the |
100 | 100 | // previous edge, the point must be added a second time inside |
101 | 101 | // $bords |
102 | - if ($i>1) |
|
103 | - if (($old_pente<0 && $pente>0) |
|
104 | - || ($old_pente>0 && $pente<0)) { |
|
102 | + if ($i > 1) |
|
103 | + if (($old_pente < 0 && $pente > 0) |
|
104 | + || ($old_pente > 0 && $pente < 0)) { |
|
105 | 105 | if (is_array($bords[$poly[$i]['y']])) //avoid warning |
106 | - array_push($bords[$poly[$i]['y']],$poly[$i]['x']); |
|
106 | + array_push($bords[$poly[$i]['y']], $poly[$i]['x']); |
|
107 | 107 | |
108 | 108 | if (DEBUG) |
109 | 109 | echo '*('.$poly[$i]['x']. |
@@ -111,8 +111,8 @@ discard block |
||
111 | 111 | } |
112 | 112 | |
113 | 113 | /* detect the direction of the elevation in Y */ |
114 | - $dy_inc = ($poly[$i]['y']-$poly[$i-1]['y']) > 0 ? 1 : -1; |
|
115 | - $x = $poly[$i-1]['x']; |
|
114 | + $dy_inc = ($poly[$i]['y'] - $poly[$i - 1]['y']) > 0 ? 1 : -1; |
|
115 | + $x = $poly[$i - 1]['x']; |
|
116 | 116 | // if (DEBUG) echo "init: ".$poly[$i-1]['y']." dy_inc: ".$dy_inc. |
117 | 117 | // " end: ".$poly[$i]['y']." pente:".$pente; |
118 | 118 | |
@@ -121,10 +121,10 @@ discard block |
||
121 | 121 | |
122 | 122 | // we iterate w/ $dy in ]$poly[$i-1]['y'],$poly[$i-1]['y'][ |
123 | 123 | // w/ $dy_inc as increment |
124 | - for ($dy = $poly[$i-1]['y']+$dy_inc; |
|
124 | + for ($dy = $poly[$i - 1]['y'] + $dy_inc; |
|
125 | 125 | $dy != $poly[$i]['y']; |
126 | 126 | $dy += $dy_inc) { |
127 | - $x += $pente*$dy_inc; |
|
127 | + $x += $pente * $dy_inc; |
|
128 | 128 | array_push($bords[$dy], $x); |
129 | 129 | // if (DEBUG) echo '/('.$x.';'.$dy.') '; |
130 | 130 | } |
@@ -132,47 +132,47 @@ discard block |
||
132 | 132 | } |
133 | 133 | |
134 | 134 | // closing the polygone (the edge between $poly[$i-1] and $poly[0]) |
135 | - if ($poly[$i-1]['y']!=$poly[0]['y']) {// droite--> rien à faire |
|
135 | + if ($poly[$i - 1]['y'] != $poly[0]['y']) {// droite--> rien à faire |
|
136 | 136 | |
137 | 137 | // elevation between $poly[0]['x'] and $poly[1]['x']) |
138 | - $rest = $poly[0]['y']-$poly[1]['y']; |
|
139 | - if ($rest!=0) |
|
140 | - $pente1 = ($poly[0]['x']-$poly[1]['x'])/($rest); |
|
138 | + $rest = $poly[0]['y'] - $poly[1]['y']; |
|
139 | + if ($rest != 0) |
|
140 | + $pente1 = ($poly[0]['x'] - $poly[1]['x']) / ($rest); |
|
141 | 141 | else |
142 | 142 | $pente1 = 0; |
143 | 143 | |
144 | 144 | // elevation between $poly[$i-1]['x'] and $poly[0]['x']) |
145 | - $pente = ($poly[$i-1]['x']-$poly[0]['x'])/ |
|
146 | - ($poly[$i-1]['y']-$poly[0]['y']); |
|
145 | + $pente = ($poly[$i - 1]['x'] - $poly[0]['x']) / |
|
146 | + ($poly[$i - 1]['y'] - $poly[0]['y']); |
|
147 | 147 | |
148 | 148 | // if (DEBUG) echo 'start('.$poly[$i-1]['x'].','.$poly[$i-1]['y']. |
149 | 149 | // ')-end('.$poly[0]['x'].','.$poly[0]['y']. |
150 | 150 | // ')-pente'.$pente; |
151 | 151 | |
152 | 152 | // doubling the first point if needed (see above) |
153 | - if (($pente1<0 && $pente>0) || ($pente1>0 && $pente<0)) { |
|
153 | + if (($pente1 < 0 && $pente > 0) || ($pente1 > 0 && $pente < 0)) { |
|
154 | 154 | if (is_array($bords[$poly[$i - 1]['y']])) |
155 | - array_push($bords[$poly[$i - 1]['y']], round($poly[$i - 1]['x'])); |
|
155 | + array_push($bords[$poly[$i - 1]['y']], round($poly[$i - 1]['x'])); |
|
156 | 156 | //if (DEBUG) echo '('.$poly[$i-1]['x'].';'.$poly[$i-1]['y'].') '; |
157 | 157 | } |
158 | 158 | // doubling the last point if neededd |
159 | - if (($old_pente<0 && $pente>0) || ($old_pente>0 && $pente<0)) { |
|
160 | - if (is_array($bords[$poly[$i-1]['y']])) //avoid warning |
|
161 | - array_push($bords[$poly[$i-1]['y']], round($poly[$i-1]['x'])); |
|
159 | + if (($old_pente < 0 && $pente > 0) || ($old_pente > 0 && $pente < 0)) { |
|
160 | + if (is_array($bords[$poly[$i - 1]['y']])) //avoid warning |
|
161 | + array_push($bords[$poly[$i - 1]['y']], round($poly[$i - 1]['x'])); |
|
162 | 162 | //if (DEBUG) echo '*('.$poly[$i-1]['x'].';'.$poly[$i-1]['y'].') '; |
163 | 163 | } |
164 | 164 | |
165 | 165 | |
166 | - $dy_inc = ($poly[0]['y']-$poly[$i-1]['y']) > 0 ? 1 : -1; |
|
167 | - $x = $poly[$i-1]['x']; |
|
166 | + $dy_inc = ($poly[0]['y'] - $poly[$i - 1]['y']) > 0 ? 1 : -1; |
|
167 | + $x = $poly[$i - 1]['x']; |
|
168 | 168 | // if (DEBUG) echo "init: ".$poly[$i-1]['y']." dy_inc: ".$dy_inc. |
169 | 169 | // " end: ".$poly[0]['y']; |
170 | 170 | |
171 | - for ($dy = $poly[$i-1]['y']+$dy_inc; |
|
171 | + for ($dy = $poly[$i - 1]['y'] + $dy_inc; |
|
172 | 172 | $dy != $poly[0]['y']; |
173 | 173 | $dy += $dy_inc) |
174 | 174 | { |
175 | - $x += $pente*$dy_inc; |
|
175 | + $x += $pente * $dy_inc; |
|
176 | 176 | array_push($bords[$dy], round($x)); |
177 | 177 | // if (DEBUG) echo '/('.$x.';'.$dy.') '; |
178 | 178 | } |
@@ -182,20 +182,20 @@ discard block |
||
182 | 182 | /* basic idea: we sort a column of edges. |
183 | 183 | For each pair of point, we color the points in between */ |
184 | 184 | $n = count($bords); |
185 | - for ($i = 0; $i<$n; $i++) { // Y |
|
185 | + for ($i = 0; $i < $n; $i++) { // Y |
|
186 | 186 | //error_log(__FILE__.' - Border Num '.$i,0); |
187 | 187 | if (is_array($bords[$i])) { |
188 | 188 | sort($bords[$i]); |
189 | 189 | } |
190 | 190 | |
191 | - for ($j = 0; $j<sizeof($bords[$i]);$j+=2) { // bords |
|
191 | + for ($j = 0; $j < sizeof($bords[$i]); $j += 2) { // bords |
|
192 | 192 | if (!isset($bords[$i][$j + 1])) { |
193 | 193 | continue; |
194 | 194 | } |
195 | 195 | |
196 | - for ($k = round($bords[$i][$j]); $k<=$bords[$i][$j+1];$k++) { |
|
196 | + for ($k = round($bords[$i][$j]); $k <= $bords[$i][$j + 1]; $k++) { |
|
197 | 197 | $res[$k][$i] = true; //filling the array with trues |
198 | - if ($test == 1) { |
|
198 | + if ($test == 1) { |
|
199 | 199 | /*how to draw the polygon in a human way: |
200 | 200 | In ubuntu : sudo apt-get install gnuplot |
201 | 201 | Create an empty file with all points with the result of this echos (No commas, no point, no headers) |
@@ -222,19 +222,19 @@ discard block |
||
222 | 222 | * |
223 | 223 | * @return string html code of the representation of the polygone image |
224 | 224 | */ |
225 | -function poly_dump(&$poly, $max, $format='raw') { |
|
225 | +function poly_dump(&$poly, $max, $format = 'raw') { |
|
226 | 226 | if ($format == 'html') { |
227 | 227 | $s = "<div style='font-size: 8px; line-height:3px'><pre>\n"; |
228 | 228 | } |
229 | - for ($i=0; $i<$max['y']; $i++) { |
|
230 | - for($j=0; $j<$max['x']; $j++) |
|
231 | - if($poly[$j][$i] == TRUE) |
|
232 | - $s .= ($format=='html'?"<b>1</b>":'1'); |
|
229 | + for ($i = 0; $i < $max['y']; $i++) { |
|
230 | + for ($j = 0; $j < $max['x']; $j++) |
|
231 | + if ($poly[$j][$i] == TRUE) |
|
232 | + $s .= ($format == 'html' ? "<b>1</b>" : '1'); |
|
233 | 233 | else |
234 | 234 | $s .= "0"; |
235 | - $s .= ($format=='html'?"<br />\n":"\n"); |
|
235 | + $s .= ($format == 'html' ? "<br />\n" : "\n"); |
|
236 | 236 | } |
237 | - $s .= ($format=='html'?"</pre></div>\n":"\n"); |
|
237 | + $s .= ($format == 'html' ? "</pre></div>\n" : "\n"); |
|
238 | 238 | return $s; |
239 | 239 | } |
240 | 240 | |
@@ -252,8 +252,8 @@ discard block |
||
252 | 252 | $surfaceOf1 = 0; |
253 | 253 | $surfaceOf2 = 0; |
254 | 254 | |
255 | - for ($i=0; $i<$max['x']; $i++) |
|
256 | - for($j=0; $j<$max['y']; $j++) { |
|
255 | + for ($i = 0; $i < $max['x']; $i++) |
|
256 | + for ($j = 0; $j < $max['y']; $j++) { |
|
257 | 257 | if (isset($poly1[$i][$j]) && ($poly1[$i][$j] == TRUE)) { |
258 | 258 | $surfaceOf1++; |
259 | 259 | if (isset($poly2[$i][$j]) && ($poly2[$i][$j] == FALSE)) |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | $surfaceOf2++; |
264 | 264 | } |
265 | 265 | |
266 | - return array ( |
|
266 | + return array( |
|
267 | 267 | "s1" => $surfaceOf1, |
268 | 268 | "s2" => $surfaceOf2, |
269 | 269 | "both" => $surfaceOf1 - $onlyIn1, |
@@ -282,8 +282,8 @@ discard block |
||
282 | 282 | */ |
283 | 283 | function poly_touch(&$poly1, &$poly2, $max) { |
284 | 284 | |
285 | - for ($i=0; $i<$max['x']; $i++) { |
|
286 | - for($j=0; $j<$max['y']; $j++) { |
|
285 | + for ($i = 0; $i < $max['x']; $i++) { |
|
286 | + for ($j = 0; $j < $max['y']; $j++) { |
|
287 | 287 | if (isset($poly1[$i][$j]) && ($poly1[$i][$j] == true) |
288 | 288 | && isset($poly2[$i][$j]) && ($poly2[$i][$j] == true)) { |
289 | 289 | return true; |
@@ -301,12 +301,12 @@ discard block |
||
301 | 301 | * @return array An array of points in the right format to use with the |
302 | 302 | * local functions |
303 | 303 | */ |
304 | -function convert_coordinates($coords,$sep='|') { |
|
304 | +function convert_coordinates($coords, $sep = '|') { |
|
305 | 305 | $points = array(); |
306 | - $pairs = explode($sep,$coords); |
|
306 | + $pairs = explode($sep, $coords); |
|
307 | 307 | foreach ($pairs as $idx => $pcoord) { |
308 | - list($x,$y) = explode(';',$pcoord); |
|
309 | - $points[] = array('x'=>$x,'y'=>$y); |
|
308 | + list($x, $y) = explode(';', $pcoord); |
|
309 | + $points[] = array('x'=>$x, 'y'=>$y); |
|
310 | 310 | } |
311 | 311 | return $points; |
312 | 312 | } |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | $my = $coord['y']; |
337 | 337 | } |
338 | 338 | } |
339 | - return array('x'=>$mx,'y'=>$my); |
|
339 | + return array('x'=>$mx, 'y'=>$my); |
|
340 | 340 | } |
341 | 341 | |
342 | 342 | /** |
@@ -85,12 +85,12 @@ |
||
85 | 85 | } |
86 | 86 | } |
87 | 87 | if(!empty($url_string)) { |
88 | - Display :: display_warning_message(get_lang('AdminShouldBeRegisterInSite').'<br />'.$url_string,false); |
|
88 | + Display :: display_warning_message(get_lang('AdminShouldBeRegisterInSite').'<br />'.$url_string,false); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | // checking the current installation |
92 | 92 | if ($current_access_url_id==-1) { |
93 | - Display::display_warning_message(get_lang('URLNotConfiguredPleaseChangedTo').': '.api_get_path(WEB_PATH)); |
|
93 | + Display::display_warning_message(get_lang('URLNotConfiguredPleaseChangedTo').': '.api_get_path(WEB_PATH)); |
|
94 | 94 | } elseif(api_is_platform_admin()) { |
95 | 95 | $quant= UrlManager::relation_url_user_exist(api_get_user_id(),$current_access_url_id); |
96 | 96 | if ($quant==0) { |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | exit; |
20 | 20 | } |
21 | 21 | |
22 | -$interbreadcrumb[] = array ("url" => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
22 | +$interbreadcrumb[] = array("url" => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
23 | 23 | $tool_name = get_lang('MultipleAccessURLs'); |
24 | 24 | Display :: display_header($tool_name); |
25 | 25 | |
@@ -55,12 +55,12 @@ discard block |
||
55 | 55 | case 'register': |
56 | 56 | // we are going to register the admin |
57 | 57 | if (api_is_platform_admin()) { |
58 | - if ($current_access_url_id!=-1) { |
|
58 | + if ($current_access_url_id != -1) { |
|
59 | 59 | $url_str = ''; |
60 | 60 | foreach ($url_list as $my_url) { |
61 | 61 | if (!in_array($my_url['id'], $my_user_url_list)) { |
62 | 62 | UrlManager::add_user_to_url(api_get_user_id(), $my_url['id']); |
63 | - $url_str.=$my_url['url'].' <br />'; |
|
63 | + $url_str .= $my_url['url'].' <br />'; |
|
64 | 64 | } |
65 | 65 | } |
66 | 66 | Display:: display_normal_message( |
@@ -84,16 +84,16 @@ discard block |
||
84 | 84 | $url_string .= $my_url['url'].' <br />'; |
85 | 85 | } |
86 | 86 | } |
87 | -if(!empty($url_string)) { |
|
88 | - Display :: display_warning_message(get_lang('AdminShouldBeRegisterInSite').'<br />'.$url_string,false); |
|
87 | +if (!empty($url_string)) { |
|
88 | + Display :: display_warning_message(get_lang('AdminShouldBeRegisterInSite').'<br />'.$url_string, false); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | // checking the current installation |
92 | -if ($current_access_url_id==-1) { |
|
92 | +if ($current_access_url_id == -1) { |
|
93 | 93 | Display::display_warning_message(get_lang('URLNotConfiguredPleaseChangedTo').': '.api_get_path(WEB_PATH)); |
94 | -} elseif(api_is_platform_admin()) { |
|
95 | - $quant= UrlManager::relation_url_user_exist(api_get_user_id(),$current_access_url_id); |
|
96 | - if ($quant==0) { |
|
94 | +} elseif (api_is_platform_admin()) { |
|
95 | + $quant = UrlManager::relation_url_user_exist(api_get_user_id(), $current_access_url_id); |
|
96 | + if ($quant == 0) { |
|
97 | 97 | Display:: display_warning_message( |
98 | 98 | '<a href="'.api_get_self().'?action=register&sec_token='.$parameters['sec_token'].'">'.get_lang('ClickToRegisterAdmin').'</a>', |
99 | 99 | false |
@@ -142,16 +142,16 @@ discard block |
||
142 | 142 | |
143 | 143 | //Status |
144 | 144 | $active = $row['active']; |
145 | - if ($active=='1') { |
|
146 | - $action='lock'; |
|
147 | - $image='right'; |
|
145 | + if ($active == '1') { |
|
146 | + $action = 'lock'; |
|
147 | + $image = 'right'; |
|
148 | 148 | } |
149 | - if ($active=='0') { |
|
150 | - $action='unlock'; |
|
151 | - $image='wrong'; |
|
149 | + if ($active == '0') { |
|
150 | + $action = 'unlock'; |
|
151 | + $image = 'wrong'; |
|
152 | 152 | } |
153 | 153 | // you cannot lock the default |
154 | - if ($row['id']=='1') { |
|
154 | + if ($row['id'] == '1') { |
|
155 | 155 | $status = Display::return_icon($image.'.gif', get_lang(ucfirst($action))); |
156 | 156 | } else { |
157 | 157 | $status = '<a href="access_urls.php?action='.$action.'&url_id='.$row['id'].'">'. |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | $url_id = $row['id']; |
162 | 162 | $actions = Display::url(Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL), "access_url_edit.php?url_id=$url_id"); |
163 | 163 | if ($url_id != '1') { |
164 | - $actions .= '<a href="access_urls.php?action=delete_url&url_id='.$url_id.'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'. |
|
164 | + $actions .= '<a href="access_urls.php?action=delete_url&url_id='.$url_id.'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES, $charset))."'".')) return false;">'. |
|
165 | 165 | Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>'; |
166 | 166 | } |
167 | 167 | $urls[] = array($url, $description, $status, $actions); |