aboutsummaryrefslogtreecommitdiff
path: root/views/default/output/confirmlink.php
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-10-16 20:26:12 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-10-16 20:26:12 +0000
commitc66831fa5138a277a9729174caf14c7eb323fb07 (patch)
tree2444b54badf4914b59c88700cc1ce30a57ae7ff1 /views/default/output/confirmlink.php
parent8048313e87b9fd5ab6734e29a0e951524fa33e45 (diff)
downloadelgg-c66831fa5138a277a9729174caf14c7eb323fb07.tar.gz
elgg-c66831fa5138a277a9729174caf14c7eb323fb07.tar.bz2
Standardizing views.`
git-svn-id: http://code.elgg.org/elgg/trunk@3555 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/output/confirmlink.php')
-rw-r--r--views/default/output/confirmlink.php67
1 files changed, 32 insertions, 35 deletions
diff --git a/views/default/output/confirmlink.php b/views/default/output/confirmlink.php
index bb7e866f2..e0a6f65d7 100644
--- a/views/default/output/confirmlink.php
+++ b/views/default/output/confirmlink.php
@@ -1,42 +1,39 @@
<?php
+/**
+ * Elgg confirmation link
+ * A link that displays a confirmation dialog before it executes
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @author Curverider Ltd
+ * @link http://elgg.org/
+ *
+ * @uses $vars['text'] The text of the link
+ * @uses $vars['href'] The address
+ * @uses $vars['confirm'] The dialog text
+ *
+ */
- /**
- * Elgg confirmation link
- * A link that displays a confirmation dialog before it executes
- *
- * @package Elgg
- * @subpackage Core
+$confirm = $vars['confirm'];
+if (!$confirm) {
+ $confirm = elgg_echo('question:areyousure');
+}
- * @author Curverider Ltd
+$link = $vars['href'];
- * @link http://elgg.org/
- *
- * @uses $vars['text'] The text of the link
- * @uses $vars['href'] The address
- * @uses $vars['confirm'] The dialog text
- *
- */
+if ($vars['is_action']) {
+ $ts = time();
+ $token = generate_action_token($ts);
- $confirm = $vars['confirm'];
- if (!$confirm)
- $confirm = elgg_echo('question:areyousure');
-
- $link = $vars['href'];
-
- if ($vars['is_action'])
- {
- $ts = time();
- $token = generate_action_token($ts);
-
- $sep = "?";
- if (strpos($link, '?')>0) $sep = "&";
- $link = "$link{$sep}__elgg_token=$token&__elgg_ts=$ts";
- }
-
- if ($vars['class']) {
- $class = 'class="' . $vars['class'] . '"';
- } else {
- $class = '';
- }
+ $sep = "?";
+ 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; ?>" <?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