Ignore:
Timestamp:
Mar 9, 2013, 11:06:35 PM (11 years ago)
Author:
mistic100
Message:

add option too allow/disallow download of categories/collections/specials

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/BatchDownloader/include/install.inc.php

    r19837 r21422  
    99  if (empty($conf['batch_download']))
    1010  {
    11     $batch_download_default_config = serialize(array(
     11    $batch_download_default_config = array(
    1212      'groups'          => array(),
    1313      'level'           => 0,
     14      'what'            => array('categories','specials','collections'),
    1415      'photo_size'      => 'original',
    1516      'archive_prefix'  => 'piwigo',
     
    1819      'max_size'        => 100, /* MB */
    1920      'last_clean'      => time(),
    20       ));
     21      );
     22     
     23    $conf['batch_download'] = serialize($batch_download_default_config);
     24    $conf['batch_download_comment'] = null;
    2125   
    22     conf_update_param('batch_download', $batch_download_default_config);
    23     conf_update_param('batch_download_comment', null);
     26    conf_update_param('batch_download', $conf['batch_download']);
     27    conf_update_param('batch_download_comment', $conf['batch_download_comment']);
     28  }
     29  else
     30  {
     31    $new_conf = is_string($conf['batch_download']) ? unserialize($conf['batch_download']) : $conf['batch_download'];
    2432   
    25     $conf['batch_download'] = $batch_download_default_config;
    26     $conf['batch_download_comment'] = null;
     33    if (empty($new_conf['what']))
     34    {
     35      $new_conf['what'] = array('categories','specials','collections');
     36     
     37      $conf['batch_download'] = serialize($new_conf);
     38      conf_update_param('batch_download', $conf['batch_download']);
     39    }
    2740  }
    2841
Note: See TracChangeset for help on using the changeset viewer.