Changeset 193

Show
Ignore:
Timestamp:
01/23/09 21:56:15 (10 months ago)
Author:
cedenoj
Message:

fixes #2890 We now display a Home link in the top black menu bar that goes to /social. Also if the user is logged in, we display a link to 'my profile'. Also fixed the annoying 1px border in the login/logout link.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • elgg/trunk/lib/templates.php

    r129 r193  
    8080    global $PAGE; 
    8181    global $CFG; 
     82    global $USER; 
    8283 
    8384    if (!empty($PAGE->setupdone)) { 
     
    103104                                  'html' => "<li><a href=\"" . $CFG->wwwroot . "_userdetails/\">" . __gettext("Settings") . "</a></li>"); 
    104105 
    105         $PAGE->menu_top[] = array( 
    106                                   'name' => 'logoff', 
    107                                   //'html' => a_href("{$CFG->wwwroot}login/logout.php", 
    108                                   //                 "Log off")); 
    109                                   'html' => "<li><a href=\"" . $CFG->wwwroot . "login/logout.php\">" . __gettext("Log off") . "</a></li>"); 
    110  
    111106        $PAGE->login[] = array( 
    112107                                  'name' => 'logoff', 
    113108                                  'html' => "<li><a href=\"" . $CFG->wwwroot . "login/logout.php\">" . __gettext("Log off") . "</a></li>"); 
     109 
     110        $PAGE->myprofile[] = array( 
     111                                  'name' => 'myprofilelink', 
     112                                  'html' => "<a href=\"".$CFG->wwwroot . $USER->username . "/profile\">" . __gettext("My Profile") . "</a>"); 
    114113    } else { 
    115114        $PAGE->login[] = array( 
    116115                                  'name' => 'login', 
    117116                                  'html' => "<li><a href=\"" . $CFG->wwwroot . "login/index.php\">" . __gettext("Log in") . "</a></li>"); 
     117 
     118        $PAGE->myprofile[] = array( 
     119                                  'name' => 'myprofilelink', 
     120                                  'html' => ""); 
    118121    } 
    119122 
     
    928931            break; 
    929932 
     933        case 'myprofile': 
     934                $result =  templates_draw(array( 
     935                                            'myprofileitems' => menu_join('', $PAGE->myprofile), 
     936                                            'context' => 'myprofile' 
     937                                            )); 
     938            break; 
     939 
    930940        case "url": 
    931941            $result =  url; 
  • elgg/trunk/mod/template/lib/default_template.php

    r130 r193  
    2626                                                            '{{topmenu}}' => __gettext("Status menu"), 
    2727                                                            '{{login}}' => __gettext("Login/Logout links"), 
     28                                                            '{{myprofile}}' => __gettext("My Profile links"), 
    2829                                                            '{{mainbody}}' => __gettext("Main body"), 
    2930                                                            '{{sidebar}}' => __gettext("Sidebar") 
     
    235236 
    236237    $template_definition[] = array( 
     238                                    'id' => 'myprofile', 
     239                                    'name' => __gettext("My Profile Link"), 
     240                                    'description' => __gettext("It displays a my profile link on the top black menu bar when the user is logged in."), 
     241                                    'glossary' => array( 
     242                                            '{{myprofileitems}}' =>  __gettext("The my profile link") 
     243                                            ) 
     244                                    ); 
     245 
     246    $template_definition[] = array( 
    237247                                    'id' => 'login', 
    238248                                    'name' => __gettext("Login/logout links shell"), 
    239249                                    'description' => __gettext("It displays a login/logout link on the top black bar if the user is logged in."), 
    240                                     'glossary' => array( 
    241                                                             '{{loginitems}}' => __gettext("The login/logout link items") 
    242                                                         ) 
    243                                     ); 
     250                                    'glossary' => __gettext("The login/logout link items") 
     251                                                         
     252                                    ); 
     253 
     254    $template['myprofile'] = <<< END 
     255        <li class="rb">{{myprofileitems}}</li> 
     256END; 
    244257 
    245258    $template['login'] = <<< END 
  • elgg/trunk/mod/toolbar/css

    r130 r193  
    22#login_links { 
    33 float:right; 
     4} 
     5#login_links li { 
     6border-right:0px; 
    47} 
    58#login_links a { 
  • elgg/trunk/mod/toolbar/lib.php

    r130 r193  
    3535        $toolbar = str_replace("{{topmenu}}", templates_variables_substitute(array(array(),"topmenu")), $toolbar); 
    3636        $toolbar = str_replace("{{login}}", templates_variables_substitute(array(array(),"login")), $toolbar); 
     37        $toolbar = str_replace("{{myprofile}}", templates_variables_substitute(array(array(),"myprofile")), $toolbar); 
    3738        if (isloggedin()) { 
    3839            $toolbar =  str_replace("{{usericon}}", "<a href=\"{$CFG->wwwroot}{$_SESSION['username']}\">" . user_icon_html($_SESSION['userid'], 50) . "</a>", $toolbar); 
  • elgg/trunk/mod/toolbar/toolbar.inc

    r130 r193  
    55<div id="topnav"> 
    66    <ul> 
    7         <li class="rb"><a href="/projects">Projects</a></li> 
    8         <li class="rb"><a href="/social">Social</a></li> 
     7        <li class="rb"><a href="/social">Home</a></li> 
     8{{myprofile}} 
    99        <li class="rb"><a href="/social/mod/marketplace">Marketplace</a></li> 
    1010        <li><a href="/request">Request a Project</a></li>