From 29792a9858484266952a53268e4fd0dd29b2f4a5 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Tue, 28 Jun 2011 18:12:41 -0400 Subject: moved the code into the base directory so that it is easier to work with --- .../event_calendar/entities/entity_list.php | 66 ++++++++++++++++++++++ views/default/event_calendar/entities/gallery.php | 44 +++++++++++++++ .../event_calendar/entities/gallery_item.php | 63 +++++++++++++++++++++ 3 files changed, 173 insertions(+) create mode 100644 views/default/event_calendar/entities/entity_list.php create mode 100644 views/default/event_calendar/entities/gallery.php create mode 100644 views/default/event_calendar/entities/gallery_item.php (limited to 'views/default/event_calendar/entities') diff --git a/views/default/event_calendar/entities/entity_list.php b/views/default/event_calendar/entities/entity_list.php new file mode 100644 index 000000000..84c2c0b7d --- /dev/null +++ b/views/default/event_calendar/entities/entity_list.php @@ -0,0 +1,66 @@ + + * @link http://elgg.com/ + * + */ + +$context = $vars['context']; +$offset = $vars['offset']; +$entities = $vars['entities']; +$limit = $vars['limit']; +$count = $vars['count']; +$baseurl = $vars['baseurl']; +$context = $vars['context']; +$viewtype = $vars['viewtype']; +$pagination = $vars['pagination']; +$fullview = $vars['fullview']; + +$html = ""; +$nav = ""; + +if (isset($vars['viewtypetoggle'])) { + $viewtypetoggle = $vars['viewtypetoggle']; +} else { + $viewtypetoggle = true; +} + +if ($context == "search" && $count > 0 && $viewtypetoggle) { + $nav .= elgg_view('navigation/viewtype', array( + 'baseurl' => $baseurl, + 'offset' => $offset, + 'count' => $count, + 'viewtype' => $viewtype, + )); +} + +if ($pagination) { + $nav .= elgg_view('navigation/pagination',array( + 'baseurl' => $baseurl, + 'offset' => $offset, + 'count' => $count, + 'limit' => $limit, + )); +} + +$html .= $nav; +if ($viewtype == 'list') { + if (is_array($entities) && sizeof($entities) > 0) { + foreach($entities as $entity) { + $html .= elgg_view_entity($entity, $fullview); + } + } +} else { + if (is_array($entities) && sizeof($entities) > 0) { + $html .= elgg_view('event_calendar/entities/gallery', array('entities' => $entities)); + } +} + +if ($count) { + $html .= $nav; +} + +echo $html; \ No newline at end of file diff --git a/views/default/event_calendar/entities/gallery.php b/views/default/event_calendar/entities/gallery.php new file mode 100644 index 000000000..a12dfa84a --- /dev/null +++ b/views/default/event_calendar/entities/gallery.php @@ -0,0 +1,44 @@ + 0) { + +?> + + + +"; + + } + echo ""; + $col++; + if ($col > 3) { + echo ""; + $col = 0; + } + } + if ($col > 0) echo ""; + +?> + + + + + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.com/ + * + * @uses $vars['entity'] The user entity + */ + +$icon = elgg_view( + "profile/icon", array( + 'entity' => $vars['entity'], + 'size' => 'medium', + ) + ); + +$banned = $vars['entity']->isBanned(); + +$rel = ""; +if (page_owner() == $vars['entity']->guid) + $rel = 'me'; +else if (check_entity_relationship(page_owner(), 'friend', $vars['entity']->guid)) + $rel = 'friend'; + +if (!$banned) + $info .= "

getUrl() . "\" rel=\"$rel\">" . $vars['entity']->name . "

"; +else + $info .= "

" . $vars['entity']->name . "
".elgg_echo('profile:banned')."

"; + +// TODO: look into a way to pass $authorised and $event_id in $vars +$authorised = FALSE; +$event_id = get_input('event_id', 0); +if ($event_id) { + if(isadminloggedin()) { + $authorised = TRUE; + } else { + // load the event from the database + $event = get_entity($event_id); + $user_id = get_loggedin_userid(); + if ($event && ($event->owner_guid == $user_id)) { + $authorised = TRUE; + } + } +} + +if ($authorised) { + $link = '

guid.'); return false;" '; + $link .= ' >'; + $link .= ''.elgg_echo('event_calendar:remove_from_the_calendar').''; + $link .= '

'; + $info .= $link; +} + +// echo elgg_view_listing($icon, $info); +echo elgg_view('search/gallery_listing',array('icon' => $icon, 'info' => $info)); + +?> \ No newline at end of file -- cgit v1.2.3