- Timestamp:
- Apr 19, 2012, 10:49:43 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/configuration.php
r14221 r14228 249 249 load_conf_from_db(); 250 250 } 251 elseif (isset($_POST['restore_settings'])) 252 { 253 ImageStdParams::set_and_save( ImageStdParams::get_default_sizes() ); 254 pwg_query('DELETE FROM '.CONFIG_TABLE.' WHERE param = \'disabled_derivatives\''); 255 clear_derivative_cache(); 256 } 251 257 252 258 //----------------------------------------------------- template initialization -
trunk/admin/themes/default/template/configuration.tpl
r14221 r14228 31 31 {/literal}{/footer_script} 32 32 33 <div class="titrePage"> 34 <h2>{'Piwigo configuration'|@translate} {$TABSHEET_TITLE}</h2> 35 </div> 33 <h2>{'Piwigo configuration'|@translate} {$TABSHEET_TITLE}</h2> 36 34 37 35 {if !isset($default)} … … 315 313 jQuery(".sizeDetails").show(); 316 314 jQuery(this).css("visibility", "hidden"); 315 return false; 317 316 }); 318 317 … … 320 319 {/literal}{/footer_script} 321 320 322 {html_head}{literal} 323 <style type="text/css"> 321 {html_style}{literal} 324 322 input[type="text"].dError {border-color:#ff7070; background-color:#FFe5e5;} 325 323 .dErrorDesc {background-color:red; color:white; padding:0 5px;border-radius:10px; font-weight:bold;cursor:help;} … … 331 329 .sizeDetails {display:none;margin-left:10px;} 332 330 .sizeEditOpen {margin-left:10px;} 333 </style> 334 {/literal}{/html_head} 331 {/literal}{/html_style} 335 332 336 333 <fieldset id="sizesConf"> … … 644 641 645 642 {if !isset($default)} 646 <p class="formButtons"> 647 <input class="submit" type="submit" name="submit" value="{'Save Settings'|@translate}"> 648 </p> 643 <p class="formButtons"> 644 <input type="submit" name="submit" value="{'Save Settings'|@translate}"> 645 {if isset($sizes)} 646 <input type="submit" name="restore_settings" value="{'Restore'|@translate}" onclick="return confirm('{'Are you sure?'|@translate|@escape:javascript}');"> 647 {/if} 648 </p> 649 649 </form> 650 650 {/if} -
trunk/include/derivative_std_params.inc.php
r13736 r14228 113 113 else 114 114 { 115 self::make_default(); 115 self::$watermark = new WatermarkParams(); 116 self::$type_map = self::get_default_sizes(); 116 117 } 117 118 self::build_maps(); … … 142 143 } 143 144 144 private static function make_default() 145 { 146 self::$watermark = new WatermarkParams(); 147 self::$type_map[IMG_SQUARE] = new DerivativeParams( SizingParams::square(120,120) ); 148 self::$type_map[IMG_THUMB] = new DerivativeParams( SizingParams::classic(144,144) ); 149 self::$type_map[IMG_XXSMALL] = new DerivativeParams( SizingParams::classic(240,240) ); 150 self::$type_map[IMG_XSMALL] = new DerivativeParams( SizingParams::classic(432,324) ); 151 self::$type_map[IMG_SMALL] = new DerivativeParams( SizingParams::classic(576,432) ); 152 self::$type_map[IMG_MEDIUM] = new DerivativeParams( SizingParams::classic(792,594) ); 153 self::$type_map[IMG_LARGE] = new DerivativeParams( SizingParams::classic(1008,756) ); 154 self::$type_map[IMG_XLARGE] = new DerivativeParams( SizingParams::classic(1224,918) ); 155 self::$type_map[IMG_XXLARGE] = new DerivativeParams( SizingParams::classic(1656,1242) ); 145 static function get_default_sizes() 146 { 147 $arr = array( 148 IMG_SQUARE => new DerivativeParams( SizingParams::square(120,120) ), 149 IMG_THUMB => new DerivativeParams( SizingParams::classic(144,144) ), 150 IMG_XXSMALL => new DerivativeParams( SizingParams::classic(240,240) ), 151 IMG_XSMALL => new DerivativeParams( SizingParams::classic(432,324) ), 152 IMG_SMALL => new DerivativeParams( SizingParams::classic(576,432) ), 153 IMG_MEDIUM => new DerivativeParams( SizingParams::classic(792,594) ), 154 IMG_LARGE => new DerivativeParams( SizingParams::classic(1008,756) ), 155 IMG_XLARGE => new DerivativeParams( SizingParams::classic(1224,918) ), 156 IMG_XXLARGE => new DerivativeParams( SizingParams::classic(1656,1242) ), 157 ); 158 foreach($arr as $params) 159 { 160 $params->last_mod_time = time(); 161 } 162 return $arr; 156 163 } 157 164
Note: See TracChangeset
for help on using the changeset viewer.