event_calendar.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <?php
  2. /**
  3. * Elgg event_calendar object view
  4. *
  5. * @package event_calendar
  6. * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
  7. * @author Kevin Jardine <kevin@radagast.biz>
  8. * @copyright Radagast Solutions 2008
  9. * @link http://radagast.biz/
  10. *
  11. */
  12. elgg_load_library('elgg:event_calendar');
  13. $event = $vars['entity'];
  14. $full = elgg_extract('full_view', $vars, FALSE);
  15. if ($full) {
  16. $body = elgg_view('event_calendar/strapline',$vars);
  17. if ($event->web_conference) {
  18. $body .= '<br />';
  19. $body .= elgg_view('event_calendar/conference_button',array('event'=>$event));
  20. }
  21. $event_items = event_calendar_get_formatted_full_items($event);
  22. $body .= '<br />';
  23. foreach($event_items as $item) {
  24. $value = $item->value;
  25. if (!empty($value)) {
  26. //This function controls the alternating class
  27. $even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even';
  28. $body .= "<p class=\"{$even_odd}\"><b>";
  29. $body .= $item->title.':</b> ';
  30. $body .= $item->value;
  31. }
  32. }
  33. $metadata = elgg_view_menu('entity', array(
  34. 'entity' => $event,
  35. 'handler' => 'event_calendar',
  36. 'sort_by' => 'priority',
  37. 'class' => 'elgg-menu-hz',
  38. ));
  39. $tags = elgg_view('output/tags', array('tags' => $event->tags));
  40. $params = array(
  41. 'entity' => $event,
  42. 'metadata' => $metadata,
  43. 'tags' => $tags,
  44. 'title' => false,
  45. );
  46. $list_body = elgg_view('object/elements/summary', $params);
  47. echo $list_body;
  48. echo $body;
  49. if ($event->long_description) {
  50. echo '<div class="elgg-output">'.$event->long_description.'</div>';
  51. } else {
  52. echo '<div class="elgg-output">'.$event->description.'</div>';
  53. }
  54. if ($vars['light_box'] == TRUE) {
  55. $event_calendar_add_users = elgg_get_plugin_setting('add_users', 'event_calendar');
  56. if ($event_calendar_add_users == 'yes') {
  57. $url = "event_calendar/manage_users/$event->guid";
  58. echo '<p>'.elgg_view('output/url',array('text'=> elgg_echo('event_calendar:manage_users:breadcrumb'), 'href'=>$url)).'</p>';
  59. }
  60. }
  61. if (elgg_get_plugin_setting('add_to_group_calendar', 'event_calendar') == 'yes') {
  62. echo elgg_view('event_calendar/forms/add_to_group',array('event' => $event));
  63. }
  64. } else {
  65. $time_bit = event_calendar_get_formatted_time($event);
  66. $icon = '<img src="'.elgg_view("icon/object/event_calendar/small").'" />';
  67. $extras = array($time_bit);
  68. if ($event->description) {
  69. $extras[] = $event->description;
  70. }
  71. if ($event_calendar_venue_view = elgg_get_plugin_setting('venue_view', 'event_calendar') == 'yes') {
  72. $extras[] = $event->venue;
  73. }
  74. if ($extras) {
  75. $info = "<p>".implode("<br />",$extras)."</p>";
  76. } else {
  77. $info = '';
  78. }
  79. if (elgg_in_context('widgets')) {
  80. $metadata = '';
  81. } else {
  82. $metadata = elgg_view_menu('entity', array(
  83. 'entity' => $event,
  84. 'handler' => 'event_calendar',
  85. 'sort_by' => 'priority',
  86. 'class' => 'elgg-menu-hz',
  87. ));
  88. }
  89. $tags = elgg_view('output/tags', array('tags' => $event->tags));
  90. $params = array(
  91. 'entity' => $event,
  92. 'metadata' => $metadata,
  93. 'subtitle' => $info,
  94. 'tags' => $tags,
  95. );
  96. $list_body = elgg_view('object/elements/summary', $params);
  97. echo elgg_view_image_block($icon, $list_body);
  98. }
  99. ?>