template based

This commit is contained in:
skeeter 2000-11-19 04:19:08 +00:00
parent d6c82577b5
commit c13ee23344
4 changed files with 62 additions and 68 deletions

View File

@ -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","<a href=\"".$phpgw->link($PHP_SELF,$param)."\">[". lang("Printer Friendly") . "]</A>");
$param = "year=".$now["year"]."&month=".$now["month"]."&day=".$now["day"]."&friendly=1";
$phpgw->template->set_var("print","<a href=\"".$phpgw->link($PHP_SELF,$param)."\" TARGET=\"cal_printer_friendly\" onMouseOver=\"window.status = '".lang("Generate printer-friendly version")."'\">[".lang("Printer Friendly")."]</A>");
$phpgw->template->parse("out","day");
$phpgw->template->pparse("out","day");
$phpgw->common->phpgw_footer();

View File

@ -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 "<body bgcolor=\"".$phpgw_info["theme"]["bg_color"]."\">";
}
$view = "month";
?>
<HEAD>
<STYLE TYPE="text/css">
<!-- <?php echo "$CCS_DEFS";?> -->
$phpgw->template->set_file(array("index" => "index.tpl"));
.tablecell {
width: 80px;
height: 80px;
$phpgw->template->set_block("index");
if ($friendly) {
$phpgw->template->set_var("printer_friendly","<body bgcolor=\"".$phpgw_info["theme"]["bg_color"]."\">");
} else {
$phpgw->template->set_var("printer_friendly","");
}
</STYLE>
</HEAD>
<table border="0" width="100%">
<tr>
<?php
echo "<td align=\"left\" valign=\"top\">";
echo $phpgw->calendar->pretty_small_calendar($thisday,$prev["month"],$prev["year"],"day.php");
echo "</td>";
?>
$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"));
<td align="middle"><font size="+2" color="#000000"><B>
<?php
$m = mktime(2,0,0,$thismonth,1,$thisyear);
echo lang(strftime("%B",$m)) . " " . $thisyear;
?>
</b></font>
<font color="#000000" size="+1" color="<?php echo $phpgw_info["theme"]["bg_text"]; ?>">
<br>
<?php
echo $phpgw->common->display_fullname($phpgw_info["user"]["userid"],$phpgw_info["user"]["firstname"],$phpgw_info["user"]["lastname"]);
?>
</font></td>
<?php
echo "<td align=\"right\" valign=\"top\">";
echo $phpgw->calendar->pretty_small_calendar($thisday,$next["month"],$next["year"],"day.php");
echo "</td>";
?>
</tr>
</table>
<?php
flush();
echo $phpgw->calendar->display_large_month($thismonth,$thisyear,True,"edit_entry.php");
flush();
/* Pre-Load the repeated events for quckier access */
$repeated_events = read_repeated_events();
?>
<p>
<p>
<?php
$phpgw->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 "<a href=\"".$phpgw->link($PHP_SELF,$param)."\" target=\"cal_printer_friendly\" onMouseOver=\"window.status='"
.lang("Generate printer-friendly version")."'\">[" . lang("Printer Friendly") . "]</a>";
$phpgw->common->phpgw_footer();
$param = "year=".$now["year"]."&month=".$now["month"]."&friendly=1";
$phpgw->template->set_var("print","<a href=\"".$phpgw->link($PHP_SELF,$param)."\" TARGET=\"cal_printer_friendly\" onMouseOver=\"window."
. "status = '" . lang("Generate printer-friendly version"). "'\">[". lang("Printer Friendly") . "]</a>");
$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");
}
?>

View File

@ -0,0 +1,31 @@
<!-- $Id$ -->
<!-- BEGIN index -->
{printer_friendly}
<head>
<style type="text/css">
.tablecell {
width: 80px;
height: 80px;
}
</style>
</head>
<table border="0" width="100%">
<tr>
<td align="left" valign="top">
{small_calendar_prev}
</td>
<td align="middle">
<font size="+2" color="#000000"><b>{month_identifier}</b></font>
<font color="#000000" size="+1" color="{bg_text}"><br>{username}</font>
</td>
<td align="right" valign="top">
{small_calendar_next}
</td>
</tr>
</table>
{large_month}
<p>
<p>
{print}
<!-- END index -->

View File

@ -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","<a href=\"".$phpgw->link($PHP_SELF,$param)."\">[". lang("Printer Friendly") . "]</A>");
$param = "year=".$now["year"]."&month=".$now["month"]."&friendly=1";
$phpgw->template->set_var("print","<a href=\"".$phpgw->link($PHP_SELF,$param)."\" TARGET=\"cal_printer_friendly\" onMouseOver=\"window."
. "status = '" . lang("Generate printer-friendly version"). "'\">[". lang("Printer Friendly") . "]</A>");
$phpgw->template->parse("out","week");
$phpgw->template->pparse("out","week");
$phpgw->common->phpgw_footer();