diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-10-28 12:33:52 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-10-28 12:33:52 +0000 |
commit | 9fdcb6143e1db1d684887b0454db4e4e90a8f020 (patch) | |
tree | cc7c344f2091270219c728b40490dd4384e15a86 /views/default | |
parent | 56b051a4f64e2150569cabcc32c331edf1838aa3 (diff) | |
download | elgg-9fdcb6143e1db1d684887b0454db4e4e90a8f020.tar.gz elgg-9fdcb6143e1db1d684887b0454db4e4e90a8f020.tar.bz2 |
Committed a generic comment view.
git-svn-id: https://code.elgg.org/elgg/trunk@2327 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default')
-rw-r--r-- | views/default/river/annotation/generic_comment/create.php | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/views/default/river/annotation/generic_comment/create.php b/views/default/river/annotation/generic_comment/create.php new file mode 100644 index 000000000..012214b16 --- /dev/null +++ b/views/default/river/annotation/generic_comment/create.php @@ -0,0 +1,53 @@ +<?php
+ /**
+ * Elgg generic comment create event.
+ * Display something in the river when a comment is left.
+ *
+ * @package Elgg
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ */
+
+ $statement = $vars['statement'];
+
+ $performed_by = $statement->getSubject();
+ $event = $statement->getEvent();
+ $object = $statement->getObject();
+
+ if (is_array($object))
+ {
+
+ switch ($object['subject']->name)
+ {
+ // Generic comments
+ case 'generic_comment' :
+
+ // Get the item that's been commented on
+ $item = $object['object'];
+
+ // Make sure the comment was left by a user ...
+ if (($performed_by instanceof ElggUser) && ($item instanceof ElggEntity))
+ {
+
+ $type = $item->getType();
+ $subtype = $item->getSubtype();
+
+ // Generate a string of them form riveritem:single:type:subtype for our description
+ $desc = 'riveritem:single:' . $type; if (!empty($subtype)) $desc .= ':' . $subtype;
+
+ // The person leaving the comment
+ $sentence_performed_by = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a> ";
+
+ // The item with the ocmment left on it
+ $sentence_object = " <a href=\"{$item->getURL()}\">". elgg_echo($desc) ."</a>";
+
+ echo sprintf(elgg_echo('riveraction:annotation:generic_comment'),$sentence_performed_by, $sentence_object);
+ }
+
+ break;
+ }
+ }
+
+?>
\ No newline at end of file |