diff options
author | Sem <sembrestels@riseup.net> | 2013-11-09 16:24:39 +0100 |
---|---|---|
committer | Sem <sembrestels@riseup.net> | 2013-11-09 16:24:39 +0100 |
commit | a9ac4c861335e60373c1e99b61372e6e0d6ac9f4 (patch) | |
tree | 84e660ad22367aab1697a1f910125f520243b882 /mod/event_calendar/views/default/object | |
parent | 1f40407cb2d2f0edfc4cc5346f332f5c6adab022 (diff) | |
parent | b011a80767e1062a394b7bbbc3be3d2959a5f773 (diff) | |
download | elgg-a9ac4c861335e60373c1e99b61372e6e0d6ac9f4.tar.gz elgg-a9ac4c861335e60373c1e99b61372e6e0d6ac9f4.tar.bz2 |
Add 'mod/event_calendar/' from commit 'b011a80767e1062a394b7bbbc3be3d2959a5f773'
git-subtree-dir: mod/event_calendar
git-subtree-mainline: 1f40407cb2d2f0edfc4cc5346f332f5c6adab022
git-subtree-split: b011a80767e1062a394b7bbbc3be3d2959a5f773
Diffstat (limited to 'mod/event_calendar/views/default/object')
-rw-r--r-- | mod/event_calendar/views/default/object/event_calendar.php | 115 |
1 files changed, 115 insertions, 0 deletions
diff --git a/mod/event_calendar/views/default/object/event_calendar.php b/mod/event_calendar/views/default/object/event_calendar.php new file mode 100644 index 000000000..17f7ff130 --- /dev/null +++ b/mod/event_calendar/views/default/object/event_calendar.php @@ -0,0 +1,115 @@ +<?php + +/** + * Elgg event_calendar object view + * + * @package event_calendar + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Kevin Jardine <kevin@radagast.biz> + * @copyright Radagast Solutions 2008 + * @link http://radagast.biz/ + * + */ + +elgg_load_library('elgg:event_calendar'); + +$event = $vars['entity']; +$full = elgg_extract('full_view', $vars, FALSE); + +if ($full) { + $body = elgg_view('event_calendar/strapline',$vars); + if ($event->web_conference) { + $body .= '<br />'; + $body .= elgg_view('event_calendar/conference_button',array('event'=>$event)); + } + $event_items = event_calendar_get_formatted_full_items($event); + $body .= '<br />'; + + foreach($event_items as $item) { + $value = $item->value; + if (!empty($value)) { + + //This function controls the alternating class + $even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even'; + $body .= "<p class=\"{$even_odd}\"><b>"; + $body .= $item->title.':</b> '; + $body .= $item->value; + } + } + $metadata = elgg_view_menu('entity', array( + 'entity' => $event, + 'handler' => 'event_calendar', + 'sort_by' => 'priority', + 'class' => 'elgg-menu-hz', + )); + + $tags = elgg_view('output/tags', array('tags' => $event->tags)); + + $params = array( + 'entity' => $event, + 'metadata' => $metadata, + 'tags' => $tags, + 'title' => false, + ); + $list_body = elgg_view('object/elements/summary', $params); + echo $list_body; + echo $body; + if ($event->long_description) { + echo '<div class="elgg-output">'.$event->long_description.'</div>'; + } else { + echo '<div class="elgg-output">'.$event->description.'</div>'; + } + if ($vars['light_box'] == TRUE) { + $event_calendar_add_users = elgg_get_plugin_setting('add_users', 'event_calendar'); + if ($event_calendar_add_users == 'yes') { + $url = "event_calendar/manage_users/$event->guid"; + echo '<p>'.elgg_view('output/url',array('text'=> elgg_echo('event_calendar:manage_users:breadcrumb'), 'href'=>$url)).'</p>'; + } + } + if (elgg_get_plugin_setting('add_to_group_calendar', 'event_calendar') == 'yes') { + echo elgg_view('event_calendar/forms/add_to_group',array('event' => $event)); + } + +} else { + + $time_bit = event_calendar_get_formatted_time($event); + $icon = '<img src="'.elgg_view("icon/object/event_calendar/small").'" />'; + $extras = array($time_bit); + if ($event->description) { + $extras[] = $event->description; + } + + if ($event_calendar_venue_view = elgg_get_plugin_setting('venue_view', 'event_calendar') == 'yes') { + $extras[] = $event->venue; + } + if ($extras) { + $info = "<p>".implode("<br />",$extras)."</p>"; + } else { + $info = ''; + } + + if (elgg_in_context('widgets')) { + $metadata = ''; + } else { + $metadata = elgg_view_menu('entity', array( + 'entity' => $event, + 'handler' => 'event_calendar', + 'sort_by' => 'priority', + 'class' => 'elgg-menu-hz', + )); + } + + $tags = elgg_view('output/tags', array('tags' => $event->tags)); + + $params = array( + 'entity' => $event, + 'metadata' => $metadata, + 'subtitle' => $info, + 'tags' => $tags, + ); + $list_body = elgg_view('object/elements/summary', $params); + + echo elgg_view_image_block($icon, $list_body); +} + +?> |