diff options
Diffstat (limited to 'views')
-rw-r--r-- | views/default/friends/collection.php | 7 | ||||
-rw-r--r-- | views/default/output/confirmlink.php | 8 |
2 files changed, 12 insertions, 3 deletions
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 "<div class=\"friends_collections_controls\"> <a href=\"" . $vars['url'] . "action/friends/deletecollection?collection={$coll->id}\" class=\"delete_collection\" onclick=\"if (!confirm('{$confirm}')) { return false; }; $('div.friends_picker').empty();\"> </a>";
+ echo "<div class=\"friends_collections_controls\">";
+ echo elgg_view('output/confirmlink', array(
+ 'href' => $vars['url'] . 'action/friends/deletecollection?collection=' . $coll->id,
+ 'class' => 'delete_collection'
+ ));
echo "</div>";
}
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 = '';
+ }
?>
-<a href="<?php echo $link; ?>" onclick="return confirm('<?php echo addslashes($confirm); ?>');"><?php echo htmlentities($vars['text'], ENT_QUOTES, 'UTF-8'); ?></a>
\ No newline at end of file +<a href="<?php echo $link; ?>" <?php echo $class; ?> onclick="return confirm('<?php echo addslashes($confirm); ?>');"><?php echo htmlentities($vars['text'], ENT_QUOTES, 'UTF-8'); ?></a>
\ No newline at end of file |