diff options
author | Thedro Neely <thedroneely@gmail.com> | 2018-12-16 11:54:04 -0500 |
---|---|---|
committer | Thedro Neely <thedroneely@gmail.com> | 2018-12-16 11:54:04 -0500 |
commit | eb7f308e896ad5b60a11f43ed00d8d4fe1df9fda (patch) | |
tree | 732b7d777e3544a49bedb448b445978678eed23d /model | |
parent | 5b7cd23d84480cd9ae02da3526c4faa93745dd35 (diff) | |
download | edwinmattiacci.com-eb7f308e896ad5b60a11f43ed00d8d4fe1df9fda.tar.gz edwinmattiacci.com-eb7f308e896ad5b60a11f43ed00d8d4fe1df9fda.tar.bz2 edwinmattiacci.com-eb7f308e896ad5b60a11f43ed00d8d4fe1df9fda.zip |
model/Navigator: Remove redundant navigator function
Diffstat (limited to 'model')
-rw-r--r-- | model/Navigator.php | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/model/Navigator.php b/model/Navigator.php index d146c13..199d3c1 100644 --- a/model/Navigator.php +++ b/model/Navigator.php @@ -2,67 +2,6 @@ function navBar() { - switch ($_SERVER['REQUEST_URI']) { - case '/posts/': - $uri = $_SERVER['REQUEST_URI']; - $location = 'Posts '; - break; - - case '/feedback/': - $uri = $_SERVER['REQUEST_URI']; - $location = 'Feedback '; - break; - - case '/contact/': - $uri = $_SERVER['REQUEST_URI']; - $location = 'Contact '; - break; - - case '/login/': - $uri = $_SERVER['REQUEST_URI']; - $location = 'Login '; - break; - - default: - $uri = '/'; - $location = 'Home '; - } - - $navbar = [ - //Hidden link shown in mobile responsive mode. - $location => ['link' => $uri], - 'Home' => ['link' => '/'], - 'Posts' => ['link' => '/posts/'], - 'Feedback' => ['link' => '/feedback/'], - 'Contact' => ['link' => '/contact/'], - ]; - - foreach ($navbar as $title => $route) { - $append =''; - - if ($title === 'Home') { - if ($route['link'] === $_SERVER['REQUEST_URI']) { - echo '<a class="active" href="/">Home</a>'; - continue; - } - echo '<a href="/">Home</a>'; - continue; - } - - if ($title === $location && $route['link'] === $_SERVER['REQUEST_URI']) { - echo '<a style="cursor: default; pointer-events: none;" href="/">' . $location . '</a>'; - continue; - } - - if ($route['link'] === $_SERVER['REQUEST_URI'] || strpos($_SERVER['REQUEST_URI'], $route['link']) !== false) { - $append = 'class="active" '; - } - echo str_repeat("\t", 4) . '<a ' . $append . 'href="' . $route['link'] . '">' . $title . '</a>' . "\n"; - } -} - -function navBarPost() -{ $navbar = [ 'Home' => ['uri' => '/'], 'Posts' => ['uri' => '/posts/'], |