From 6a05dd8540ee72e8c3538d58e9e6d24f396d55a4 Mon Sep 17 00:00:00 2001 From: M Date: Sun, 22 Nov 2015 02:12:21 -0500 Subject: + Added controller for SysConf MVC --- app/controller/sysconf.control.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 app/controller/sysconf.control.php (limited to 'app/controller/sysconf.control.php') diff --git a/app/controller/sysconf.control.php b/app/controller/sysconf.control.php new file mode 100644 index 0000000..b69da87 --- /dev/null +++ b/app/controller/sysconf.control.php @@ -0,0 +1,27 @@ +action_default($mod); + } + + function action_default($mod) + { + $mod->default(); + include "view/sysconf/default.view.php"; + } +} + +?> -- cgit v1.2.3 From 2710f0de8d8d900a0997fd72f315c8a6f07329cf Mon Sep 17 00:00:00 2001 From: M Date: Sun, 22 Nov 2015 03:04:06 -0500 Subject: * Derp, default is a reserved word, calling the function 'deflt' instead * Removed explicit call to parent constructor in model class, since that function is not explicitly defined --- app/controller/sysconf.control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/controller/sysconf.control.php') diff --git a/app/controller/sysconf.control.php b/app/controller/sysconf.control.php index b69da87..f96c97e 100644 --- a/app/controller/sysconf.control.php +++ b/app/controller/sysconf.control.php @@ -19,7 +19,7 @@ class Sysconf extends Controller function action_default($mod) { - $mod->default(); + $mod->deflt(); include "view/sysconf/default.view.php"; } } -- cgit v1.2.3 From 94b39ff32f6cc9566de651f35994d877634d7317 Mon Sep 17 00:00:00 2001 From: M Date: Sun, 6 Dec 2015 02:16:46 -0500 Subject: * Implemented the "save" action for MVC sysconf --- app/controller/sysconf.control.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'app/controller/sysconf.control.php') diff --git a/app/controller/sysconf.control.php b/app/controller/sysconf.control.php index f96c97e..a7db1e8 100644 --- a/app/controller/sysconf.control.php +++ b/app/controller/sysconf.control.php @@ -14,7 +14,17 @@ class Sysconf extends Controller function handle($argv) { $mod = new SysconfModel(); - $this->action_default($mod); + + switch ($_REQUEST['input']['action']) + { + case "save": + $this->action_save($mod); + break; + + default: + $this->action_default($mod); + break; + } } function action_default($mod) @@ -22,6 +32,12 @@ class Sysconf extends Controller $mod->deflt(); include "view/sysconf/default.view.php"; } + + function action_save($mod) + { + $mod->save($_REQUEST['input']); + $this->action_default($mod); + } } ?> -- cgit v1.2.3