Elgg  Version 1.9
confirmlink.php
Go to the documentation of this file.
1 <?php
16 $vars['data-confirm'] = elgg_extract('confirm', $vars, elgg_echo('question:areyousure'));
17 
18 $encode = elgg_extract('encode_text', $vars, false);
19 
20 // always generate missing action tokens
22 
23 $text = elgg_extract('text', $vars, '');
24 if ($encode) {
25  $text = htmlspecialchars($text, ENT_QUOTES, 'UTF-8', false);
26 }
27 
28 if (!isset($vars['title']) && isset($vars['confirm'])) {
29  $vars['title'] = $vars['confirm'];
30 }
31 
32 if (isset($vars['class'])) {
33  if (!is_array($vars['class'])) {
34  $vars['class'] = array($vars['class']);
35  }
36  $vars['class'][] = 'elgg-requires-confirmation';
37 } else {
38  $vars['class'] = 'elgg-requires-confirmation';
39 }
40 
41 unset($vars['encode_text']);
42 unset($vars['text']);
43 unset($vars['confirm']);
44 unset($vars['is_trusted']);
45 
47 echo "<a $attributes>$text</a>";
elgg_add_action_tokens_to_url($url, $html_encode=false)
Adds action tokens to URL.
Definition: elgglib.php:1277
elgg_normalize_url($url)
Definition: output.php:290
elgg_extract($key, array $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:1464
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
elgg echo
Translates a string.
Definition: languages.js:43
elgg_format_attributes(array $attrs=array())
Converts an associative array into a string of well-formed attributes.
Definition: output.php:118