From b4e5f49e7569563e369566fcf144f8b7c3840ac1 Mon Sep 17 00:00:00 2001 From: brettp Date: Sat, 19 Feb 2011 03:46:50 +0000 Subject: Pulled the confirm link output view's JS into elgg.us. Any links with elgg-requires-confirmation will get a confirm box with the title of the anchor tag as the question, or the default "Are you sure?" if that doesn't exist. git-svn-id: http://code.elgg.org/elgg/trunk@8310 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/output/confirmlink.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'views') diff --git a/views/default/output/confirmlink.php b/views/default/output/confirmlink.php index aef33ab1f..20431e5a7 100644 --- a/views/default/output/confirmlink.php +++ b/views/default/output/confirmlink.php @@ -13,7 +13,6 @@ */ $confirm = elgg_extract('confirm', $vars, elgg_echo('question:areyousure')); - $encode = elgg_extract('text_encode', $vars, true); // always generate missing action tokens @@ -24,7 +23,16 @@ if ($encode) { $text = htmlspecialchars($text, ENT_QUOTES, 'UTF-8', false); } -$vars['onclick'] = "return confirm('" . addslashes($confirm) . "')"; +$vars['title'] = addslashes($confirm); +if (isset($vars['class'])) { + if (!is_array($vars['class'])) { + $vars['class'] = array($vars['class']); + } + $vars['class'][] = 'elgg-requires-confirmation'; +} else { + $vars['class'] = 'elgg-requires-confirmation'; +} +//$vars['onclick'] = "return confirm('" . addslashes($confirm) . "')"; unset($vars['encode_text']); unset($vars['text']); -- cgit v1.2.3