From 56b3516baeefc245d994390e4c134db9d4aeab72 Mon Sep 17 00:00:00 2001 From: rvelices Date: Thu, 27 Jun 2013 20:45:32 +0000 Subject: [PATCH] fix missing prev/next nav items in the calendar view (Smarty get_template_vars by reference not working anymore) git-svn-id: http://piwigo.org/svn/trunk@23618 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/calendar_base.class.php | 10 +++++----- themes/default/template/month_calendar.tpl | 19 ++++++++----------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/include/calendar_base.class.php b/include/calendar_base.class.php index 8f9d1c252..b61dc41c8 100644 --- a/include/calendar_base.class.php +++ b/include/calendar_base.class.php @@ -294,7 +294,7 @@ GROUP BY period'; $upper_items_rank = array_flip($upper_items); if ( !isset($upper_items_rank[$current]) ) { - array_push($upper_items, $current);// just in case (external link) + $upper_items[] = $current;// just in case (external link) usort($upper_items, 'version_compare'); $upper_items_rank = array_flip($upper_items); } @@ -330,11 +330,11 @@ GROUP BY period'; if ( !empty($tpl_var) ) { - $existing = & $template->get_template_vars('chronology_navigation_bars'); - if ( !empty($existing) ) + $existing = $template->smarty->getVariable('chronology_navigation_bars'); + if (! ($existing instanceof Undefined_Smarty_Variable)) { - $existing[ sizeof($existing)-1 ] = - array_merge( $existing[ sizeof($existing)-1 ], $tpl_var); + $existing->value[ sizeof($existing->value)-1 ] = + array_merge( $existing->value[ sizeof($existing->value)-1 ], $tpl_var); } else { diff --git a/themes/default/template/month_calendar.tpl b/themes/default/template/month_calendar.tpl index e2713346c..1dd4b9922 100644 --- a/themes/default/template/month_calendar.tpl +++ b/themes/default/template/month_calendar.tpl @@ -1,4 +1,3 @@ - {if !empty($chronology_navigation_bars) } {foreach from=$chronology_navigation_bars item=bar}
@@ -12,7 +11,7 @@   {else} {foreach from=$bar.items item=item} - + {if isset($item.URL)} {$item.LABEL} {else} @@ -52,13 +51,11 @@ {/foreach} -{html_head} {*add the style to html head for strict standard compliance*} - -{/html_head} +{/html_style} {foreach from=$chronology_calendar.month_view.weeks item=week} {foreach from=$week item=day} @@ -68,7 +65,7 @@ TABLE.calMonth TBODY TD, TABLE.calMonth TBODY TD DIV.calImg {ldelim}
{$day.DAY}
{$day.DAY}
{else} @@ -78,9 +75,9 @@ TABLE.calMonth TBODY TD, TABLE.calMonth TBODY TD DIV.calImg {ldelim} {/if} - {/foreach} {*day in week*} + {/foreach}{*day in week*} - {/foreach} {*week in month*} + {/foreach}{*week in month*} {/if}