diff options
| -rw-r--r-- | app/class/user.class.php | 11 | ||||
| -rw-r--r-- | app/model/common.mod.php | 14 | ||||
| -rw-r--r-- | app/view/common/topp.view.php | 2 | 
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>  | 
