diff options
-rw-r--r-- | include/nav.php | 5 | ||||
-rw-r--r-- | view/tpl/navbar_default.tpl | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/include/nav.php b/include/nav.php index 18fa65edc..737beaca2 100644 --- a/include/nav.php +++ b/include/nav.php @@ -201,7 +201,10 @@ function nav($template = 'default') { $nav['admin'] = ['admin/', t('Admin'), "", t('Site Setup and Configuration'), 'admin_nav_btn']; } - $theme_switch_icon = ((App::$page['color_mode'] === 'dark') ? 'sun' : 'moon'); + $theme_switch_icon = ''; + if (isset(App::$page['color_mode'])) { + $theme_switch_icon = ((App::$page['color_mode'] === 'dark') ? 'sun' : 'moon'); + } $x = ['nav' => $nav, 'usermenu' => $userinfo]; diff --git a/view/tpl/navbar_default.tpl b/view/tpl/navbar_default.tpl index ed243c103..d8b8e2f74 100644 --- a/view/tpl/navbar_default.tpl +++ b/view/tpl/navbar_default.tpl @@ -195,7 +195,9 @@ <i id="app-bin-trash" class="fa fa-2x fa-fw fa-trash-o d-none"></i> {{/if}} <div class="hstack gap-1"> + {{if $theme_switch_icon}} <button id="theme-switch" type="button" class="btn btn-outline-secondary border-0"><i id="theme-switch-icon" class="fa fa-{{$theme_switch_icon}}-o"></i></button> + {{/if}} <button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button> </div> |