diff options
author | Malf Furious <m@lfurio.us> | 2016-03-06 14:30:01 -0500 |
---|---|---|
committer | Malf Furious <m@lfurio.us> | 2016-03-27 20:16:32 -0400 |
commit | 3168dceb5434ac8a6f0bd397712019597ea2dd4c (patch) | |
tree | fa60c6abc7e4c0b0c0ee129284bbbd73304a20ce | |
parent | 7df5bfb84ac979e26cd23042bc8bbcf53d3f6ae6 (diff) | |
download | scrott-3168dceb5434ac8a6f0bd397712019597ea2dd4c.tar.gz scrott-3168dceb5434ac8a6f0bd397712019597ea2dd4c.zip |
Add function getCurrentUserGlyphicon() to Common model
This helps render data for the common topp view (navbar). This function will return the glyphicon to use next to the current user's name.
-rw-r--r-- | app/model/common.mod.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/model/common.mod.php b/app/model/common.mod.php index d4270d8..e52230d 100644 --- a/app/model/common.mod.php +++ b/app/model/common.mod.php @@ -4,6 +4,19 @@ require_once "model/master.mod.php"; class CommonModel extends MasterModel { + /* + * Get the glyphicon to use for the logged in user (user or admin) + */ + function getCurrentUserGlyphicon() + { + if (!$this->getCurrentUser()) + return ""; + + if ($this->getCurrentUser()->admin == 1) + return "glyphicon glyphicon-sunglasses"; + else + return "glyphicon glyphicon-user"; + } } ?> |