Skip to content

Instantly share code, notes, and snippets.

@anniejocain
Last active October 15, 2017 15:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anniejocain/149a42cc522df2d0145ef73f5cdccb9c to your computer and use it in GitHub Desktop.
Save anniejocain/149a42cc522df2d0145ef73f5cdccb9c to your computer and use it in GitHub Desktop.
Breadcrumbs in PeopleSoft Fluid NavBar Navigator
.lplistgrid a {
padding-left: 2.4em;
}
.lplistgrid div.lplistitem.up_breadcrumb {
border-bottom: none !important;
}
.up_breadcrumb a,
.up_breadcrumb_selected a {
padding: 0.5em 0.5em 0.5em 22px;
background-color: #f9fbfd;
}
.up_breadcrumb_selected a {
background-color: #fff;
}
.lplistgrid .up_breadcrumb_selected a:link {
color: #333;
cursor: default;
}
.up_breadcrumb::before {
content: '';
width: 0;
height: 0;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-top: 6px solid #4388c5;
position: absolute;
top: 12px;
left: 4px;
}
.lplistgrid div.lplistitem.up_breadcrumb:hover,
.lplistgrid div.lplistitem.up_breadcrumb_selected:hover {
background-color: #fff;
}
.up_breadcrumb a:focus,
.up_breadcrumb_selected a:focus {
outline: none;
}
.ptnui_menu_hdr {
display: none;
}
.nbmenugb > .nui-myfav-gb {
top: 0em !important;
}
import PT_RCF:ServiceInterface;
import PTNUI:NavBarContentArea:NBContentCollection;
import PTNUI:NavBarContentArea:NBContent;
import PTUN_UNINAV:RemoteMenu:*;
class DisplayBreadcrumbs implements PT_RCF:ServiceInterface
method execute();
end-class;
/* This is a reference to the current nav bar content collection */
Component PTNUI:NavBarContentArea:NBContentCollection &ptnui_CurContentColl;
/* Use this function to get a reference to the appropriate portal */
Declare Function PortalOpen PeopleCode FUNCLIB_PORTAL.PORTAL_GEN_FUNC FieldFormula;
/* Use this function to set what shows up in the content (menu) area */
Declare Function SetContentArea PeopleCode PTNUI_DOCK_REC.PTNUI_NB_ACTION FieldFormula;
Declare Function GetLocalNodeContentURI PeopleCode PTNUI_NB_WRK.FUNCLIB FieldFormula;
method execute
/+ Extends/implements PT_RCF:ServiceInterface.execute +/
/* If the nav bar content collection is blank then return */
If None(&ptnui_CurContentColl) Then
Return;
End-If;
/* The FLDR parameter will be the folder that the user clicked on */
Local string &sFolder = %Request.GetParameter("FLDR");
Local string &RFolderLabel = %Request.GetParameter("FLDRLBL");
Local string &standalone = %Request.GetParameter("sa");
Local string &IsRemote = %Request.GetParameter("UNINAV");
Local string &RemoteNode = %Request.GetParameter("UNNODE");
Local string &RFolderList = %Request.GetParameter("RFolderList");
Local string &RFolder = %Request.GetParameter("RFolder");
/* If no folder was passed in, then the user must be a the root */
If None(&sFolder) Then
&sFolder = "PORTAL_ROOT_OBJECT";
End-If;
/* Get a reference to the current portal */
Local ApiObject &portal = PortalOpen();
Local integer &iBreadcrumbCount = 0;
/* While the parent folder exists */
While All(&sFolder)
/* If this folder is the remote root, jump back to the local menu */
If &RFolderList = &RemoteNode | ":" | &sFolder Then
&sFolder = &RFolder;
&IsRemote = "";
&RemoteNode = "";
End-If;
/* If this is a remote folder, use the remote portal registry */
If &IsRemote = "Y" Then
Local PTUN_UNINAV:RemoteMenu:RemoteMenu &objRemotePortalRegistry = create PTUN_UNINAV:RemoteMenu:RemoteMenu(&RemoteNode | ":" | &sFolder, "N");
Local string &Rurl = GetLocalNodeContentURI() | "/c/NUI_FRAMEWORK.PTNUI_MENU_COMP.GBL?sa=&FLDR=" | EscapeHTML(&sFolder) | "&FLDRLBL=" | EscapeHTML(&RFolderLabel) | "&UNINAV=Y&UNNODE=" | EscapeHTML(&RemoteNode) | "&RFolder=" | &RFolder | "&RFolderList=" | &RFolderList;
&Rurl = "javascript:PTNavBar.OpenInContentArea('" | &Rurl | "&ICDoModal=1&ICGrouplet=1', '" | &RemoteNode | ":" | &sFolder | "');";
/* Create NBContent object to represent the breadcrumb in the nav bar */
Local PTNUI:NavBarContentArea:NBContent &oRemBreadCrumb = create PTNUI:NavBarContentArea:NBContent(&sFolder, &RFolderLabel, &Rurl);
/* Set a custom style to differentiate the breadcrumbs from the normal nav bar content items */
If (&iBreadcrumbCount > 0) Then
&oRemBreadCrumb.style = "up_breadcrumb"; /* Parent breadcrumb */
Else
&oRemBreadCrumb.style = "up_breadcrumb_selected"; /* Current breadcrumb */
End-If;
/* Set the breadcrumb to show at the top of the nav bar content collection */
&ptnui_CurContentColl.InsertItemAtStart(&oRemBreadCrumb);
/* Reference the current folder's parent name and label */
&sFolder = &objRemotePortalRegistry.RFolderParentName;
&RFolderLabel = &objRemotePortalRegistry.RFolderParentLabel;
&iBreadcrumbCount = &iBreadcrumbCount + 1;
Else
/* Get a reference to the current portal registry folder object */
Local ApiObject &sParentFolder = &portal.FindFolderByName(&sFolder);
/* Generate the URL to invoke when the breadcrumb is clicked on */
Local string &sUrl = GetLocalNodeContentURI() | "/c/NUI_FRAMEWORK.PTNUI_MENU_COMP.GBL?sa=" | &standalone | "&FLDR=" | &sParentFolder.name;
If &standalone <> "y" Then
&sUrl = "javascript:PTNavBar.OpenInContentArea('" | &sUrl | "&ICDoModal=1&ICGrouplet=1', '" | &sParentFolder.name | "');";
End-If;
/* Change the label for the Root folder */
If (&sParentFolder.name = "PORTAL_ROOT_OBJECT") Then
&sParentFolder.label = "Main Menu";
End-If;
/* Create NBContent object to represent the breadcrumb in the nav bar */
Local PTNUI:NavBarContentArea:NBContent &oParentBreadCrumb = create PTNUI:NavBarContentArea:NBContent(&sParentFolder.name, &sParentFolder.label, &sUrl);
/* Set a custom style to differentiate the breadcrumbs from the normal nav bar content items */
If (&iBreadcrumbCount > 0) Then
&oParentBreadCrumb.style = "up_breadcrumb"; /* Parent breadcrumb */
Else
&oParentBreadCrumb.style = "up_breadcrumb_selected"; /* Current breadcrumb */
End-If;
/* Set the breadcrumb to show at the top of the nav bar content collection */
&ptnui_CurContentColl.InsertItemAtStart(&oParentBreadCrumb);
/* Reference the current folder's parent */
&sFolder = &sParentFolder.ParentName;
&iBreadcrumbCount = &iBreadcrumbCount + 1;
End-If;
End-While;
/* Set the content area equal to the modified nav bar content collection */
SetContentArea(&portal, &ptnui_CurContentColl);
/* Close the PortalRegistry object */
&portal.close();
end-method;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment