event_calendar.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. /**
  3. * Elgg default object view
  4. *
  5. * @package Elgg
  6. * @subpackage Core
  7. * @author Curverider Ltd
  8. * @link http://elgg.org/
  9. */
  10. elgg_load_library('elgg:event_calendar');
  11. $title = $vars['entity']->title;
  12. $event_items = event_calendar_get_formatted_full_items($vars['entity']);
  13. $items = array();
  14. foreach($event_items as $item) {
  15. if (trim($item->value)) {
  16. $items[] = '<b>'.$item->title.'</b>: '.$item->value;
  17. }
  18. }
  19. $description = '<p>'.implode('<br />',$items).'</p>';
  20. if ($vars['entity']->long_description) {
  21. $description .= '<p>'.elgg_autop($vars['entity']->long_description).'</p>';
  22. } else {
  23. $description .= '<p>'.$vars['entity']->description.'</p>';
  24. }
  25. ?>
  26. <item>
  27. <guid isPermaLink='true'><?php echo htmlspecialchars($vars['entity']->getURL()); ?></guid>
  28. <link><?php echo htmlspecialchars($vars['entity']->getURL()); ?></link>
  29. <title><![CDATA[<?php echo $title; ?>]]></title>
  30. <description><![CDATA[<?php echo $description; ?>]]></description>
  31. <?php
  32. $owner = $vars['entity']->getOwnerEntity();
  33. if ($owner)
  34. {
  35. ?>
  36. <dc:creator><?php echo $owner->name; ?></dc:creator>
  37. <?php
  38. }
  39. ?>
  40. <?php
  41. if (
  42. ($vars['entity'] instanceof Locatable) &&
  43. ($vars['entity']->getLongitude()) &&
  44. ($vars['entity']->getLatitude())
  45. ) {
  46. ?>
  47. <georss:point><?php echo $vars['entity']->getLatitude(); ?> <?php echo $vars['entity']->getLongitude(); ?></georss:point>
  48. <?php
  49. }
  50. ?>
  51. <?php echo elgg_view('extensions/item'); ?>
  52. </item>