From c66831fa5138a277a9729174caf14c7eb323fb07 Mon Sep 17 00:00:00 2001 From: brettp Date: Fri, 16 Oct 2009 20:26:12 +0000 Subject: Standardizing views.` git-svn-id: http://code.elgg.org/elgg/trunk@3555 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/output/calendar.php | 39 +++++++-------- views/default/output/checkboxes.php | 32 ++++++------ views/default/output/confirmlink.php | 67 ++++++++++++------------- views/default/output/date.php | 34 ++++++------- views/default/output/email.php | 34 ++++++------- views/default/output/iframe.php | 22 ++++----- views/default/output/longtext.php | 32 ++++++------ views/default/output/pulldown.php | 32 ++++++------ views/default/output/radio.php | 32 ++++++------ views/default/output/tagcloud.php | 90 +++++++++++++++++----------------- views/default/output/tags.php | 95 +++++++++++++++++------------------- views/default/output/text.php | 32 ++++++------ views/default/output/url.php | 58 ++++++++++------------ 13 files changed, 277 insertions(+), 322 deletions(-) (limited to 'views/default/output') diff --git a/views/default/output/calendar.php b/views/default/output/calendar.php index 336129aed..0a21eb74c 100644 --- a/views/default/output/calendar.php +++ b/views/default/output/calendar.php @@ -1,24 +1,19 @@ \ No newline at end of file +if (is_int($vars['value'])) { + echo date("F j, Y", $vars['value']); +} else { + echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); +} \ No newline at end of file diff --git a/views/default/output/checkboxes.php b/views/default/output/checkboxes.php index a93455e28..537d996e0 100644 --- a/views/default/output/checkboxes.php +++ b/views/default/output/checkboxes.php @@ -1,19 +1,15 @@ \ No newline at end of file +/** + * Elgg text output + * Displays some text that was input using a standard text field + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + * + * @uses $vars['text'] The text to display + * + */ + +echo elgg_view('output/tags',$vars); \ No newline at end of file diff --git a/views/default/output/confirmlink.php b/views/default/output/confirmlink.php index bb7e866f2..e0a6f65d7 100644 --- a/views/default/output/confirmlink.php +++ b/views/default/output/confirmlink.php @@ -1,42 +1,39 @@ 0) $sep = "&"; - $link = "$link{$sep}__elgg_token=$token&__elgg_ts=$ts"; - } - - if ($vars['class']) { - $class = 'class="' . $vars['class'] . '"'; - } else { - $class = ''; - } + $sep = "?"; + if (strpos($link, '?')>0) $sep = "&"; + $link = "$link{$sep}__elgg_token=$token&__elgg_ts=$ts"; +} + +if ($vars['class']) { + $class = 'class="' . $vars['class'] . '"'; +} else { + $class = ''; +} ?> onclick="return confirm('');"> \ No newline at end of file diff --git a/views/default/output/date.php b/views/default/output/date.php index d4fba97a0..fdc8e3a1b 100644 --- a/views/default/output/date.php +++ b/views/default/output/date.php @@ -1,21 +1,17 @@ 86400) { - echo date("F j, Y",$vars['value']); - } -?> \ No newline at end of file +if ($vars['value'] > 86400) { + echo date("F j, Y",$vars['value']); +} \ No newline at end of file diff --git a/views/default/output/email.php b/views/default/output/email.php index 2d454213f..e2142b09b 100644 --- a/views/default/output/email.php +++ b/views/default/output/email.php @@ -1,21 +1,17 @@ ". htmlentities($vars['value'], ENT_QUOTES, 'UTF-8') .""; - } -?> \ No newline at end of file +if (!empty($vars['value'])) { + echo "". htmlentities($vars['value'], ENT_QUOTES, 'UTF-8') .""; +} \ No newline at end of file diff --git a/views/default/output/iframe.php b/views/default/output/iframe.php index eb0cea0b4..e1a1e98c4 100644 --- a/views/default/output/iframe.php +++ b/views/default/output/iframe.php @@ -1,15 +1,15 @@ \ No newline at end of file diff --git a/views/default/output/longtext.php b/views/default/output/longtext.php index 3d130359a..a8540913f 100644 --- a/views/default/output/longtext.php +++ b/views/default/output/longtext.php @@ -1,21 +1,17 @@ \ No newline at end of file +echo autop(parse_urls(filter_tags($vars['value']))); \ No newline at end of file diff --git a/views/default/output/pulldown.php b/views/default/output/pulldown.php index 60b365b11..6e48043a9 100644 --- a/views/default/output/pulldown.php +++ b/views/default/output/pulldown.php @@ -1,19 +1,15 @@ \ No newline at end of file +/** + * Elgg pulldown display + * Displays a value that was entered into the system via a pulldown + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + * + * @uses $vars['text'] The text to display + * + */ + +echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); //$vars['value']; \ No newline at end of file diff --git a/views/default/output/radio.php b/views/default/output/radio.php index 78723b555..b454bae71 100644 --- a/views/default/output/radio.php +++ b/views/default/output/radio.php @@ -1,19 +1,15 @@ \ No newline at end of file +/** + * Elgg text output + * Displays some text that was input using a standard text field + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + * + * @uses $vars['text'] The text to display + * + */ + +echo elgg_view('output/text',$vars); \ No newline at end of file diff --git a/views/default/output/tagcloud.php b/views/default/output/tagcloud.php index 27d49b089..a41ec20c3 100644 --- a/views/default/output/tagcloud.php +++ b/views/default/output/tagcloud.php @@ -1,52 +1,50 @@ total > $max) { + $max = $tag->total; + } } - if (!empty($vars['object'])) { - $object = "&object=" . urlencode($vars['object']); - } else { - $object = ""; + foreach($vars['tagcloud'] as $tag) { + if (!empty($cloud)) { + $cloud .= ", "; + } + $size = round((log($tag->total) / log($max)) * 100) + 30; + if ($size < 60) { + $size = 60; + } + $cloud .= "tag)." ({$tag->total})\" style=\"text-decoration:none;\">" . htmlentities($tag->tag, ENT_QUOTES, 'UTF-8') . ""; } - - if (empty($vars['tagcloud']) && !empty($vars['value'])) - $vars['tagcloud'] = $vars['value']; - - if (!empty($vars['tagcloud']) && is_array($vars['tagcloud'])) { - - $counter = 0; - $cloud = ""; - $max = 0; - foreach($vars['tagcloud'] as $tag) { - if ($tag->total > $max) { - $max = $tag->total; - } - } - foreach($vars['tagcloud'] as $tag) { - if (!empty($cloud)) $cloud .= ", "; - $size = round((log($tag->total) / log($max)) * 100) + 30; - if ($size < 60) $size = 60; - $cloud .= "tag)." ({$tag->total})\" style=\"text-decoration:none;\">" . htmlentities($tag->tag, ENT_QUOTES, 'UTF-8') . ""; - } - echo $cloud; - - } - -?> \ No newline at end of file + echo $cloud; +} \ No newline at end of file diff --git a/views/default/output/tags.php b/views/default/output/tags.php index 901fa806b..f394d084f 100644 --- a/views/default/output/tags.php +++ b/views/default/output/tags.php @@ -1,55 +1,52 @@ " . htmlentities($tag, ENT_QUOTES, 'UTF-8') . ""; - } - } - echo $tagstr; - - } -?> \ No newline at end of file + foreach($vars['tags'] as $tag) { + if (!empty($tagstr)) { + $tagstr .= ", "; + } + if (!empty($vars['type'])) { + $type = "&type={$vars['type']}"; + } else { + $type = ""; + } + if (is_string($tag)) { + $tagstr .= "" . htmlentities($tag, ENT_QUOTES, 'UTF-8') . ""; + } + } + echo $tagstr; +} \ No newline at end of file diff --git a/views/default/output/text.php b/views/default/output/text.php index 080b81d68..bcfe33ea0 100644 --- a/views/default/output/text.php +++ b/views/default/output/text.php @@ -1,19 +1,15 @@ \ No newline at end of file +/** + * Elgg text output + * Displays some text that was input using a standard text field + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + * + * @uses $vars['text'] The text to display + * + */ + +echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); // $vars['value']; \ No newline at end of file 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 @@ 0) $sep = "&"; - $val = "$val{$sep}__elgg_token=$token&__elgg_ts=$ts"; + $sep = "?"; + if (strpos($val, '?')>0) { + $sep = "&"; } - - echo "". htmlentities($val, ENT_QUOTES, 'UTF-8'). ""; - } + $val = "$val{$sep}__elgg_token=$token&__elgg_ts=$ts"; + } -?> \ No newline at end of file + echo "". htmlentities($val, ENT_QUOTES, 'UTF-8'). ""; +} \ No newline at end of file -- cgit v1.2.3