From 25587657328ca8b492a497e385a2fc3887925848 Mon Sep 17 00:00:00 2001 From: cash Date: Mon, 21 Feb 2011 01:45:21 +0000 Subject: Fixes #2971 added canComment() method and implemented it for ElggBlog git-svn-id: http://code.elgg.org/elgg/trunk@8381 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/core/river/controls.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'views/default/core/river') diff --git a/views/default/core/river/controls.php b/views/default/core/river/controls.php index 6f2be623c..615da7f96 100644 --- a/views/default/core/river/controls.php +++ b/views/default/core/river/controls.php @@ -10,14 +10,16 @@ $object = $vars['item']->getObjectEntity(); if (elgg_is_logged_in()) { // comments and non-objects cannot be commented on or liked - if ($object->getType() == 'object' && $vars['item']->annotation_id == 0) { - $params = array( - 'href' => '#', - 'text' => elgg_echo('generic_comments:text'), - 'class' => 'elgg-toggle', - 'id' => "elgg-toggler-{$object->getGUID()}", - ); - echo elgg_view('output/url', $params); + if ($vars['item']->annotation_id == 0) { + if ($object->canComment()) { + $params = array( + 'href' => '#', + 'text' => elgg_echo('generic_comments:text'), + 'class' => 'elgg-toggle', + 'id' => "elgg-toggler-{$object->getGUID()}", + ); + echo elgg_view('output/url', $params); + } // like this if (!elgg_annotation_exists($object->getGUID(), 'likes')) { -- cgit v1.2.3