Changeset 28443


Ignore:
Timestamp:
05/12/14 13:13:56 (5 years ago)
Author:
plg
Message:

simpler configuration for square thumbnails (default = 250px)

Location:
extensions/modus
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/modus/admin/admin.inc.php

    r27151 r28443  
    2626        foreach ($bool_values as $k ) 
    2727                $my_conf[$k] = isset($_POST[$k]) ? true:false; 
     28   
     29  if (!isset($_POST['use_album_square_thumbs'])) 
     30  { 
     31    $my_conf['album_thumb_size'] = 0; 
     32  } 
     33   
    2834        // int/double 
    2935        $my_conf['album_thumb_size'] = max(0, $my_conf['album_thumb_size']); 
     
    3238 
    3339        global $page; 
    34         $page['infos'][] = 'options saved !'; 
     40  $page['infos'][] = l10n('Information data registered in database'); 
    3541} 
    3642 
     
    4349foreach ($bool_values as $k ) 
    4450  $template->assign( strtoupper($k), $my_conf[$k] ); 
     51 
     52// we don't use square thumbs if the thumb size is 0 
     53$template->assign('use_album_square_thumbs', 0 != $my_conf['album_thumb_size']); 
     54 
     55if (0 == $my_conf['album_thumb_size']) 
     56{ 
     57  $template->assign('ALBUM_THUMB_SIZE', 250); 
     58} 
    4559 
    4660$available_derivatives = array( ''=> 'Default'); 
  • extensions/modus/admin/modus_admin.tpl

    r27151 r28443  
     1{combine_script id='common' load='footer' path='admin/themes/default/js/common.js'} 
     2{combine_script id='jquery.ui.slider' require='jquery.ui' load='footer' path='themes/default/js/ui/minified/jquery.ui.slider.min.js'} 
     3{combine_css path="themes/default/js/ui/theme/jquery.ui.slider.css"} 
     4 
     5{html_style} 
     6.graphicalCheckbox { 
     7  font-size:16px; 
     8  line-height:16px; 
     9} 
     10 
     11.graphicalCheckbox + input { 
     12  display:none; 
     13} 
     14 
     15#album_thumb_size { 
     16  width:400px; 
     17  display:inline-block; 
     18  margin-right:10px; 
     19} 
     20 
     21#album_square_thumbs { 
     22  margin-top:5px; 
     23} 
     24{/html_style} 
     25 
     26 
     27{footer_script} 
     28jQuery(document).ready(function() { 
     29  jQuery('#modus-config input[type=checkbox]').change(function() { 
     30    jQuery(this).prev().toggleClass('icon-check icon-check-empty'); 
     31  }); 
     32 
     33  jQuery('input[name=use_album_square_thumbs]').change(function() { 
     34    jQuery('#album_square_thumbs').toggle(); 
     35  }); 
     36 
     37  jQuery("#album_thumb_size").slider({ 
     38    range: "min", 
     39    min: 200, 
     40    max: 400, 
     41    value: {$ALBUM_THUMB_SIZE}, 
     42    slide: function( event, ui ) { 
     43      jQuery("#album_thumb_size_info").html(sprintf("{'%d pixels'|translate}", ui.value)); 
     44    }, 
     45    stop: function( event, ui ) { 
     46      jQuery("input[name=album_thumb_size]").val(ui.value); 
     47    } 
     48  }); 
     49 
     50}); 
     51{/footer_script} 
     52 
    153<h2>Modus theme config</h2> 
    254 
    3 <form method="post" action=""> 
     55<form method="post" action="" id="modus-config"> 
    456 
    557 
     
    1163 
    1264<fieldset><legend>Album thumbs size</legend> 
    13 Use square thumbs of <input type="text" size="4" name="album_thumb_size" value="{$ALBUM_THUMB_SIZE}"> pixels. (Leave 0 for default theme presentation) 
     65  <label> 
     66    <span class="graphicalCheckbox icon-check{if not $use_album_square_thumbs}-empty{/if}"></span> 
     67    <input type="checkbox" name="use_album_square_thumbs"{if $use_album_square_thumbs} checked="checked"{/if}> 
     68    <b>{'Use square thumbs'|translate}</b> 
     69  </label> 
     70 
     71  <div id="album_square_thumbs"{if not $use_album_square_thumbs} style="display:none"{/if}> 
     72    <div id="album_thumb_size"></div> 
     73    <span id="album_thumb_size_info">{'%d pixels'|translate|sprintf:$ALBUM_THUMB_SIZE}</span> 
     74    <input type="hidden" name="album_thumb_size" value="{$ALBUM_THUMB_SIZE}"> 
     75  </div> 
     76 
    1477</fieldset> 
    1578 
     
    3497</fieldset> 
    3598 
    36 <p> 
    37 <input type="submit" value="Submit" /> 
     99<p class="formButtons"> 
     100<input type="submit" value="{'Save Settings'|translate}" /> 
    38101</p> 
    39102</form> 
  • extensions/modus/functions.inc.php

    r26836 r28443  
    1818  return array( 
    1919        'skin' => 'dark', 
    20         'album_thumb_size' => 0, 
     20        'album_thumb_size' => 250, 
    2121  'index_photo_deriv'=>'', 
    2222  'index_photo_deriv_hdpi'=>'', 
Note: See TracChangeset for help on using the changeset viewer.