diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-04-15 15:16:07 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-04-15 15:16:07 +0000 |
commit | 71d39f1c4ca21bd25b9bda01451ae651cbbabb64 (patch) | |
tree | 93d67f848ed0bf60a26c57ca3c809985a8c55603 /views/default | |
parent | 5a6d2bf8e397792fdc557b658e5ab5caea5d9f29 (diff) | |
download | elgg-71d39f1c4ca21bd25b9bda01451ae651cbbabb64.tar.gz elgg-71d39f1c4ca21bd25b9bda01451ae651cbbabb64.tar.bz2 |
Tidied up output views
git-svn-id: https://code.elgg.org/elgg/trunk@463 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default')
-rw-r--r-- | views/default/output/confirmlink.php | 21 | ||||
-rw-r--r-- | views/default/output/date.php | 18 | ||||
-rw-r--r-- | views/default/output/file.php | 3 | ||||
-rw-r--r-- | views/default/output/gender.php | 3 | ||||
-rw-r--r-- | views/default/output/longtext.php | 16 | ||||
-rw-r--r-- | views/default/output/pulldown.php | 16 | ||||
-rw-r--r-- | views/default/output/tagcloud.php | 20 | ||||
-rw-r--r-- | views/default/output/tags.php | 20 | ||||
-rw-r--r-- | views/default/output/text.php | 16 | ||||
-rw-r--r-- | views/default/output/timestamp.php | 5 | ||||
-rw-r--r-- | views/default/output/url.php | 15 |
11 files changed, 134 insertions, 19 deletions
diff --git a/views/default/output/confirmlink.php b/views/default/output/confirmlink.php new file mode 100644 index 000000000..db52a4f3e --- /dev/null +++ b/views/default/output/confirmlink.php @@ -0,0 +1,21 @@ +<?php
+
+ /**
+ * Elgg confirmation link
+ * A link that displays a confirmation dialog before it executes
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.org/
+ *
+ * @uses $vars['text'] The text of the link
+ * @uses $vars['href'] The address
+ * @uses $vars['confirm'] The dialog text
+ *
+ */
+
+?>
+<a href="<?php echo $vars['href']; ?>" onclick="return confirm('<?php echo addslashes($vars['confirm']); ?>');"><?php echo $vars['text']; ?></a>
\ No newline at end of file diff --git a/views/default/output/date.php b/views/default/output/date.php index ebb891154..cbb6b8786 100644 --- a/views/default/output/date.php +++ b/views/default/output/date.php @@ -1,5 +1,21 @@ <?php
+
+ /**
+ * Date
+ * Displays a properly formatted date
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.org/
+ *
+ * @uses $vars['value'] A UNIX epoch timestamp
+ *
+ */
+
if ($vars['value'] > 86400) {
- echo gmdate("F j, Y",$vars['value']);
+ echo date("F j, Y",$vars['value']);
}
?>
\ No newline at end of file diff --git a/views/default/output/file.php b/views/default/output/file.php deleted file mode 100644 index af042230f..000000000 --- a/views/default/output/file.php +++ /dev/null @@ -1,3 +0,0 @@ -<span class="file-attachment">
- <a href="<?php echo $vars['value']; ?>">Download attachment</a>
-<span>
\ No newline at end of file diff --git a/views/default/output/gender.php b/views/default/output/gender.php deleted file mode 100644 index 79048485c..000000000 --- a/views/default/output/gender.php +++ /dev/null @@ -1,3 +0,0 @@ -<?php
- echo $vars['value'];
-?>
\ No newline at end of file diff --git a/views/default/output/longtext.php b/views/default/output/longtext.php index d16332182..88c8a925c 100644 --- a/views/default/output/longtext.php +++ b/views/default/output/longtext.php @@ -1,3 +1,19 @@ <?php
+
+ /**
+ * Elgg display long text
+ * Displays a large amount of text, with new lines converted to line breaks
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.org/
+ *
+ * @uses $vars['text'] The text to display
+ *
+ */
+
echo nl2br($vars['value']);
?>
\ No newline at end of file diff --git a/views/default/output/pulldown.php b/views/default/output/pulldown.php index 79048485c..10c9d055d 100644 --- a/views/default/output/pulldown.php +++ b/views/default/output/pulldown.php @@ -1,3 +1,19 @@ <?php
+
+ /**
+ * Elgg pulldown display
+ * Displays a value that was entered into the system via a pulldown
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.org/
+ *
+ * @uses $vars['text'] The text to display
+ *
+ */
+
echo $vars['value'];
?>
\ No newline at end of file diff --git a/views/default/output/tagcloud.php b/views/default/output/tagcloud.php index 5d219fd07..89b6f0371 100644 --- a/views/default/output/tagcloud.php +++ b/views/default/output/tagcloud.php @@ -1,9 +1,19 @@ <?php
- /**
- * This is a generic view that will display a tag cloud for any
- * section; photos, services, resources and a user or group
- **/
+ /**
+ * Elgg tagcloud
+ * Displays a tagcloud
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.org/
+ *
+ * @uses $vars['tagcloud'] An array of stdClass objects with two elements: 'tag' (the text of the tag) and 'total' (the number of elements with this tag)
+ *
+ */
if (!empty($vars['tagcloud']) && is_array($vars['tagcloud'])) {
@@ -19,7 +29,7 @@ if (!empty($cloud)) $cloud .= ", ";
$size = round((log($tag->total) / log($max)) * 100) + 30;
if ($size < 60) $size = 60;
- $cloud .= "<a href=\"" . $vars['url'] . "search/?tag=". urlencode($tag->tag) . "&type=".urlencode($tag->tag_type)."\" style=\"font-size: {$size}%\" title=\"".addslashes($tag->tag)." ({$tag->total})\" style=\"text-decoration:none;\">" .$tag->tag . "</a>";
+ $cloud .= "<a href=\"" . $vars['url'] . "search/?tag=". urlencode($tag->tag) . "\" style=\"font-size: {$size}%\" title=\"".addslashes($tag->tag)." ({$tag->total})\" style=\"text-decoration:none;\">" .$tag->tag . "</a>";
}
echo $cloud;
diff --git a/views/default/output/tags.php b/views/default/output/tags.php index 39cee3280..d7df0ccf2 100644 --- a/views/default/output/tags.php +++ b/views/default/output/tags.php @@ -1,4 +1,22 @@ <?php
+
+ /**
+ * Elgg tags
+ * Displays a list of tags, separated by commas
+ *
+ * Tags can be a single string (for one tag) or an array of strings
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.org/
+ *
+ * @uses $vars['tags'] The tags to display
+ *
+ */
+
if (!empty($vars['tags'])) {
$string = "";
@@ -16,8 +34,6 @@ }
if (is_string($tag)) {
$tagstr .= "<a href=\"{$vars['url']}search/?tag=".urlencode($tag) . "{$type}\">{$tag}</a>";
- } else {
- $tagstr .= "<a href=\"{$vars['url']}search/?tag=".urlencode($tag->value) . "{$type}\">{$tag->value}</a>";
}
}
echo $tagstr;
diff --git a/views/default/output/text.php b/views/default/output/text.php index 79048485c..01cbdc35d 100644 --- a/views/default/output/text.php +++ b/views/default/output/text.php @@ -1,3 +1,19 @@ <?php
+
+ /**
+ * Elgg text output
+ * Displays some text that was input using a standard text field
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.org/
+ *
+ * @uses $vars['text'] The text to display
+ *
+ */
+
echo $vars['value'];
?>
\ No newline at end of file diff --git a/views/default/output/timestamp.php b/views/default/output/timestamp.php deleted file mode 100644 index 20d25d043..000000000 --- a/views/default/output/timestamp.php +++ /dev/null @@ -1,5 +0,0 @@ -<?php
-
- echo date("F j, Y", $vars['value']);
-
-?>
\ No newline at end of file diff --git a/views/default/output/url.php b/views/default/output/url.php index 98fb610a1..b710bf512 100644 --- a/views/default/output/url.php +++ b/views/default/output/url.php @@ -1,5 +1,20 @@ <?php
+ /**
+ * Elgg URL display
+ * Displays a URL as a link
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.org/
+ *
+ * @uses $vars['value'] The URL to display
+ *
+ */
+
$val = trim($vars['value']);
if (!empty($val)) {
if (substr_count($val, "http://") == 0) {
|