From c13ee233440ed2c9aefc9aa31138c19c9c835278 Mon Sep 17 00:00:00 2001 From: skeeter Date: Sun, 19 Nov 2000 04:19:08 +0000 Subject: [PATCH] template based --- calendar/day.php | 11 +--- calendar/index.php | 82 +++++++++------------------- calendar/templates/default/index.tpl | 31 +++++++++++ calendar/week.php | 6 +- 4 files changed, 62 insertions(+), 68 deletions(-) create mode 100755 calendar/templates/default/index.tpl diff --git a/calendar/day.php b/calendar/day.php index a8b4f7d6bb..bc359c5610 100644 --- a/calendar/day.php +++ b/calendar/day.php @@ -65,16 +65,11 @@ $phpgw->template->set_var("date",lang(strftime("%B",$m))." ".$thisday.", ".$thisyear); $phpgw->template->set_var("username",$phpgw->common->display_fullname($phpgw_info["user"]["userid"],$phpgw_info["user"]["firstname"],$phpgw_info["user"]["lastname"])); $phpgw->template->set_var("daily_events",$phpgw->calendar->print_day_at_a_glance($now)); - $cal = $phpgw->calendar->pretty_small_calendar($now["day"],$now["month"],$now["year"],"day.php"); - $phpgw->template->set_var("small_calendar",$cal); + $phpgw->template->set_var("small_calendar",$phpgw->calendar->pretty_small_calendar($now["day"],$now["month"],$now["year"],"day.php")); if (!$friendly) { - $param = ""; - $param .= "year=".$now["year"]."&month=".$now["month"]."&day=".$now["day"]."&"; - - $param .= "friendly=1\" TARGET=\"cal_printer_friendly\" onMouseOver=\"window." - . "status = '" . lang("Generate printer-friendly version"). "'"; - $phpgw->template->set_var("print","link($PHP_SELF,$param)."\">[". lang("Printer Friendly") . "]"); + $param = "year=".$now["year"]."&month=".$now["month"]."&day=".$now["day"]."&friendly=1"; + $phpgw->template->set_var("print","link($PHP_SELF,$param)."\" TARGET=\"cal_printer_friendly\" onMouseOver=\"window.status = '".lang("Generate printer-friendly version")."'\">[".lang("Printer Friendly")."]"); $phpgw->template->parse("out","day"); $phpgw->template->pparse("out","day"); $phpgw->common->phpgw_footer(); diff --git a/calendar/index.php b/calendar/index.php index 4dfd108c7e..b054e6225c 100755 --- a/calendar/index.php +++ b/calendar/index.php @@ -14,13 +14,13 @@ /* $Id$ */ + $phpgw_info["flags"] = array("currentapp" => "calendar", "enable_calendar_class" => True, "enable_nextmatchs_class" => True); if (isset($friendly) && $friendly){ $phpgw_info["flags"]["noheader"] = True; } else { $friendly = 0; } - $phpgw_info["flags"] = array("currentapp" => "calendar", "enable_calendar_class" => True, "enable_nextmatchs_class" => True); include("../header.inc.php"); if (isset($date) && strlen($date) > 0) { @@ -46,69 +46,37 @@ $prev = $phpgw->calendar->splitdate(mktime(2,0,0,$thismonth - 1,1,$thisyear)); - if ($friendly) { - echo ""; - } $view = "month"; -?> - - - - - -"; - echo $phpgw->calendar->pretty_small_calendar($thisday,$prev["month"],$prev["year"],"day.php"); - echo ""; -?> + $phpgw->template->set_var("bg_text",$phpgw_info["theme"]["bg_text"]); + + $phpgw->template->set_var("small_calendar_prev",$phpgw->calendar->pretty_small_calendar($thisday,$prev["month"],$prev["year"],"day.php")); - -"; - echo $phpgw->calendar->pretty_small_calendar($thisday,$next["month"],$next["year"],"day.php"); - echo ""; -?> - -
- - -"> -
-common->display_fullname($phpgw_info["user"]["userid"],$phpgw_info["user"]["firstname"],$phpgw_info["user"]["lastname"]); -?> -
-calendar->display_large_month($thismonth,$thisyear,True,"edit_entry.php"); - flush(); - /* Pre-Load the repeated events for quckier access */ - $repeated_events = read_repeated_events(); -?> -

-

- -template->set_var("month_identifier",lang(strftime("%B",$m)) . " " . $thisyear); + $phpgw->template->set_var("username",$phpgw->common->display_fullname($phpgw_info["user"]["userid"],$phpgw_info["user"]["firstname"],$phpgw_info["user"]["lastname"])); + $phpgw->template->set_var("small_calendar_next",$phpgw->calendar->pretty_small_calendar($thisday,$next["month"],$next["year"],"day.php")); + $phpgw->template->set_var("large_month",$phpgw->calendar->display_large_month($thismonth,$thisyear,True,"edit_entry.php")); if (!$friendly) { - $param = ""; - if ($thisyear) - $param .= "year=$thisyear&month=$thismonth&"; - - $param .= "friendly=1"; - echo "link($PHP_SELF,$param)."\" target=\"cal_printer_friendly\" onMouseOver=\"window.status='" - .lang("Generate printer-friendly version")."'\">[" . lang("Printer Friendly") . "]"; - $phpgw->common->phpgw_footer(); + $param = "year=".$now["year"]."&month=".$now["month"]."&friendly=1"; + $phpgw->template->set_var("print","link($PHP_SELF,$param)."\" TARGET=\"cal_printer_friendly\" onMouseOver=\"window." + . "status = '" . lang("Generate printer-friendly version"). "'\">[". lang("Printer Friendly") . "]"); + $phpgw->template->parse("out","index"); + $phpgw->template->pparse("out","index"); + $phpgw->common->phpgw_footer(); + } else { + $phpgw->template->set_var("print",""); + $phpgw->template->parse("out","index"); + $phpgw->template->pparse("out","index"); } ?> diff --git a/calendar/templates/default/index.tpl b/calendar/templates/default/index.tpl new file mode 100755 index 0000000000..a0e83b047f --- /dev/null +++ b/calendar/templates/default/index.tpl @@ -0,0 +1,31 @@ + + +{printer_friendly} + + + + + + + + + + +
+ {small_calendar_prev} + + {month_identifier} +
{username}
+
+ {small_calendar_next} +
+{large_month} +

+

+{print} + diff --git a/calendar/week.php b/calendar/week.php index f36bb671a9..75d6ed20ee 100755 --- a/calendar/week.php +++ b/calendar/week.php @@ -95,9 +95,9 @@ $phpgw->template->set_var("week_display",$phpgw->calendar->display_large_week($thisday,$thismonth,$thisyear,true)); if (!$friendly) { - $param = "year=".$now["year"]."&month=".$now["month"]."&friendly=1\" TARGET=\"cal_printer_friendly\" onMouseOver=\"window." - . "status = '" . lang("Generate printer-friendly version"). "'"; - $phpgw->template->set_var("print","link($PHP_SELF,$param)."\">[". lang("Printer Friendly") . "]"); + $param = "year=".$now["year"]."&month=".$now["month"]."&friendly=1"; + $phpgw->template->set_var("print","link($PHP_SELF,$param)."\" TARGET=\"cal_printer_friendly\" onMouseOver=\"window." + . "status = '" . lang("Generate printer-friendly version"). "'\">[". lang("Printer Friendly") . "]"); $phpgw->template->parse("out","week"); $phpgw->template->pparse("out","week"); $phpgw->common->phpgw_footer();