From 0569a4b633298e87d1f41f481c5d240d26aba2ab Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Sat, 2 Mar 2013 16:28:46 +0000 Subject: [PATCH] Remove redundant full tree code No longer need to consider depths as we are getting folder/file listings for 1 branch at a time. For this reason, the opening UL will always be block and the closing one shown when it's the last item and $GET location is available (ie, not the root). --- lib/get-branch.php | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/lib/get-branch.php b/lib/get-branch.php index decce9b..1f48150 100644 --- a/lib/get-branch.php +++ b/lib/get-branch.php @@ -6,7 +6,6 @@ if (!isset($ICEcoder['root'])) { if (!$_SESSION['loggedIn']) { header("Location: ../"); } -$lastPath=""; $fileCount=0; $fileBytes=0; $dirCount=0; @@ -45,14 +44,9 @@ for ($i=0;$i $lastDepth) {echo "\n";} - if ($thisDepth < $lastDepth) { - for ($j=$lastDepth;$j>$thisDepth;$j--) { - echo "\n"; - } + if ($i==0) {echo "
    \n";} + if ($i==count($finalArray)-1 && isset($_GET['location'])) { + echo "
\n"; } $type == "folder" ? $class = 'pft-directory' : $class = 'pft-file '.strtolower($ext); $loadParam = $type == "folder" ? "true" : "false"; @@ -60,7 +54,6 @@ for ($i=0;$i'; echo $serverType=="Linux" ? substr(sprintf('%o', fileperms($docRoot.$iceRoot.$fileFolderName)), -3) : ''; echo "\n"; - $lastPath = $fileFolderName; } if (isset($_GET['location'])) {