summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2016-03-12 23:38:18 -0500
committerMalf Furious <m@lfurio.us>2016-03-27 20:16:32 -0400
commit2936f0d151fb52bd2649edc37abd2e1d559d1f0f (patch)
tree0fd96caebbf3727038b9750d21a84c492b53f457
parent587bdef47abbf4545508cac95a0495be0d5ddaa5 (diff)
downloadscrott-2936f0d151fb52bd2649edc37abd2e1d559d1f0f.tar.gz
scrott-2936f0d151fb52bd2649edc37abd2e1d559d1f0f.zip
Move getUserGlyphicon function from common model into user class
Diffstat (limited to '')
-rw-r--r--app/class/user.class.php11
-rw-r--r--app/model/common.mod.php14
-rw-r--r--app/view/common/topp.view.php2
3 files changed, 12 insertions, 15 deletions
diff --git a/app/class/user.class.php b/app/class/user.class.php
index 7d8519e..f1f7ff1 100644
--- a/app/class/user.class.php
+++ b/app/class/user.class.php
@@ -160,6 +160,17 @@ class User extends Object
return $this->name;
}
+
+ /*
+ * Get the glyphicon to use for this user
+ */
+ function getGlyphicon()
+ {
+ if ($this->admin)
+ return "glyphicon glyphicon-sunglasses";
+
+ return "glyphicon glyphicon-user";
+ }
}
?>
diff --git a/app/model/common.mod.php b/app/model/common.mod.php
index 34ac17d..7f0302f 100644
--- a/app/model/common.mod.php
+++ b/app/model/common.mod.php
@@ -7,20 +7,6 @@ require_once "class/setting.class.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";
- }
-
- /*
* Default action
*/
function common_deflt()
diff --git a/app/view/common/topp.view.php b/app/view/common/topp.view.php
index d520e00..40ad3fe 100644
--- a/app/view/common/topp.view.php
+++ b/app/view/common/topp.view.php
@@ -24,7 +24,7 @@
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
- <span class="<?=$mod->getCurrentUserGlyphicon()?>"></span> <?=$mod->getCurrentUser()->getDisplayName()?> <span class="caret"></span>
+ <span class="<?=$mod->getCurrentUser()->getGlyphicon()?>"></span> <?=$mod->getCurrentUser()->getDisplayName()?> <span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li><a href="#" data-toggle="modal" data-target="#settingModal">Settings</a></li>