diff options
author | Chad Little <clittle@users.sourceforge.net> | 2004-05-15 23:56:17 +0000 |
---|---|---|
committer | Chad Little <clittle@users.sourceforge.net> | 2004-05-15 23:56:17 +0000 |
commit | 8767e4b66fffb6010646f92a77b267e5e254d2d0 (patch) | |
tree | 8173d4b42b8a8c70288253903dd52810e1bac936 | |
parent | 7bede9014cacd534de83640496a9f7aa1fdf3d39 (diff) | |
download | phpicalendar-8767e4b66fffb6010646f92a77b267e5e254d2d0.tar.gz phpicalendar-8767e4b66fffb6010646f92a77b267e5e254d2d0.tar.bz2 phpicalendar-8767e4b66fffb6010646f92a77b267e5e254d2d0.zip |
Subscribe and Download links work on all templates.
-rw-r--r-- | day.php | 1 | ||||
-rw-r--r-- | functions/template.php | 12 | ||||
-rw-r--r-- | month.php | 1 | ||||
-rw-r--r-- | week.php | 1 |
4 files changed, 15 insertions, 0 deletions
@@ -80,6 +80,7 @@ $page->replace_tags(array( $page->draw_day($this->page); $page->tomorrows_events($this->page); $page->get_vtodo($this->page); +$page->draw_subscribe($this->page); $page->output(); diff --git a/functions/template.php b/functions/template.php index e5c631b..3c2eefe 100644 --- a/functions/template.php +++ b/functions/template.php @@ -4,6 +4,18 @@ class Page { var $page; + function draw_subscribe($template_p) { + global $template, $getdate, $cal, $ALL_CALENDARS_COMBINED, $subscribe_path, $download_filename; + preg_match("!<\!-- switch display_download on -->(.*)<\!-- switch display_download off -->!is", $this->page, $match1); + $subscribe = trim($match2[1]); + if ($cal != $ALL_CALENDARS_COMBINED && $subscribe_path != '' && $download_filename != '') { + $this->page = str_replace('{SUBSCRIBE_PATH}', $subscribe_path, $this->page); + $this->page = str_replace('{DOWNLOAD_FILENAME}', $download_filename, $this->page); + } else { + $this->page = preg_replace('!<\!-- switch display_download on -->(.*)<\!-- switch display_download off -->!is', '', $this->page); + } + } + function draw_print($template_p) { global $template, $getdate, $cal, $master_array, $daysofweek_lang, $week_start_day; foreach($master_array as $key => $val) { @@ -79,6 +79,7 @@ $page->replace_tags(array( )); $page->monthbottom($this->page); +$page->draw_subscribe($this->page); $page->output(); @@ -85,6 +85,7 @@ $page->replace_tags(array( $page->draw_week($this->page); $page->tomorrows_events($this->page); $page->get_vtodo($this->page); +$page->draw_subscribe($this->page); $page->output(); |