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()) { ?>