24 unset(
$vars[
'excerpt_length']);
26 if (!empty(
$vars[
'confirm']) && !isset(
$vars[
'is_action'])) {
27 $vars[
'is_action'] =
true;
30 if (!empty(
$vars[
'confirm'])) {
34 if (
$vars[
'data-confirm'] ===
true) {
39 unset(
$vars[
'confirm']);
46 unset(
$vars[
'allowed_schemes']);
50 $url =
'javascript:void(0);';
56 unset(
$vars[
'value']);
63 if (isset(
$vars[
'text'])) {
65 $text = htmlspecialchars((
string)
$vars[
'text'], ENT_QUOTES,
'UTF-8',
false);
75 unset(
$vars[
'encode_text']);
81 $scheme = parse_url(
$url, PHP_URL_SCHEME);
83 $url =
"denied:{$url}";
93 if (!isset(
$vars[
'rel'])) {
94 if ($is_trusted === null) {
95 $url_host = parse_url(
$url, PHP_URL_HOST);
97 $site_url_host = parse_url(
$site_url, PHP_URL_HOST);
98 $is_trusted = $url_host == $site_url_host;
101 if ($is_trusted ===
false) {
103 $vars[
'rel'] =
'nofollow';
111 if (!isset(
$vars[
'title']) && isset(
$vars[
'data-confirm'])) {
115 unset(
$vars[
'is_action']);
116 unset(
$vars[
'is_trusted']);
121 elgg_log(
'An output/url should have a discernible text (text, title, aria-label or aria-labelledby)', \Psr\Log\LogLevel::NOTICE);
126 'class' =>
'elgg-anchor-label',
131 unset(
$vars[
'icon']);
135 'class' =>
'elgg-anchor-icon',
140 unset(
$vars[
'icon_alt']);
144 'class' =>
'elgg-anchor-icon-alt',
149 unset(
$vars[
'badge']);
156 if (in_array(
'elgg-popup',
$classes)) {
if($icon &&!str_starts_with($icon, '<')) $icon_alt
elgg_get_excerpt(string $text, int $num_chars=250)
Returns an excerpt.
elgg_add_action_tokens_to_url(string $url, bool $html_encode=false)
Adds action tokens to URL.
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
$excerpt_length
Elgg URL display Displays a URL as a link.
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
if(!is_null($badge)) $classes
elgg_import_esm(string $name)
Helper functions for external files like css/js.
elgg_log($message, $level=\Psr\Log\LogLevel::NOTICE)
Log a message.
if(!isset($vars['aria-label'])&&!isset($vars['aria-labelledby'])&&!isset($vars['title'])&&empty(elgg_strip_tags((string) $text))) if(!elgg_is_empty($text)) $icon
elgg_get_site_url()
Get the URL for the current (or specified) site, ending with "/".
elgg_view_icon(string $name, array $vars=[])
View an icon glyph.
if($icon_alt &&!str_starts_with($icon_alt, '<')) $badge
elgg_format_element(string $tag_name, array $attributes=[], string $text= '', array $options=[])
Format an HTML element.
elgg_extract_class(array $array, array|string $existing=[], string $extract_key= 'class')
Extract class names from an array, optionally merging into a preexisting set.
elgg_normalize_url(string $url)
elgg_strip_tags(string $string, string $allowable_tags=null)
Strip tags and offer plugins the chance.