91195602cdf0dbb574694cb9cd02e10e6573add1
4 * Displays the day page (day view).
6 * @copyright 2002-2024 The SquirrelMail Project Team
7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
10 * @subpackage calendar
14 * Include the SquirrelMail initialization file.
16 require('../../include/init.php');
19 include_once(SM_PATH
. 'functions/date.php');
21 /* Calendar plugin required files. */
22 include_once(SM_PATH
. 'plugins/calendar/calendar_data.php');
23 include_once(SM_PATH
. 'plugins/calendar/functions.php');
26 if (! sqGetGlobalVar('year',$year,SQ_FORM
) ||
! is_numeric($year)) {
29 if (! sqGetGlobalVar('month',$month,SQ_FORM
) ||
! is_numeric($month)) {
32 if (! sqGetGlobalVar('day',$day,SQ_FORM
) ||
! is_numeric($day)) {
38 * displays head of day calendar view
42 function day_header() {
43 global $color, $month, $day, $year, $prev_year, $prev_month, $prev_day,
44 $prev_date, $next_month, $next_day, $next_year, $next_date;
46 echo html_tag( 'tr', '', '', $color[0] ) . "\n".
47 html_tag( 'td', '', 'left' ) .
48 html_tag( 'table', '', '', $color[0], 'width="100%" border="0" cellpadding="2" cellspacing="1"' ) ."\n" .
51 "<a href=\"day.php?year=$prev_year&month=$prev_month&day=$prev_day\">< ".
52 date_intl('D',$prev_date)."</a>",
54 html_tag( 'th', date_intl( _("l, F j Y"), mktime(0, 0, 0, $month, $day, $year)) ,
55 '', '', 'width="75%"' ) .
57 "<a href=\"day.php?year=$next_year&month=$next_month&day=$next_day\">".
58 date_intl('D',$next_date)." ></a>" ,
64 * events for specific day are inserted into "daily" array
68 function initialize_events() {
69 global $daily_events, $calendardata, $month, $day, $year;
71 for ($i=7;$i<23;$i++
){
73 $evntime = '0' . $i . '00';
77 $daily_events[$evntime] = 'empty';
80 $cdate = $month . $day . $year;
82 if (isset($calendardata[$cdate])){
83 foreach ($calendardata[$cdate] as $key => $value){
84 $daily_events[$key] = $calendardata[$cdate][$key];
90 * main loop for displaying daily events
94 function display_events() {
95 global $daily_events, $month, $day, $year, $color;
97 ksort($daily_events,SORT_STRING
);
99 foreach ($daily_events as $key => $value) {
106 $ehour = substr($key,0,2);
107 $eminute = substr($key,2,2);
108 if (!is_array($value)){
110 html_tag( 'td', $ehour . ':' . $eminute, 'left' ) .
111 html_tag( 'td', ' ', 'left' ) .
113 "<font size=\"-1\"><a href=\"event_create.php?year=$year&month=$month&day=$day&hour="
114 .substr($key,0,2)."\">".
115 _("ADD") . "</a></font>" ,
121 if ($calbar['length']!=0){
122 $elength = '-'.date_intl(_("H:i"),mktime($ehour,$eminute+
$calbar['length'],0,1,1,0));
126 echo html_tag( 'tr', '', '', $color[$eo] ) .
127 html_tag( 'td', date_intl(_("H:i"),mktime($ehour,$eminute,0,1,1,0)) . $elength, 'left' ) .
128 html_tag( 'td', '', 'left' ) . '[';
129 echo ($calbar['priority']==1) ?
130 "<font color=\"$color[1]\">".sm_encode_html_special_chars($calbar['title']).'</font>' :
131 sm_encode_html_special_chars($calbar['title']);
132 echo'] <div style="margin-left:10px">'.nl2br(sm_encode_html_special_chars($calbar['message'])).'</div>' .
134 "<font size=\"-1\"><nobr>\n" .
135 "<a href=\"event_edit.php?year=$year&month=$month&day=$day&hour=".
136 substr($key,0,2)."&minute=".substr($key,2,2)."\">".
137 _("EDIT") . "</a> | \n" .
138 "<a href=\"event_delete.php?dyear=$year&dmonth=$month&dday=$day&dhour=".
139 substr($key,0,2)."&dminute=".substr($key,2,2).
140 "&year=$year&month=$month&day=$day\">" .
147 /* end of day functions */
159 $prev_date = mktime(0, 0, 0, $month , $day - 1, $year);
160 $next_date = mktime(0, 0, 0, $month , $day +
1, $year);
161 $prev_day = date ('d',$prev_date);
162 $prev_month = date ('m',$prev_date);
163 $prev_year = date ('Y',$prev_date);
164 $next_day = date ('d',$next_date);
165 $next_month = date ('m',$next_date);
166 $next_year = date ('Y',$next_date);
168 $calself=basename($PHP_SELF);
170 $daily_events = array();
172 displayPageHeader($color);
179 </table
></td
></tr
></table
>