ajwillia-ms pushed a commit to branch master.

http://git.enlightenment.org/website/www.git/commit/?id=2ed90754d02b1d1803d735bfd49165d0316406b3

commit 2ed90754d02b1d1803d735bfd49165d0316406b3
Author: Andy Williams <[email protected]>
Date:   Mon Nov 20 16:35:53 2017 +0000

    layout: Save a little space in the nav bar by only outputting first names
---
 public_html/lib/tpl/e/tpl_functions.php | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/public_html/lib/tpl/e/tpl_functions.php 
b/public_html/lib/tpl/e/tpl_functions.php
index 318e56d0..b6c86a05 100644
--- a/public_html/lib/tpl/e/tpl_functions.php
+++ b/public_html/lib/tpl/e/tpl_functions.php
@@ -195,9 +195,14 @@ function _tpl_output_search_bar()
 
 function _tpl_userinfo($element='li') {
        global $INFO;
+       $names = explode(' ', $INFO['userinfo']['name']);
+       if (count($names))
+               $firstname = $names[0];
+       else
+               $firstname = $INFO['userinfo']['name'];
 
        if(isset($_SERVER['REMOTE_USER'])) {
-       echo '<li class="dropdown"><a href="#" class="dropdown-toggle" 
data-toggle="dropdown">'.hsc($INFO['userinfo']['name']).'<b 
class="caret"></b></a>';
+               echo '<li class="dropdown"><a href="#" class="dropdown-toggle" 
data-toggle="dropdown">'.hsc($firstname).'<b class="caret"></b></a>';
                echo '<ul class="dropdown-menu">';
                tpl_action('admin', 1, $element);
                tpl_action('profile', 1, $element);

-- 


Reply via email to