diff options
author | Chad Little <clittle@users.sourceforge.net> | 2004-02-01 04:16:36 +0000 |
---|---|---|
committer | Chad Little <clittle@users.sourceforge.net> | 2004-02-01 04:16:36 +0000 |
commit | 42ec254f9caa7322073f3356c82560970a7e3d32 (patch) | |
tree | dca0f64512a6a4ce921870157fca0635947d5bb0 | |
parent | 972908f8a0f06713db318770eb204579fa08a507 (diff) | |
download | phpicalendar-42ec254f9caa7322073f3356c82560970a7e3d32.tar.gz phpicalendar-42ec254f9caa7322073f3356c82560970a7e3d32.tar.bz2 phpicalendar-42ec254f9caa7322073f3356c82560970a7e3d32.zip |
Events now spawn popup on pages.
-rw-r--r-- | functions/date_functions.php | 1 | ||||
-rw-r--r-- | functions/template.php | 4 | ||||
-rw-r--r-- | templates/default/calendar_nav.tpl | 10 | ||||
-rw-r--r-- | templates/default/header.tpl | 22 | ||||
-rw-r--r-- | templates/default/year.tpl | 6 | ||||
-rw-r--r-- | year.php | 35 |
6 files changed, 34 insertions, 44 deletions
diff --git a/functions/date_functions.php b/functions/date_functions.php index 02cfa77..ccd6bf6 100644 --- a/functions/date_functions.php +++ b/functions/date_functions.php @@ -196,7 +196,6 @@ function openevent($calendar_name, $start, $end, $arr, $lines, $wrap, $pre_text, // fix for URL-length bug in IE: populate and submit a hidden form on click static $popup_data_index = 0; $return = " - <script language=\"Javascript\" type=\"text/javascript\"><!-- var eventData = new EventData('$escaped_event', '$escaped_calendar', '$escaped_start', '$escaped_end', '$description', '$status', '$location', '$organizer', '$attendee', '$url'); document.popup_data[$popup_data_index] = eventData; diff --git a/functions/template.php b/functions/template.php index a59ea29..a84be3a 100644 --- a/functions/template.php +++ b/functions/template.php @@ -2,8 +2,6 @@ //print_r($master_array); - - class Page { var $page; function draw_month($template_p, $offset = '+0', $type) { @@ -21,7 +19,6 @@ class Page { $t_month[0] = trim($match3[1]); $t_month[1] = trim($match4[1]); $t_month[2] = trim($match5[1]); - $startweek = trim($match6[1]); $endweek = trim($match7[1]); if ($type != 'medium') { @@ -126,6 +123,7 @@ class Page { $return = preg_replace('!<\!-- loop weekday on -->(.*)<\!-- loop weekday off -->!is', $weekday_loop, $template_p); $return = ereg_replace('<!-- loop monthweeks on -->(.*)<!-- loop monthweeks off -->', $middle, $return); $return = str_replace('{MONTH_TITLE}', $month_title, $return); + $return = str_replace('{CAL}', $cal, $return); return $return; diff --git a/templates/default/calendar_nav.tpl b/templates/default/calendar_nav.tpl index c32e61f..668734c 100644 --- a/templates/default/calendar_nav.tpl +++ b/templates/default/calendar_nav.tpl @@ -21,11 +21,11 @@ <tr> <td> <div style="padding: 5px;"> - <form style="margin-bottom:0;" action="day.php" method="GET"> - <select name="action" class="query_style" onChange="window.location=(this.options[this.selectedIndex].value">{LIST_ICALS}</select><br> - <select name="action" class="query_style" onChange="window.location=(this.options[this.selectedIndex].value">{LIST_YEARS}</select><br> - <select name="action" class="query_style" onChange="window.location=(this.options[this.selectedIndex].value">{LIST_MONTHS}</select><br> - <select name="action" class="query_style" onChange="window.location=(this.options[this.selectedIndex].value">{LIST_WEEKS}</select><br> + <form style="margin-bottom:0;" action="{CURRENT_VIEW}.php" method="GET"> + <select name="action" class="query_style" onChange="window.location=(this.options[this.selectedIndex].value);">{LIST_ICALS}</select><br> + <select name="action" class="query_style" onChange="window.location=(this.options[this.selectedIndex].value);">{LIST_YEARS}</select><br> + <select name="action" class="query_style" onChange="window.location=(this.options[this.selectedIndex].value);">{LIST_MONTHS}</select><br> + <select name="action" class="query_style" onChange="window.location=(this.options[this.selectedIndex].value);">{LIST_WEEKS}</select><br> </form> <!-- switch show_search on --> {SEARCH_BOX} diff --git a/templates/default/header.tpl b/templates/default/header.tpl index 59aae9a..9ecc5fc 100644 --- a/templates/default/header.tpl +++ b/templates/default/header.tpl @@ -8,11 +8,19 @@ <!-- switch rss_available on --> <link rel="alternate" type="application/rss+xml" title="RSS" href="{DEFAULT_VIEW}/rss/rss.php?cal={CAL}&rssview={CURRENT_VIEW}"> <!-- switch rss_available off --> - <!-- switch event_js on --> - {EVENT_JS} - <!-- switch event_js off --> - <!-- switch todo_available on --> - {TODO_JS} - <!-- switch todo_available off --> + {EVENT_JS} + {TODO_JS} </head> -<body>
\ No newline at end of file +<body> +<form name="eventPopupForm" id="eventPopupForm" method="post" action="includes/event.php" style="display: none;"> + <input type="hidden" name="event" id="event" value=""> + <input type="hidden" name="cal" id="cal" value=""> + <input type="hidden" name="start" id="start" value=""> + <input type="hidden" name="end" id="end" value=""> + <input type="hidden" name="description" id="description" value=""> + <input type="hidden" name="status" id="status" value=""> + <input type="hidden" name="location" id="location" value=""> + <input type="hidden" name="organizer" id="organizer" value=""> + <input type="hidden" name="attendee" id="attendee" value=""> + <input type="hidden" name="url" id="url" value=""> +</form>
\ No newline at end of file diff --git a/templates/default/year.tpl b/templates/default/year.tpl index f297cde..d64e078 100644 --- a/templates/default/year.tpl +++ b/templates/default/year.tpl @@ -12,13 +12,13 @@ <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="right" width="45%" class="navback"> - <a class="psf" href="year.php?cal=all_calendars_combined971&getdate=20030129"><img src="styles/silver/left_day.gif" alt="[Previous Year]" border="0" align="right"></a> + <a class="psf" href="year.php?cal={CAL}&getdate={PREV_YEAR}"><img src="styles/silver/left_day.gif" alt="[Previous Year]" border="0" align="right"></a> </td> <td align="center" width="10%" class="navback" nowrap valign="middle"> - <font class="H20">2004</font> + <font class="H20">{THIS_YEAR}</font> </td> <td align="left" width="45%" class="navback"> - <a class="psf" href="year.php?cal=all_calendars_combined971&getdate=20050129"><img src="styles/silver/right_day.gif" alt="[Next Year]" border="0" align="left"></a> + <a class="psf" href="year.php?cal={CAL}&getdate={NEXT_YEAR}"><img src="styles/silver/right_day.gif" alt="[Next Year]" border="0" align="left"></a> </td> </tr> </table> @@ -6,21 +6,13 @@ require_once(BASE.'functions/template.php'); $current_view = 'year'; ereg ("([0-9]{4})([0-9]{2})([0-9]{2})", $getdate, $day_array2); -$this_day = $day_array2[3]; +$this_day = $day_array2[3]; $this_month = $day_array2[2]; -$this_year = $day_array2[1]; -$display_date = $day_array2[1]; - -$unix_time = strtotime($getdate); -$startYear = strtotime ($this_year); -$checkad = date ("Ymd", $startYear); - -$next_year = strtotime ("+1 year", strtotime("$getdate")); -$next_year = date ("Ymd", $next_year); -$prev_year = strtotime ("-1 year", strtotime("$getdate")); -$prev_year = date ("Ymd", $prev_year); - -$thisday2 = localizeDate($dateFormat_week_list, $unix_time); +$this_year = $day_array2[1]; +$next_year = strtotime ("+1 year", strtotime($getdate)); +$next_year = date ("Ymd", $next_year); +$prev_year = strtotime ("-1 year", strtotime($getdate)); +$prev_year = date ("Ymd", $prev_year); $page = new Page(BASE.'templates/'.$template.'/year.tpl'); @@ -31,22 +23,15 @@ $page->replace_tags(array( 'cal' => $cal, 'getdate' => $getdate, 'calendar_name' => $calendar_name, - 'display_date' => $display_date, + 'display_date' => $this_year, 'rss_powered' => $rss_powered, 'rss_available' => '', 'rss_valid' => '', 'todo_available' => '', 'event_js' => '', - 'show_search' => '', - 'next_month' => $next_month, - 'prev_month' => $prev_month, - 'show_goto' => '', - 'is_logged_in' => '', - 'list_icals' => $list_icals, - 'list_years' => $list_years, - 'list_months' => $list_months, - 'list_weeks' => $list_weeks, - 'style_select' => $style_select + 'this_year' => $this_year, + 'next_year' => $next_year, + 'prev_year' => $prev_year )); $page->output(); |