aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-19 03:46:50 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-19 03:46:50 +0000
commitb4e5f49e7569563e369566fcf144f8b7c3840ac1 (patch)
tree74cc262caaacefd57911be096a67573db12c0eef /views
parentb7e83f5641f559b0eb19d7648bd0369412973488 (diff)
downloadelgg-b4e5f49e7569563e369566fcf144f8b7c3840ac1.tar.gz
elgg-b4e5f49e7569563e369566fcf144f8b7c3840ac1.tar.bz2
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
Diffstat (limited to 'views')
-rw-r--r--views/default/output/confirmlink.php12
1 files changed, 10 insertions, 2 deletions
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']);