Provides a widget-like information and utility block to be applied to all registry apps at Rapporteket. Contains the user name, organization and logout/exit as hyperlinked text.
appNavbarUserWidget(
user = "Undefined person",
organization = "Undefined organization",
addUserInfo = FALSE,
selectOrganization = FALSE,
namespace = NULL
)
Ready made html script
String providing the name of the user
String providing the organization of the user
Logical defining whether a user data pop-up is to be part of the widget (TRUE) or not (FALSE, default)
Logical if organization can be selected.
Character string providing the namespace to use, if any.
Defaults is NULL
in which case no namespace will be applied.
Normally, user information will be be provided through the session parameter
and hence this will have to be provided from the server. The "rendering" of
this info must hence be done within a layout element at the client such as
a tabPanel
. Selecting any one of them should be fine... At the
client, both uiOutput
and textOutput
will be fine "rendering
the information provided by the server.
Example of use in shiny (pseudo code):
server <- function(input, output, session) {
...
output$appUserName <- renderText(getUserName(session))
output$appUserOrg <- renderText(getUserReshId(session))
...
}ui <- tagList(
navbarPage(
...,
tabPanel(...,
appNavbarUserWidget(user = uiOutput(appUserName),
organization = textOutput(appUserOrg))
),
...
)
)