'Custom Top Menu'

@classmethod
def menu_top(cls, **attr):

    auth = current.auth
    if (not auth.is_logged_in()):
        self_registration = current.deployment_settings.get_security_registration_visible()
        request = current.request
        login_next = URL(args=request.args, vars=request.vars)
        if ((request.controller == 'default') and (request.function == 'user') and ('_next' in request.get_vars)):
            login_next = request.get_vars['_next']
        menu_top = MT()(MT('Login', c='default', f='user', m='login', _id='auth_menu_login', vars=dict(_next=login_next), **attr), MT('Register', c='default', f='index', args='register'), MT('About', c='default', f='index', args='about'), MT('User    Manual', url=('static', 'themes', 'DRRPP', 'DRR_Portal_User_Manual.pdf')), MT('Contact', c='default', f='index', args='contact'))
    else:
        user = auth.user
        welcome = ('Welcome    %s    %s' % (user.first_name, user.last_name))
        s3_has_role = auth.s3_has_role
        system_roles = auth.get_system_roles()
        ADMIN = system_roles.ADMIN
        ORG_ADMIN = system_roles.ORG_ADMIN
        menu_top = MT()(MT(welcome, c='default', f='user', translate=False, link=False, _id='auth_menu_email', **attr), MT('Administration', c='default', f='index', args='admin', check=(s3_has_role(ADMIN) | s3_has_role(ORG_ADMIN))), MT('Logout', c='default', f='user', args='logout', _id='auth_menu_logout'), MT('About', c='default', f='index', args='about'), MT('User    Manual', url=('static', 'themes', 'DRRPP', 'DRR_Portal_User_Manual.pdf')), MT('Contact', c='default', f='index', args='contact'))
    return menu_top
