From 69aa38ac22767d458399b33a7deccf410ee15f25 Mon Sep 17 00:00:00 2001 From: nickw Date: Thu, 20 May 2010 14:32:40 +0000 Subject: Updating RSS views to allow for object creator and geolocation. git-svn-id: http://code.elgg.org/elgg/trunk@6110 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/rss/annotation/default.php | 52 ++++++++++++++++------------------------ views/rss/object/creator.php | 8 +++++++ views/rss/object/default.php | 18 ++------------ views/rss/object/georss.php | 10 ++++++++ 4 files changed, 41 insertions(+), 47 deletions(-) create mode 100644 views/rss/object/creator.php create mode 100644 views/rss/object/georss.php (limited to 'views') diff --git a/views/rss/annotation/default.php b/views/rss/annotation/default.php index 8ff34b7fa..aaad66919 100644 --- a/views/rss/annotation/default.php +++ b/views/rss/annotation/default.php @@ -1,46 +1,36 @@ entity_guid); +$entity = get_entity($vars['annotation']->entity_guid); + $title = substr($vars['annotation']->value, 0, 32); if (strlen($vars['annotation']->value) > 32) { $title .= " ..."; } -?> +$permalink = $entity->getURL(); +$pubdate = date('r', $entity->time_created); - - getURL(); ?>#id; ?> - time_created) ?> - getURL(); ?>#id; ?> - <![CDATA[<?php echo $title; ?>]]> - value)); ?>]]> - owner); - if ($owner) { -?> - name; ?> - - getLongitude()) && - ($vars['entity']->getLatitude()) - ) { - ?> - getLatitude(); ?> getLongitude(); ?> - - - \ No newline at end of file +$creator = elgg_view('object/creator', array('entity' => $entity)); +$georss = elgg_view('object/georss', array('entity' => $entity)); +$extensions = elgg_view('extensions/item'); + +$item = <<<__HTML + + $permalink#{$vars['annotation']->id} + $pubdate + $permalink#{$vars['annotation']->id} + <![CDATA[$title]]> + value}]]> + $creator$georss$extensions + +__HTML; + +echo $item; diff --git a/views/rss/object/creator.php b/views/rss/object/creator.php new file mode 100644 index 000000000..2bc6fd57d --- /dev/null +++ b/views/rss/object/creator.php @@ -0,0 +1,8 @@ +getOwnerEntity()) { + echo "{$owner->name}"; +} diff --git a/views/rss/object/default.php b/views/rss/object/default.php index 7b1ab10bc..c7ff172f7 100644 --- a/views/rss/object/default.php +++ b/views/rss/object/default.php @@ -20,22 +20,8 @@ if (empty($title)) { $permalink = htmlspecialchars($vars['entity']->getURL()); $pubdate = date('r', $vars['entity']->time_created); -$creator = ''; -if ($owner = $vars['entity']->getOwnerEntity()) { - $creator = "{$owner->name}"; -} - -$georss = ''; -if ( - ($vars['entity'] instanceof Locatable) && - ($vars['entity']->getLongitude()) && - ($vars['entity']->getLatitude()) -) { - $latitude = $vars['entity']->getLatitude(); - $longitude = $vars['entity']->getLongitude(); - $georss = "$latitude $longitude"; -} - +$creator = elgg_view('object/creator', $vars); +$georss = elgg_view('object/georss', $vars); $extension = elgg_view('extensions/item'); $item = <<<__HTML diff --git a/views/rss/object/georss.php b/views/rss/object/georss.php new file mode 100644 index 000000000..8aa027519 --- /dev/null +++ b/views/rss/object/georss.php @@ -0,0 +1,10 @@ +getLongitude()) && ($longitude = $vars['entity']->getLatitude()) +) { + echo "$latitude $longitude"; +} \ No newline at end of file -- cgit v1.2.3