aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authormistic100 <mistic@piwigo.org>2014-01-23 19:29:42 +0000
committermistic100 <mistic@piwigo.org>2014-01-23 19:29:42 +0000
commit63f3531059a859a834676914d4d5f16fb418c9a1 (patch)
tree5593741b0c6cf86510f75a139b8f65968df13e5d /admin
parente255abf3e22962b71341310a145b071d15fd65e3 (diff)
feature 3031: add $conf['sync_exclude_folders'] parameter
git-svn-id: http://piwigo.org/svn/trunk@26928 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin')
-rw-r--r--admin/include/functions.php20
1 files changed, 13 insertions, 7 deletions
diff --git a/admin/include/functions.php b/admin/include/functions.php
index 1df6e4f45..2060e03b4 100644
--- a/admin/include/functions.php
+++ b/admin/include/functions.php
@@ -534,22 +534,28 @@ DELETE
*/
function get_fs_directories($path, $recursive = true)
{
+ global $conf;
+
$dirs = array();
$path = rtrim($path, '/');
+ $exclude_folders = array_merge(
+ $conf['sync_exclude_folders'],
+ array(
+ '.', '..', '.svn',
+ 'thumbnail', 'pwg_high',
+ 'pwg_representative',
+ )
+ );
+ $exclude_folders = array_flip($exclude_folders);
+
if (is_dir($path))
{
if ($contents = opendir($path))
{
while (($node = readdir($contents)) !== false)
{
- if ($node != '.'
- and $node != '..'
- and $node != '.svn'
- and $node != 'thumbnail'
- and $node != 'pwg_high'
- and $node != 'pwg_representative'
- and is_dir($path.'/'.$node))
+ if (is_dir($path.'/'.$node) and !isset($exclude_folders[$node]))
{
$dirs[] = $path.'/'.$node;
if ($recursive)