Skip to content

Commit

Permalink
Add recursive option
Browse files Browse the repository at this point in the history
  • Loading branch information
T1l3 committed Apr 19, 2016
1 parent 37f9d6d commit daf615f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion modules/redactor_imagemanager/redactor_imagemanager.module
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function redactor_imagemanager_list($wysiwyg_profile) {
$files = file_scan_directory(
$config['upload_dir'], '/\.(' . join(drupal_explode_tags($config['extensions']), '|') . ')$/',
array(
'recurse' => false
'recurse' => $config['recursive']
)
);

Expand All @@ -131,6 +131,7 @@ function redactor_imagemanager_redactor_plugins($editor) {
'config' => array(
'extensions' => 'jpg, png, gif, jpeg',
'upload_dir' => 'public://',
'recursive' => false,
),
),
);
Expand Down Expand Up @@ -194,5 +195,12 @@ function redactor_imagemanager_form_wysiwyg_profile_form_alter(&$form, &$form_st
'#default_value' => !empty($profile->settings['imagemanager']['upload_dir']) ? $profile->settings['imagemanager']['upload_dir'] : NULL,
'#description' => 'directory where image will be uploaded'
);

$form['imagemanager']['recursive'] = array(
'#type' => 'checkbox',
'#title' => 'Recursive image directory',
'#default_value' => !empty($profile->settings['imagemanager']['recursive']) ? $profile->settings['imagemanager']['recursive'] : FALSE,
'#description' => 'Scan directory recursively'
);
}

0 comments on commit daf615f

Please sign in to comment.