|
1 | | -<?php |
2 | | - |
| 1 | +<?php /* vim: set colorcolumn= expandtab shiftwidth=2 softtabstop=2 tabstop=4 smarttab: */ |
3 | 2 | namespace BNETDocs\Templates\User; |
4 | | - |
5 | 3 | use \CarlBennett\MVC\Libraries\Pair; |
6 | | - |
7 | | -$title = "Logout"; |
8 | | -$description = "Log out of the BNETDocs website"; |
9 | | -$this->opengraph->attach(new Pair("url", "/user/logout")); |
10 | | - |
11 | | -switch ($this->getContext()->error) { |
12 | | - case "NOT_LOGGED_IN": |
13 | | - $message = "You were not logged in to begin with."; |
14 | | - break; |
15 | | - default: |
16 | | - $message = $this->getContext()->error; |
| 4 | +$title = 'Logout'; |
| 5 | +$description = 'Log out of the BNETDocs website'; |
| 6 | +$this->opengraph->attach(new Pair('url', '/user/logout')); |
| 7 | +$error = $this->getContext()->error; |
| 8 | +switch ($error) |
| 9 | +{ |
| 10 | + case 'NOT_LOGGED_IN': $message = 'You were not logged in to begin with.'; break; |
| 11 | + default: $message = $error; |
17 | 12 | } |
18 | | - |
19 | | -require("./header.inc.phtml"); |
20 | | -?> |
21 | | - <article> |
22 | | -<?php if (is_null($this->getContext()->error)) { ?> |
23 | | - <header>Account Logout</header> |
24 | | - <form method="POST" action="?"> |
25 | | - <section> |
26 | | - <p>If you are sure you wish to log out, press the button below.</p> |
27 | | - <p><input type="submit" value="Log Out"/></p> |
28 | | - </section> |
29 | | - </form> |
30 | | -<?php } else if ($this->getContext()->error === false) { ?> |
31 | | - <header class="green">Logged Out</header> |
32 | | - <section class="green"> |
33 | | - <p>You have been successfully logged out!</p> |
34 | | - <p>Use the navigation to the left to move to another page.</p> |
35 | | - </section> |
36 | | -<?php } else { ?> |
37 | | - <header class="red">Log out failure</header> |
38 | | - <section class="red"> |
39 | | - <p>An error occurred while attempting to log out.</p> |
40 | | - <p><?php echo $message; ?></p> |
41 | | - <p>Use the navigation to the left to move to another page.</p> |
42 | | - </section> |
43 | | -<?php } ?> |
44 | | - </article> |
45 | | -<?php require("./footer.inc.phtml"); ?> |
| 13 | +require('./header.inc.phtml'); ?> |
| 14 | +<div class="container"> |
| 15 | +<? if (is_null($error)) { ?> |
| 16 | + <h1 class="text-danger"><?=$title?></h1> |
| 17 | + <p class="text-danger">If you are sure you wish to log out, press the button below.</p> |
| 18 | + <form method="POST" action="?"> |
| 19 | + <input class="btn btn-danger" type="submit" value="Log Out"/> |
| 20 | + </form> |
| 21 | +<? } else if ($this->getContext()->error === false) { ?> |
| 22 | + <h1 class="text-success">Logged Out</h1> |
| 23 | + <div class="alert alert-success"> |
| 24 | + <p class="mb-0">You have been successfully logged out!</p> |
| 25 | + </div> |
| 26 | +<? } else { ?> |
| 27 | + <h1 class="text-danger">Log out failure</h1> |
| 28 | + <div class="alert alert-danger"> |
| 29 | + <p>An error occurred while attempting to log out.</p> |
| 30 | + <p class="mb-0"><?=$message?></p> |
| 31 | + </secton> |
| 32 | +<? } ?> |
| 33 | +</div> |
| 34 | +<? require('./footer.inc.phtml'); ?> |
0 commit comments