aboutsummaryrefslogtreecommitdiff
path: root/views/default/annotation
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/annotation')
-rw-r--r--views/default/annotation/annotatelike.php11
-rw-r--r--views/default/annotation/default.php37
-rw-r--r--views/default/annotation/generic_comment.php43
-rw-r--r--views/default/annotation/likes.php40
4 files changed, 53 insertions, 78 deletions
diff --git a/views/default/annotation/annotatelike.php b/views/default/annotation/annotatelike.php
deleted file mode 100644
index 7b0d5c2e2..000000000
--- a/views/default/annotation/annotatelike.php
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-
-$performed_by = get_entity($vars['item']->subject_guid);
-$object = get_entity($vars['item']->object_guid);
-$url = $object->getURL();
-$title = $object->title;
-
-$string = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a> ";
-$string .= elgg_echo("likes:river:annotate") . " <a href=\"{$object->getURL()}\">" . $title . "</a> <span class='entity-subtext'>" . elgg_view_friendly_time($object->time_created)."</span>";
-
-echo $string; \ No newline at end of file
diff --git a/views/default/annotation/default.php b/views/default/annotation/default.php
index 13713e8ad..5d29a53e2 100644
--- a/views/default/annotation/default.php
+++ b/views/default/annotation/default.php
@@ -1,11 +1,40 @@
<?php
/**
* Elgg default annotation view
+ *
+ * @note To add or remove from the annotation menu, register handlers for the menu:annotation hook.
+ *
+ * @uses $vars['annotation']
*/
-$owner = get_user($vars['annotation']->owner_guid);
-$icon = elgg_view("profile/icon", array('entity' => $owner, 'size' => 'tiny'));
+$annotation = $vars['annotation'];
-$info = elgg_view("output/longtext", array("value" => $vars['annotation']->value));
+$owner = get_entity($annotation->owner_guid);
+if (!$owner) {
+ return true;
+}
+$icon = elgg_view_entity_icon($owner, 'tiny');
+$owner_link = "<a href=\"{$owner->getURL()}\">$owner->name</a>";
-echo elgg_view_listing($icon, $info);
+$menu = elgg_view_menu('annotation', array(
+ 'annotation' => $annotation,
+ 'sort_by' => 'priority',
+ 'class' => 'elgg-menu-hz float-alt',
+));
+
+$text = elgg_view("output/longtext", array("value" => $annotation->value));
+
+$friendlytime = elgg_view_friendly_time($annotation->time_created);
+
+$body = <<<HTML
+<div class="mbn">
+ $menu
+ $owner_link
+ <span class="elgg-subtext">
+ $friendlytime
+ </span>
+ $text
+</div>
+HTML;
+
+echo elgg_view_image_block($icon, $body);
diff --git a/views/default/annotation/generic_comment.php b/views/default/annotation/generic_comment.php
index c6fea8b41..22a8d9211 100644
--- a/views/default/annotation/generic_comment.php
+++ b/views/default/annotation/generic_comment.php
@@ -3,14 +3,14 @@
* Elgg generic comment view
*
* @uses $vars['annotation'] ElggAnnotation object
- * @uses $vars['full'] Display fill view or brief view
+ * @uses $vars['full_view'] Display fill view or brief view
*/
if (!isset($vars['annotation'])) {
return true;
}
-$full_view = elgg_get_array_value('full', $vars, true);
+$full_view = elgg_extract('full_view', $vars, true);
$comment = $vars['annotation'];
@@ -22,51 +22,48 @@ if (!$entity || !$commenter) {
$friendlytime = elgg_view_friendly_time($comment->time_created);
-$commenter_icon = elgg_view("profile/icon", array('entity' => $commenter, 'size' => 'tiny'));
+$commenter_icon = elgg_view_entity_icon($commenter, 'tiny');
$commenter_link = "<a href=\"{$commenter->getURL()}\">$commenter->name</a>";
$entity_title = $entity->title ? $entity->title : elgg_echo('untitled');
$entity_link = "<a href=\"{$entity->getURL()}\">$entity_title</a>";
if ($full_view) {
-
- $delete_button = '';
- if ($comment->canEdit()) {
- $delete_button = elgg_view("output/confirmlink",array(
- 'href' => "action/comments/delete?annotation_id={$comment->id}",
- 'text' => elgg_echo('delete'),
- 'confirm' => elgg_echo('deleteconfirm')
- ));
- $delete_button = "<span class=\"delete-button\">$delete_button</span>";
- }
+ $menu = elgg_view_menu('annotation', array(
+ 'annotation' => $comment,
+ 'sort_by' => 'priority',
+ 'class' => 'elgg-menu-hz float-alt',
+ ));
$comment_text = elgg_view("output/longtext", array("value" => $comment->value));
$body = <<<HTML
-<p class="mbn">
- $delete_button
+<div class="mbn">
+ $menu
$commenter_link
- <span class="entity-subtext">
+ <span class="elgg-subtext">
$friendlytime
</span>
$comment_text
-</p>
+</div>
HTML;
- echo elgg_view_media($commenter_icon, $body);
+ echo elgg_view_image_block($commenter_icon, $body);
} else {
// brief view
//@todo need link to actual comment!
-
- $on = elgg_echo('on');
+
+ $commented_on = elgg_echo('generic_comment:on', array($commenter_link, $entity_link));
+
+ $excerpt = elgg_get_excerpt($comment->value, 80);
$body = <<<HTML
-<span class="entity-subtext">
- $commenter_link $on <span class='entity-title'>$entity_link</span> ($friendlytime)
+<span class="elgg-subtext">
+ $commented_on ($friendlytime): $excerpt
</span>
HTML;
- echo elgg_view_media($commenter_icon, $body);
+ echo elgg_view_image_block($commenter_icon, $body);
}
diff --git a/views/default/annotation/likes.php b/views/default/annotation/likes.php
deleted file mode 100644
index 3fdf2349b..000000000
--- a/views/default/annotation/likes.php
+++ /dev/null
@@ -1,40 +0,0 @@
-<?php
-/**
- * Elgg show the user who liked the object
- */
-
-$owner = get_user($vars['annotation']->owner_guid);
-
-?>
-<div class="elgg-likes-user clearfix">
- <div class="entity-listing-icon">
- <?php
- echo elgg_view("profile/icon", array(
- 'entity' => $owner,
- 'size' => 'tiny'
- ));
- ?>
- </div>
-
- <div class="entity-listing-info">
- <?php
- // if the user looking at the like listing can edit, show the delete link
- if ($vars['annotation']->canEdit()) {
- ?>
- <div class="entity-metadata"><span class="delete-button">
- <?php echo elgg_view("output/confirmlink",array(
- 'href' => "action/likes/delete?annotation_id=" . $vars['annotation']->id,
- 'text' => elgg_echo('remove'),
- 'confirm' => elgg_echo('deleteconfirm')
- ));
- ?>
- </span></div>
- <?php
- } //end of can edit if statement
- ?>
- <p class="elgg-likes-owner">
- <a href="<?php echo $owner->getURL(); ?>"><?php echo $owner->name; ?></a> <?php echo elgg_echo('likes:this') .
- " <span class=\"entity-subtext\">" . elgg_view_friendly_time($vars['annotation']->time_created) . "</span>"; ?>
- </p>
- </div>
-</div> \ No newline at end of file