Projet

Général

Profil

Révision 7e72b748

Ajouté par Assos Assos il y a plus de 6 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/media/modules/media_bulk_upload/includes/media_bulk_upload.admin.inc
15 15
    $form['directory'] = array(
16 16
      '#type' => 'textfield',
17 17
      '#title' => t('Directory'),
18
      '#description' => t('Enter the absolute directory on the web server to look for files. Subdirectories inside this directory will not be scanned.'),
18
      '#description' => t('Enter the absolute directory on the web server to look for files. Subdirectories inside this directory will not be scanned unless the Recurse through subdirectories box is checked.'),
19 19
      '#required' => TRUE,
20 20
    );
21 21

  
22
    $form['recurse'] = array(
23
      '#type' => 'checkbox',
24
      '#title' => t('Recurse through subdirectories'),
25
      '#description' => 'Iterate over the directory looking for files within subfolders that match the pattern.',
26
    );
27

  
22 28
    $form['to_directory'] = array(
23 29
      '#type' => 'textfield',
24 30
      '#title' => t('To Directory'),
......
63 69
  if ($form_state['values']['op'] != t('Confirm')) {
64 70
    $directory = $form_state['values']['directory'];
65 71
    $pattern = $form_state['values']['pattern'];
72
    $recurse = $form_state['values']['recurse'];
66 73
    if (!is_dir($directory)) {
67 74
      form_set_error('directory', t('The provided directory does not exist.'));
68 75
    }
......
77 84
      '\\*' => '.*',
78 85
      '\\?' => '.?',
79 86
    ));
80
    $files = file_scan_directory($directory, '/^(' . $pattern_quoted . ')$/', array('recurse' => FALSE));
87
    $files = file_scan_directory($directory, '/^(' . $pattern_quoted . ')$/i', array('recurse' => $recurse));
81 88
    $files = array_keys($files);
82 89
    if (empty($files)) {
83 90
      form_set_error('pattern', t('No files were found in %directory matching the regular expression %pattern', array('%directory' => $directory, '%pattern' => $pattern_quoted)));

Formats disponibles : Unified diff