From c6e91e88635d798cd7eed2d2ad3f52b10827fddb Mon Sep 17 00:00:00 2001 From: Garrett K Date: Tue, 23 Mar 2021 03:47:42 +0000 Subject: [PATCH] 0.3.14 --- includes/App.class.php | 101 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) diff --git a/includes/App.class.php b/includes/App.class.php index 5d989b8..a62f671 100755 --- a/includes/App.class.php +++ b/includes/App.class.php @@ -2059,6 +2059,107 @@ var $qls; // Cable inline } else { + foreach($pathArray as $pathArrayIndex => $connection) { + + // Set connectionPairID so connection can be drawn + $connectionPairID = $pathArrayIndex; + + foreach($connection as $connectionIndex => $connectionSide) { + + if(count($connectionSide)) { + // Set trunkPairID so trunk can be drawn + if($connectionIndex == 1) { + $trunkPairID++; + } + + // Generate port name(s) + $objName = ''; + $selected = false; + $populated = false; + foreach($connectionSide as $port) { + + $objID = $port['objID']; + $objFace = $port['objFace']; + $objDepth = $port['objDepth']; + $objPort = $port['objPort']; + $selected = ($port['selected'] == true) ? true : $selected; + $portDiverges = $port['portDiverges']; + $cableLength = $port['length']; + $mediaTypeID = $port['mediaTypeID']; + $connectorTypeID = $port['connectorTypeID']; + $populated = (isset($this->populatedPortArray[$objID][$objFace][$objDepth][$objPort])) ? true : $populated; + + if(!$portDiverges) { + $objName .= $this->generateObjectPortName($objID, $objFace, $objDepth, $objPort).'
'; + } + } + + // Compile port name(s) in an object box + $htmlPort = $this->wrapObject($objID, $objName, $selected, $trunkPairID); + + // Gather connector data + if($connectorTypeID) { + $portTypeName = $this->connectorTypeValueArray[$connectorTypeID]['name']; + } else { + $obj = $this->objectArray[$objID]; + $objTemplateID = $obj['template_id']; + $objCompatibility = $this->compatibilityArray[$objTemplateID][$objFace][$objDepth]; + $portTypeID = $objCompatibility['portType']; + $portTypeName = $this->portTypeValueArray[$portTypeID]['name']; + } + + // Determine if this port is connected to another + if($connectionIndex == 1) { + $connected = (count($connection[0])) ? true : false; + } else { + $connected = (count($connection[1])) ? true : false; + } + + if($connected or $populated) { + // Compile connector div + $htmlConnector = '
'; + + // Gather cable data + if($mediaTypeID) { + $mediaTypeName = $this->mediaTypeValueArray[$mediaTypeID]['name']; + } else { + $obj = $this->objectArray[$objID]; + $objTemplateID = $obj['template_id']; + $objCompatibility = $this->compatibilityArray[$objTemplateID][$objFace][$objDepth]; + $mediaTypeID = $objCompatibility['mediaType']; + $mediaTypeName = $this->mediaTypeValueArray[$mediaTypeID]['name']; + } + + // Compile cable div + $htmlCable = '
'.$cableLength.'
'.$mediaTypeName.'
'; + } else { + $htmlConnector = ''; + $htmlCable = ''; + } + + if($connectionIndex == 1) { + $htmlPathFull .= ''; + $htmlPathFull .= ''.$htmlConnector.''; + $htmlPathFull .= ''; + $htmlPathFull .= ''; + $htmlPathFull .= ''.$htmlPort.''; + $htmlPathFull .= ''; + } + + + if($connectionIndex == 0) { + $htmlPathFull .= ''; + $htmlPathFull .= ''.$htmlPort.''; + $htmlPathFull .= ''; + $htmlPathFull .= ''; + $htmlPathFull .= ''.$htmlConnector.''; + $htmlPathFull .= ''; + $htmlPathFull .= ''.$htmlCable.''; + } + } + } + } + } $htmlPathFull .= '';