@@ -145,10 +145,13 @@ public function getDirectories($path)
145145 $ arr_dir = [];
146146
147147 foreach ($ all_directories as $ directory ) {
148- $ dir_name = $ this ->getFileName ($ directory );
148+ $ directory_name = $ this ->getName ($ directory );
149149
150- if ($ dir_name ['short ' ] !== $ thumb_folder_name ) {
151- $ arr_dir [] = $ dir_name ;
150+ if ($ directory_name !== $ thumb_folder_name ) {
151+ $ arr_dir [] = (object )[
152+ 'name ' => $ directory_name ,
153+ 'path ' => $ this ->getInternalPath ($ directory )
154+ ];
152155 }
153156 }
154157
@@ -174,7 +177,17 @@ public function getUserSlug()
174177 return empty (auth ()->user ()) ? '' : auth ()->user ()->$ slug_of_user ;
175178 }
176179
177- public function getFileName ($ file )
180+ public function getName ($ file )
181+ {
182+ $ lfm_file_path = $ this ->getInternalPath ($ file );
183+
184+ $ arr_dir = explode ('/ ' , $ lfm_file_path );
185+ $ file_name = end ($ arr_dir );
186+
187+ return $ file_name ;
188+ }
189+
190+ public function getInternalPath ($ file )
178191 {
179192 if ($ this ->isRunningOnWindows ()) {
180193 $ file = str_replace ('\\' , '/ ' , $ file );
@@ -183,11 +196,7 @@ public function getFileName($file)
183196 $ working_dir_start = $ lfm_dir_start + strlen ($ this ->getPathPrefix ('dir ' ));
184197 $ lfm_file_path = substr ($ file , $ working_dir_start );
185198
186- $ arr_dir = explode ('/ ' , $ lfm_file_path );
187- $ arr_filename ['short ' ] = end ($ arr_dir );
188- $ arr_filename ['long ' ] = str_replace ('// ' , '/ ' , '/ ' . $ lfm_file_path );
189-
190- return $ arr_filename ;
199+ return str_replace ('// ' , '/ ' , '/ ' . $ lfm_file_path );
191200 }
192201
193202 public function error ($ error_type , $ variables = [])
0 commit comments