From c336c96eaa056c70b708b36c32e31b3ff7356add Mon Sep 17 00:00:00 2001 From: Jay Trees Date: Tue, 1 Mar 2022 09:46:30 +0100 Subject: [PATCH] Add MJML settings --- src/classes/page.php | 175 +++++++++++++++++++++++++++-------------- src/pages/settings.php | 59 ++++++++++++++ 2 files changed, 173 insertions(+), 61 deletions(-) create mode 100644 src/pages/settings.php diff --git a/src/classes/page.php b/src/classes/page.php index b60e8aed..7e50e752 100644 --- a/src/classes/page.php +++ b/src/classes/page.php @@ -233,31 +233,73 @@ class Page { $user = new User(); - $pagesAccount = array(); + $pages = array( + 'wishlists' => array( + 'text' => 'Wishlists', + 'alignment' => 'left', + 'items' => array( + array( + 'url' => '/?page=wishlists', + 'text' => 'My lists', + 'icon' => 'list', + ) + ), + ), + 'system' => array( + 'text' => 'System', + 'icon' => 'wrench', + 'alignment' => 'right', + 'items' => array( + array( + 'url' => '/?page=settings', + 'text' => 'Settings', + 'icon' => 'cog', + ), + ), + ), + 'account' => array( + 'text' => 'Account', + 'icon' => 'user circle', + 'alignment' => 'right', + 'items' => array(), + ), + ); if ($user && $user->isLoggedIn()) { if (100 === $user->power) { - $pagesAccount[] = array( + $pages['account']['items'][] = array( 'url' => '/?page=login-as', - 'icon' => 'sign out alternate', 'text' => 'Login as', + 'icon' => 'sign out alternate', ); } - $pagesAccount[] = array( + $pages['account']['items'][] = array( 'url' => '/?page=logout', - 'icon' => 'sign out alternate', 'text' => 'Logout', + 'icon' => 'sign out alternate', ); } else { - $pagesAccount[] = array( + $pages['account']['items'][] = array( 'url' => '/?page=login', - 'icon' => 'sign in alternate', 'text' => 'Login', + 'icon' => 'sign in alternate', ); - $pagesAccount[] = array( + $pages['account']['items'][] = array( 'url' => '/?page=register', - 'icon' => 'user plus alternate', 'text' => 'Register', + 'icon' => 'user plus alternate', + ); + } + + global $options; + + if ($options->updateAvailable && $user && 100 === $user->power) { + $pages['system']['items'][] = array( + array( + 'url' => '/?page=update', + 'text' => 'Update', + 'icon' => 'upload', + ), ); } ?> @@ -268,30 +310,16 @@ class Page wishthis logo - - - My lists - - - - updateAvailable && $user && 100 === $user->power) { ?> - - Update - + + + + + + + - - - - - - - footer() ?> @@ -303,45 +331,70 @@ class Page - - - My lists - -