added profile "inline" menus as a way of extending the user profile display
This commit is contained in:
@@ -48,6 +48,18 @@ if (user.isAnonymous())
|
||||
loader = cast.queryDialogLoader(req);
|
||||
dlg = loader.loadDialogResource("user_profile.dlg.xml");
|
||||
|
||||
// Load the profile menu.
|
||||
mprov = vcast.queryMenuProvider(req_help.getRequestObject(Namespaces.DYNAMO_OBJECT_NAMESPACE,"venice-menus"));
|
||||
menu = mprov.getInlineMenu(user,VeniceNamespaces.USER_PROFILE_NAMESPACE,"user.profile.menu",cast.newIntArray(0));
|
||||
if (menu.getItemCount()>1)
|
||||
{ // set up the menu properly
|
||||
menu.setVariable("target",stringutils.encodeURL(target));
|
||||
menu.setSelectedIndex(0);
|
||||
|
||||
} // end if
|
||||
else // don't display the menu
|
||||
menu = null;
|
||||
|
||||
if (req_help.isVerb("GET"))
|
||||
{ // Get the privacy settings and admin flags.
|
||||
priv = cast.toOptionSet(user.getObject(VeniceNamespaces.USER_PROFILE_NAMESPACE,"privacy"));
|
||||
@@ -113,7 +125,7 @@ if (req_help.isVerb("GET"))
|
||||
dlg.setRenderParam("rtgt",stringutils.encodeURL(target));
|
||||
vlib.setLocation(req,target);
|
||||
vlib.setDisplayLogin(req,false);
|
||||
dynamo.scriptReturn(new FrameDialog(dlg));
|
||||
dynamo.scriptReturn(new FrameDialog(dlg,menu,null));
|
||||
|
||||
} // end if
|
||||
|
||||
@@ -164,7 +176,7 @@ catch (e)
|
||||
dlg.setRenderParam("rtgt",stringutils.encodeURL(target));
|
||||
vlib.setLocation(req,target);
|
||||
vlib.setDisplayLogin(req,false);
|
||||
dynamo.scriptReturn(new FrameDialog(dlg));
|
||||
dynamo.scriptReturn(new FrameDialog(dlg,menu,null));
|
||||
|
||||
} // end catch
|
||||
|
||||
|
||||
Reference in New Issue
Block a user