// Use this script to display a location popup. // // Parameter: // // request The request record should have the followings field. // // WebNode The associate WenNode of this node // // data The data assoc should contain the following fields: // // Location The list of assoc. Each assoc contains location information. // NodeRec The specific node record. // NewDate The date to compare for the recurrently created item. // ModDate The date to compare for the recurrently modified item. ;;webscript LocationPopup( Record request, Assoc data, Boolean displayIcon = FALSE, Boolean infoLink = FALSE, Boolean configLink = FALSE ) ;Assoc element ;Assoc times ;Object cb ;Object configCmd ;Frame modifiedImageCallbackRegistry = $WebNode.ModifiedImageCallbackRegistry ;List location = data.Location ;Object factory = $Kernel.Factory ;Object prgCtx = .PrgSession() ;Object webNode = request.WebNode ;Object webNodeUtils = $WebNode.WebNodeUtils ;Record nodeRec = data.NodeRec ;String webdocSupport = .Module( "webdoc" ).SupportPrefix() ;Date now = prgCtx.fDBConnect.Now() ;Boolean IamMac = $WebLL.WebUtils.NoFunctionPopup( .fArgs ) ;if displayIcon `%LwebNode.IMG( nodeRec )` ;end ;Boolean Breadcrumbs = false ;if (IsDefined(request.Breadcrumbs) && request.Breadcrumbs == 'on') ;Breadcrumbs = true ;end ;if (Str.LocateI(request.QUERY_STRING,'&Breadcrumbs')) ;request.QUERY_STRING = request.QUERY_STRING[:Str.LocateI(request.QUERY_STRING,'&Breadcrumbs')-1] ;end ;if Breadcrumbs // add in a HTML Form Select Control to ensure that any functions that are looking for the control find it, // but its hidden from the user display using CSS ;for element in location // check that we have a URL, this is to solve the issue of some elements such as a Form Template that don't provide a URL // and have code on their forms to remove themselves from this list. ;if (Length(element.url)>0) // put a link in for each element and add a | delimiter if not the last item. `element.name``%L( element in location == Length( location ) ) ? "" : " | "` ;end ;end // add a link to toggle the style Show as Dropdown ;else // add a link to toggle the style Show as BreadCrumbs ;end ;if infoLink ;if ( IamMac ) ;Object infoCmd ;infoCmd = webNode.Cmd( "properties" ) `%LinfoCmd.EnabledUnescapedLink( prgCtx, request, nodeRec, infoCmd.IMG() )` ;else `[WebDoc_HTMLLabel.ActionsAlt]` ;end ;end ;if IsDefined( data.ParentInfo ) `[WebDoc_HTMLLabel.UpOneLevelAltImage]` ;end ;if configLink ;if ( IamMac ) ;configCmd = webNode.Cmd( "editconfig" ) `%LconfigCmd.EnabledUnescapedLink( prgCtx, request, nodeRec, configCmd.IMG() )` ;end ;end ;times.PrgCtx = prgCtx `%LwebNodeUtils.ModifiedIMG( now, nodeRec, times )` ;for cb in modifiedImageCallbackRegistry.Get( nodeRec.subtype ) `%Lfactory.Instance( cb ).Execute( prgCtx, request, nodeRec )` ;end ;;end