Changeset 25746 for trunk/include


Ignore:
Timestamp:
Nov 28, 2013, 10:10:37 PM (10 years ago)
Author:
rvelices
Message:

remove reminescences of pre multi size ...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/calendar_monthly.class.php

    r25507 r25746  
    420420
    421421      list($cell_width, $cell_height) = ImageStdParams::get_by_type(IMG_SQUARE)->sizing->ideal_size;
    422       if ($cell_width>120)
    423       {
    424         $cell_width = $cell_height = 120;
    425       }
    426422
    427423      $tpl_weeks    = array();
     
    456452        else
    457453        {
    458           list($tn_width,$tn_height) = $items[$day]['derivative']->get_size();
    459 
    460           // now need to fit the thumbnail of size tn_size within
    461           // a cell of size cell_size by playing with CSS position (left/top)
    462           // and the width and height of <img>.
    463           $ratio_w = $tn_width/$cell_width;
    464           $ratio_h = $tn_height/$cell_height;
    465 
    466           $pos_top=$pos_left=0;
    467           $css_style = '';
    468 
    469           if ( $ratio_w>1 and $ratio_h>1)
    470           {// cell completely smaller than the thumbnail so we will let the browser
    471            // resize the thumbnail
    472             if ($ratio_w > $ratio_h )
    473             {// thumbnail ratio compared to cell -> wide format
    474               $css_style = 'height:'.$cell_height.'px;';
    475               $browser_img_width = $cell_height*$tn_width/$tn_height;
    476               $pos_left = ($browser_img_width-$cell_width)/2;
    477             }
    478             else
    479             {
    480               $css_style = 'width:'.$cell_width.'px;';
    481               $browser_img_height = $cell_width*$tn_height/$tn_width;
    482               $pos_top = ($browser_img_height-$cell_height)/2;
    483             }
    484           }
    485           else
    486           {
    487             $pos_left = ($tn_width-$cell_width)/2;
    488             $pos_top = ($tn_height-$cell_height)/2;
    489           }
    490 
    491           if ( round($pos_left)!=0)
    492           {
    493             $css_style.='left:'.round(-$pos_left).'px;';
    494           }
    495           if ( round($pos_top)!=0)
    496           {
    497             $css_style.='top:'.round(-$pos_top).'px;';
    498           }
    499454          $url = duplicate_index_url(
    500455              array(
     
    515470                'IMAGE'       => $items[$day]['derivative']->get_url(),
    516471                'U_IMG_LINK'  => $url,
    517                 'IMAGE_STYLE' => $css_style,
    518472                'IMAGE_ALT'   => $items[$day]['file'],
    519473              );
Note: See TracChangeset for help on using the changeset viewer.