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 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 app/model/master.mod.php (limited to '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 @@ + -- 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(+) (limited to 'app/model/master.mod.php') 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(-) (limited to 'app/model/master.mod.php') 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 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'app/model/master.mod.php') 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 ""; + } } ?> -- cgit v1.2.3