diff options
author | M <m@lfurio.us> | 2015-12-06 20:51:30 -0500 |
---|---|---|
committer | M <m@lfurio.us> | 2015-12-06 20:51:30 -0500 |
commit | f83a90323bb359f995e7359a917eb9470a5e40e0 (patch) | |
tree | 623d78f957aad096e09143202a080c5fa94a4e1a | |
parent | 5f8d24d62e1474958685fee21e7e442aa3ce9d9c (diff) | |
download | scrott-f83a90323bb359f995e7359a917eb9470a5e40e0.tar.gz scrott-f83a90323bb359f995e7359a917eb9470a5e40e0.zip |
+ 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
Diffstat (limited to '')
-rw-r--r-- | app/model/master.mod.php | 33 | ||||
-rw-r--r-- | 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 @@ <?php if ($mod->isError() || $mod->isWarning() || $mod->isNotice()) { ?> <div id="noticeModal" class="modal fade" tabindex="-1" role="dialog"> - <div class="modal-dialog modal-lg" role="document"> + <div class="modal-dialog" role="document"> <div class="modal-content"> - <div class="modal-body"> - Something happened. - </div> - <div class="modal-footer"> - <button type="button" class="btn btn-default" data-dismiss="modal"> - <span class="glyphicon glyphicon-ok"></span> Got it - </button> + <div class="modal-body alert <?=$mod->getNoticeModalAlertClass()?>" style="margin: 0;"> + <h1 class="text-center"><span class="<?=$mod->getNoticeModalGlyphicon()?>"></span></h1> + <h5 class="text-center">Something Happened</h5> + + <?php if ($mod->isError()) { ?> + <p> + <?php foreach ($mod->errorlist as $err) { ?> + <span class="label label-danger">Error</span> <?=$err?><br /> + <?php } ?> + </p> + <?php } ?> + + <?php if ($mod->isWarning()) { ?> + <p> + <?php foreach ($mod->warninglist as $warn) { ?> + <span class="label label-warning">Warning</span> <?=$warn?><br /> + <?php } ?> + </p> + <?php } ?> + + <?php if ($mod->isNotice()) { ?> + <p> + <?php foreach ($mod->noticelist as $note) { ?> + <span class="label label-info">Notice</span> <?=$note?><br /> + <?php } ?> + </p> + <?php } ?> + + <div class="text-center"> + <button type="button" class="btn btn-default" data-dismiss="modal"> + <span class="glyphicon glyphicon-ok"></span> Got it + </button> + </div> </div> + </div> </div> </div> |