aboutsummaryrefslogtreecommitdiff
path: root/mod/likes/start.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/likes/start.php')
-rw-r--r--mod/likes/start.php37
1 files changed, 12 insertions, 25 deletions
diff --git a/mod/likes/start.php b/mod/likes/start.php
index 64be8b239..0f8e12159 100644
--- a/mod/likes/start.php
+++ b/mod/likes/start.php
@@ -60,6 +60,17 @@ function likes_entity_menu_setup($hook, $type, $return, $params) {
function likes_river_menu_setup($hook, $type, $return, $params) {
if (elgg_is_logged_in()) {
$item = $params['item'];
+
+ // only like group creation #3958
+ if ($item->type == "group" && $item->view != "river/group/create") {
+ return $return;
+ }
+
+ // don't like users #4116
+ if ($item->type == "user") {
+ return $return;
+ }
+
$object = $item->getObjectEntity();
if (!elgg_in_context('widgets') && $item->annotation_id == 0) {
if ($object->canAnnotate(0, 'likes')) {
@@ -130,31 +141,7 @@ function likes_notify_user(ElggUser $user, ElggUser $liker, ElggEntity $entity)
if (!$entity instanceof ElggEntity) {
return false;
}
-
- // get language for entity type / subtype
- // would be nice to have standardized languages....
- // we can have:
- // item:object:<subtype>
- // subtype
- // subtype:subtype
- $type = $entity->getType();
- $subtype = $entity->getSubtype();
-
- $strings = array(
- "item:$type:$subtype",
- $subtype,
- "$subtype:$subtype"
- );
-
- $type_str = elgg_echo('likes:content');
- foreach ($strings as $string) {
- $tmp = elgg_echo($string);
- if ($tmp != $string) {
- $type_str = $tmp;
- break;
- }
- }
-
+
$title_str = $entity->title;
if (!$title_str) {
$title_str = elgg_get_excerpt($entity->description);