diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-10-16 20:26:12 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-10-16 20:26:12 +0000 |
commit | c66831fa5138a277a9729174caf14c7eb323fb07 (patch) | |
tree | 2444b54badf4914b59c88700cc1ce30a57ae7ff1 /views/default/output/url.php | |
parent | 8048313e87b9fd5ab6734e29a0e951524fa33e45 (diff) | |
download | elgg-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/url.php')
-rw-r--r-- | views/default/output/url.php | 58 |
1 files changed, 27 insertions, 31 deletions
diff --git a/views/default/output/url.php b/views/default/output/url.php index 7f72f0dce..190b08c21 100644 --- a/views/default/output/url.php +++ b/views/default/output/url.php @@ -1,37 +1,33 @@ <?php +/** + * Elgg URL display + * Displays a URL as a link + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + * + * @uses $vars['value'] The URL to display + * + */ - /** - * Elgg URL display - * Displays a URL as a link - * - * @package Elgg - * @subpackage Core +$val = trim($vars['value']); +if (!empty($val)) { + if ((substr_count($val, "http://") == 0) && (substr_count($val, "https://") == 0)) { + $val = "http://" . $val; + } - * @author Curverider Ltd + if ($vars['is_action']) { + $ts = time(); + $token = generate_action_token($ts); - * @link http://elgg.org/ - * - * @uses $vars['value'] The URL to display - * - */ - - $val = trim($vars['value']); - if (!empty($val)) { - if ((substr_count($val, "http://") == 0) && (substr_count($val, "https://") == 0)) { - $val = "http://" . $val; - } - - if ($vars['is_action']) - { - $ts = time(); - $token = generate_action_token($ts); - - $sep = "?"; - if (strpos($val, '?')>0) $sep = "&"; - $val = "$val{$sep}__elgg_token=$token&__elgg_ts=$ts"; + $sep = "?"; + if (strpos($val, '?')>0) { + $sep = "&"; } - - echo "<a href=\"{$val}\" target=\"_blank\">". htmlentities($val, ENT_QUOTES, 'UTF-8'). "</a>"; - } + $val = "$val{$sep}__elgg_token=$token&__elgg_ts=$ts"; + } -?>
\ No newline at end of file + echo "<a href=\"{$val}\" target=\"_blank\">". htmlentities($val, ENT_QUOTES, 'UTF-8'). "</a>"; +}
\ No newline at end of file |