diff options
author | Bharat Mediratta <bharat@menalto.com> | 2008-11-27 11:43:48 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2008-11-27 11:43:48 +0000 |
commit | 723eb2f611727cb7a1d8b64e1a7814de94be9cc9 (patch) | |
tree | 0d41574e44cf4c4307fdfdeee2973b6632c258bc | |
parent | e183901dc39c31ef4aaacca0edc36540dc2edd8b (diff) |
Move the ADMIN global nav option into the core module and only show it if we're logged in as an admin user
-rw-r--r-- | core/helpers/core_block.php | 7 | ||||
-rw-r--r-- | themes/default/views/header.html.php | 1 |
2 files changed, 7 insertions, 1 deletions
diff --git a/core/helpers/core_block.php b/core/helpers/core_block.php index 469dcf86..801ffb82 100644 --- a/core/helpers/core_block.php +++ b/core/helpers/core_block.php @@ -25,4 +25,11 @@ class core_block_Core { return new View("in_place_edit.html"); } } + + public static function navigation_bottom($theme) { + $user = Session::instance()->get('user', null); + if ($user && $user->admin) { + return "<li><a href=#>" . _("ADMIN") . "</a></li>"; + } + } }
\ No newline at end of file diff --git a/themes/default/views/header.html.php b/themes/default/views/header.html.php index 29c7a8e0..513147bc 100644 --- a/themes/default/views/header.html.php +++ b/themes/default/views/header.html.php @@ -9,7 +9,6 @@ <li><a class="active" href="<?= url::site("albums/1") ?>"><?= _("BROWSE") ?></a></li> <li><a href="#"><?= _("UPLOAD") ?></a></li> <?= $theme->navigation_bottom() ?> - <li><a href="#"><?= _("ADMIN") ?></a></li> </ul> </div> |