X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Fcalendar%2Fevent_edit.php;h=286fc1c097cde2d917f111c25d27ad4c09d76197;hp=de5e156ec670e7f5130dd8db9c467beedd4ec379;hb=8d6a115b0ef06dbcf9b149ba2509208f09b3a2ab;hpb=2c85de8f66702a488ea0c371f2576963c593d64d diff --git a/plugins/calendar/event_edit.php b/plugins/calendar/event_edit.php index de5e156e..286fc1c0 100644 --- a/plugins/calendar/event_edit.php +++ b/plugins/calendar/event_edit.php @@ -1,24 +1,31 @@ - * Licensed under the GNU GPL. For full terms see the file COPYING. + * Originally contrubuted by Michal Szczotka * - * Functions to edit an event. + * Functions to edit an event. * * $Id$ */ +define('SM_PATH','../'); -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'); +/* Calender plugin required files. */ +require_once(SM_PATH . 'plugins/calendar/calendar_data.php'); +require_once(SM_PATH . 'plugins/calendar/functions.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'); // update event info function show_event_form() { @@ -32,8 +39,9 @@ function show_event_form() { " \n". " \n". " \n". - " " . _("Date:") . "\n". - " \n". + html_tag( 'tr' ) . + html_tag( 'td', _("Date:"), 'right', $color[4] ) . "\n" . + html_tag( 'td', '', 'left', $color[4] ) . " \n" . @@ -45,9 +53,10 @@ function show_event_form() { " \n". - " \n". - " " . _("Time:") . "\n". - " \n". + " \n". + html_tag( 'tr' ) . + html_tag( 'td', _("Time:"), 'right', $color[4] ) . "\n" . + html_tag( 'td', '', 'left', $color[4] ) . " \n". @@ -55,29 +64,35 @@ function show_event_form() { " \n". - " \n". - " " . _("Length:") . "\n". - " \n". + " \n". + html_tag( 'tr' ) . + html_tag( 'td', _("Length:"), 'right', $color[4] ) . "\n" . + html_tag( 'td', '', 'left', $color[4] ) . " \n". - " \n". - " " . _("Priority:") . "\n". - " \n". + " \n". + html_tag( 'tr' ) . + html_tag( 'td', _("Priority:"), 'right', $color[4] ) . "\n" . + html_tag( 'td', '', 'left', $color[4] ) . " \n". - " \n". - " " . _("Title:") . "\n". - " \n". + " \n". + html_tag( 'tr' ) . + html_tag( 'td', _("Title:"), 'right', $color[4] ) . "\n" . + html_tag( 'td', '', 'left', $color[4] ) . "
\n". - " \n". - " \n". - " \n". - " \n". - " \n". - "\n"; + " \n". + html_tag( 'td', + " \n" , + 'left', $color[4], 'colspan="2"' ) . + '' . html_tag( 'tr' ) . + html_tag( 'td', + "\n" , + 'left', $color[4], 'colspan="2"' ) . + "\n"; } // self explenatory @@ -86,63 +101,86 @@ function confirm_update() { $tmparray = $calendardata["$month$day$year"]["$hour$minute"]; - echo " \n". - " \n". - " \n". - " \n". - " \n". - " \n". - " \n". - " \n". - " \n". - " \n". - " \n". - " \n". - " \n". - " \n". - " \n". - " \n". - " \n". - " \n". - " \n". - " \n". - " \n". - " \n". - " \n". - " \n". - "
\n". - _("Do you really want to change this event from:") . "
\n". - "
" . _("Date:") . "$month/$day/$year
" . _("Time:") . "$hour:$minute
" . _("Priority:") . "$tmparray[priority]
" . _("Title:") . "$tmparray[title]
" . _("Message:") . "$tmparray[message]
\n". - _("to:") . "
\n". - "
" . _("Date:") . "$event_month/$event_day/$event_year
" . ("Time:") . "$event_hour:$event_minute
" . _("Priority:") . "$event_priority
" . _("Title:") . "$event_title
" . _("Message:") . "$event_text
\n". - "
\n". - " \n". - " \n". - " \n". - " \n". - " \n". - " \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 change this event from:") . "
\n", '', $color[4], 'colspan="2"' ) ."\n" + ) . + html_tag( 'tr', + html_tag( 'td', _("Date:") , 'right', $color[4] ) ."\n" . + html_tag( 'td', $month.'/'.$day.'/'.$year , 'left', $color[4] ) ."\n" + ) . + html_tag( 'tr', + html_tag( 'td', _("Time:") , 'right', $color[4] ) ."\n" . + html_tag( 'td', $hour.':'.$minute , 'left', $color[4] ) ."\n" + ) . + html_tag( 'tr', + html_tag( 'td', _("Priority:") , 'right', $color[4] ) ."\n" . + html_tag( 'td', $tmparray[priority] , 'left', $color[4] ) ."\n" + ) . + html_tag( 'tr', + html_tag( 'td', _("Title:") , 'right', $color[4] ) ."\n" . + html_tag( 'td', $tmparray[title] , 'left', $color[4] ) ."\n" + ) . + html_tag( 'tr', + html_tag( 'td', _("Message:") , 'right', $color[4] ) ."\n" . + html_tag( 'td', $tmparray[message] , 'left', $color[4] ) ."\n" + ) . + html_tag( 'tr', + html_tag( 'th', _("to:") . "
\n", '', $color[4], 'colspan="2"' ) ."\n" + ) . + html_tag( 'tr', + html_tag( 'td', _("Date:") , 'right', $color[4] ) ."\n" . + html_tag( 'td', $event_month.'/'.$event_day.'/'.$event_year , 'left', $color[4] ) ."\n" + ) . + html_tag( 'tr', + html_tag( 'td', _("Time:") , 'right', $color[4] ) ."\n" . + html_tag( 'td', $event_hour.':'.$event_minute , 'left', $color[4] ) ."\n" + ) . + html_tag( 'tr', + html_tag( 'td', _("Priority:") , 'right', $color[4] ) ."\n" . + html_tag( 'td', $event_priority , 'left', $color[4] ) ."\n" + ) . + html_tag( 'tr', + html_tag( 'td', _("Title:") , 'right', $color[4] ) ."\n" . + html_tag( 'td', $event_title , 'left', $color[4] ) ."\n" + ) . + html_tag( 'tr', + html_tag( 'td', _("Message:") , 'right', $color[4] ) ."\n" . + html_tag( 'td', $event_text , 'left', $color[4] ) ."\n" + ) . + html_tag( 'tr', + html_tag( 'td', + "
\n". + " \n". + " \n". + " \n". + " \n". + " \n". + " \n". + " \n". + " \n". + " \n". + " \n". + " \n". + " \n". + " \n". + " \n". + " \n". + " \n". + ' \n". + "
\n" , + 'right', $color[4] ) ."\n" . + html_tag( 'td', + "
\n". + " \n". + " \n". + " \n". + ' \n". + "
\n" , + 'left', $color[4] ) ."\n" + ) , + '', $color[0], 'border="0" cellpadding="2" cellspacing="1"' ); } if ($month <= 0){ @@ -164,11 +202,13 @@ displayPageHeader($color, 'None'); //load calendar menu calendar_header(); -echo "" . - "" . - ''; +echo html_tag( 'tr', '', '', $color[0] ) . + html_tag( 'td', '', 'left' ) . + html_tag( 'table', '', '', $color[0], 'width="100%" border="0" cellpadding="2" cellspacing="1"' ) . + html_tag( 'tr' ) . + html_tag( 'td', + date_intl( _("l, F j Y"), mktime(0, 0, 0, $month, $day, $year)) , + 'left', '', 'colspan="2"' ); if (!isset($updated)){ //get changes to event readcalendardata(); @@ -184,9 +224,16 @@ if (!isset($updated)){ confirm_update(); } else { update_event("$month$day$year", "$hour$minute"); - echo "\n"; - echo "\n"; + echo html_tag( 'tr', + html_tag( 'td', _("Event updated!"), 'left' ) + ) . "\n"; + echo html_tag( 'tr', + html_tag( 'td', + "" . + _("Day View") ."", + 'left' ) + ) . "\n"; + $fixdate = date( 'mdY', mktime(0, 0, 0, $event_month, $event_day, $event_year)); //if event has been moved to different year then act accordingly if ($year==$event_year){ @@ -205,4 +252,4 @@ if (!isset($updated)){ ?>
' . - date_intl( 'l, F d Y', mktime(0, 0, 0, $month, $day, $year)) . - '
Event updated!
" . - _("Day View") ."
- \ No newline at end of file +