var i = 0; var childList = ''; var childKey = ''; var childName = ''; var childID = 0; var cList = ''; var classAttr = ''; var key = arguments.NodeName & '^' & arguments.NodeID; var currentNodeID = arguments.parentChildAssocArray[key].id; var indAttr = ''; var ind = ''; var childArray = ArrayNew(1); if( NOT StructKeyExists(request, 'ProcessedNodes') ) request.processedNodes = StructNew(); // Make sure we have NOT already processed this node if( NOT StructKeyExists(request.processedNodes, currentNodeID) ) { // record that we have processed this node request.processedNodes[currentNodeID] = StructNew(); if( currentNodeID eq arguments.ActiveNodeIDs ) // Only show if one classAttr = 'class="active-local"'; // if Industries List Associative Array was past, put out data-industry attribute with comma delimitted list // of industry IDs indAttr = ' data-industry=""'; ind = StructKeyList( arguments.IndustriesListAssocArray ); if( ListLen( ind ) ) { if( StructKeyExists( arguments.IndustriesListAssocArray, currentNodeID ) AND StructKeyExists( arguments.IndustriesListAssocArray[currentNodeID],'industriesList' ) ) { indAttr = ' data-industry="#arguments.IndustriesListAssocArray[currentNodeID].industriesList#"'; } } // begin rendering the list WriteOutput('
    '); WriteOutput( '
  • Overview
  • ' ); // Determine if there are children // writeDump( arguments.parentChildAssocArray ); if( StructKeyExists( arguments.parentChildAssocArray, key ) AND StructKeyExists( arguments.parentChildAssocArray[key],'children') ) { // sort the children - returns a sorted array childArray = StructSort( arguments.parentChildAssocArray[key].children,"textnocase","asc","sort_text" ); // writeDump(childArray); if( ArrayLen(childArray) ) { // loop over children for( i=1; i lte ArrayLen(childArray); i=i+1 ) { childKey = childArray[i]; childName = ListFirst(ChildKey,'^'); childID = ListLast(ChildKey,'^'); // if( StructKeyExists(arguments.parentChildAssocArray, ChildKey) ) // childID = arguments.parentChildAssocArray[ChildKey].id; // else // childID = '0'; // Render children if( ListFind( arguments.ActiveNodeIDs, childID ) ) classAttr = 'class="active-local"'; else classAttr = ''; // if Industries List Associative Array was past, put out data-industry attribute with comma delimitted list // of industry IDs indAttr = ' data-industry=""'; if( ListLen( ind ) ) { if( StructKeyExists( arguments.IndustriesListAssocArray, childID ) AND StructKeyExists( arguments.IndustriesListAssocArray[childID],'industriesList' ) ) { indAttr = ' data-industry="#arguments.IndustriesListAssocArray[childID].industriesList#"'; } } // Check if node has children if( StructKeyExists( arguments.parentChildAssocArray, childKey ) ) { cList = StructKeyList( arguments.parentChildAssocArray[childKey].children ); if( cList eq '' ) // no children WriteOutput('
  • #Trim(childName)#
  • '); else // has children { WriteOutput('
  • #Trim(childName)#'); // recursively call children renderPracticeAreaNodeAndChildren( parentChildAssocArray=arguments.parentChildAssocArray, NodeID=ChildID, NodeName=ChildName, ActiveNodeIDs=arguments.ActiveNodeIDs, IndustriesListAssocArray=arguments.IndustriesListAssocArray ); WriteOutput('
  • '); } } } } } } WriteOutput('
');