From: <jo...@us...> - 2005-12-01 06:25:20
|
Update of /cvsroot/phpicalendar/phpicalendar/functions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21357/functions Modified Files: template.php Log Message: Feature #1109495. Print view will now show the location if the field is defined. Code provided by Nicolas Contamin. Index: template.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/functions/template.php,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** template.php 1 Dec 2005 06:15:30 -0000 1.78 --- template.php 1 Dec 2005 06:25:09 -0000 1.79 *************** *** 77,80 **** --- 77,81 ---- 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']; *************** *** 95,101 **** $events_tmp = preg_replace('!<\!-- switch description_events on -->(.*)<\!-- switch description_events off -->!is', '', $events_tmp); } ! $search = array('{EVENT_START}', '{EVENT_TEXT}', '{DESCRIPTION}'); ! $replace = array($event_start, $event_text, $description); $events_tmp = str_replace($search, $replace, $events_tmp); $some_events .= $events_tmp; --- 96,106 ---- $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}', '{LOCATION}'); ! $replace = array($event_start, $event_text, $description, $location); $events_tmp = str_replace($search, $replace, $events_tmp); $some_events .= $events_tmp; |