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 (limited to 'app/controller') 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(-) (limited to 'app/controller') 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 c93ae572abf32262137cce69f1c020e9a5b46d9f Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Thu, 10 Mar 2016 20:35:32 -0500 Subject: Add function CommonModel::common_handleFormSubmissions() This helper func to all implementing MVC controllers is used to check for submission of any web-form defined within a common MVC view file. If detected, the appropriate handler function is called. --- app/controller/dashboard.control.php | 1 + 1 file changed, 1 insertion(+) (limited to 'app/controller') diff --git a/app/controller/dashboard.control.php b/app/controller/dashboard.control.php index 4ee4b38..9a279ca 100644 --- a/app/controller/dashboard.control.php +++ b/app/controller/dashboard.control.php @@ -14,6 +14,7 @@ class Dashboard extends Controller function handle($argv) { $mod = new DashboardModel(); + $mod->common_handleFormSubmissions($_REQUEST['input']); $this->action_default($mod); } -- cgit v1.2.3 From a5eb5c0ee075b8d307e63ce936f2bc4b4592ed21 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Fri, 11 Mar 2016 22:48:36 -0500 Subject: Call common default action handler from dashboard controller --- app/controller/dashboard.control.php | 1 + 1 file changed, 1 insertion(+) (limited to 'app/controller') diff --git a/app/controller/dashboard.control.php b/app/controller/dashboard.control.php index 9a279ca..53ca160 100644 --- a/app/controller/dashboard.control.php +++ b/app/controller/dashboard.control.php @@ -15,6 +15,7 @@ class Dashboard extends Controller { $mod = new DashboardModel(); $mod->common_handleFormSubmissions($_REQUEST['input']); + $mod->common_deflt(); $this->action_default($mod); } -- cgit v1.2.3