diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-20 12:38:25 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-20 12:38:25 +0000 |
commit | 45809013256e8c5eb87fa90a6feee66ec632cb03 (patch) | |
tree | dcecf3c13dea698febc0d00c49ba90260abce79d /views/default/output/confirmlink.php | |
parent | 14a131e73eca92bb216ffad468a18c4a28ee35c2 (diff) | |
download | elgg-45809013256e8c5eb87fa90a6feee66ec632cb03.tar.gz elgg-45809013256e8c5eb87fa90a6feee66ec632cb03.tar.bz2 |
added elgg-icon-delete and elgg-icon-likes
git-svn-id: http://code.elgg.org/elgg/trunk@7698 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/output/confirmlink.php')
-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> |