@@ -1,9 +1,9 @@ |
||
1 | 1 | <?php |
2 | -$text_input = function ($name, $large_text=false) use ($errors) { |
|
2 | +$text_input = function($name, $large_text = false) use ($errors) { |
|
3 | 3 | ?> |
4 | 4 | <?php if ($large_text): ?> |
5 | 5 | <textarea name="<?= $name ?>" class="pure-input-1" required=""><?= isset($_POST[$name]) ? $_POST[$name] : '' ?></textarea> |
6 | - <?php else: ?> |
|
6 | + <?php else : ?> |
|
7 | 7 | <input |
8 | 8 | name="<?= $name ?>" |
9 | 9 | value="<?= isset($_POST[$name]) ? $_POST[$name] : '' ?>" |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -$text_input = function ($name, $required=true) use ($errors) { |
|
2 | +$text_input = function($name, $required = true) use ($errors) { |
|
3 | 3 | ?> |
4 | 4 | <input |
5 | 5 | name="<?= $name ?>" |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -$text_input = function ($name, $type="text") use ($errors) { |
|
2 | +$text_input = function($name, $type = "text") use ($errors) { |
|
3 | 3 | ?> |
4 | 4 | <input |
5 | 5 | name="<?= $name ?>" |
@@ -1,9 +1,9 @@ |
||
1 | 1 | <?php |
2 | -$text_input = function ($name, $large_text=false, $required=true) use ($errors) { |
|
2 | +$text_input = function($name, $large_text = false, $required = true) use ($errors) { |
|
3 | 3 | ?> |
4 | 4 | <?php if ($large_text): ?> |
5 | 5 | <textarea name="<?= $name ?>" class="pure-input-1" <?php if ($required): ?>required=""<?php endif; ?> ><?= isset($_POST[$name]) ? $_POST[$name] : '' ?></textarea> |
6 | - <?php else: ?> |
|
6 | + <?php else : ?> |
|
7 | 7 | <input |
8 | 8 | name="<?= $name ?>" |
9 | 9 | value="<?= isset($_POST[$name]) ? $_POST[$name] : '' ?>" |
@@ -11,7 +11,7 @@ |
||
11 | 11 | You're registered for the event |
12 | 12 | <?php if ($team_info['nick2']): ?> |
13 | 13 | as a team with <?= $team_info['nick2'] == $user_nick ? $team_info['nick1'] : $team_info['nick2'] ?>. |
14 | - <?php else: ?> |
|
14 | + <?php else : ?> |
|
15 | 15 | as individual. |
16 | 16 | <?php endif; ?> |
17 | 17 | <?php if ($team_info['team_name']): ?> |
@@ -8,11 +8,11 @@ |
||
8 | 8 | $events_to_display = []; |
9 | 9 | |
10 | 10 | foreach ($events_data as $event) { |
11 | - if ( substr($event['path'], 1, $len) == $page_slug && $event['template'] == 'event' ) { |
|
11 | + if (substr($event['path'], 1, $len) == $page_slug && $event['template'] == 'event') { |
|
12 | 12 | $events_to_display[] = $event; |
13 | 13 | } |
14 | 14 | } |
15 | -usort($events_to_display, function ($e1, $e2) { |
|
15 | +usort($events_to_display, function($e1, $e2) { |
|
16 | 16 | if (!$e2['data']['start_time']) { |
17 | 17 | return -1; |
18 | 18 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | <?php if (isset($mission['description'])): ?> |
22 | 22 | <p><?= linkify(nl2br(htmlspecialchars($mission['description']))) ?></p> |
23 | 23 | <?php endif; ?> |
24 | - <?php if(!$mission['published']): ?> |
|
24 | + <?php if (!$mission['published']): ?> |
|
25 | 25 | <p>This mission is unpublished.</p> |
26 | 26 | <form method="post" action="./publish"> |
27 | 27 | <button type="submit" class="btn btn-red">Publish mission</button> |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | </strong> |
41 | 41 | </p> |
42 | 42 | <?php if ($is_admin): ?> |
43 | - <?php if(!$mission['published']): ?> |
|
43 | + <?php if (!$mission['published']): ?> |
|
44 | 44 | <a href="./createtask/" class="btn btn-green">Create new task</a> |
45 | 45 | <?php endif; ?> |
46 | 46 | <a href="../../review/mission/<?= $mission['id'] ?>/" class="btn btn-blue"> |
@@ -22,7 +22,7 @@ |
||
22 | 22 | foreach ($user_scores as $user_score) { |
23 | 23 | $name = $user_score['name']; |
24 | 24 | $score = $user_score['score']; |
25 | - if ($score_prev > $score){ |
|
25 | + if ($score_prev > $score) { |
|
26 | 26 | $score_prev = $score; |
27 | 27 | $rank += 1; |
28 | 28 | } |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | * @return string The token |
21 | 21 | */ |
22 | 22 | public function new_csrf_token() { |
23 | - if (! isset($_SESSION['csrf_token'])) { |
|
23 | + if (!isset($_SESSION['csrf_token'])) { |
|
24 | 24 | $_SESSION['csrf_token'] = self::generate_token(); |
25 | 25 | } |
26 | 26 | return $_SESSION['csrf_token']; |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | * loads the 400 view and quits. |
40 | 40 | */ |
41 | 41 | public function check_csrf_token($value) { |
42 | - if (! isset($_SESSION['csrf_token']) |
|
42 | + if (!isset($_SESSION['csrf_token']) |
|
43 | 43 | || $value !== $_SESSION['csrf_token'] |
44 | 44 | ) { |
45 | 45 | // If no CSRF token is set, or the $value does not match it, error |