diff options
author | Sem <sembrestels@riseup.net> | 2011-11-18 07:32:27 +0100 |
---|---|---|
committer | Sem <sembrestels@riseup.net> | 2011-11-18 07:32:27 +0100 |
commit | e53d410129701ea1c9d19529afa493f11b5f5b70 (patch) | |
tree | d9963b24bf8932654b4a47e36602c75975e50dba /views/default/output | |
parent | 377da25d2965c64941f83baae119fc970ec60982 (diff) | |
parent | 08a962c98e2923724f8013d6eaae89101243752a (diff) | |
download | elgg-e53d410129701ea1c9d19529afa493f11b5f5b70.tar.gz elgg-e53d410129701ea1c9d19529afa493f11b5f5b70.tar.bz2 |
Merge github.com:Elgg/Elgg
Conflicts:
engine/lib/input.php
Diffstat (limited to 'views/default/output')
-rw-r--r-- | views/default/output/access.php | 2 | ||||
-rw-r--r-- | views/default/output/confirmlink.php | 17 | ||||
-rw-r--r-- | views/default/output/date.php | 2 | ||||
-rw-r--r-- | views/default/output/img.php | 12 | ||||
-rw-r--r-- | views/default/output/longtext.php | 4 | ||||
-rw-r--r-- | views/default/output/tag.php | 6 | ||||
-rw-r--r-- | views/default/output/text.php | 3 | ||||
-rw-r--r-- | views/default/output/url.php | 15 |
8 files changed, 43 insertions, 18 deletions
diff --git a/views/default/output/access.php b/views/default/output/access.php index f312608d5..811948323 100644 --- a/views/default/output/access.php +++ b/views/default/output/access.php @@ -20,7 +20,7 @@ if (isset($vars['entity']) && elgg_instanceof($vars['entity'])) { // we decided to show that the item is in a group, rather than its actual access level // not required. Group ACLs are prepended with "Group: " when written. //$access_id_string = elgg_echo('groups:group') . $container->name; - $membership = $is_group->membership; + $membership = $container->membership; if ($membership == ACCESS_PUBLIC) { $access_class .= ' elgg-access-group-open'; diff --git a/views/default/output/confirmlink.php b/views/default/output/confirmlink.php index 5059a656e..532790a38 100644 --- a/views/default/output/confirmlink.php +++ b/views/default/output/confirmlink.php @@ -6,16 +6,16 @@ * @package Elgg * @subpackage Core * - * @uses $vars['text'] The text of the link - * @uses $vars['href'] The address - * @uses $vars['title'] The title text (defaults to confirm text) - * @uses $vars['confirm'] The dialog text - * @uses $vars['text_encode'] Encode special characters? (false) + * @uses $vars['text'] The text of the link + * @uses $vars['href'] The address + * @uses $vars['title'] The title text (defaults to confirm text) + * @uses $vars['confirm'] The dialog text + * @uses $vars['encode_text'] Run $vars['text'] through htmlspecialchars() (false) */ $vars['rel'] = elgg_extract('confirm', $vars, elgg_echo('question:areyousure')); $vars['rel'] = addslashes($vars['rel']); -$encode = elgg_extract('text_encode', $vars, false); +$encode = elgg_extract('encode_text', $vars, false); // always generate missing action tokens $vars['href'] = elgg_add_action_tokens_to_url(elgg_normalize_url($vars['href']), true); @@ -25,8 +25,8 @@ if ($encode) { $text = htmlspecialchars($text, ENT_QUOTES, 'UTF-8', false); } -if (!isset($vars['title'])) { - $vars['title'] = addslashes($confirm); +if (!isset($vars['title']) && isset($vars['confirm'])) { + $vars['title'] = $vars['rel']; } if (isset($vars['class'])) { @@ -41,6 +41,7 @@ if (isset($vars['class'])) { unset($vars['encode_text']); unset($vars['text']); unset($vars['confirm']); +unset($vars['is_trusted']); $attributes = elgg_format_attributes($vars); echo "<a $attributes>$text</a>"; diff --git a/views/default/output/date.php b/views/default/output/date.php index 7c98dddc9..1644a3480 100644 --- a/views/default/output/date.php +++ b/views/default/output/date.php @@ -11,7 +11,7 @@ // convert timestamps to text for display if (is_numeric($vars['value'])) { - $vars['value'] = gmdate('Y/m/d', $vars['value']); + $vars['value'] = gmdate('Y-m-d', $vars['value']); } echo $vars['value']; diff --git a/views/default/output/img.php b/views/default/output/img.php new file mode 100644 index 000000000..d3f596801 --- /dev/null +++ b/views/default/output/img.php @@ -0,0 +1,12 @@ +<?php +/** + * Elgg image view + * + * @uses string $vars['src'] The image src url. + */ + +$vars['src'] = elgg_normalize_url($vars['src']); +$vars['src'] = elgg_format_url($vars['src']); + +$attributes = elgg_format_attributes($vars); +echo "<img $attributes/>"; diff --git a/views/default/output/longtext.php b/views/default/output/longtext.php index ffdfd87cc..200f27de5 100644 --- a/views/default/output/longtext.php +++ b/views/default/output/longtext.php @@ -25,12 +25,12 @@ unset($vars['parse_urls']); $text = $vars['value']; unset($vars['value']); -$text = filter_tags($text); - if ($parse_urls) { $text = parse_urls($text); } +$text = filter_tags($text); + $text = autop($text); $attributes = elgg_format_attributes($vars); diff --git a/views/default/output/tag.php b/views/default/output/tag.php index abae9c4b2..3c002a31b 100644 --- a/views/default/output/tag.php +++ b/views/default/output/tag.php @@ -26,5 +26,9 @@ if (isset($vars['value'])) { $type = ""; } $url = elgg_get_site_url() . 'search?q=' . urlencode($vars['value']) . "&search_type=tags{$type}{$subtype}{$object}"; - echo elgg_view('output/url', array('href' => $url, 'text' => $vars['value'], 'rel' => 'tag')); + echo elgg_view('output/url', array( + 'href' => $url, + 'text' => $vars['value'], + 'rel' => 'tag', + )); } diff --git a/views/default/output/text.php b/views/default/output/text.php index 2c9242c1d..5cbfc35b0 100644 --- a/views/default/output/text.php +++ b/views/default/output/text.php @@ -6,8 +6,7 @@ * @package Elgg * @subpackage Core * - * @uses $vars['text'] The text to display - * + * @uses $vars['value'] The text to display */ echo htmlspecialchars($vars['value'], ENT_QUOTES, 'UTF-8', false);
\ No newline at end of file diff --git a/views/default/output/url.php b/views/default/output/url.php index 79ab52377..81b02087d 100644 --- a/views/default/output/url.php +++ b/views/default/output/url.php @@ -10,7 +10,7 @@ * @uses string $vars['href'] The unencoded url string * @uses bool $vars['encode_text'] Run $vars['text'] through htmlspecialchars() (false) * @uses bool $vars['is_action'] Is this a link to an action (false) - * + * @uses bool $vars['is_trusted'] Is this link trusted (false) */ $url = elgg_extract('href', $vars, null); @@ -37,11 +37,20 @@ if ($url) { if (elgg_extract('is_action', $vars, false)) { $url = elgg_add_action_tokens_to_url($url, false); - unset($vars['is_action']); + } + + if (!elgg_extract('is_trusted', $vars, false)) { + if (!isset($vars['rel'])) { + $vars['rel'] = 'nofollow'; + $url = strip_tags($url); + } } $vars['href'] = $url; } +unset($vars['is_action']); +unset($vars['is_trusted']); + $attributes = elgg_format_attributes($vars); -echo "<a $attributes>$text</a>";
\ No newline at end of file +echo "<a $attributes>$text</a>"; |