Changeset 23618 for trunk


Ignore:
Timestamp:
Jun 27, 2013, 10:45:32 PM (11 years ago)
Author:
rvelices
Message:

fix missing prev/next nav items in the calendar view (Smarty get_template_vars by reference not working anymore)

Location:
trunk
Files:
2 edited

Legend:

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

    r19703 r23618  
    295295    if ( !isset($upper_items_rank[$current]) )
    296296    {
    297       array_push($upper_items, $current);// just in case (external link)
     297      $upper_items[] = $current;// just in case (external link)
    298298      usort($upper_items, 'version_compare');
    299299      $upper_items_rank = array_flip($upper_items);
     
    331331    if ( !empty($tpl_var) )
    332332    {
    333       $existing = & $template->get_template_vars('chronology_navigation_bars');
    334       if ( !empty($existing) )
    335       {
    336         $existing[ sizeof($existing)-1 ] =
    337           array_merge( $existing[ sizeof($existing)-1 ], $tpl_var);
     333      $existing = $template->smarty->getVariable('chronology_navigation_bars');
     334      if (! ($existing instanceof Undefined_Smarty_Variable))
     335      {
     336        $existing->value[ sizeof($existing->value)-1 ] =
     337          array_merge( $existing->value[ sizeof($existing->value)-1 ], $tpl_var);
    338338      }
    339339      else
  • trunk/themes/default/template/month_calendar.tpl

    r23476 r23618  
    1 
    21{if !empty($chronology_navigation_bars) }
    32{foreach from=$chronology_navigation_bars item=bar}
     
    1312        {else}
    1413                {foreach from=$bar.items item=item}
    15                 <span class="calItem{if !isset($item.URL)}Empty{/if}" {if isset($item.NB_IMAGES)}title="{$item.NB_IMAGES|@translate_dec:'%d photo':'%d photos'}"{/if}>
     14                <span class="calItem{if !isset($item.URL)}Empty{/if}"{if isset($item.NB_IMAGES)} title="{$item.NB_IMAGES|@translate_dec:'%d photo':'%d photos'}"{/if}>
    1615                {if isset($item.URL)}
    1716                <a href="{$item.URL}">{$item.LABEL}</a>
     
    5352 </tr>
    5453 </thead>
    55 {html_head} {*add the style to html head for strict standard compliance*}
    56 <style type="text/css">
    57 TABLE.calMonth TBODY TD, TABLE.calMonth TBODY TD DIV.calImg {ldelim}
    58   width:{$chronology_calendar.month_view.CELL_WIDTH}px;height:{$chronology_calendar.month_view.CELL_HEIGHT}px;
     54{html_style}
     55TABLE.calMonth TBODY TD, TABLE.calMonth TBODY TD DIV.calImg{
     56        width:{$chronology_calendar.month_view.CELL_WIDTH}px;height:{$chronology_calendar.month_view.CELL_HEIGHT}px
    5957}
    60 </style>
    61 {/html_head}
     58{/html_style}
    6259 {foreach from=$chronology_calendar.month_view.weeks item=week}
    6360 <tr>
     
    6966                                <div class="calImg">
    7067                                        <a href="{$day.U_IMG_LINK}">
    71                                                 <img style="{$day.IMAGE_STYLE}" src="{$day.IMAGE}" alt="{$day.IMAGE_ALT}" title="{$day.NB_ELEMENTS|@translate_dec:'%d photo':'%d photos'}">
     68                                                <img style="{$day.IMAGE_STYLE}" src="{$day.IMAGE}" alt="{$day.IMAGE_ALT}" title="{$day.NB_ELEMENTS|@translate_dec:'%d photo':'%d photos'}">
    7269                                        </a>
    7370                                </div>
     
    7976        {/if}
    8077        </td>
    81         {/foreach} {*day in week*}
     78        {/foreach}{*day in week*}
    8279 </tr>
    83  {/foreach}  {*week in month*}
     80 {/foreach}{*week in month*}
    8481</table>
    8582{/if}
Note: See TracChangeset for help on using the changeset viewer.