From 9fdcb6143e1db1d684887b0454db4e4e90a8f020 Mon Sep 17 00:00:00 2001 From: ben Date: Tue, 28 Oct 2008 12:33:52 +0000 Subject: Committed a generic comment view. git-svn-id: https://code.elgg.org/elgg/trunk@2327 36083f99-b078-4883-b0ff-0f9b5a30f544 --- languages/en.php | 11 +++-- .../river/annotation/generic_comment/create.php | 53 ++++++++++++++++++++++ 2 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 views/default/river/annotation/generic_comment/create.php diff --git a/languages/en.php b/languages/en.php index 6b1f486cd..4d74ec2aa 100644 --- a/languages/en.php +++ b/languages/en.php @@ -225,7 +225,7 @@ To remove a widget drag it back to the Widget gallery.", 'group' => "Group", 'item:group' => "Groups", - + /** * Profile */ @@ -233,7 +233,9 @@ To remove a widget drag it back to the Widget gallery.", 'profile' => "Profile", 'profile:edit:default' => 'Edit default profile', 'user' => "User", - 'item:user' => "Users", + 'item:user' => "Users", + 'riveritem:single:user' => 'a user', + 'riveritem:plural:user' => 'some users', /** * Profile menu items and titles @@ -769,7 +771,10 @@ If you requested this click on the link below, otherwise ignore this email. * Comments */ - 'comments:count' => "%s comments", + 'comments:count' => "%s comments", + + 'riveraction:annotation:generic_comment' => '%s commented on %s', + 'generic_comments:add' => "Add a comment", 'generic_comments:text' => "Comment", 'generic_comment:posted' => "Your comment was successfully posted.", 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 @@ +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 = "getURL()}\">{$performed_by->name} "; + + // The item with the ocmment left on it + $sentence_object = " getURL()}\">". elgg_echo($desc) .""; + + echo sprintf(elgg_echo('riveraction:annotation:generic_comment'),$sentence_performed_by, $sentence_object); + } + + break; + } + } + +?> \ No newline at end of file -- cgit v1.2.3