aboutsummaryrefslogtreecommitdiff
path: root/views/default/output/action_link.php
blob: 1f64d4f5b80ca159a449f82ed6322e013f5c8b6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
/**
 * Elgg action link
 * Creates a link to an action that includes action tokens
 *
 * @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
 *
 */

// always generate missing action tokens
$link = elgg_validate_action_url($vars['href']);

if (isset($vars['class']) && $vars['class']) {
	$class = 'class="' . $vars['class'] . '"';
} else {
	$class = '';
}
?>
<a href="<?php echo $link; ?>" <?php echo $class; ?> ><?php echo htmlentities($vars['text'], ENT_QUOTES, 'UTF-8'); ?></a>