diff options
author | Kevin Jardine <kevinjardine@yahoo.com> | 2012-05-10 17:15:21 +0200 |
---|---|---|
committer | Kevin Jardine <kevinjardine@yahoo.com> | 2012-05-10 17:15:21 +0200 |
commit | 0f849b3526483df26b2228a51c1032c8504d64a1 (patch) | |
tree | c720eba91864e2dc7045eb5266b01d043d0edb54 | |
parent | f8b9db301d19813725b9f43020a52587b03baadc (diff) | |
download | elgg-0f849b3526483df26b2228a51c1032c8504d64a1.tar.gz elgg-0f849b3526483df26b2228a51c1032c8504d64a1.tar.bz2 |
empty event types are not displayed
-rw-r--r-- | models/model.php | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/models/model.php b/models/model.php index b3ba4db80..287adee54 100644 --- a/models/model.php +++ b/models/model.php @@ -1179,10 +1179,14 @@ function event_calendar_get_region($event) { function event_calendar_get_type($event) { $event_calendar_type_list_handles = elgg_get_plugin_setting('type_list_handles', 'event_calendar'); $type = trim($event->event_type); - if ($event_calendar_type_list_handles == 'yes') { - $type = elgg_echo('event_calendar:type:'.$type); - } - return htmlspecialchars($type); + if ($type) { + if ($event_calendar_type_list_handles == 'yes') { + $type = elgg_echo('event_calendar:type:'.$type); + } + return htmlspecialchars($type); + } else { + return $type; + } } function event_calendar_get_formatted_full_items($event) { @@ -1205,10 +1209,13 @@ function event_calendar_get_formatted_full_items($event) { $event_items[] = $item; } if ($event_calendar_type_display == 'yes') { - $item = new stdClass(); - $item->title = elgg_echo('event_calendar:type_label'); - $item->value = event_calendar_get_type($event); - $event_items[] = $item; + $event_type = event_calendar_get_type($event); + if ($event_type) { + $item = new stdClass(); + $item->title = elgg_echo('event_calendar:type_label'); + $item->value = event_calendar_get_type($event); + $event_items[] = $item; + } } $item = new stdClass(); $item->title = elgg_echo('event_calendar:fees_label'); |