diff options
Diffstat (limited to 'views/default/output')
-rw-r--r-- | views/default/output/confirmlink.php | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/views/default/output/confirmlink.php b/views/default/output/confirmlink.php index bce06305a..5cb9aa52e 100644 --- a/views/default/output/confirmlink.php +++ b/views/default/output/confirmlink.php @@ -9,21 +9,27 @@ * @uses $vars['text'] The text of the link * @uses $vars['href'] The address * @uses $vars['confirm'] The dialog text - * + * @uses $vars['encode'] Encode special characters? */ -$confirm = $vars['confirm']; -if (!$confirm) { - $confirm = elgg_echo('question:areyousure'); -} +$confirm = elgg_get_array_value('confirm', $vars, elgg_echo('question:areyousure')); + +$encode = elgg_get_array_value('encode', $vars, true); // always generate missing action tokens $link = elgg_add_action_tokens_to_url(elgg_normalize_url($vars['href'])); +$text = elgg_get_array_value('text', $vars, ''); +if ($encode) { + $text = htmlspecialchars($text, ENT_QUOTES, 'UTF-8'); +} + if (isset($vars['class']) && $vars['class']) { $class = 'class="' . $vars['class'] . '"'; } else { $class = ''; } ?> -<a href="<?php echo $link; ?>" <?php echo $class; ?> onclick="return confirm('<?php echo addslashes($confirm); ?>');"><?php echo htmlspecialchars($vars['text'], ENT_QUOTES, 'UTF-8'); ?></a> +<a href="<?php echo $link; ?>" <?php echo $class; ?> onclick="return confirm('<?php echo addslashes($confirm); ?>');"> + <?php echo $text; ?> +</a> |