From ec0eee8f6c5cccfc0a29ecd8cbd08be183e1eb92 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Sat, 5 Mar 2016 21:36:38 -0500 Subject: Add Dashboard MVC default view --- app/view/dashboard/default.view.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 app/view/dashboard/default.view.php diff --git a/app/view/dashboard/default.view.php b/app/view/dashboard/default.view.php new file mode 100644 index 0000000..059d9c8 --- /dev/null +++ b/app/view/dashboard/default.view.php @@ -0,0 +1,13 @@ + + + + + + Scrott - Dashboard + + + + + + + -- cgit v1.2.3 From 3b2b46aaefc3c98969173debfb3ee8e59ab6e5fd Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Sat, 5 Mar 2016 22:40:57 -0500 Subject: Add Dashboard model --- app/model/dashboard.mod.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 app/model/dashboard.mod.php diff --git a/app/model/dashboard.mod.php b/app/model/dashboard.mod.php new file mode 100644 index 0000000..845a56a --- /dev/null +++ b/app/model/dashboard.mod.php @@ -0,0 +1,15 @@ + -- cgit v1.2.3 From e7268937ab3e7dce2fb14e3ae1256690c3b34b63 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Sat, 5 Mar 2016 23:30:10 -0500 Subject: Add Dashboard controller --- app/controller/dashboard.control.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 app/controller/dashboard.control.php diff --git a/app/controller/dashboard.control.php b/app/controller/dashboard.control.php new file mode 100644 index 0000000..4ee4b38 --- /dev/null +++ b/app/controller/dashboard.control.php @@ -0,0 +1,27 @@ +action_default($mod); + } + + function action_default($mod) + { + $mod->deflt(); + include "view/dashboard/default.view.php"; + } +} + +?> -- cgit v1.2.3 From 493e10764abe630e2537f72e3b98d95e6a679b6a Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Sun, 6 Mar 2016 00:04:09 -0500 Subject: Hook Deauth and Dashboard MVCs from Root controller These two MVC trees are now accessable from the app. Also, the root controller is finally in a clean state :). --- app/controller/root.control.php | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/app/controller/root.control.php b/app/controller/root.control.php index a9e23e9..7017ada 100644 --- a/app/controller/root.control.php +++ b/app/controller/root.control.php @@ -5,6 +5,8 @@ require_once "class/setting.class.php"; require_once "controller/sysconf.control.php"; require_once "controller/except.control.php"; require_once "controller/auth.control.php"; +require_once "controller/deauth.control.php"; +require_once "controller/dashboard.control.php"; /* * Root-level controller for Scrott app. This object will delegate the page request to the @@ -17,8 +19,6 @@ class Root extends Controller */ function handle($argv) { - /* TODO -- Authentication (login / logout / register) MVC */ - global $_SCROTT; $argv = $this->normalizeArgv($argv); @@ -56,8 +56,22 @@ class Root extends Controller return; } - /* TODO */ - echo "ALL GOOD!
"; + /* Handle page request */ + if (count($argv) == 0) + $ctrl = new Dashboard(); + + else + { + switch ($argv[0]) + { + case "logout": $ctrl = new Deauth(); break; + default: + throw new Exception("The requested path is not valid."); + break; + } + } + + $ctrl->handle($argv); } catch (Exception $e) -- cgit v1.2.3 From 7df5bfb84ac979e26cd23042bc8bbcf53d3f6ae6 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Sun, 6 Mar 2016 14:22:50 -0500 Subject: Add function getDisplayName() to User class If a user has an alias set, it should be displayed throughout the app instead of the username. --- app/class/user.class.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/class/user.class.php b/app/class/user.class.php index bd2e174..4f1bbfe 100644 --- a/app/class/user.class.php +++ b/app/class/user.class.php @@ -120,6 +120,17 @@ class User extends Object $key = $this->getKey($password, $this->salt); return $key == $this->key; } + + /* + * If a user has an alias set, display it instead of their username + */ + function getDisplayName() + { + if ($this->alias != "") + return $this->alias; + + return $this->name; + } } ?> -- cgit v1.2.3 From 3168dceb5434ac8a6f0bd397712019597ea2dd4c Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Sun, 6 Mar 2016 14:30:01 -0500 Subject: Add function getCurrentUserGlyphicon() to Common model This helps render data for the common topp view (navbar). This function will return the glyphicon to use next to the current user's name. --- app/model/common.mod.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/model/common.mod.php b/app/model/common.mod.php index d4270d8..e52230d 100644 --- a/app/model/common.mod.php +++ b/app/model/common.mod.php @@ -4,6 +4,19 @@ require_once "model/master.mod.php"; class CommonModel extends MasterModel { + /* + * Get the glyphicon to use for the logged in user (user or admin) + */ + function getCurrentUserGlyphicon() + { + if (!$this->getCurrentUser()) + return ""; + + if ($this->getCurrentUser()->admin == 1) + return "glyphicon glyphicon-sunglasses"; + else + return "glyphicon glyphicon-user"; + } } ?> -- cgit v1.2.3 From 0cc2192ff7582f5f9c2c9a20adcceae3bbc1fa84 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Sun, 6 Mar 2016 15:39:06 -0500 Subject: Update application navbar The navbar now has a different view when logged in. I added the 'user button' which shows alert info and has a menu. Currently, the only menu item is 'Log out'. --- app/view/common/topp.view.php | 15 ++++++++++++++- examples/example.html | 28 +++++++++++----------------- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/app/view/common/topp.view.php b/app/view/common/topp.view.php index 05e4862..460887d 100644 --- a/app/view/common/topp.view.php +++ b/app/view/common/topp.view.php @@ -14,7 +14,20 @@ diff --git a/examples/example.html b/examples/example.html index 7f1ac2a..ca22361 100644 --- a/examples/example.html +++ b/examples/example.html @@ -34,23 +34,17 @@ - + + + + + +
  • Issues assigned to Me 1
  • +
  • My open Issues
  • + +
  • Private Messages 1
  • +
  • Settings
  • + -- cgit v1.2.3 From 53472e75c050ce9b653cc70eeed56715d9a4163e Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Sun, 6 Mar 2016 17:09:55 -0500 Subject: Add settings modal to Common MVC This modal dialog will be used to change app and object settings from any page in the app. The link to open it is added to the user button menu. --- app/view/common/setting.modal.view.php | 24 ++++++++++++++++++++++++ app/view/common/topp.view.php | 3 +++ examples/example.html | 1 - 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 app/view/common/setting.modal.view.php diff --git a/app/view/common/setting.modal.view.php b/app/view/common/setting.modal.view.php new file mode 100644 index 0000000..27fb9d2 --- /dev/null +++ b/app/view/common/setting.modal.view.php @@ -0,0 +1,24 @@ + diff --git a/app/view/common/topp.view.php b/app/view/common/topp.view.php index 460887d..b23dc9c 100644 --- a/app/view/common/topp.view.php +++ b/app/view/common/topp.view.php @@ -1,5 +1,7 @@ + +