From 0af3ab738efb2fe6ea14d33a7a8261cfdb60efb7 Mon Sep 17 00:00:00 2001 From: brettp Date: Tue, 30 Jun 2009 13:28:51 +0000 Subject: Modified output/confirmlink view to accept a class param. user_remove_friend() uses remove_user_from_access_collection() instead of raw SQL. Deleting an access collection prompts using output/confirmlink. git-svn-id: https://code.elgg.org/elgg/trunk@3368 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/friends/collection.php | 7 +++++-- views/default/output/confirmlink.php | 8 +++++++- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'views') diff --git a/views/default/friends/collection.php b/views/default/friends/collection.php index a12ad6e6a..1a9949cc9 100644 --- a/views/default/friends/collection.php +++ b/views/default/friends/collection.php @@ -28,8 +28,11 @@ //as collections are private, check that the logged in user is the owner if($coll->owner_guid == $_SESSION['user']->getGUID()) { - $confirm = addslashes(elgg_echo('question:areyousure')); - echo "
id}\" class=\"delete_collection\" onclick=\"if (!confirm('{$confirm}')) { return false; }; $('div.friends_picker').empty();\"> "; + echo "
"; + echo elgg_view('output/confirmlink', array( + 'href' => $vars['url'] . 'action/friends/deletecollection?collection=' . $coll->id, + 'class' => 'delete_collection' + )); echo "
"; } echo $coll->name; diff --git a/views/default/output/confirmlink.php b/views/default/output/confirmlink.php index 0843083f0..a89299300 100644 --- a/views/default/output/confirmlink.php +++ b/views/default/output/confirmlink.php @@ -32,5 +32,11 @@ if (strpos($link, '?')>0) $sep = "&"; $link = "$link{$sep}__elgg_token=$token&__elgg_ts=$ts"; } + + if ($vars['class']) { + $class = 'class="' . $vars['class'] . '"'; + } else { + $class = ''; + } ?> - \ No newline at end of file + onclick="return confirm('');"> \ No newline at end of file -- cgit v1.2.3