diff options
Diffstat (limited to 'views/default/annotation')
-rw-r--r-- | views/default/annotation/default.php | 40 | ||||
-rw-r--r-- | views/default/annotation/generic_comment.php | 32 |
2 files changed, 43 insertions, 29 deletions
diff --git a/views/default/annotation/default.php b/views/default/annotation/default.php new file mode 100644 index 000000000..5d29a53e2 --- /dev/null +++ b/views/default/annotation/default.php @@ -0,0 +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'] + */ + +$annotation = $vars['annotation']; + +$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>"; + +$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 588f72e52..22a8d9211 100644 --- a/views/default/annotation/generic_comment.php +++ b/views/default/annotation/generic_comment.php @@ -1,30 +1,9 @@ <?php /** - * Editable Comments -- Override Elgg's generic comment view + * Elgg generic comment view * * @uses $vars['annotation'] ElggAnnotation object * @uses $vars['full_view'] Display fill view or brief view - * - * @package Lorea - * @subpackage EditableComments - * - * Copyright 2012 Lorea Faeries <federation@lorea.org> - * - * This file is part of the EditableComments plugin for Elgg. - * - * EditableComments is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * EditableComments is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/>. */ if (!isset($vars['annotation'])) { @@ -57,10 +36,6 @@ if ($full_view) { )); $comment_text = elgg_view("output/longtext", array("value" => $comment->value)); - $comment_edit = elgg_view_form("comments/edit", array("class" => ""), array( - "entity" => $comment->getEntity(), - "annotation" => $comment, - )); $body = <<<HTML <div class="mbn"> @@ -70,7 +45,6 @@ if ($full_view) { $friendlytime </span> $comment_text - $comment_edit </div> HTML; @@ -81,13 +55,13 @@ HTML; //@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="elgg-subtext"> - $commenter_link $on $entity_link ($friendlytime): $excerpt + $commented_on ($friendlytime): $excerpt </span> HTML; |