From 4106d50727d5a56ec1442b16e182fbd9acc6b167 Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 29 Oct 2011 15:07:43 -0400 Subject: Fixes #3201 updates rss view type for core Elgg --- views/rss/annotation/generic_comment.php | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 views/rss/annotation/generic_comment.php (limited to 'views/rss/annotation/generic_comment.php') diff --git a/views/rss/annotation/generic_comment.php b/views/rss/annotation/generic_comment.php new file mode 100644 index 000000000..9e9107568 --- /dev/null +++ b/views/rss/annotation/generic_comment.php @@ -0,0 +1,33 @@ +getOwnerEntity(); +$poster_name = htmlspecialchars($poster->name, ENT_NOQUOTES, 'UTF-8'); +$pubdate = date('r', $annotation->getTimeCreated()); +$permalink = $annotation->getURL(); + +$title = elgg_echo('generic_comment:title', array($poster_name)); + +$creator = elgg_view('page/components/creator', array('entity' => $annotation)); +$extensions = elgg_view('extensions/item'); + +$item = <<<__HTML + + $permalink + $pubdate + $permalink + <![CDATA[$title]]> + value}]]> + $creator$extensions + + +__HTML; + +echo $item; -- cgit v1.2.3 From 7f8b7adeb346c8d07e2da4b72e9f78e8ffcb82b9 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Thu, 3 Nov 2011 08:24:19 -0400 Subject: Refs #4027 updated all rss views except for groups --- mod/bookmarks/languages/en.php | 4 +- mod/bookmarks/views/rss/object/bookmarks.php | 36 +++++++++++------ mod/file/start.php | 3 ++ mod/file/views/rss/file/enclosure.php | 16 ++++++++ mod/file/views/rss/object/file.php | 21 ---------- mod/search/views/rss/search/list.php | 25 ++++++++++++ mod/search/views/rss/search/listing.php | 25 ------------ mod/thewire/languages/en.php | 1 + mod/thewire/views/rss/object/thewire.php | 59 +++++++++++----------------- views/rss/annotation/generic_comment.php | 2 +- views/rss/group/default.php | 2 +- views/rss/object/default.php | 6 ++- views/rss/user/default.php | 2 +- 13 files changed, 103 insertions(+), 99 deletions(-) create mode 100644 mod/file/views/rss/file/enclosure.php delete mode 100644 mod/file/views/rss/object/file.php create mode 100644 mod/search/views/rss/search/list.php delete mode 100644 mod/search/views/rss/search/listing.php (limited to 'views/rss/annotation/generic_comment.php') diff --git a/mod/bookmarks/languages/en.php b/mod/bookmarks/languages/en.php index 0478e292f..2c589c207 100644 --- a/mod/bookmarks/languages/en.php +++ b/mod/bookmarks/languages/en.php @@ -68,14 +68,14 @@ $english = array( */ 'bookmarks:save:success' => "Your item was successfully bookmarked.", - 'bookmarks:delete:success' => "Your bookmarked item was successfully deleted.", + 'bookmarks:delete:success' => "Your bookmark was deleted.", /** * Error messages */ 'bookmarks:save:failed' => "Your bookmark could not be saved. Make sure you've entered a title and address and then try again.", - 'bookmarks:save:invalid' => "The address of the bookmark is invalid and could nto be saved.", + 'bookmarks:save:invalid' => "The address of the bookmark is invalid and could not be saved.", 'bookmarks:delete:failed' => "Your bookmark could not be deleted. Please try again.", ); diff --git a/mod/bookmarks/views/rss/object/bookmarks.php b/mod/bookmarks/views/rss/object/bookmarks.php index 8e88485f1..1abda4710 100644 --- a/mod/bookmarks/views/rss/object/bookmarks.php +++ b/mod/bookmarks/views/rss/object/bookmarks.php @@ -1,23 +1,37 @@ title; if (empty($title)) { - $title = substr($vars['entity']->description,0,32); - if (strlen($vars['entity']->description) > 32) - $title .= " ..."; + $title = strip_tags($vars['entity']->description); + $title = elgg_get_excerpt($title, 32); } -?> +$permalink = htmlspecialchars($vars['entity']->getURL(), ENT_NOQUOTES, 'UTF-8'); +$pubdate = date('r', $vars['entity']->getTimeCreated()); +$url_text = elgg_echo('bookmarks:address'); +$link = elgg_view('output/url', array('href' => $vars['entity']->address)); +$description = $vars['entity']->description . "

