aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWesley Miaw <josuah@users.sourceforge.net>2005-12-01 06:25:09 +0000
committerWesley Miaw <josuah@users.sourceforge.net>2005-12-01 06:25:09 +0000
commit20030121c4fc988b94418561191bd9784b9cfd29 (patch)
tree05fe8479ef2a8c02ab867213d1bbd3e7cf4ec412
parente5e49f470c5e4cdcf55671416ea7297177d139ff (diff)
downloadphpicalendar-20030121c4fc988b94418561191bd9784b9cfd29.tar.gz
phpicalendar-20030121c4fc988b94418561191bd9784b9cfd29.tar.bz2
phpicalendar-20030121c4fc988b94418561191bd9784b9cfd29.zip
Feature #1109495. Print view will now show the location if the field
is defined. Code provided by Nicolas Contamin.
-rw-r--r--functions/template.php9
-rw-r--r--print.php1
-rw-r--r--templates/default/print.tpl6
3 files changed, 14 insertions, 2 deletions
diff --git a/functions/template.php b/functions/template.php
index c70da14..399aa6a 100644
--- a/functions/template.php
+++ b/functions/template.php
@@ -76,6 +76,7 @@ class Page {
foreach ($new_val as $new_key2 => $new_val2) {
if ($new_val2['event_text']) {
$event_text = stripslashes(urldecode($new_val2['event_text']));
+ $location = stripslashes(urldecode($new_val2['location']));
$description = stripslashes(urldecode($new_val2['description']));
$event_start = $new_val2['event_start'];
$event_end = $new_val2['event_end'];
@@ -94,9 +95,13 @@ class Page {
if ($description == '') {
$events_tmp = preg_replace('!<\!-- switch description_events on -->(.*)<\!-- switch description_events off -->!is', '', $events_tmp);
}
+
+ if ($location == '') {
+ $events_tmp = preg_replace('!<\!-- switch location_events on -->(.*)<\!-- switch location_events off -->!is', '', $events_tmp);
+ }
- $search = array('{EVENT_START}', '{EVENT_TEXT}', '{DESCRIPTION}');
- $replace = array($event_start, $event_text, $description);
+ $search = array('{EVENT_START}', '{EVENT_TEXT}', '{DESCRIPTION}', '{LOCATION}');
+ $replace = array($event_start, $event_text, $description, $location);
$events_tmp = str_replace($search, $replace, $events_tmp);
$some_events .= $events_tmp;
$events_tmp = $loop_event;
diff --git a/print.php b/print.php
index 8aa9b75..34a9c92 100644
--- a/print.php
+++ b/print.php
@@ -79,6 +79,7 @@ $page->replace_tags(array(
'l_week' => $lang['l_week'],
'l_month' => $lang['l_month'],
'l_year' => $lang['l_year'],
+ 'l_location' => $lang['l_location'],
'l_subscribe' => $lang['l_subscribe'],
'l_download' => $lang['l_download'],
'l_no_results' => $lang['l_no_results'],
diff --git a/templates/default/print.tpl b/templates/default/print.tpl
index cb34c00..c1c8d4e 100644
--- a/templates/default/print.tpl
+++ b/templates/default/print.tpl
@@ -38,6 +38,12 @@
<td width="100" class="G10BOLD">{L_TIME}:</td>
<td align="left" class="G10B">{EVENT_START}</td>
</tr>
+ <!-- switch location_events on -->
+ <tr>
+ <td valign="top" width="100" class="G10BOLD">{L_LOCATION}:</td>
+ <td valign="top" align="left" class="G10B">{LOCATION}</td>
+ </tr>
+ <!-- switch location_events off -->
<tr>
<td valign="top" width="100" class="G10BOLD">{L_SUMMARY}:</td>
<td valign="top" align="left" class="G10B">{EVENT_TEXT}</td>

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