Changeset 29928


Ignore:
Timestamp:
10/08/14 16:21:48 (6 years ago)
Author:
JanisV
Message:

Native proportions for thumbnails can be enabled

Location:
extensions/Fotorama
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • extensions/Fotorama/admin.php

    r29918 r29928  
    2020    'resize' => isset($_POST['resize']), 
    2121    'info_button' => isset($_POST['info_button']), 
     22    'square_thumb' => isset($_POST['square_thumb']), 
    2223    ); 
    2324  if (isset($_POST['allowfullscreen'])) 
  • extensions/Fotorama/language/en_UK/plugin.lang.php

    r29918 r29928  
    2222$lang['milliseconds'] = 'milliseconds'; 
    2323$lang['Add image info button'] = 'Add image info button'; 
     24$lang['Thumbnail is a square (when present)'] = 'Thumbnail is a square (when present)'; 
    2425 
    2526?> 
  • extensions/Fotorama/language/ru_RU/plugin.lang.php

    r29918 r29928  
    2222$lang['milliseconds'] = 'миллисекунд'; 
    2323$lang['Add image info button'] = 'Добавить кнопку информации об изображении'; 
     24$lang['Thumbnail is a square (when present)'] = 'Квадратные миниатюры (когда присутствуют)'; 
    2425 
    2526?> 
  • extensions/Fotorama/main.inc.php

    r29918 r29928  
    5656        $conf['Fotorama']['period'] = 4000; 
    5757    $conf['Fotorama']['info_button'] = false; 
     58    $conf['Fotorama']['square_thumb'] = true; 
    5859  } 
    5960} 
     
    142143        $row['derivative_big'] = $row['src_image']; 
    143144      } 
    144 //      $row['derivative_thumb'] = DerivativeImage::get_one(IMG_SQUARE, $row['src_image']); 
    145       $thumb_params = ImageStdParams::get_custom($conf['Fotorama']['thumbheight'], $conf['Fotorama']['thumbheight'], 1, $conf['Fotorama']['thumbheight'], $conf['Fotorama']['thumbheight']); 
     145 
     146      if ($conf['Fotorama']['square_thumb']) 
     147      { 
     148        $thumb_params = ImageStdParams::get_custom($conf['Fotorama']['thumbheight'], $conf['Fotorama']['thumbheight'], 1, $conf['Fotorama']['thumbheight'], $conf['Fotorama']['thumbheight']); 
     149      } 
     150      else 
     151      { 
     152        $thumb_params = ImageStdParams::get_custom(9999, $conf['Fotorama']['thumbheight']); 
     153      } 
    146154      $row['derivative_thumb'] = new DerivativeImage($thumb_params, $row['src_image']);; 
    147155      if ($row['derivative_thumb'] == null) 
  • extensions/Fotorama/maintain.inc.php

    r29918 r29928  
    2727    'period' => 4000, 
    2828    'info_button' => false, 
     29    'square_thumb' => true, 
    2930  ); 
    3031 
  • extensions/Fotorama/template/admin.tpl

    r29918 r29928  
    9494    </label> 
    9595    <input type="number" size="2" maxlength="3" name="thumbheight" id="thumbheight" value="{$Fotorama.thumbheight}" min="5" max="300" style="width: 50px;">&nbsp;px 
     96  </li> 
     97  <li> 
     98    <input type="checkbox" id="square_thumb" name="square_thumb"{if $Fotorama.square_thumb} checked="checked"{/if}> 
     99    <label for="square_thumb"> 
     100      <b>{'Thumbnail is a square (when present)'|translate}</b> 
     101    </label> 
    96102  </li> 
    97103  <li> 
  • extensions/Fotorama/template/fotorama-content.tpl

    r29918 r29928  
    2121    data-full="{$thumbnail.derivative_big->get_url()}" data-url="{$thumbnail.url}" data-caption="{$thumbnail.TITLE}" 
    2222    {if $Fotorama.nav == 'thumbs' || $Fotorama.fullscreen_nav == 'thumbs'}data-thumb="{$thumbnail.derivative_thumb->get_url()}"{/if}> 
     23    {assign var=thumb_size value=$thumbnail.derivative_thumb->get_size()} 
     24    {if !$Fotorama.square_thumb}<img width="{$thumb_size[0]}" height="{$thumb_size[1]}">{/if} 
    2325  </a> 
    2426{/foreach} 
Note: See TracChangeset for help on using the changeset viewer.