$url_text: $link

"; + +$creator = elgg_view('page/components/creator', $vars); +$georss = elgg_view('page/components/georss', $vars); +$extension = elgg_view('extensions/item'); + +$item = <<<__HTML - getURL(); ?> - time_created) ?> - address; ?> - <![CDATA[<?php echo $title; ?>]]> - description)); ?>]]> + $permalink + $pubdate + $permalink + <![CDATA[$title]]> + + $creator$georss$extension + +__HTML; + +echo $item; diff --git a/mod/file/start.php b/mod/file/start.php index 843ae0794..9007fc9ba 100644 --- a/mod/file/start.php +++ b/mod/file/start.php @@ -22,6 +22,9 @@ function file_init() { // Extend CSS elgg_extend_view('css/elgg', 'file/css'); + // add enclosure to rss item + elgg_extend_view('extensions/item', 'file/enclosure'); + // extend group main page elgg_extend_view('groups/tool_latest', 'file/group_module'); diff --git a/mod/file/views/rss/file/enclosure.php b/mod/file/views/rss/file/enclosure.php new file mode 100644 index 000000000..600d287ef --- /dev/null +++ b/mod/file/views/rss/file/enclosure.php @@ -0,0 +1,16 @@ +getGUID(); + $size = $vars['entity']->size(); + $mime_type = $vars['entity']->getMimeType(); + echo <<"; +END; +} diff --git a/mod/file/views/rss/object/file.php b/mod/file/views/rss/object/file.php deleted file mode 100644 index a0660d6c8..000000000 --- a/mod/file/views/rss/object/file.php +++ /dev/null @@ -1,21 +0,0 @@ -title; -if (empty($title)) { - $title = elgg_get_excerpt($vars['entity']->description, 32); -} -?> - - - getURL(); ?> - time_created) ?> - getURL(); ?> - <![CDATA[<?php echo $title; ?>]]> - description)); ?>]]> - - diff --git a/mod/search/views/rss/search/list.php b/mod/search/views/rss/search/list.php new file mode 100644 index 000000000..32082fd31 --- /dev/null +++ b/mod/search/views/rss/search/list.php @@ -0,0 +1,25 @@ + $entity, + 'params' => $vars['params'], + 'results' => $vars['results'] + )); + } +} + +echo $body; \ No newline at end of file diff --git a/mod/search/views/rss/search/listing.php b/mod/search/views/rss/search/listing.php deleted file mode 100644 index 32082fd31..000000000 --- a/mod/search/views/rss/search/listing.php +++ /dev/null @@ -1,25 +0,0 @@ - $entity, - 'params' => $vars['params'], - 'results' => $vars['results'] - )); - } -} - -echo $body; \ No newline at end of file diff --git a/mod/thewire/languages/en.php b/mod/thewire/languages/en.php index 9716fc060..3c83d145f 100644 --- a/mod/thewire/languages/en.php +++ b/mod/thewire/languages/en.php @@ -20,6 +20,7 @@ $english = array( 'thewire:noposts' => "No wire posts yet", 'item:object:thewire' => "Wire posts", 'thewire:update' => 'Update', + 'thewire:by' => 'Wire post by %s', 'thewire:previous' => "Previous", 'thewire:hide' => "Hide", diff --git a/mod/thewire/views/rss/object/thewire.php b/mod/thewire/views/rss/object/thewire.php index 8229f46f1..494c2c8dc 100644 --- a/mod/thewire/views/rss/object/thewire.php +++ b/mod/thewire/views/rss/object/thewire.php @@ -2,46 +2,35 @@ /** * Elgg thewire rss view * - * @package Elgg - * @subpackage Core + * @package ElggTheWire */ $owner = $vars['entity']->getOwnerEntity(); -if ($owner) { - $title = elgg_echo('thewire:by', array($owner->name)); -} else { - $subtitle = strip_tags($vars['entity']->description); - $title = elgg_get_excerpt($subtitle, 32); +if (!$owner) { + return true; } -?> +$title = elgg_echo('thewire:by', array($owner->name)); +$permalink = htmlspecialchars($vars['entity']->getURL(), ENT_NOQUOTES, 'UTF-8'); +$pubdate = date('r', $vars['entity']->getTimeCreated()); + +$description = autop($vars['entity']->description); + +$creator = elgg_view('page/components/creator', $vars); +$georss = elgg_view('page/components/georss', $vars); +$extension = elgg_view('extensions/item', $vars); + +$item = <<<__HTML -getGUID(); ?> -time_created) ?> -getURL()); ?> -<![CDATA[<?php echo $title; ?>]]> -description)); ?>]]> -getOwnerEntity(); -if ($owner) { - ?> - name; ?> - -getLongitude()) && - ($vars['entity']->getLatitude()) -) { - ?> - - getLatitude(); ?> getLongitude(); ?> - - - + $permalink + $pubdate + $permalink + <![CDATA[$title]]> + + $creator$georss$extension + +__HTML; + +echo $item; diff --git a/views/rss/annotation/generic_comment.php b/views/rss/annotation/generic_comment.php index 9e9107568..de652fc8e 100644 --- a/views/rss/annotation/generic_comment.php +++ b/views/rss/annotation/generic_comment.php @@ -16,7 +16,7 @@ $permalink = $annotation->getURL(); $title = elgg_echo('generic_comment:title', array($poster_name)); $creator = elgg_view('page/components/creator', array('entity' => $annotation)); -$extensions = elgg_view('extensions/item'); +$extensions = elgg_view('extensions/item', $vars); $item = <<<__HTML diff --git a/views/rss/group/default.php b/views/rss/group/default.php index 1276ab8f1..f57c7f82c 100644 --- a/views/rss/group/default.php +++ b/views/rss/group/default.php @@ -20,7 +20,7 @@ if ($vars['entity']->description) { $creator = elgg_view('page/components/creator', $vars); $georss = elgg_view('page/components/georss', $vars); -$extension = elgg_view('extensions/item'); +$extension = elgg_view('extensions/item', $vars); $item = <<<__HTML diff --git a/views/rss/object/default.php b/views/rss/object/default.php index b5d269ac7..be8025953 100644 --- a/views/rss/object/default.php +++ b/views/rss/object/default.php @@ -15,9 +15,11 @@ if (empty($title)) { $permalink = htmlspecialchars($vars['entity']->getURL(), ENT_NOQUOTES, 'UTF-8'); $pubdate = date('r', $vars['entity']->getTimeCreated()); +$description = autop($vars['entity']->description); + $creator = elgg_view('page/components/creator', $vars); $georss = elgg_view('page/components/georss', $vars); -$extension = elgg_view('extensions/item'); +$extension = elgg_view('extensions/item', $vars); $item = <<<__HTML @@ -25,7 +27,7 @@ $item = <<<__HTML $pubdate $permalink <![CDATA[$title]]> - description}]]> + $creator$georss$extension diff --git a/views/rss/user/default.php b/views/rss/user/default.php index 1500881f8..1c7bf75e7 100644 --- a/views/rss/user/default.php +++ b/views/rss/user/default.php @@ -17,7 +17,7 @@ if ($vars['entity']->description) { } $georss = elgg_view('page/components/georss', $vars); -$extension = elgg_view('extensions/item'); +$extension = elgg_view('extensions/item', $vars); $item = <<<__HTML -- cgit v1.2.3