22 if (!empty(
$vars[
'confirm']) && !isset(
$vars[
'is_action'])) {
23 $vars[
'is_action'] =
true;
26 if (!empty(
$vars[
'confirm'])) {
30 if (
$vars[
'data-confirm'] ===
true) {
38 unset(
$vars[
'value']);
41 if (isset(
$vars[
'text'])) {
43 $text = htmlspecialchars(
$vars[
'text'], ENT_QUOTES,
'UTF-8',
false);
49 $text = htmlspecialchars(
$url, ENT_QUOTES,
'UTF-8',
false);
52 unset(
$vars[
'encode_text']);
64 if (!isset(
$vars[
'rel'])) {
65 if ($is_trusted ===
null) {
66 $url_host = parse_url(
$url, PHP_URL_HOST);
68 $site_url_host = parse_url(
$site_url, PHP_URL_HOST);
69 $is_trusted = $url_host == $site_url_host;
71 if ($is_trusted ===
false) {
73 $vars[
'rel'] =
'nofollow';
81 if (!isset(
$vars[
'title']) && isset(
$vars[
'data-confirm'])) {
85 unset(
$vars[
'is_action']);
86 unset(
$vars[
'is_trusted']);
87 unset(
$vars[
'confirm']);
90 echo
"<a $attributes>$text</a>";
elgg_get_site_url($site_guid=0)
Get the URL for the current (or specified) site.
if(!empty($vars['confirm']) &&!isset($vars['is_action'])) if(!empty($vars['confirm'])) $url
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
elgg_add_action_tokens_to_url($url, $html_encode=false)
Adds action tokens to URL.
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
elgg_format_attributes(array $attrs=array())
Converts an associative array into a string of well-formed HTML/XML attributes Returns a concatenated...