From 4fc41ad060b5aab7bb6e595e64083fda2d8a44da Mon Sep 17 00:00:00 2001 From: M Date: Fri, 20 Nov 2015 23:13:11 -0500 Subject: * Named old example content example.html to keep it around for now --- app/example.html | 230 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ app/index.html | 230 ------------------------------------------------------- 2 files changed, 230 insertions(+), 230 deletions(-) create mode 100644 app/example.html delete mode 100644 app/index.html diff --git a/app/example.html b/app/example.html new file mode 100644 index 0000000..15b8602 --- /dev/null +++ b/app/example.html @@ -0,0 +1,230 @@ + + + + + + + + + Scrott - Save the World + + + + + + + + + + + +
+
+
+
+

Save the World

+ Sonic + + Miles + Amy + Knuckles +
+ +
+ Issue Progress +
+
Closed
+
In Progress
+
To Do
+
+ +
+ + + + +
+
+ +
+
+
+
+
+
+ +
+

In Progress

+ + + + + + + + + + + + + + +
a8c2402b (#4)Example Issue + Sonic + + Miles + +
+ + + + +
+
a8c2402b (#5)Example Issue + Miles + + Amy + + Sonic + +
+ + + + +
+
+
+ +
+

To Do

+ + + + + + + + + + + + + + + + + + + + + +
a8c2402b (#6)Example Issue for external user + Knuckles + + + +
+ + + + +
+
a8c2402b (#7)Example Unassigned Issue + + + Sonic + +
+ + + + +
+
a8c2402b (#8)Example Self-assigned Issue + Amy + +
+ + + + +
+
+
+
+ + + + + + diff --git a/app/index.html b/app/index.html deleted file mode 100644 index 15b8602..0000000 --- a/app/index.html +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - - - Scrott - Save the World - - - - - - - - - - - -
-
-
-
-

Save the World

- Sonic - - Miles - Amy - Knuckles -
- -
- Issue Progress -
-
Closed
-
In Progress
-
To Do
-
- -
- - - - -
-
- -
-
-
-
-
-
- -
-

In Progress

- - - - - - - - - - - - - - -
a8c2402b (#4)Example Issue - Sonic - - Miles - -
- - - - -
-
a8c2402b (#5)Example Issue - Miles - - Amy - - Sonic - -
- - - - -
-
-
- -
-

To Do

- - - - - - - - - - - - - - - - - - - - - -
a8c2402b (#6)Example Issue for external user - Knuckles - - - -
- - - - -
-
a8c2402b (#7)Example Unassigned Issue - - - Sonic - -
- - - - -
-
a8c2402b (#8)Example Self-assigned Issue - Amy - -
- - - - -
-
-
-
- - - - - - -- cgit v1.2.3 From 39ad0dfc8ce79a3e3b013cef67568edd01fe48d2 Mon Sep 17 00:00:00 2001 From: M Date: Sat, 21 Nov 2015 13:31:48 -0500 Subject: + Adding main source file which invokes the master controller --- app/index.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 app/index.php diff --git a/app/index.php b/app/index.php new file mode 100644 index 0000000..ca2ce45 --- /dev/null +++ b/app/index.php @@ -0,0 +1,16 @@ +"; +} + +main(explode("/", $_SERVER['PATH_INFO'])); // Start rendering web page for the requested path. + +?> -- cgit v1.2.3 From 2f353e89409420b875afefd7b412c17996c32045 Mon Sep 17 00:00:00 2001 From: M Date: Sat, 21 Nov 2015 16:33:28 -0500 Subject: * Changing the mechanism by which the requested path is passed to the app ! It has been observed that on server nginx, some of the assumptions from doing similar work on apache have broken down and a more general mechanism must be used to handle paths in the clean-url app. ! New scheme is this: app is invoked with `index.php?path=` The app will be configured with its own root location on the virt. server and use logic to dedue the relative path requested from that. Also app will use the configured path to predend to urls linked/directed to during use of the app --- app/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/index.php b/app/index.php index ca2ce45..5f2d9f4 100644 --- a/app/index.php +++ b/app/index.php @@ -11,6 +11,6 @@ function main($argv) echo "Scrott!
"; } -main(explode("/", $_SERVER['PATH_INFO'])); // Start rendering web page for the requested path. +main(explode("/", $_REQUEST['path'])); // Start rendering web page for the requested path. ?> -- cgit v1.2.3 From dbba1012ca163a9e9117ff3f6c2a7ca984b4dc4c Mon Sep 17 00:00:00 2001 From: M Date: Sat, 21 Nov 2015 16:51:52 -0500 Subject: * Now using require in favor of include throughout PHP in the app --- app/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/index.php b/app/index.php index 5f2d9f4..854df0b 100644 --- a/app/index.php +++ b/app/index.php @@ -1,6 +1,6 @@ Date: Sat, 21 Nov 2015 17:37:18 -0500 Subject: + Committing initial framework class definition --- app/class/framework.class.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 app/class/framework.class.php diff --git a/app/class/framework.class.php b/app/class/framework.class.php new file mode 100644 index 0000000..452f0c3 --- /dev/null +++ b/app/class/framework.class.php @@ -0,0 +1,26 @@ + -- cgit v1.2.3 From adade14d9e386797a65f1beb405c21ebbff1ca37 Mon Sep 17 00:00:00 2001 From: M Date: Sat, 21 Nov 2015 18:25:28 -0500 Subject: + Adding abstract controller class --- app/class/controller.class.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 app/class/controller.class.php diff --git a/app/class/controller.class.php b/app/class/controller.class.php new file mode 100644 index 0000000..4ea40d1 --- /dev/null +++ b/app/class/controller.class.php @@ -0,0 +1,17 @@ + -- cgit v1.2.3 From 49b19e95939cd38ffc9b2601a2c97ea1ee4d8eb3 Mon Sep 17 00:00:00 2001 From: M Date: Sat, 21 Nov 2015 19:59:25 -0500 Subject: + Added app root controller * Finished implementing app main function to instanciate root and delegate to it --- app/controller/root.control.php | 20 ++++++++++++++++++++ app/index.php | 4 ++-- 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 app/controller/root.control.php diff --git a/app/controller/root.control.php b/app/controller/root.control.php new file mode 100644 index 0000000..2d12eb6 --- /dev/null +++ b/app/controller/root.control.php @@ -0,0 +1,20 @@ + diff --git a/app/index.php b/app/index.php index 854df0b..37258d7 100644 --- a/app/index.php +++ b/app/index.php @@ -7,8 +7,8 @@ require_once "controller/root.control.php"; */ function main($argv) { - /* TODO */ - echo "Scrott!
"; + $app = new Root(); + $app->handle($argv); } main(explode("/", $_REQUEST['path'])); // Start rendering web page for the requested path. -- cgit v1.2.3 From c50a6be054db3ddb260585865df8341e1347ad73 Mon Sep 17 00:00:00 2001 From: M Date: Sat, 21 Nov 2015 20:53:44 -0500 Subject: * Framework def file is now condifionally including system-level app configuration --- app/class/framework.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/class/framework.class.php b/app/class/framework.class.php index 452f0c3..e20be7f 100644 --- a/app/class/framework.class.php +++ b/app/class/framework.class.php @@ -1,5 +1,9 @@ Date: Sat, 21 Nov 2015 21:47:03 -0500 Subject: + Defined function to check if scrott.conf.php file exists --- app/class/framework.class.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/class/framework.class.php b/app/class/framework.class.php index e20be7f..5232135 100644 --- a/app/class/framework.class.php +++ b/app/class/framework.class.php @@ -9,6 +9,15 @@ is_file("scrott.conf.php") && */ abstract class Framework { + /* + * Check for the existence of Scrott's system-level config + */ + function scrottConfExists() + { + global $_SCROTT; + return isset($_SCROTT['conf']); + } + /* * Get the absolute path on this server for the root of this app */ -- cgit v1.2.3 From dfa67b6059c9657454d3abed2e66ce30ce168960 Mon Sep 17 00:00:00 2001 From: M Date: Sat, 21 Nov 2015 23:17:11 -0500 Subject: + Added abstract model definition --- app/class/model.class.php | 71 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 app/class/model.class.php diff --git a/app/class/model.class.php b/app/class/model.class.php new file mode 100644 index 0000000..25e34ab --- /dev/null +++ b/app/class/model.class.php @@ -0,0 +1,71 @@ +errorlist = array(); + $this->warninglist = array(); + $this->noticelist = array(); + } + + /* + * Check for error + */ + function isError() + { + return count($this->errorlist) > 0; + } + + /* + * Check for warning + */ + function isWarning() + { + return count($this->warninglist) > 0; + } + + /* + * Check for notice + */ + function isNotice() + { + return count($this->noticelist) > 0; + } + + /* + * Log an error + */ + function logError($str) + { + $this->errorlist[] = $str; + } + + /* + * Log a warning + */ + function logWarning($str) + { + $this->warninglist[] = $str; + } + + /* + * Log a notice + */ + function logNotice($str) + { + $this->noticelist[] = $str; + } +} + +?> -- cgit v1.2.3 From debd679aa4e3d7eb2d216e57df859dd9e6427f5f Mon Sep 17 00:00:00 2001 From: M Date: Sun, 22 Nov 2015 00:24:37 -0500 Subject: * Implemented framework ar (app root) function --- app/class/framework.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/class/framework.class.php b/app/class/framework.class.php index 5232135..11902d0 100644 --- a/app/class/framework.class.php +++ b/app/class/framework.class.php @@ -23,7 +23,7 @@ abstract class Framework */ function ar() { - /* TODO */ + return substr($_SERVER['PHP_SELF'], 0, -10); // 10 = length of "/index.php" } /* -- cgit v1.2.3 From edb25b777896910705df7b6ce991ef1e4870400c Mon Sep 17 00:00:00 2001 From: M Date: Sun, 22 Nov 2015 01:13:30 -0500 Subject: + Added function to root controller for normalizing the $argv array --- app/controller/root.control.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/app/controller/root.control.php b/app/controller/root.control.php index 2d12eb6..fffb2fc 100644 --- a/app/controller/root.control.php +++ b/app/controller/root.control.php @@ -15,6 +15,38 @@ class Root extends Controller { /* TODO */ } + + /* + * Get a useful path string by normalizeing the $argv array received from the main function. + * This will remove directory names that appear in the $this->ar() string and the initial + * and trailing (if present) empty strings + */ + function normalizeArgv($argv) + { + $argv = array_filter($argv); + $ar = array_filter(explode("/", $this->ar())); + $i = 0; + $trunc = true; + + if (count($ar) == 0) + return $argv; + + foreach ($ar as $elem) + { + if ($elem != $argv[$i]) + { + $trunc = false; + break; + } + + $i++; + } + + if (!$trunc) + return $argv; + + return array_slice($argv, count($ar)); + } } ?> -- cgit v1.2.3 From 5c43e0f85077e758a9a260fde198e38ff42a28ab Mon Sep 17 00:00:00 2001 From: M Date: Sun, 22 Nov 2015 01:34:10 -0500 Subject: * Bug fix in normalizeArgv function --- app/controller/root.control.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/controller/root.control.php b/app/controller/root.control.php index fffb2fc..bb7bb4e 100644 --- a/app/controller/root.control.php +++ b/app/controller/root.control.php @@ -14,6 +14,8 @@ class Root extends Controller function handle($argv) { /* TODO */ + $argv = $this->normalizeArgv($argv); + echo implode("/", $argv); } /* @@ -23,8 +25,8 @@ class Root extends Controller */ function normalizeArgv($argv) { - $argv = array_filter($argv); - $ar = array_filter(explode("/", $this->ar())); + $argv = array_values(array_filter($argv)); + $ar = array_values(array_filter(explode("/", $this->ar()))); $i = 0; $trunc = true; @@ -45,7 +47,7 @@ class Root extends Controller if (!$trunc) return $argv; - return array_slice($argv, count($ar)); + return array_values(array_slice($argv, count($ar))); } } -- cgit v1.2.3 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 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 9250262017b605495c879a12ed38c693b1e024cc Mon Sep 17 00:00:00 2001 From: M Date: Sun, 22 Nov 2015 02:25:58 -0500 Subject: * Root controller is now asserting the existence of scrott.conf.php and delegating to the correct mvc if it is missing --- app/controller/root.control.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/controller/root.control.php b/app/controller/root.control.php index bb7bb4e..6263862 100644 --- a/app/controller/root.control.php +++ b/app/controller/root.control.php @@ -1,6 +1,7 @@ scrottConfExists()) + { + $ctrl = new Sysconf(); + $ctrl->handle($argv); + } + /* TODO */ - $argv = $this->normalizeArgv($argv); - echo implode("/", $argv); } /* -- cgit v1.2.3 From 7acf1af340b9d11b72bca70731ed6dbcd7c95132 Mon Sep 17 00:00:00 2001 From: M Date: Sun, 22 Nov 2015 02:45:31 -0500 Subject: + Adding model for sysconf mvc --- app/model/sysconf.mod.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 app/model/sysconf.mod.php diff --git a/app/model/sysconf.mod.php b/app/model/sysconf.mod.php new file mode 100644 index 0000000..11b8f4f --- /dev/null +++ b/app/model/sysconf.mod.php @@ -0,0 +1,15 @@ + -- 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/class/model.class.php | 2 -- app/controller/sysconf.control.php | 2 +- app/model/sysconf.mod.php | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/class/model.class.php b/app/class/model.class.php index 25e34ab..4f597f7 100644 --- a/app/class/model.class.php +++ b/app/class/model.class.php @@ -12,8 +12,6 @@ abstract class Model extends Framework */ function __construct() { - parent::__construct(); - $this->errorlist = array(); $this->warninglist = array(); $this->noticelist = array(); 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"; } } diff --git a/app/model/sysconf.mod.php b/app/model/sysconf.mod.php index 11b8f4f..cc29294 100644 --- a/app/model/sysconf.mod.php +++ b/app/model/sysconf.mod.php @@ -7,7 +7,7 @@ class SysconfModel extends Model /* * Default action */ - function default() + function deflt() { } } -- cgit v1.2.3 From b1f4cf9b23acbcb80f937ef7f0b9f18fdb167f5a Mon Sep 17 00:00:00 2001 From: M Date: Sun, 22 Nov 2015 12:40:37 -0500 Subject: + Start of Master MVC ( will define generic layout of pages but will not define logic for header ui. since this depends on an established database ). + Added Master model ! As far as I am planning right now, the only MVC that will inherit Master directly will be sysconf since it cannot rely on an existing database connection. --- app/model/master.mod.php | 9 +++++++++ app/model/sysconf.mod.php | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 app/model/master.mod.php diff --git a/app/model/master.mod.php b/app/model/master.mod.php new file mode 100644 index 0000000..2570a8b --- /dev/null +++ b/app/model/master.mod.php @@ -0,0 +1,9 @@ + diff --git a/app/model/sysconf.mod.php b/app/model/sysconf.mod.php index cc29294..754d1a6 100644 --- a/app/model/sysconf.mod.php +++ b/app/model/sysconf.mod.php @@ -1,8 +1,8 @@ Date: Sun, 22 Nov 2015 13:26:48 -0500 Subject: + Added view for Master MVC --- app/example.html | 6 ------ app/view/master/head.view.php | 5 +++++ 2 files changed, 5 insertions(+), 6 deletions(-) create mode 100644 app/view/master/head.view.php diff --git a/app/example.html b/app/example.html index 15b8602..6b0ea8e 100644 --- a/app/example.html +++ b/app/example.html @@ -2,14 +2,8 @@ - - - - Scrott - Save the World - - + + + + + + +
+
+

+     +     +     +     +     + +

+ +

Welcome to Scrott!

+
+ +

You're seeing this page because the file "scrott.conf.php" is missing.
Please fill out the form below to create a config automatically!

+

Click the icons above to learn more about core Scrott features and constructs!

+
+ +

This form will initialize Scrott's system-level configuration.
These are things the app needs before it can begin functioning at all!

+
It is presumed that you are the administrator for this Scrott install.
There is a security risk involved with exposing this page to the public!
+ +
+
+ +
+
+
+
+ Database Connection +
+
+ + localhost + +
+
+ + + + + +
+ +
+ +
+
+
+
+
+
+ +
+
+
+
+ + + + + -- cgit v1.2.3 From 7de4383f0d7e5b3db8eb69e34795dec251ae842e Mon Sep 17 00:00:00 2001 From: M Date: Sun, 29 Nov 2015 17:33:50 -0500 Subject: * Moved sysconf default view modal content out to diffent view file --- app/view/sysconf/default.view.php | 23 +++-------------------- app/view/sysconf/user.modal.view.php | 30 ++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 20 deletions(-) create mode 100644 app/view/sysconf/user.modal.view.php diff --git a/app/view/sysconf/default.view.php b/app/view/sysconf/default.view.php index 74dfd79..a4dade9 100644 --- a/app/view/sysconf/default.view.php +++ b/app/view/sysconf/default.view.php @@ -19,29 +19,12 @@ - - - +

+     +             diff --git a/app/view/sysconf/user.modal.view.php b/app/view/sysconf/user.modal.view.php new file mode 100644 index 0000000..b3650b0 --- /dev/null +++ b/app/view/sysconf/user.modal.view.php @@ -0,0 +1,30 @@ + -- cgit v1.2.3 From 32569e09783e442415f76e0b54b20f084843b120 Mon Sep 17 00:00:00 2001 From: M Date: Sun, 29 Nov 2015 17:56:48 -0500 Subject: + Created sysconf group modal --- app/view/sysconf/default.view.php | 5 ++--- app/view/sysconf/group.modal.view.php | 31 +++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 app/view/sysconf/group.modal.view.php diff --git a/app/view/sysconf/default.view.php b/app/view/sysconf/default.view.php index a4dade9..7febbf6 100644 --- a/app/view/sysconf/default.view.php +++ b/app/view/sysconf/default.view.php @@ -20,13 +20,12 @@ +

    - -     -     +                 diff --git a/app/view/sysconf/group.modal.view.php b/app/view/sysconf/group.modal.view.php new file mode 100644 index 0000000..cd05642 --- /dev/null +++ b/app/view/sysconf/group.modal.view.php @@ -0,0 +1,31 @@ + -- cgit v1.2.3 From b4af0b4594a95365f77575eef288a5d318f5a06c Mon Sep 17 00:00:00 2001 From: M Date: Sun, 29 Nov 2015 19:16:06 -0500 Subject: + Added sysconf pad modal view --- app/view/sysconf/pad.modal.view.php | 50 +++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 app/view/sysconf/pad.modal.view.php diff --git a/app/view/sysconf/pad.modal.view.php b/app/view/sysconf/pad.modal.view.php new file mode 100644 index 0000000..88c62e7 --- /dev/null +++ b/app/view/sysconf/pad.modal.view.php @@ -0,0 +1,50 @@ + -- cgit v1.2.3 From d0ac4b2ef6ac4bb472188a84085ab040e5b2a769 Mon Sep 17 00:00:00 2001 From: M Date: Sun, 29 Nov 2015 20:03:50 -0500 Subject: + Added sysconf stage modal view --- app/view/sysconf/stage.modal.view.php | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 app/view/sysconf/stage.modal.view.php diff --git a/app/view/sysconf/stage.modal.view.php b/app/view/sysconf/stage.modal.view.php new file mode 100644 index 0000000..4eaab43 --- /dev/null +++ b/app/view/sysconf/stage.modal.view.php @@ -0,0 +1,34 @@ + -- cgit v1.2.3 From fd415e6d1054795f8643e909061f7cd0cd5c5318 Mon Sep 17 00:00:00 2001 From: M Date: Sun, 29 Nov 2015 20:29:37 -0500 Subject: + Added sysconf issue modal view --- app/view/sysconf/issue.modal.view.php | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 app/view/sysconf/issue.modal.view.php diff --git a/app/view/sysconf/issue.modal.view.php b/app/view/sysconf/issue.modal.view.php new file mode 100644 index 0000000..a77c1e3 --- /dev/null +++ b/app/view/sysconf/issue.modal.view.php @@ -0,0 +1,34 @@ + -- cgit v1.2.3 From bd78037bb26a2c325d4dc25ae4d5bc11738c9838 Mon Sep 17 00:00:00 2001 From: M Date: Sun, 29 Nov 2015 21:39:48 -0500 Subject: + Adding sysconf message modal view --- app/view/sysconf/message.modal.view.php | 37 +++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 app/view/sysconf/message.modal.view.php diff --git a/app/view/sysconf/message.modal.view.php b/app/view/sysconf/message.modal.view.php new file mode 100644 index 0000000..715bb06 --- /dev/null +++ b/app/view/sysconf/message.modal.view.php @@ -0,0 +1,37 @@ + -- cgit v1.2.3 From b6883568aa378fc27a0d561f31945fc7d44a4df3 Mon Sep 17 00:00:00 2001 From: M Date: Sun, 29 Nov 2015 22:08:59 -0500 Subject: * Updated sysconf default view to include new modal content --- app/view/sysconf/default.view.php | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/app/view/sysconf/default.view.php b/app/view/sysconf/default.view.php index 7febbf6..83fa145 100644 --- a/app/view/sysconf/default.view.php +++ b/app/view/sysconf/default.view.php @@ -6,30 +6,27 @@ Scrott - System-level configuration missing + + + +

        -     -     -     - +     +     +     +

Welcome to Scrott!

-- cgit v1.2.3 From b0ab1bc56182514d0cb39febf1792f2c63819d49 Mon Sep 17 00:00:00 2001 From: M Date: Wed, 2 Dec 2015 22:43:22 -0500 Subject: * Formatted DB portion of the sysconf page form --- app/view/sysconf/default.view.php | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/app/view/sysconf/default.view.php b/app/view/sysconf/default.view.php index 83fa145..4266ab8 100644 --- a/app/view/sysconf/default.view.php +++ b/app/view/sysconf/default.view.php @@ -18,6 +18,7 @@ +

@@ -47,23 +48,30 @@
Database Connection +
-
- - localhost - -
+ +
+
+ + +
+
+ + +
+
+ + +
- -
- -
- -
+
+ +
@@ -76,11 +84,5 @@
- -- cgit v1.2.3 From cc6c04725504d7419513c6a023bd51c02a6de8a4 Mon Sep 17 00:00:00 2001 From: M Date: Thu, 3 Dec 2015 21:00:34 -0500 Subject: * Finished form for sysconf default view --- app/view/sysconf/default.view.php | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/app/view/sysconf/default.view.php b/app/view/sysconf/default.view.php index 4266ab8..f6b5b23 100644 --- a/app/view/sysconf/default.view.php +++ b/app/view/sysconf/default.view.php @@ -48,7 +48,6 @@
Database Connection -
@@ -73,6 +72,40 @@
+ + Application Installation +
+ + +
Detected from location of files in web document root
+
+ + Settings +
+ +
+ +
+ +
+ +
+ +
+ +
+
+ +

-- cgit v1.2.3 From dfd10529bb00ed344cb118219abab98cb1769760 Mon Sep 17 00:00:00 2001 From: M Date: Thu, 3 Dec 2015 21:12:02 -0500 Subject: * Fixed the sources in the master head and foot views (wasn't accounting for app-root) --- app/view/master/foot.view.php | 4 ++-- app/view/master/head.view.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/view/master/foot.view.php b/app/view/master/foot.view.php index 5c52563..c295455 100644 --- a/app/view/master/foot.view.php +++ b/app/view/master/foot.view.php @@ -1,2 +1,2 @@ - - + + diff --git a/app/view/master/head.view.php b/app/view/master/head.view.php index 0c9178f..54294b8 100644 --- a/app/view/master/head.view.php +++ b/app/view/master/head.view.php @@ -2,4 +2,4 @@ - + -- cgit v1.2.3 From 49e6128951e8d8b340ea6027735c8b3566c44b6b Mon Sep 17 00:00:00 2001 From: M Date: Thu, 3 Dec 2015 22:11:13 -0500 Subject: + Started Form class definition --- app/class/form.class.php | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 app/class/form.class.php diff --git a/app/class/form.class.php b/app/class/form.class.php new file mode 100644 index 0000000..e398690 --- /dev/null +++ b/app/class/form.class.php @@ -0,0 +1,35 @@ +textFields = array(); + + $this->errorlist = array(); + $this->warninglist = array(); + $this->noticelist = array(); + } + + /* + * Add new text field to the form + */ + function field_text($name, $req = true) + { + if ($req !== true) + $req = false; + + $this->textFields[] = array( + 'name' => $name, + 'req' => $req + ); + } +} + +?> -- cgit v1.2.3 From 59962f7c260aaa0661b0c811e6b553d1a850032b Mon Sep 17 00:00:00 2001 From: M Date: Sat, 5 Dec 2015 15:03:48 -0500 Subject: + Added numeric and enum types to Form class --- app/class/form.class.php | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/app/class/form.class.php b/app/class/form.class.php index e398690..ffee3d7 100644 --- a/app/class/form.class.php +++ b/app/class/form.class.php @@ -11,6 +11,8 @@ class Form function __construct() { $this->textFields = array(); + $this->numbFields = array(); + $this->enumFields = array(); $this->errorlist = array(); $this->warninglist = array(); @@ -30,6 +32,41 @@ class Form 'req' => $req ); } + + /* + * Add new numeric field to the form + */ + function field_numeric($name, $req = true, $integer = true, $min = null, $max = null) + { + if ($req !== true) + $req = false; + + if ($integer !== true) + $integer = false; + + $this->numbFields[] = array( + 'name' => $name, + 'req' => $req, + 'int' => $integer, + 'min' => $min, + 'max' => $max + ); + } + + /* + * Add new enumeration field to the form + */ + function field_enum($name, $req = true, $values) + { + if ($req !== true) + $req = false; + + $this->enumFields[] = array( + 'name' => $name, + 'req' => $req, + 'vals' => $values + ); + } } ?> -- cgit v1.2.3 From 91659b121e63735a7620663c0f43f5c5adef77d4 Mon Sep 17 00:00:00 2001 From: M Date: Sat, 5 Dec 2015 18:54:01 -0500 Subject: + Implemented populate function in Form class + Added helper function in Form class, logError ! Finished Form class for now --- app/class/form.class.php | 100 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 97 insertions(+), 3 deletions(-) diff --git a/app/class/form.class.php b/app/class/form.class.php index ffee3d7..502e348 100644 --- a/app/class/form.class.php +++ b/app/class/form.class.php @@ -14,9 +14,15 @@ class Form $this->numbFields = array(); $this->enumFields = array(); - $this->errorlist = array(); - $this->warninglist = array(); - $this->noticelist = array(); + $this->errorlist = array(); + } + + /* + * Log an error + */ + function logError($str) + { + $this->errorlist[] = $str; } /* @@ -67,6 +73,94 @@ class Form 'vals' => $values ); } + + /* + * Populate the form with input data from web page + */ + function populate($input) + { + /* detect duplicate names */ + $names = array(); + foreach ($this->textFields as $fld) + $names[] = $fld['name']; + foreach ($this->numbFields as $fld) + $names[] = $fld['name']; + foreach ($this->enumFields as $fld) + $names[] = $fld['name']; + + if (count(array_unique($names)) != count($names)) + { + $this->logError("Internal error: Duplicate field names defined in form"); + return false; + } + + /* init text fields */ + foreach ($this->textFields as $fld) + { + if (isset($input[$fld['name']])) + $this->$fld['name'] = htmlEntities($input[$fld['name']], ENT_QUOTES); + + else if ($fld['req']) + $this->logError($fld['name'] . " is required"); + } + + /* init numeric fields */ + foreach ($this->numbFields as $fld) + { + if (isset($input[$fld['name']])) + { + if (!is_numeric($input[$fld['name']])) + { + $this->logError($fld['name'] . " must be numeric"); + continue; + } + + if ($fld['int'] && (floor($input[$fld['name']]) != $input[$fld['name']])) + { + $this->logError($fld['name'] . " must be an integer"); + continue; + } + + if (!is_null($fld['min']) && ($input[$fld['name']] < $fld['min'])) + { + $this->logError($fld['name'] . " must be no less than " . $fld['min']); + continue; + } + + if (!is_null($fld['max']) && ($input[$fld['name']] > $fld['max'])) + { + $this->logError($fld['name'] . " must be no more than " . $fld['max']); + continue; + } + + $this->$fld['name'] = $input[$fld['name']]; + } + + else if ($fld['req']) + $this->logError($fld['name'] . " is required"); + } + + /* init enum fields */ + foreach ($this->enumFields as $fld) + { + if (isset($input[$fld['name']])) + { + if (array_search($input[$fld['name']], $fld['vals']) === false) + { + $this->logError($fld['name'] . " is not an appropriate value"); + continue; + } + + $this->$fld['name'] = $input[$fld['name']]; + } + + else if ($fld['req']) + $this->logError($fld['name'] . " is required"); + } + + /* return */ + return count($this->errorlist) == 0; + } } ?> -- cgit v1.2.3 From 9bab1e5c3d7dae9603c5f2172b2a620465caab0e Mon Sep 17 00:00:00 2001 From: M Date: Sat, 5 Dec 2015 21:37:03 -0500 Subject: * Form class fields now have the ability to set a default value. Default value is applied if the supplied $input array has no key matching the field name. --- app/class/form.class.php | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/app/class/form.class.php b/app/class/form.class.php index 502e348..e50876d 100644 --- a/app/class/form.class.php +++ b/app/class/form.class.php @@ -28,21 +28,22 @@ class Form /* * Add new text field to the form */ - function field_text($name, $req = true) + function field_text($name, $deflt = null, $req = true) { if ($req !== true) $req = false; $this->textFields[] = array( - 'name' => $name, - 'req' => $req + 'name' => $name, + 'deflt' => $deflt, + 'req' => $req ); } /* * Add new numeric field to the form */ - function field_numeric($name, $req = true, $integer = true, $min = null, $max = null) + function field_numeric($name, $min = null, $max = null, $deflt = null, $integer = true, $req = true) { if ($req !== true) $req = false; @@ -51,26 +52,28 @@ class Form $integer = false; $this->numbFields[] = array( - 'name' => $name, - 'req' => $req, - 'int' => $integer, - 'min' => $min, - 'max' => $max + 'name' => $name, + 'min' => $min, + 'max' => $max, + 'deflt' => $deflt, + 'int' => $integer, + 'req' => $req ); } /* * Add new enumeration field to the form */ - function field_enum($name, $req = true, $values) + function field_enum($name, $values, $deflt = null, $req = true) { if ($req !== true) $req = false; $this->enumFields[] = array( - 'name' => $name, - 'req' => $req, - 'vals' => $values + 'name' => $name, + 'vals' => $values, + 'deflt' => $deflt, + 'req' => $req ); } @@ -100,6 +103,9 @@ class Form if (isset($input[$fld['name']])) $this->$fld['name'] = htmlEntities($input[$fld['name']], ENT_QUOTES); + else if (!is_null($fld['deflt'])) + $this->$fld['name'] = $fld['deflt']; + else if ($fld['req']) $this->logError($fld['name'] . " is required"); } @@ -136,6 +142,9 @@ class Form $this->$fld['name'] = $input[$fld['name']]; } + else if (!is_null($fld['deflt'])) + $this->$fld['name'] = $fld['deflt']; + else if ($fld['req']) $this->logError($fld['name'] . " is required"); } @@ -154,6 +163,9 @@ class Form $this->$fld['name'] = $input[$fld['name']]; } + else if (!is_null($fld['deflt'])) + $this->$fld['name'] = $fld['deflt']; + else if ($fld['req']) $this->logError($fld['name'] . " is required"); } -- cgit v1.2.3 From 5a05468fe2d78641d3adb0ba5b83bf526f4f06de Mon Sep 17 00:00:00 2001 From: M Date: Sat, 5 Dec 2015 22:53:34 -0500 Subject: + Added framework function for getting current app path * Changed sysconf view to use new function ($mod->ar()/sysconf -> $mod->ap) --- app/class/framework.class.php | 8 ++++++++ app/view/sysconf/default.view.php | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/class/framework.class.php b/app/class/framework.class.php index 11902d0..151ca8e 100644 --- a/app/class/framework.class.php +++ b/app/class/framework.class.php @@ -26,6 +26,14 @@ abstract class Framework return substr($_SERVER['PHP_SELF'], 0, -10); // 10 = length of "/index.php" } + /* + * Get the absolute path to the current page + */ + function ap() + { + return $this->ar() . $_REQUEST['path']; + } + /* * Redirect to the given URL and die */ diff --git a/app/view/sysconf/default.view.php b/app/view/sysconf/default.view.php index f6b5b23..b6b85ac 100644 --- a/app/view/sysconf/default.view.php +++ b/app/view/sysconf/default.view.php @@ -46,7 +46,8 @@
-
+ + Database Connection
-- cgit v1.2.3 From 182ec782d61749ca67bf0cd9e67821849fc29584 Mon Sep 17 00:00:00 2001 From: M Date: Sat, 5 Dec 2015 22:56:39 -0500 Subject: * Now normalizing the $argv array in the root app controller --- app/controller/root.control.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controller/root.control.php b/app/controller/root.control.php index d77b0e6..7ccf35e 100644 --- a/app/controller/root.control.php +++ b/app/controller/root.control.php @@ -14,6 +14,8 @@ class Root extends Controller */ function handle($argv) { + $argv = $this->normalizeArgv($argv); + /* First, make sure the system configuration file has been included */ if (!$this->scrottConfExists()) { -- cgit v1.2.3 From e6f3bf746fbb1d4c768a1d43e2a0233d0fb25f47 Mon Sep 17 00:00:00 2001 From: M Date: Sun, 6 Dec 2015 00:12:16 -0500 Subject: * Bug fix in Form class - populate function -- If a field was set in $input, but equal to "", the isset check would not behave as expected --- app/class/form.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/class/form.class.php b/app/class/form.class.php index e50876d..d3af399 100644 --- a/app/class/form.class.php +++ b/app/class/form.class.php @@ -100,7 +100,7 @@ class Form /* init text fields */ foreach ($this->textFields as $fld) { - if (isset($input[$fld['name']])) + if (isset($input[$fld['name']]) && $input[$fld['name']] != "") $this->$fld['name'] = htmlEntities($input[$fld['name']], ENT_QUOTES); else if (!is_null($fld['deflt'])) @@ -113,7 +113,7 @@ class Form /* init numeric fields */ foreach ($this->numbFields as $fld) { - if (isset($input[$fld['name']])) + if (isset($input[$fld['name']]) && $input[$fld['name']] != "") { if (!is_numeric($input[$fld['name']])) { @@ -152,7 +152,7 @@ class Form /* init enum fields */ foreach ($this->enumFields as $fld) { - if (isset($input[$fld['name']])) + if (isset($input[$fld['name']]) && $input[$fld['name']] != "") { if (array_search($input[$fld['name']], $fld['vals']) === false) { -- cgit v1.2.3 From 9f9d2a9d313122e9cf365e3baf4a8889b611ae28 Mon Sep 17 00:00:00 2001 From: M Date: Sun, 6 Dec 2015 00:16:14 -0500 Subject: + Added function to model class to log all error messages from a Form objects populate call --- app/class/model.class.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/class/model.class.php b/app/class/model.class.php index 4f597f7..85bcf54 100644 --- a/app/class/model.class.php +++ b/app/class/model.class.php @@ -64,6 +64,14 @@ abstract class Model extends Framework { $this->noticelist[] = $str; } + + /* + * Log errors from a Form + */ + function logFormErrors($obj) + { + $this->errorlist = array_merge($this->errorlist, $obj->errorlist); + } } ?> -- 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 +++++++++++++++- app/model/sysconf.mod.php | 43 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) 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); + } } ?> diff --git a/app/model/sysconf.mod.php b/app/model/sysconf.mod.php index 754d1a6..d86f589 100644 --- a/app/model/sysconf.mod.php +++ b/app/model/sysconf.mod.php @@ -1,15 +1,58 @@ field_text("dbAddress"); + $form->field_text("dbName"); + $form->field_text("dbUser"); + $form->field_text("dbPass", null, false); + $form->field_enum("settSSL", array("force", "neither", "forbid")); + + if (!$form->populate($input)) + { + $this->logFormErrors($form); + return; + } + + $f = fopen($this->CONF_FILE, "w"); + + if (!$f) + { + $this->logError("Can not create configuration file"); + return; + } + + fwrite($f, "dbAddress . "';\n"); + fwrite($f, "\$_SCROTT['dbName'] = '" . $form->dbName . "';\n"); + fwrite($f, "\$_SCROTT['dbUser'] = '" . $form->dbUser . "';\n"); + fwrite($f, "\$_SCROTT['dbPass'] = '" . $form->dbPass . "';\n"); + fwrite($f, "\$_SCROTT['settSSL'] = '" . $form->settSSL . "';\n"); + fwrite($f, "?>\n"); + + fclose($f); + $this->redirectTo($this->ar()); + } } ?> -- cgit v1.2.3 From 366e538edd1a63143ddc229679d3d8be285a9ec3 Mon Sep 17 00:00:00 2001 From: M Date: Sun, 6 Dec 2015 03:10:13 -0500 Subject: * Bug fix in framework class - redirectTo function -- http_redirect function I was using is part of an extension for PHP and therefore, non-standard --- app/class/framework.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/class/framework.class.php b/app/class/framework.class.php index 151ca8e..7244220 100644 --- a/app/class/framework.class.php +++ b/app/class/framework.class.php @@ -39,7 +39,7 @@ abstract class Framework */ function redirectTo($url) { - http_redirect($url); + header("Location: " . $url); exit; } } -- cgit v1.2.3 From b7dfa1cbde0eb56a3251e48692e5757559bf604a Mon Sep 17 00:00:00 2001 From: M Date: Sun, 6 Dec 2015 03:27:39 -0500 Subject: + Adding a TODO note for later --- app/model/sysconf.mod.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/model/sysconf.mod.php b/app/model/sysconf.mod.php index d86f589..30ebd58 100644 --- a/app/model/sysconf.mod.php +++ b/app/model/sysconf.mod.php @@ -32,6 +32,8 @@ class SysconfModel extends MasterModel return; } + /* TODO -- test database connection before proceeding */ + $f = fopen($this->CONF_FILE, "w"); if (!$f) -- cgit v1.2.3 From 75cb46f665eeec0096dd464fe49444c2c3af5eb1 Mon Sep 17 00:00:00 2001 From: M Date: Sun, 6 Dec 2015 15:02:15 -0500 Subject: + Adding master page modal for displaying page errors/warnings/and notices (shell only, content coming soon) --- app/view/master/foot.view.php | 8 ++++++++ app/view/master/topp.view.php | 17 +++++++++++++++++ app/view/sysconf/default.view.php | 2 ++ 3 files changed, 27 insertions(+) create mode 100644 app/view/master/topp.view.php diff --git a/app/view/master/foot.view.php b/app/view/master/foot.view.php index c295455..6220f89 100644 --- a/app/view/master/foot.view.php +++ b/app/view/master/foot.view.php @@ -1,2 +1,10 @@ + +isError() || $mod->isWarning() || $mod->isNotice()) { ?> + + diff --git a/app/view/master/topp.view.php b/app/view/master/topp.view.php new file mode 100644 index 0000000..eef344e --- /dev/null +++ b/app/view/master/topp.view.php @@ -0,0 +1,17 @@ +isError() || $mod->isWarning() || $mod->isNotice()) { ?> + + diff --git a/app/view/sysconf/default.view.php b/app/view/sysconf/default.view.php index b6b85ac..1ecedd8 100644 --- a/app/view/sysconf/default.view.php +++ b/app/view/sysconf/default.view.php @@ -12,6 +12,8 @@ + + -- cgit v1.2.3 From f1c8aca230a0fc982f98f3dfc9b630b82dbb7dc4 Mon Sep 17 00:00:00 2001 From: M Date: Sun, 6 Dec 2015 17:38:02 -0500 Subject: + Added functions to Master model for getting merged strings for all error/warning/or notice messages --- app/model/master.mod.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/app/model/master.mod.php b/app/model/master.mod.php index 2570a8b..1ce9b9a 100644 --- a/app/model/master.mod.php +++ b/app/model/master.mod.php @@ -4,6 +4,38 @@ require_once "class/model.class.php"; class MasterModel extends Model { + /* + * Get string of all logged error messages + */ + function getErrorStr() + { + if (!$this->isError()) + return ""; + + return implode("
", $this->errorlist); + } + + /* + * Get string of all logged warning messages + */ + function getWarningStr() + { + if (!$this->isWarning()) + return ""; + + return implode("
", $this->warninglist); + } + + /* + * Get string of all logged notice messages + */ + function getNoticeStr() + { + if (!$this->isNotice()) + return ""; + + return implode("
", $this->noticelist); + } } ?> -- cgit v1.2.3 From 5f8d24d62e1474958685fee21e7e442aa3ce9d9c Mon Sep 17 00:00:00 2001 From: M Date: Sun, 6 Dec 2015 20:11:28 -0500 Subject: Revert "+ Added functions to Master model for getting merged strings for all error/warning/or notice messages" - Rm'ing functions I just added. I decided to go about this in a different way This reverts commit f1c8aca230a0fc982f98f3dfc9b630b82dbb7dc4. --- app/model/master.mod.php | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/app/model/master.mod.php b/app/model/master.mod.php index 1ce9b9a..2570a8b 100644 --- a/app/model/master.mod.php +++ b/app/model/master.mod.php @@ -4,38 +4,6 @@ require_once "class/model.class.php"; class MasterModel extends Model { - /* - * Get string of all logged error messages - */ - function getErrorStr() - { - if (!$this->isError()) - return ""; - - return implode("
", $this->errorlist); - } - - /* - * Get string of all logged warning messages - */ - function getWarningStr() - { - if (!$this->isWarning()) - return ""; - - return implode("
", $this->warninglist); - } - - /* - * Get string of all logged notice messages - */ - function getNoticeStr() - { - if (!$this->isNotice()) - return ""; - - return implode("
", $this->noticelist); - } } ?> -- cgit v1.2.3 From f83a90323bb359f995e7359a917eb9470a5e40e0 Mon Sep 17 00:00:00 2001 From: M Date: Sun, 6 Dec 2015 20:51:30 -0500 Subject: + Implemented the "noticeModal" -- an object in the master MVC topp view for displaying error / warning / and notice messages + Added two helper functions to Master MVC model for retruning values to the noticeModal --- app/model/master.mod.php | 33 +++++++++++++++++++++++++++++++++ app/view/master/topp.view.php | 43 +++++++++++++++++++++++++++++++++++-------- 2 files changed, 68 insertions(+), 8 deletions(-) diff --git a/app/model/master.mod.php b/app/model/master.mod.php index 2570a8b..aebcaaa 100644 --- a/app/model/master.mod.php +++ b/app/model/master.mod.php @@ -4,6 +4,39 @@ require_once "class/model.class.php"; class MasterModel extends Model { + /* + * Get the appropriate alert class to use when showing the notice modal + */ + function getNoticeModalAlertClass() + { + if ($this->isError()) + return "alert-danger"; + + if ($this->isWarning()) + return "alert-warning"; + + if ($this->isNotice()) + return "alert-info"; + + return ""; + } + + /* + * Get the appropriate glyphicon to use when showing the notice modal + */ + function getNoticeModalGlyphicon() + { + if ($this->isError()) + return "glyphicon glyphicon-remove-sign"; + + if ($this->isWarning()) + return "glyphicon glyphicon-exclamation-sign"; + + if ($this->isNotice()) + return "glyphicon glyphicon-info-sign"; + + return ""; + } } ?> diff --git a/app/view/master/topp.view.php b/app/view/master/topp.view.php index eef344e..fe430ff 100644 --- a/app/view/master/topp.view.php +++ b/app/view/master/topp.view.php @@ -1,16 +1,43 @@ isError() || $mod->isWarning() || $mod->isNotice()) { ?>