Revision 1824
Added by Dietmar almost 12 years ago
functions.php | ||
---|---|---|
222 | 222 |
return $result_list; |
223 | 223 |
} |
224 | 224 |
|
225 |
function remove_home_subs($directory = '/', $home_folders = '') |
|
226 |
{ |
|
227 |
if( ($handle = opendir(WB_PATH.MEDIA_DIRECTORY.$directory)) ) |
|
228 |
{ |
|
229 |
// Loop through the dirs to check the home folders sub-dirs are not shown |
|
230 |
while(false !== ($file = readdir($handle))) |
|
231 |
{ |
|
232 |
if($file[0] != '.' && $file != 'index.php') |
|
233 |
{ |
|
234 |
if(is_dir(WB_PATH.MEDIA_DIRECTORY.$directory.'/'.$file)) |
|
235 |
{ |
|
236 |
if($directory != '/') { |
|
237 |
$file = $directory.'/'.$file; |
|
238 |
}else { |
|
239 |
$file = '/'.$file; |
|
240 |
} |
|
241 |
foreach($home_folders AS $hf) |
|
242 |
{ |
|
243 |
$hf_length = strlen($hf); |
|
244 |
if($hf_length > 0) { |
|
245 |
if(substr($file, 0, $hf_length+1) == $hf) { |
|
246 |
$home_folders[$file] = $file; |
|
247 |
} |
|
248 |
} |
|
249 |
} |
|
250 |
$home_folders = remove_home_subs($file, $home_folders); |
|
251 |
} |
|
252 |
} |
|
253 |
} |
|
254 |
} |
|
255 |
return $home_folders; |
|
256 |
} |
|
257 |
|
|
225 | 258 |
// Function to get a list of home folders not to show |
226 | 259 |
function get_home_folders() |
227 | 260 |
{ |
... | ... | |
241 | 274 |
$home_folders[$folder['home_folder']] = $folder['home_folder']; |
242 | 275 |
} |
243 | 276 |
} |
244 |
function remove_home_subs($directory = '/', $home_folders = '') |
|
245 |
{ |
|
246 |
if( ($handle = opendir(WB_PATH.MEDIA_DIRECTORY.$directory)) ) |
|
247 |
{ |
|
248 |
// Loop through the dirs to check the home folders sub-dirs are not shown |
|
249 |
while(false !== ($file = readdir($handle))) |
|
250 |
{ |
|
251 |
if($file[0] != '.' && $file != 'index.php') |
|
252 |
{ |
|
253 |
if(is_dir(WB_PATH.MEDIA_DIRECTORY.$directory.'/'.$file)) |
|
254 |
{ |
|
255 |
if($directory != '/') { |
|
256 |
$file = $directory.'/'.$file; |
|
257 |
}else { |
|
258 |
$file = '/'.$file; |
|
259 |
} |
|
260 |
foreach($home_folders AS $hf) |
|
261 |
{ |
|
262 |
$hf_length = strlen($hf); |
|
263 |
if($hf_length > 0) { |
|
264 |
if(substr($file, 0, $hf_length+1) == $hf) { |
|
265 |
$home_folders[$file] = $file; |
|
266 |
} |
|
267 |
} |
|
268 |
} |
|
269 |
$home_folders = remove_home_subs($file, $home_folders); |
|
270 |
} |
|
271 |
} |
|
272 |
} |
|
273 |
} |
|
274 |
return $home_folders; |
|
275 |
} |
|
276 | 277 |
$home_folders = remove_home_subs('/', $home_folders); |
277 | 278 |
} |
278 | 279 |
return $home_folders; |
... | ... | |
289 | 290 |
{ |
290 | 291 |
$path = str_replace($vars, '', $path); |
291 | 292 |
} |
292 |
|
|
293 | 293 |
/* |
294 | 294 |
* @param object &$wb: $wb from frontend or $admin from backend |
295 | 295 |
* @return array: list of ro-dirs |
Also available in: Unified diff
! update media in look to the changes in user management