Skip to content

Commit 31f5199

Browse files
Merge pull request #145 from ContentsViewer/pre
bug fix. display not all directories
2 parents 35d6f36 + 1f90b25 commit 31f5199

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

Frontend/directory-viewer.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,8 @@ function CreateNavi($parents, $current, $children, $language){
147147
else{
148148
$stack[] = $current;
149149
}
150-
151-
$stackCount = 1;
152150

153-
while($stackCount > 0){
154-
$path = array_pop($stack);
155-
$stackCount--;
156-
151+
while(!is_null($path = array_pop($stack))){
157152
if($path === true){
158153
$navi .= '</ul>';
159154
continue;
@@ -177,7 +172,6 @@ function CreateNavi($parents, $current, $children, $language){
177172
$stack[] = true;
178173

179174
$stack = array_merge($stack, array_reverse($result['subDirs']));
180-
$stackCount += count($result['subDirs']);
181175

182176
$navi .= '<ul>';
183177

@@ -189,7 +183,6 @@ function CreateNavi($parents, $current, $children, $language){
189183
$stack[] = true;
190184

191185
$stack = array_merge($stack, array_reverse($children));
192-
$stackCount += count($children);
193186

194187
$navi .= '<ul>';
195188
}

0 commit comments

Comments
 (0)