Changeset 26308
- Timestamp:
- Dec 29, 2013, 11:02:14 AM (10 years ago)
- Location:
- extensions/header_manager
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/header_manager/admin/add.php
r26298 r26308 13 13 { 14 14 include_once(HEADER_MANAGER_PATH . 'include/banner.class.php'); 15 16 $conf['header_manager']['keep_ratio'] = isset($_POST['keep_ratio']); 17 conf_update_param('header_manager', serialize($conf['header_manager'])); 15 18 16 19 $banner = get_banner($_POST['picture_file']); … … 118 121 'picture' => $picture, 119 122 'crop' => hm_get_crop_display($picture), 123 'keep_ratio' => $conf['header_manager']['keep_ratio'], 120 124 )); 121 125 } -
extensions/header_manager/admin/template/add.tpl
r26299 r26308 17 17 boxHeight: {$crop.box_height}, 18 18 trueSize: [{$picture.width}, {$picture.height}], 19 aspectRatio: {$crop.real_width}/{$crop.real_height},19 {if $keep_ratio}aspectRatio: {$crop.real_width}/{$crop.real_height},{/if} 20 20 setSelect: [{$crop.l}, {$crop.t}, {$crop.r}, {$crop.b}], 21 21 onChange: function(sel) { … … 37 37 function() { 38 38 jcrop_api = this; 39 {if $keep_ratio}jQuery(".jcrop-holder").addClass('fixed-ratio');{/if} 39 40 }); 40 41 … … 46 47 jcrop_api.release(); 47 48 } 49 jQuery(".jcrop-holder").toggleClass('fixed-ratio'); 48 50 }); 49 51 }()); … … 60 62 <li><b>{'Width'|translate}:</b> <span id="width"></span>px</li> 61 63 <li><b>{'Height'|translate}:</b> <span id="height"></span>px</li> 62 <li><label><input type="checkbox" name="keep_ratio" checked> {'Respect %s aspect ratio'|translate:($crop.desired_width|cat:'/'|cat:$crop.desired_height)}</label></li>64 <li><label><input type="checkbox" name="keep_ratio" {if $keep_ratio}checked{/if}> {'Respect %s aspect ratio'|translate:($crop.desired_width|cat:'/'|cat:$crop.desired_height)}</label></li> 63 65 </ul> 64 66 -
extensions/header_manager/admin/template/style.css
r24010 r26308 62 62 vertical-align:middle; 63 63 } 64 65 .jcrop-holder.fixed-ratio .ord-s, 66 .jcrop-holder.fixed-ratio .ord-n, 67 .jcrop-holder.fixed-ratio .ord-e, 68 .jcrop-holder.fixed-ratio .ord-w { 69 display:none; 70 } -
extensions/header_manager/include/banner.class.php
r26298 r26308 51 51 return $this->get_resize_result($destination_filepath, $crop['width'], $crop['height'], $starttime); 52 52 } 53 54 private function get_resize_result($destination_filepath, $width, $height, $time=null)55 {56 return array(57 'source' => $this->source_filepath,58 'destination' => $destination_filepath,59 'width' => $width,60 'height' => $height,61 'size' => floor(filesize($destination_filepath) / 1024).' KB',62 'time' => $time ? number_format((get_moment() - $time) * 1000, 2, '.', ' ').' ms' : null,63 'library' => $this->library,64 );65 }66 53 } -
extensions/header_manager/maintain.inc.php
r26298 r26308 12 12 'display' => 'image_only', 13 13 'banner_on_picture' => true, 14 'keep_ratio' => true 14 15 ); 15 16 … … 27 28 { 28 29 $new_conf = is_string($conf['header_manager']) ? unserialize($conf['header_manager']) : $conf['header_manager']; 30 29 31 if (!isset($new_conf['banner_on_picture'])) 30 32 { 31 33 $new_conf['banner_on_picture'] = true; 32 $conf['header_manager'] = serialize($new_conf);33 conf_update_param('header_manager', $conf['header_manager']);34 34 } 35 else if (!isset($new_conf['keep_ratio'])) 36 { 37 $new_conf['keep_ratio'] = true; 38 } 39 40 $conf['header_manager'] = serialize($new_conf); 41 conf_update_param('header_manager', $conf['header_manager']); 35 42 } 36 43
Note: See TracChangeset
for help on using the changeset viewer.