various code formatting changes

This commit is contained in:
skeeter 2001-02-20 03:48:00 +00:00
parent 175cc243b1
commit 5ba2a1cdde
4 changed files with 205 additions and 218 deletions

View File

@ -14,69 +14,68 @@
/* $Id$ */
$phpgw_flags = Array (
if (isset($friendly) && $friendly)
{
$phpgw_flags = Array(
'currentapp' => 'calendar',
'enable_nextmatchs_class' => True,
'noheader' => True,
'nonavbar' => True,
'noappheader' => True,
'noappfooter' => True,
'nofooter' => True
);
}
else
{
$phpgw_flags = Array(
'currentapp' => 'calendar',
'enable_nextmatchs_class' => True
);
$phpgw_info['flags'] = $phpgw_flags;
if (isset($friendly) && $friendly)
{
$phpgw_info['flags']['noheader'] = True;
$phpgw_info['flags']['nonavbar'] = True;
$phpgw_info['flags']['noappheader'] = True;
$phpgw_info['flags']['noappfooter'] = True;
$phpgw_info['flags']['nofooter'] = True;
}
else
{
$friendly = 0;
}
$phpgw_info['flags'] = $phpgw_flags;
include('../header.inc.php');
$view = 'day';
$now = $phpgw->calendar->makegmttime(0, 0, 0, $thismonth, $thisday, $thisyear);
$p = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('calendar'));
$template = Array(
'day_t' => 'day.tpl'
);
$p->set_file($template);
// $phpgw->template->set_block('day_t');
if ($friendly)
{
$p->set_var('printer_friendly','<body bgcolor="'.$phpgw_info['theme']['bg_color'].'">');
}
else
{
$p->set_var('printer_friendly','');
}
$p->set_var('bg_text',$phpgw_info['theme']['bg_text']);
$m = mktime(0,0,0,$thismonth,1,$thisyear);
$p->set_var('date',lang(date('F',$m)).' '.$thisday.', '.$thisyear);
$p->set_var('username',$phpgw->common->grab_owner_name($owner));
$p->set_var('daily_events',$phpgw->calendar->print_day_at_a_glance($now,$owner));
$p->set_var('small_calendar',$phpgw->calendar->mini_calendar($thisday,$thismonth,$thisyear,'day.php'));
if ($friendly == 0)
{
$printer = '';
$param = 'year='.$thisyear.'&month='.$thismonth.'&day='.$thisday.'&friendly=1&filter='.$filter.'&owner='.$owner;
$print = '<a href="'.$phpgw->link('',$param)."\" TARGET=\"cal_printer_friendly\" onMouseOver=\"window.status = '".lang('Generate printer-friendly version')."'\">[".lang('Printer Friendly').']</a>';
}
else
{
$printer = '<body bgcolor="'.$phpgw_info['theme']['bg_color'].'">';
$print = '';
}
$p->set_var('print',$print);
$now = $phpgw->calendar->makegmttime(0, 0, 0, $thismonth, $thisday, $thisyear);
$m = mktime(0,0,0,$thismonth,1,$thisyear);
$var = Array(
'printer_friendly' => $printer,
'bg_text' => $phpgw_info['themem']['bg_text'],
'daily_events' => $phpgw->calendar->print_day_at_a_glance($now,$owner),
'small_calendar' => $phpgw->calendar->mini_calendar($thisday,$thismonth,$thisyear,'day.php'),
'date' => lang(date('F',$m)).' '.$thisday.', '.$thisyear,
'username' => $phpgw->common->grab_owner_name($owner),
'print' => $print
);
$p->set_var($var);
$p->pparse('out','day_t');
$phpgw->common->phpgw_footer();

View File

@ -48,7 +48,7 @@
/* Load calendar class */
$parameters = Array(
'printer_friendly' => ((isset($friendly) && ($friendly==1))?True:False),
'printer_friendly'=> ((isset($friendly) && ($friendly==1))?True:False),
'owner' => $owner,
'rights' => $rights
);
@ -56,7 +56,9 @@
$phpgw->calendar = CreateObject('calendar.calendar',$parameters);
if(!isset($phpgw_info['user']['preferences']['calendar']['weekdaystarts']))
{
$phpgw_info['user']['preferences']['calendar']['weekdaystarts'] = 'Sunday';
}
if (isset($date) && strlen($date) > 0)
{

View File

@ -14,55 +14,67 @@
/* $Id$ */
$phpgw_info['flags'] = array('currentapp' => 'calendar', 'enable_nextmatchs_class' => True);
if (isset($friendly) && $friendly)
{
$phpgw_flags = Array(
'currentapp' => 'calendar',
'enable_nextmatchs_class' => True,
'noheader' => True,
'nonavbar' => True,
'noappheader' => True,
'noappfooter' => True,
'nofooter' => True
);
}
else
{
$phpgw_flags = Array(
'currentapp' => 'calendar',
'enable_nextmatchs_class' => True
);
if (isset($friendly) && $friendly){
$phpgw_info['flags']['noheader'] = True;
$phpgw_info['flags']['nonavbar'] = True;
$phpgw_info['flags']['noappheader'] = True;
$phpgw_info['flags']['noappfooter'] = True;
$phpgw_info['flags']['nofooter'] = True;
} else {
$friendly = 0;
}
$phpgw_info['flags'] = $phpgw_flags;
include('../header.inc.php');
$view = "month";
$p = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('calendar'));
$p->set_file(array('index_t' => 'index.tpl'));
$templates = Array(
'index_t' => 'index.tpl'
);
$p->set_block('index_t','index');
if ($friendly) {
$p->set_var('printer_friendly','<body bgcolor="'.$phpgw_info['theme']['bg_color'].'">');
} else {
$p->set_var('printer_friendly','');
}
$p->set_var('bg_text',$phpgw_info['theme']['bg_text']);
$p->set_var('small_calendar_prev',$phpgw->calendar->mini_calendar(1,$thismonth - 1,$thisyear,'day.php'));
$p->set_file($templates);
$m = mktime(0,0,0,$thismonth,1,$thisyear);
$p->set_var('month_identifier',lang(strftime("%B",$m)) . ' ' . $thisyear);
$p->set_var('username',$phpgw->common->grab_owner_name($owner));
$p->set_var('small_calendar_next',$phpgw->calendar->mini_calendar(1,$thismonth + 1,$thisyear,'day.php'));
$p->set_var('large_month',$phpgw->calendar->display_large_month($thismonth,$thisyear,True,$owner));
if ($friendly == 0)
{
$printer = '';
$param = 'year='.$thisyear.'&month='.$thismonth.'&friendly=1&filter='.$filter.'&owner='.$owner;
$print = '<a href="'.$phpgw->link('',$param)."\" TARGET=\"cal_printer_friendly\" onMouseOver=\"window.status = '".lang('Generate printer-friendly version')."'\">[".lang('Printer Friendly').']</a>';
}
else
{
$printer = '<body bgcolor="'.$phpgw_info['theme']['bg_color'].'">';
$print = '';
}
$p->set_var('print',$print);
$var = Array(
'printer_friendly' => $printer,
'bg_text' => $phpgw_info['themem']['bg_text'],
'small_calendar_prev' => $phpgw->calendar->mini_calendar(1,$thismonth - 1,$thisyear,'day.php'),
'month_identifier' => lang(strftime("%B",$m)) . ' ' . $thisyear,
'username' => $phpgw->common->grab_owner_name($owner),
'small_calendar_next' => $phpgw->calendar->mini_calendar(1,$thismonth + 1,$thisyear,'day.php'),
'large_month' => $phpgw->calendar->display_large_month($thismonth,$thisyear,True,$owner),
'print' => $print
);
$p->set_var($var);
$p->pparse('out','index_t');
$phpgw->common->phpgw_footer();
?>

View File

@ -14,26 +14,29 @@
/* $Id$ */
if (isset($friendly) && $friendly)
{
$phpgw_flags = Array(
'currentapp' => 'calendar',
'enable_nextmatchs_class' => True,
'noheader' => True,
'nonavbar' => True,
'noappheader' => True,
'noappfooter' => True,
'nofooter' => True
);
}
else
{
$phpgw_flags = Array(
'currentapp' => 'calendar',
'enable_nextmatchs_class' => True
);
$phpgw_info['flags'] = $phpgw_flags;
if (isset($friendly) && $friendly)
{
$phpgw_info['flags']['noheader'] = True;
$phpgw_info['flags']['nonavbar'] = True;
$phpgw_info['flags']['noappheader'] = True;
$phpgw_info['flags']['noappfooter'] = True;
$phpgw_info['flags']['nofooter'] = True;
}
else
{
$friendly = 0;
}
$phpgw_info['flags'] = $phpgw_flags;
include('../header.inc.php');
$next = $phpgw->calendar->makegmttime(0,0,0,$thismonth,$thisday + 7,$thisyear);
@ -45,86 +48,57 @@
$first = $phpgw->calendar->gmtdate($phpgw->calendar->get_weekday_start($thisyear, $thismonth, $thisday));
$last = $phpgw->calendar->gmtdate($first['raw'] + 518400);
$p = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('calendar'));
$templates = Array(
'week_t' => 'week.tpl'
);
$p->set_file($templates);
$p->set_block('week_t','week');
if ($friendly)
{
$p->set_var('printer_friendly','<body bgcolor="'.$phpgw_info['theme']['bg_color'].'">');
}
else
{
$p->set_var('printer_friendly','');
}
$p->set_var('bg_text',$phpgw_info['theme']['bg_text']);
$p->set_var('small_calendar_prev',$phpgw->calendar->mini_calendar($thisday,$thismonth - 1,$thisyear,'day.php'));
if (!$friendly)
{
$p->set_var('prev_week_link','<a href="'.$phpgw->link('week.php','year='.$prev['year'].'&month='.$prev['month'].'&day='.$prev['day']).'">&lt;&lt;</a>');
}
else
{
$p->set_var('prev_week_link','&lt;&lt;');
}
$p->set_var('small_calendar_this',$phpgw->calendar->mini_calendar($thisday,$thismonth,$thisyear,'day.php'));
// Week Label
$week_id = lang(strftime("%B",$first['raw'])).' '.$first['day'];
if($first['month'] <> $last['month'] && $first['year'] <> $last['year'])
{
$week_id .= ', '.$first['year'];
}
$week_id .= ' - ';
if($first['month'] <> $last['month'])
{
$week_id .= lang(strftime("%B",$last['raw'])).' ';
}
$week_id .= $last['day'].', '.$last['year'];
$p->set_var('week_identifier',$week_id);
$p = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('calendar'));
$templates = Array(
'week_t' => 'week.tpl'
);
$p->set_var('username',$phpgw->common->grab_owner_name($owner));
$p->set_file($templates);
if (!$friendly)
if ($friendly == 0)
{
$p->set_var('next_week_link','<a href="'.$phpgw->link('week.php','year='.$next['year'].'&month='.$next['month'].'&day='.$next['day']).'">&gt;&gt;</a>');
$printer = '';
$prev_week_link = '<a href="'.$phpgw->link('week.php','year='.$prev['year'].'&month='.$prev['month'].'&day='.$prev['day']).'">&lt;&lt;</a>';
$next_week_link = '<a href="'.$phpgw->link('week.php','year='.$next['year'].'&month='.$next['month'].'&day='.$next['day']).'">&gt;&gt;</a>';
$param = 'year='.$thisyear.'&month='.$thismonth.'&day='.$thisday.'&friendly=1&filter='.$filter.'&owner='.$owner;
$print = '<a href="'.$phpgw->link('',$param)."\" TARGET=\"cal_printer_friendly\" onMouseOver=\"window.status = '".lang('Generate printer-friendly version')."'\">[".lang('Printer Friendly').']</a>';
}
else
{
$p->set_var('next_week_link','&gt;&gt;');
$printer = '<body bgcolor="'.$phpgw_info['theme']['bg_color'].'">';
$prev_week_link = '&lt;&lt;';
$next_week_link = '&gt;&gt;';
$print = '';
}
$p->set_var('small_calendar_next',$phpgw->calendar->mini_calendar($thisday,$$thismonth + 1,$thisyear,'day.php'));
$var = Array(
'printer_friendly' => $printer,
'bg_text' => $phpgw_info['themem']['bg_text'],
'small_calendar_prev' => $phpgw->calendar->mini_calendar(1,$thismonth - 1,$thisyear,'day.php'),
'prev_week_link' => $prev_week_link,
'small_calendar_this' => $phpgw->calendar->mini_calendar($thisday,$thismonth,$thisyear,'day.php'),
'week_identifier' => $week_id,
'next_week_link' => $next_week_link,
'username' => $phpgw->common->grab_owner_name($owner),
'small_calendar_next' => $phpgw->calendar->mini_calendar(1,$thismonth + 1,$thisyear,'day.php'),
'week_display' => $phpgw->calendar->display_large_week($thisday,$thismonth,$thisyear,true,$owner),
'print' => $print
);
$p->set_var('week_display',$phpgw->calendar->display_large_week($thisday,$thismonth,$thisyear,true,$owner));
if (!$friendly)
{
$param = 'year='.$thisyear.'&month='.$thismonth.'&friendly=1&filter='.$filter;
$p->set_var('print','<a href="'.$phpgw->link('',$param)
.'" TARGET="cal_printer_friendly" onMouseOver="window.'
. "status = '" . lang('Generate printer-friendly version')
. "'\">[". lang('Printer Friendly') . ']</A>');
$p->parse('out','week_t');
$p->set_var($var);
$p->pparse('out','week_t');
}
else
{
$p->set_var('print','');
$p->parse('out','week_t');
$p->pparse('out','week_t');
}
$phpgw->common->phpgw_footer();
?>