Skip to content

Commit

Permalink
Revert "Fixes #4606 made unlike code consistent and functional"
Browse files Browse the repository at this point in the history
This reverts commit e322253.
  • Loading branch information
ewinslow committed Jul 21, 2012
1 parent b164c39 commit 3cb2ce9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
17 changes: 11 additions & 6 deletions mod/likes/actions/likes/delete.php
Expand Up @@ -4,12 +4,17 @@
*
*/

$id = (int) get_input('id');
$like = elgg_get_annotation_from_id($id);
if ($like && $like->canEdit()) {
$like->delete();
system_message(elgg_echo("likes:deleted"));
forward(REFERER);
$likes = elgg_get_annotations(array(
'guid' => (int) get_input('guid'),
'annotation_owner_guid' => elgg_get_logged_in_user_guid(),
'annotation_name' => 'likes',
));
if ($likes) {
if ($likes[0]->canEdit()) {
$likes[0]->delete();
system_message(elgg_echo("likes:deleted"));
forward(REFERER);
}
}

register_error(elgg_echo("likes:notdeleted"));
Expand Down
1 change: 0 additions & 1 deletion mod/likes/languages/en.php
Expand Up @@ -17,7 +17,6 @@
'likes:userlikedthis' => '%s like',
'likes:userslikedthis' => '%s likes',
'likes:river:annotate' => 'likes',
'likes:delete:confirm' => 'Are you sure you want to unlike this?',

'river:likes' => 'likes %s %s',

Expand Down
4 changes: 2 additions & 2 deletions mod/likes/views/default/annotation/likes.php
Expand Up @@ -29,9 +29,9 @@

if ($like->canEdit()) {
$delete_button = elgg_view("output/confirmlink",array(
'href' => "action/likes/delete?id={$like->id}",
'href' => "action/likes/delete?annotation_id={$like->id}",
'text' => "<span class=\"elgg-icon elgg-icon-delete float-alt\"></span>",
'confirm' => elgg_echo('likes:delete:confirm'),
'confirm' => elgg_echo('deleteconfirm'),
'encode_text' => false,
));
}
Expand Down
8 changes: 1 addition & 7 deletions mod/likes/views/default/likes/button.php
Expand Up @@ -24,13 +24,7 @@
);
$likes_button = elgg_view('output/url', $params);
} else {
$like = elgg_get_annotations(array(
'guid' => $guid,
'annotation_owner_guid' => elgg_get_logged_in_user_guid(),
'annotation_name' => 'likes',
));
$like = $like[0];
$url = elgg_get_site_url() . "action/likes/delete?id={$like->id}";
$url = elgg_get_site_url() . "action/likes/delete?guid={$guid}";
$params = array(
'href' => $url,
'text' => elgg_view_icon('thumbs-up-alt'),
Expand Down

0 comments on commit 3cb2ce9

Please sign in to comment.