aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChad Little <clittle@users.sourceforge.net>2004-05-15 23:56:17 +0000
committerChad Little <clittle@users.sourceforge.net>2004-05-15 23:56:17 +0000
commit8767e4b66fffb6010646f92a77b267e5e254d2d0 (patch)
tree8173d4b42b8a8c70288253903dd52810e1bac936
parent7bede9014cacd534de83640496a9f7aa1fdf3d39 (diff)
downloadphpicalendar-8767e4b66fffb6010646f92a77b267e5e254d2d0.tar.gz
phpicalendar-8767e4b66fffb6010646f92a77b267e5e254d2d0.tar.bz2
phpicalendar-8767e4b66fffb6010646f92a77b267e5e254d2d0.zip
Subscribe and Download links work on all templates.
-rw-r--r--day.php1
-rw-r--r--functions/template.php12
-rw-r--r--month.php1
-rw-r--r--week.php1
4 files changed, 15 insertions, 0 deletions
diff --git a/day.php b/day.php
index 93e0eaf..9dc3e82 100644
--- a/day.php
+++ b/day.php
@@ -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) {
diff --git a/month.php b/month.php
index 017b5a1..1f7fc9b 100644
--- a/month.php
+++ b/month.php
@@ -79,6 +79,7 @@ $page->replace_tags(array(
));
$page->monthbottom($this->page);
+$page->draw_subscribe($this->page);
$page->output();
diff --git a/week.php b/week.php
index 1caa054..effa298 100644
--- a/week.php
+++ b/week.php
@@ -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();

© 2014-2024 Faster IT GmbH | imprint | privacy policy