@@ -3122,8 +3122,9 @@ |
||
| 3122 | 3122 | global $DaysShort, $course_path; |
| 3123 | 3123 | //Handle leap year |
| 3124 | 3124 | $numberofdays = array (0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); |
| 3125 | - if (($year % 400 == 0) or ($year % 4 == 0 and $year % 100 <> 0)) |
|
| 3126 | - $numberofdays[2] = 29; |
|
| 3125 | + if (($year % 400 == 0) or ($year % 4 == 0 and $year % 100 <> 0)) { |
|
| 3126 | + $numberofdays[2] = 29; |
|
| 3127 | + } |
|
| 3127 | 3128 | //Get the first day of the month |
| 3128 | 3129 | $dayone = getdate(mktime(0, 0, 0, $month, 1, $year)); |
| 3129 | 3130 | //Start the week on monday |
@@ -351,8 +351,9 @@ discard block |
||
| 351 | 351 | } |
| 352 | 352 | |
| 353 | 353 | $url = esc_url($url); |
| 354 | - if ( empty($url) ) |
|
| 355 | - return $matches[0]; |
|
| 354 | + if ( empty($url) ) { |
|
| 355 | + return $matches[0]; |
|
| 356 | + } |
|
| 356 | 357 | |
| 357 | 358 | return $matches[1] . "<a href=\"$url\" rel=\"nofollow\">$url</a>" . $suffix; |
| 358 | 359 | } |
@@ -377,8 +378,9 @@ discard block |
||
| 377 | 378 | function esc_url( $url, $protocols = null, $_context = 'display' ) { |
| 378 | 379 | //$original_url = $url; |
| 379 | 380 | |
| 380 | - if ( '' == $url ) |
|
| 381 | - return $url; |
|
| 381 | + if ( '' == $url ) { |
|
| 382 | + return $url; |
|
| 383 | + } |
|
| 382 | 384 | $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\\x80-\\xff]|i', '', $url); |
| 383 | 385 | $strip = array('%0d', '%0a', '%0D', '%0A'); |
| 384 | 386 | $url = _deep_replace($strip, $url); |
@@ -388,8 +390,9 @@ discard block |
||
| 388 | 390 | * link starting with /, # or ? or a php file). |
| 389 | 391 | */ |
| 390 | 392 | if ( strpos($url, ':') === false && ! in_array( $url[0], array( '/', '#', '?' ) ) && |
| 391 | - ! preg_match('/^[a-z0-9-]+?\.php/i', $url) ) |
|
| 392 | - $url = 'http://' . $url; |
|
| 393 | + ! preg_match('/^[a-z0-9-]+?\.php/i', $url) ) { |
|
| 394 | + $url = 'http://' . $url; |
|
| 395 | + } |
|
| 393 | 396 | |
| 394 | 397 | return Security::remove_XSS($url); |
| 395 | 398 | |
@@ -466,8 +469,9 @@ discard block |
||
| 466 | 469 | $dest = $matches[2]; |
| 467 | 470 | $dest = 'http://' . $dest; |
| 468 | 471 | $dest = esc_url($dest); |
| 469 | - if ( empty($dest) ) |
|
| 470 | - return $matches[0]; |
|
| 472 | + if ( empty($dest) ) { |
|
| 473 | + return $matches[0]; |
|
| 474 | + } |
|
| 471 | 475 | |
| 472 | 476 | // removed trailing [.,;:)] from URL |
| 473 | 477 | if ( in_array( substr($dest, -1), array('.', ',', ';', ':', ')') ) === true ) { |
@@ -511,10 +515,11 @@ discard block |
||
| 511 | 515 | $nested_code_pre = 0; // Keep track of how many levels link is nested inside <pre> or <code> |
| 512 | 516 | foreach ( $textarr as $piece ) { |
| 513 | 517 | |
| 514 | - if ( preg_match( '|^<code[\s>]|i', $piece ) || preg_match( '|^<pre[\s>]|i', $piece ) ) |
|
| 515 | - $nested_code_pre++; |
|
| 516 | - elseif ( ( '</code>' === strtolower( $piece ) || '</pre>' === strtolower( $piece ) ) && $nested_code_pre ) |
|
| 517 | - $nested_code_pre--; |
|
| 518 | + if ( preg_match( '|^<code[\s>]|i', $piece ) || preg_match( '|^<pre[\s>]|i', $piece ) ) { |
|
| 519 | + $nested_code_pre++; |
|
| 520 | + } elseif ( ( '</code>' === strtolower( $piece ) || '</pre>' === strtolower( $piece ) ) && $nested_code_pre ) { |
|
| 521 | + $nested_code_pre--; |
|
| 522 | + } |
|
| 518 | 523 | |
| 519 | 524 | if ( $nested_code_pre || empty( $piece ) || ( $piece[0] === '<' && ! preg_match( '|^<\s*[\w]{1,20}+://|', $piece ) ) ) { |
| 520 | 525 | $r .= $piece; |
@@ -723,15 +728,13 @@ discard block |
||
| 723 | 728 | if($length>$maxchar) |
| 724 | 729 | { |
| 725 | 730 | break; |
| 726 | - } |
|
| 727 | - else |
|
| 731 | + } else |
|
| 728 | 732 | { |
| 729 | 733 | $output = $output." ".$words[$i]; |
| 730 | 734 | $i++; |
| 731 | 735 | }; |
| 732 | 736 | }; |
| 733 | - } |
|
| 734 | - else |
|
| 737 | + } else |
|
| 735 | 738 | { |
| 736 | 739 | $output = $text; |
| 737 | 740 | return $output; |
@@ -782,13 +785,21 @@ discard block |
||
| 782 | 785 | if (isset($array['Y']) && (isset($array['F']) || isset($array['M'])) && isset($array['d']) && isset($array['H']) && isset($array['i'])) { |
| 783 | 786 | $year = $array['Y']; |
| 784 | 787 | $month = isset($array['F'])?$array['F']:$array['M']; |
| 785 | - if (intval($month) < 10 ) $month = '0'.$month; |
|
| 788 | + if (intval($month) < 10 ) { |
|
| 789 | + $month = '0'.$month; |
|
| 790 | + } |
|
| 786 | 791 | $day = $array['d']; |
| 787 | - if (intval($day) < 10 ) $day = '0'.$day; |
|
| 792 | + if (intval($day) < 10 ) { |
|
| 793 | + $day = '0'.$day; |
|
| 794 | + } |
|
| 788 | 795 | $hours = $array['H']; |
| 789 | - if (intval($hours) < 10 ) $hours = '0'.$hours; |
|
| 796 | + if (intval($hours) < 10 ) { |
|
| 797 | + $hours = '0'.$hours; |
|
| 798 | + } |
|
| 790 | 799 | $minutes = $array['i']; |
| 791 | - if (intval($minutes) < 10 ) $minutes = '0'.$minutes; |
|
| 800 | + if (intval($minutes) < 10 ) { |
|
| 801 | + $minutes = '0'.$minutes; |
|
| 802 | + } |
|
| 792 | 803 | } |
| 793 | 804 | if (checkdate($month,$day,$year)) { |
| 794 | 805 | $datetime = $year.'-'.$month.'-'.$day.' '.$hours.':'.$minutes.':'.$seconds; |
@@ -73,8 +73,9 @@ |
||
| 73 | 73 | //$form->addElement('submit','submit',get_lang('Filter')); |
| 74 | 74 | $form->addButtonFilter(get_lang('Filter')); |
| 75 | 75 | |
| 76 | -if (!empty($_REQUEST['course_code'])) |
|
| 76 | +if (!empty($_REQUEST['course_code'])) { |
|
| 77 | 77 | $selected_course = $_REQUEST['course_code']; |
| 78 | +} |
|
| 78 | 79 | if (!empty($selected_course)) { |
| 79 | 80 | $selected_course = api_get_course_info($selected_course); |
| 80 | 81 | $course_list = array($selected_course); |
@@ -182,10 +182,11 @@ |
||
| 182 | 182 | echo "<td style='padding-left : 40px;' valign='top'>" . $beautifulDateTime . "</td>"; |
| 183 | 183 | echo"</tr>"; |
| 184 | 184 | // $limit is used to select only results between $results[$j] (current login) and next one |
| 185 | - if ($j == ( sizeof($results) - 1 )) |
|
| 186 | - $limit = date("Y-m-d H:i:s", $nextReqDate); |
|
| 187 | - else |
|
| 188 | - $limit = $results[$j + 1]; |
|
| 185 | + if ($j == ( sizeof($results) - 1 )) { |
|
| 186 | + $limit = date("Y-m-d H:i:s", $nextReqDate); |
|
| 187 | + } else { |
|
| 188 | + $limit = $results[$j + 1]; |
|
| 189 | + } |
|
| 189 | 190 | // select all access to tool between displayed date and next displayed date or now() if |
| 190 | 191 | // displayed date is the last login date |
| 191 | 192 | $sql = "SELECT access_tool, count(access_tool) |
@@ -38,20 +38,27 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | $view = $_REQUEST['view']; |
| 40 | 40 | |
| 41 | -if ($view == "0000001") |
|
| 41 | +if ($view == "0000001") { |
|
| 42 | 42 | $nameTools = get_lang('SynthesisView'); |
| 43 | -if ($view == "1000000") |
|
| 43 | +} |
|
| 44 | +if ($view == "1000000") { |
|
| 44 | 45 | $nameTools = get_lang('CourseStats'); |
| 45 | -if ($view == "0100000") |
|
| 46 | +} |
|
| 47 | +if ($view == "0100000") { |
|
| 46 | 48 | $nameTools = get_lang('CourseAccess'); |
| 47 | -if ($view == "0010000") |
|
| 49 | +} |
|
| 50 | +if ($view == "0010000") { |
|
| 48 | 51 | $nameTools = get_lang('ToolsAccess'); |
| 49 | -if ($view == "0001000") |
|
| 52 | +} |
|
| 53 | +if ($view == "0001000") { |
|
| 50 | 54 | $nameTools = get_lang('LinksAccess'); |
| 51 | -if ($view == "0000100") |
|
| 55 | +} |
|
| 56 | +if ($view == "0000100") { |
|
| 52 | 57 | $nameTools = get_lang('DocumentsAccess'); |
| 53 | -if ($view == "00000010") |
|
| 58 | +} |
|
| 59 | +if ($view == "00000010") { |
|
| 54 | 60 | $nameTools = get_lang('ScormAccess'); |
| 61 | +} |
|
| 55 | 62 | |
| 56 | 63 | $interbreadcrumb[] = array("url" => api_get_self() . "?view=0000000", "name" => get_lang('ToolName')); |
| 57 | 64 | |
@@ -79,8 +86,9 @@ discard block |
||
| 79 | 86 | </div><br> |
| 80 | 87 | "; */ |
| 81 | 88 | |
| 82 | - if (!isset($view)) |
|
| 83 | - $view = "0000000"; |
|
| 89 | + if (!isset($view)) { |
|
| 90 | + $view = "0000000"; |
|
| 91 | + } |
|
| 84 | 92 | |
| 85 | 93 | |
| 86 | 94 | /* Reporting */ |
@@ -47,8 +47,16 @@ |
||
| 47 | 47 | $form->addElement('select', 'session_id', get_lang('Sessions'), $my_session_list); |
| 48 | 48 | $form->addButtonFilter(get_lang('Filter')); |
| 49 | 49 | |
| 50 | -if (!empty($_REQUEST['score'])) $filter_score = intval($_REQUEST['score']); else $filter_score = 70; |
|
| 51 | -if (!empty($_REQUEST['session_id'])) $session_id = intval($_REQUEST['session_id']); else $session_id = 0; |
|
| 50 | +if (!empty($_REQUEST['score'])) { |
|
| 51 | + $filter_score = intval($_REQUEST['score']); |
|
| 52 | +} else { |
|
| 53 | + $filter_score = 70; |
|
| 54 | +} |
|
| 55 | +if (!empty($_REQUEST['session_id'])) { |
|
| 56 | + $session_id = intval($_REQUEST['session_id']); |
|
| 57 | +} else { |
|
| 58 | + $session_id = 0; |
|
| 59 | +} |
|
| 52 | 60 | |
| 53 | 61 | if (empty($session_id)) { |
| 54 | 62 | $session_id = key($my_session_list); |
@@ -445,7 +445,10 @@ |
||
| 445 | 445 | } |
| 446 | 446 | } |
| 447 | 447 | ?> |
| 448 | - <input type="hidden" name="updatePath" value="<?php if (!$badUpdatePath) echo api_htmlentities($proposedUpdatePath, ENT_QUOTES); ?>" /> |
|
| 448 | + <input type="hidden" name="updatePath" value="<?php if (!$badUpdatePath) { |
|
| 449 | + echo api_htmlentities($proposedUpdatePath, ENT_QUOTES); |
|
| 450 | +} |
|
| 451 | +?>" /> |
|
| 449 | 452 | <input type="hidden" name="urlAppendPath" value="<?php echo api_htmlentities($urlAppendPath, ENT_QUOTES); ?>" /> |
| 450 | 453 | <input type="hidden" name="pathForm" value="<?php echo api_htmlentities($pathForm, ENT_QUOTES); ?>" /> |
| 451 | 454 | <input type="hidden" name="urlForm" value="<?php echo api_htmlentities($urlForm, ENT_QUOTES); ?>" /> |
@@ -149,8 +149,7 @@ discard block |
||
| 149 | 149 | <?php |
| 150 | 150 | if ($session['access_start_date'] == '00-00-0000' && $session['access_end_date']== '00-00-0000' ) { |
| 151 | 151 | echo get_lang('NoTimeLimits'); |
| 152 | - } |
|
| 153 | - else { |
|
| 152 | + } else { |
|
| 154 | 153 | if ($session['access_start_date'] != '00-00-0000') { |
| 155 | 154 | //$session['date_start'] = Display::tag('i', get_lang('NoTimeLimits')); |
| 156 | 155 | $session['access_start_date'] = get_lang('From').' '.$session['access_start_date']; |
@@ -189,12 +188,18 @@ discard block |
||
| 189 | 188 | <?php echo api_ucfirst(get_lang('SessionVisibility')) ?> : |
| 190 | 189 | </td> |
| 191 | 190 | <td> |
| 192 | - <?php if ($session['visibility']==1) echo get_lang('ReadOnly'); elseif($session['visibility']==2) echo get_lang('Visible');elseif($session['visibility']==3) echo api_ucfirst(get_lang('Invisible')) ?> |
|
| 191 | + <?php if ($session['visibility']==1) { |
|
| 192 | + echo get_lang('ReadOnly'); |
|
| 193 | +} elseif($session['visibility']==2) { |
|
| 194 | + echo get_lang('Visible'); |
|
| 195 | +} elseif($session['visibility']==3) { |
|
| 196 | + echo api_ucfirst(get_lang('Invisible')) ?> |
|
| 193 | 197 | </td> |
| 194 | 198 | </tr> |
| 195 | 199 | <?php |
| 196 | 200 | |
| 197 | 201 | $multiple_url_is_on = api_get_multiple_access_url(); |
| 202 | +} |
|
| 198 | 203 | if ($multiple_url_is_on) { |
| 199 | 204 | echo '<tr><td>'; |
| 200 | 205 | echo 'URL'; |
@@ -477,7 +477,10 @@ discard block |
||
| 477 | 477 | <div class="actions"> |
| 478 | 478 | <?php echo $link_add_type_unique ?> | <?php echo $link_add_type_multiple ?> | <?php echo $link_add_group; ?> |
| 479 | 479 | </div> |
| 480 | - <form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?page=<?php echo $page; ?>&id_session=<?php echo $id_session; ?><?php if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>> |
|
| 480 | + <form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?page=<?php echo $page; ?>&id_session=<?php echo $id_session; ?><?php if(!empty($_GET['add'])) { |
|
| 481 | + echo '&add=true' ; |
|
| 482 | +} |
|
| 483 | +?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>> |
|
| 481 | 484 | <?php echo '<legend>'.$tool_name.' ('.$session_info['name'].') </legend>'; ?> |
| 482 | 485 | <?php |
| 483 | 486 | if ($add_type == 'multiple') { |
@@ -545,7 +548,10 @@ discard block |
||
| 545 | 548 | <?php |
| 546 | 549 | foreach ($nosessionUsersList as $uid => $enreg) { |
| 547 | 550 | ?> |
| 548 | - <option value="<?php echo $uid; ?>" <?php if(in_array($uid,$UserList)) echo 'selected="selected"'; ?>><?php echo api_get_person_name($enreg['fn'], $enreg['ln']).' ('.$enreg['un'].')'; ?></option> |
|
| 551 | + <option value="<?php echo $uid; ?>" <?php if(in_array($uid,$UserList)) { |
|
| 552 | + echo 'selected="selected"'; |
|
| 553 | +} |
|
| 554 | +?>><?php echo api_get_person_name($enreg['fn'], $enreg['ln']).' ('.$enreg['un'].')'; ?></option> |
|
| 549 | 555 | <?php |
| 550 | 556 | } |
| 551 | 557 | ?> |