X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Fcalendar%2Fevent_delete.php;h=09fe78fba27848d66dbb70f2d3427029a73c4a8a;hp=b771861733b53ced3457fd2ff55ee3ef5a5e6624;hb=92219031d9ad648536aeda878a336c6bd9b4c3a1;hpb=2c85de8f66702a488ea0c371f2576963c593d64d diff --git a/plugins/calendar/event_delete.php b/plugins/calendar/event_delete.php index b7718617..09fe78fb 100644 --- a/plugins/calendar/event_delete.php +++ b/plugins/calendar/event_delete.php @@ -1,24 +1,31 @@ - * Licensed under the GNU GPL. For full terms see the file COPYING. + * Originally contrubuted by Michal Szczotka * - * Functions to delete a event. + * Functions to delete a event. * * $Id$ */ +define('SM_PATH','../../'); + +/* Calender plugin required files. */ +require_once(SM_PATH . 'plugins/calendar/calendar_data.php'); +require_once(SM_PATH . 'plugins/calendar/functions.php'); -require_once('calendar_data.php'); -require_once('functions.php'); -chdir('..'); -require_once('../src/validate.php'); -require_once('../functions/strings.php'); -require_once('../functions/date.php'); -require_once('../config/config.php'); -require_once('../functions/page_header.php'); -require_once('../src/load_prefs.php'); +/* 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() { @@ -26,41 +33,51 @@ function confirm_deletion() $tmparray = $calendardata["$dmonth$dday$dyear"]["$dhour$dminute"]; - echo " \n". - " \n". - " \n". - " \n". - " \n". - " \n". - " \n". - " \n". - " \n". - " \n". - " \n". - "
\n". - _("Do you really want to delete this event?") . "
" . _("Date:") . "$dmonth/$dday/$dyear
" . _("Time:") . "$dhour:$dminute
" . _("Title:") . "$tmparray[title]
" . _("Message:") . "$tmparray[message]
\n". - "
\n". - " \n". - " \n". - " \n". - " \n". - " \n". - " \n". - " \n". - " \n". - " \n". - " \n". - "
\n". - "
\n". - "
\n". - " \n". - " \n". - " \n". - " \n". - "
\n". - "
\n"; - - + 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){ @@ -79,15 +96,18 @@ displayPageHeader($color, 'None'); //load calendar menu calendar_header(); -echo "". - "". - '
'. - date_intl( 'l, F d Y', mktime(0, 0, 0, $month, $day, $year)); +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"; + echo '

' . _("Event deleted!") . "
\n"; + echo "" . + _("Day View") . "\n"; } else { readcalendardata(); confirm_deletion(); @@ -98,4 +118,4 @@ if (isset($dyear) && isset($dmonth) && isset($dday) && isset($dhour) && isset($d ?>
- \ No newline at end of file +