From 1f2d8fec99903bbbacd1cecac10d0ce616cad3e2 Mon Sep 17 00:00:00 2001 From: Nathan Booth Date: Mon, 19 Dec 2011 14:10:00 +0000 Subject: [PATCH] Updated generation of previous days in heading on home template, now looped into array then passed to smarty Signed-off-by: Nathan Booth --- source/webui/pages/home.php | 7 ++----- source/webui/templates/home.tpl | 10 ++++------ 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/source/webui/pages/home.php b/source/webui/pages/home.php index 2f3accf..2e190c6 100644 --- a/source/webui/pages/home.php +++ b/source/webui/pages/home.php @@ -3,12 +3,9 @@ $services = StatusBoard_Service::all(); for ($i = 1; $i <= 6; ++$i){ - $day = 'day'.$i; - $date = date("M. d", strtotime("-{$i}day")); - - $this->smarty->assign($day, $date); + $tbl_header_date[] = date("M. d", strtotime("-{$i}day")); } - +$this->smarty->assign('days', $tbl_header_date); $this->smarty->assign('services', $services); ?> \ No newline at end of file diff --git a/source/webui/templates/home.tpl b/source/webui/templates/home.tpl index 38f94b4..49dee50 100644 --- a/source/webui/templates/home.tpl +++ b/source/webui/templates/home.tpl @@ -4,12 +4,10 @@ Service Current - {$day1} - {$day2} - {$day3} - {$day4} - {$day5} - {$day6} + {foreach from=$days key="ind" item="day"} + {$day} + {/foreach} +