From 3168dceb5434ac8a6f0bd397712019597ea2dd4c Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Sun, 6 Mar 2016 14:30:01 -0500 Subject: 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. --- app/model/common.mod.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'app/model') 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"; + } } ?> -- cgit v1.2.3