Changeset 10653


Ignore:
Timestamp:
04/28/11 19:16:45 (9 years ago)
Author:
patdenice
Message:

Insert upload form parameters in database during installation.
Remove prepare_upload_configuration function.

Location:
trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/functions_upload.inc.php

    r10641 r10653  
    141141 
    142142  return $upload_form_config; 
    143 } 
    144  
    145 /* 
    146  * automatic fill of configuration parameters 
    147  */ 
    148 function prepare_upload_configuration() 
    149 { 
    150   global $conf; 
    151  
    152   $inserts = array(); 
    153    
    154   foreach (get_upload_form_config() as $param_shortname => $param) 
    155   { 
    156     $param_name = 'upload_form_'.$param_shortname; 
    157    
    158     if (!isset($conf[$param_name])) 
    159     { 
    160       $conf[$param_name] = $param['default']; 
    161        
    162       array_push( 
    163         $inserts, 
    164         array( 
    165           'param' => $param_name, 
    166           'value' => boolean_to_string($param['default']), 
    167           ) 
    168         ); 
    169     } 
    170   } 
    171    
    172   if (count($inserts) > 0) 
    173   { 
    174     mass_inserts( 
    175       CONFIG_TABLE, 
    176       array_keys($inserts[0]), 
    177       $inserts 
    178       ); 
    179   } 
    180143} 
    181144 
  • trunk/admin/photos_add.php

    r10641 r10653  
    4444// |                          Load configuration                           | 
    4545// +-----------------------------------------------------------------------+ 
    46  
    47 prepare_upload_configuration(); 
    4846 
    4947$upload_form_config = get_upload_form_config(); 
  • trunk/admin/thumbnail.php

    r10571 r10653  
    3030// |                          Load configuration                           | 
    3131// +-----------------------------------------------------------------------+ 
    32 prepare_upload_configuration(); 
    33  
    3432$upload_form_config = get_upload_form_config(); 
    3533 
  • trunk/include/ws_functions.inc.php

    r10641 r10653  
    14511451 
    14521452  include_once(PHPWG_ROOT_PATH.'admin/include/functions_upload.inc.php'); 
    1453   prepare_upload_configuration(); 
    14541453 
    14551454  $image_id = add_uploaded_file( 
  • trunk/install/config.sql

    r10511 r10653  
    5151INSERT INTO piwigo_config (param,value,comment) VALUES ('week_starts_on','monday','Monday may not be the first day of the week'); 
    5252INSERT INTO piwigo_config (param,value,comment) VALUES ('updates_ignored','a:3:{s:7:"plugins";a:0:{}s:6:"themes";a:0:{}s:9:"languages";a:0:{}}','Extensions ignored for update'); 
     53INSERT INTO piwigo_config (param,value) VALUES ('websize_resize','true'); 
     54INSERT INTO piwigo_config (param,value) VALUES ('websize_maxwidth','800'); 
     55INSERT INTO piwigo_config (param,value) VALUES ('websize_maxheight','600'); 
     56INSERT INTO piwigo_config (param,value) VALUES ('websize_quality','95'); 
     57INSERT INTO piwigo_config (param,value) VALUES ('thumb_maxwidth','128'); 
     58INSERT INTO piwigo_config (param,value) VALUES ('thumb_maxheight','96'); 
     59INSERT INTO piwigo_config (param,value) VALUES ('thumb_quality','95'); 
     60INSERT INTO piwigo_config (param,value) VALUES ('thumb_crop','false'); 
     61INSERT INTO piwigo_config (param,value) VALUES ('thumb_follow_orientation','true'); 
     62INSERT INTO piwigo_config (param,value) VALUES ('hd_keep','true'); 
     63INSERT INTO piwigo_config (param,value) VALUES ('hd_resize','false'); 
     64INSERT INTO piwigo_config (param,value) VALUES ('hd_maxwidth','2000'); 
     65INSERT INTO piwigo_config (param,value) VALUES ('hd_maxheight','2000'); 
     66INSERT INTO piwigo_config (param,value) VALUES ('hd_quality','95'); 
Note: See TracChangeset for help on using the changeset viewer.