* * Functions to delete a event. * * $Id$ */ require_once('calendar_data.php'); require_once('functions.php'); chdir('..'); define('SM_PATH','../'); /* SquirrelMail required files. */ require_once(SM_PATH . 'include/validate.php'); require_once(SM_PATH . 'functions/strings.php'); require_once(SM_PATH . 'functions/date.php'); require_once(SM_PATH . 'config/config.php'); require_once(SM_PATH . 'functions/page_header.php'); require_once(SM_PATH . 'include/load_prefs.php'); require_once(SM_PATH . 'functions/html.php'); function confirm_deletion() { global $calself, $dyear, $dmonth, $dday, $dhour, $dminute, $calendardata, $color, $year, $month, $day; $tmparray = $calendardata["$dmonth$dday$dyear"]["$dhour$dminute"]; echo html_tag( 'table', html_tag( 'tr', html_tag( 'th', _("Do you really want to delete this event?") . '
', '', $color[4], 'colspan="2"' ) ) . html_tag( 'tr', html_tag( 'td', _("Date:"), 'right', $color[4] ) . html_tag( 'td', $dmonth.'/'.$dday.'/'.$dyear, 'left', $color[4] ) ) . html_tag( 'tr', html_tag( 'td', _("Time:"), 'right', $color[4] ) . html_tag( 'td', $dhour.':'.$dminute, 'left', $color[4] ) ) . html_tag( 'tr', html_tag( 'td', _("Title:"), 'right', $color[4] ) . html_tag( 'td', $tmparray[title], 'left', $color[4] ) ) . html_tag( 'tr', html_tag( 'td', _("Message:"), 'right', $color[4] ) . html_tag( 'td', $tmparray[message], 'left', $color[4] ) ) . html_tag( 'tr', html_tag( 'td', "
\n". " \n". " \n". " \n". " \n". " \n". " \n". " \n". " \n". " \n". ' \n". "
\n" , 'right', $color[4] ) . html_tag( 'td', "
\n". " \n". " \n". " \n". ' \n". "
\n" , 'left', $color[4] ) ) , '', $color[0], 'border="0" cellpadding="2" cellspacing="1"' ); } if ($month <= 0){ $month = date( 'm' ); } if ($year <= 0){ $year = date( 'Y' ); } if ($day <= 0){ $day = date( 'd' ); } $calself=basename($PHP_SELF); displayPageHeader($color, 'None'); //load calendar menu calendar_header(); echo html_tag( 'tr', '', '', $color[0] ) . html_tag( 'td' ) . html_tag( 'table', '', '', $color[0], 'width="100%" border="0" cellpadding="2" cellspacing="1"' ) . html_tag( 'tr' ) . html_tag( 'td', '', 'left' ) . date_intl( _("l, F j Y"), mktime(0, 0, 0, $month, $day, $year)); if (isset($dyear) && isset($dmonth) && isset($dday) && isset($dhour) && isset($dminute)){ if (isset($confirmed)){ delete_event("$dmonth$dday$dyear", "$dhour$dminute"); echo '

' . _("Event deleted!") . "
\n"; echo "" . _("Day View") . "\n"; } else { readcalendardata(); confirm_deletion(); } } else { echo '
' . _("Nothing to delete!"); } ?>