diff options
-rw-r--r-- | actions/comments/add.php | 5 | ||||
-rw-r--r-- | views/default/annotation/annotate.php | 14 |
2 files changed, 18 insertions, 1 deletions
diff --git a/actions/comments/add.php b/actions/comments/add.php index 1202a30ec..ea3b0326e 100644 --- a/actions/comments/add.php +++ b/actions/comments/add.php @@ -11,7 +11,7 @@ */
// Make sure we're logged in; forward to the front page if not
- gatekeeper(); + gatekeeper();
action_gatekeeper();
// Get input
@@ -38,6 +38,9 @@ );
system_message(elgg_echo("generic_comment:posted"));
+ //add to river
+ add_to_river('annotation/annotate','comment',$_SESSION['user']->guid,$entity->guid);
+
} else {
register_error(elgg_echo("generic_comment:failure"));
diff --git a/views/default/annotation/annotate.php b/views/default/annotation/annotate.php new file mode 100644 index 000000000..78059254b --- /dev/null +++ b/views/default/annotation/annotate.php @@ -0,0 +1,14 @@ +<?php
+
+ $performed_by = get_entity($vars['item']->subject_guid); // $statement->getSubject();
+ $object = get_entity($vars['item']->object_guid);
+ $url = $object->getURL();
+ $subtype = get_subtype_from_id($object->subtype);
+
+ $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
+ $string = sprintf(elgg_echo("blog:river:posted"),$url) . " ";
+ $string .= elgg_echo("{$subtype}:river:annotate") . " <a href=\"" . $object->getURL() . "\">" . $object->title . "</a>";
+
+?>
+
+<?php echo $string; ?>
\ No newline at end of file |