Changeset 25746
- Timestamp:
- Nov 28, 2013, 10:10:37 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/calendar_monthly.class.php
r25507 r25746 420 420 421 421 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 }426 422 427 423 $tpl_weeks = array(); … … 456 452 else 457 453 { 458 list($tn_width,$tn_height) = $items[$day]['derivative']->get_size();459 460 // now need to fit the thumbnail of size tn_size within461 // 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 browser471 // resize the thumbnail472 if ($ratio_w > $ratio_h )473 {// thumbnail ratio compared to cell -> wide format474 $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 else479 {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 else486 {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 }499 454 $url = duplicate_index_url( 500 455 array( … … 515 470 'IMAGE' => $items[$day]['derivative']->get_url(), 516 471 'U_IMG_LINK' => $url, 517 'IMAGE_STYLE' => $css_style,518 472 'IMAGE_ALT' => $items[$day]['file'], 519 473 ); -
trunk/themes/default/template/month_calendar.tpl
r25232 r25746 1 {if !empty($chronology_navigation_bars) 1 {if !empty($chronology_navigation_bars)} 2 2 {foreach from=$chronology_navigation_bars item=bar} 3 3 <div class="calendarBar"> … … 23 23 {/if} 24 24 25 {if !empty($chronology_calendar.calendar_bars) 25 {if !empty($chronology_calendar.calendar_bars)} 26 26 {foreach from=$chronology_calendar.calendar_bars item=bar} 27 27 <div class="calendarCalBar"> … … 41 41 {/if} 42 42 43 {if isset($chronology_calendar.month_view) 43 {if isset($chronology_calendar.month_view)} 44 44 <table class="calMonth"> 45 45 <thead> … … 51 51 </thead> 52 52 {html_style} 53 TABLE.calMonth TBODY TD, TABLE.calMonth TBODY TD DIV.calImg{53 .calMonth TD, .calMonth .calImg{ 54 54 width:{$chronology_calendar.month_view.CELL_WIDTH}px;height:{$chronology_calendar.month_view.CELL_HEIGHT}px 55 55 } … … 64 64 <div class="calImg"> 65 65 <a href="{$day.U_IMG_LINK}"> 66 <img s tyle="{$day.IMAGE_STYLE}" src="{$day.IMAGE}" alt="{$day.IMAGE_ALT}" title="{$day.NB_ELEMENTS|@translate_dec:'%d photo':'%d photos'}">66 <img src="{$day.IMAGE}" alt="{$day.IMAGE_ALT}" title="{$day.NB_ELEMENTS|@translate_dec:'%d photo':'%d photos'}"> 67 67 </a> 68 68 </div> -
trunk/themes/default/theme.css
r25232 r25746 172 172 font-size: 18px; 173 173 border: 1px solid gray; 174 }175 176 .calImg {177 overflow: hidden;178 vertical-align: bottom;179 z-index: 1;180 position: relative; /*<- this required by IE*/181 }182 183 .calImg IMG {184 position: relative;185 border: 0;186 174 } 187 175
Note: See TracChangeset
for help on using the changeset viewer.