diff options
author | Evan Winslow <evan.b.winslow@gmail.com> | 2010-10-21 17:46:39 +0000 |
---|---|---|
committer | Evan Winslow <evan.b.winslow@gmail.com> | 2010-10-21 17:46:39 +0000 |
commit | 9ff9d71952db26c06fe2eb1bf98b53340242e524 (patch) | |
tree | fa0a068d6a024d029246691c0c67f1b5e83d2ede /views/default/html | |
parent | 1bb750cdf821416584dc42206a29dae7c41144a5 (diff) | |
download | elgg-9ff9d71952db26c06fe2eb1bf98b53340242e524.tar.gz elgg-9ff9d71952db26c06fe2eb1bf98b53340242e524.tar.bz2 |
Removed html/tag view -- all we really needed was a function to form an attribute string from an array. This is now being used in each input view and there is not so much view nesting going on...
Diffstat (limited to 'views/default/html')
-rw-r--r-- | views/default/html/form.php | 11 | ||||
-rw-r--r-- | views/default/html/img.php | 8 | ||||
-rw-r--r-- | views/default/html/input.php | 12 | ||||
-rw-r--r-- | views/default/html/option.php | 1 | ||||
-rw-r--r-- | views/default/html/tag.php | 64 | ||||
-rw-r--r-- | views/default/html/textarea.php | 16 |
6 files changed, 3 insertions, 109 deletions
diff --git a/views/default/html/form.php b/views/default/html/form.php deleted file mode 100644 index b93c62051..000000000 --- a/views/default/html/form.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php -$defaults = array( - 'method' => 'POST', - 'body' => '', -); - -$overrides = array( - 'tag' => 'form', -); - -echo elgg_view('html/tag', array_merge($defaults, $vars, $overrides));
\ No newline at end of file diff --git a/views/default/html/img.php b/views/default/html/img.php index 3560e066e..734e59a55 100644 --- a/views/default/html/img.php +++ b/views/default/html/img.php @@ -3,11 +3,9 @@ $defaults = array( 'alt' => '', 'title' => '', + 'border' => 0, ); -$overrides = array( - 'tag' => 'img', - 'body' => NULL, -); +$attributes = html5_get_html_attributes(array_merge($defaults, $vars)); -echo elgg_view('html/tag', array_merge($defaults, $vars, $overrides));
\ No newline at end of file +echo "<img $attributes />";
\ No newline at end of file diff --git a/views/default/html/input.php b/views/default/html/input.php deleted file mode 100644 index 7350ae308..000000000 --- a/views/default/html/input.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php -$defaults = array( - 'type' => 'text', -); - -$overrides = array( - 'tag' => 'input', -); - -$args = array_merge($defaults, $vars, $overrides); - -echo elgg_view('html/tag', $args);
\ No newline at end of file diff --git a/views/default/html/option.php b/views/default/html/option.php deleted file mode 100644 index b3d9bbc7f..000000000 --- a/views/default/html/option.php +++ /dev/null @@ -1 +0,0 @@ -<?php diff --git a/views/default/html/tag.php b/views/default/html/tag.php deleted file mode 100644 index 67a7d067c..000000000 --- a/views/default/html/tag.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php - -// remove all the junk that elgg_view throws into $vars - -unset($vars['config']); -unset($vars['url']); -unset($vars['page_owner']); -unset($vars['page_owner_user']); -foreach ($_SESSION as $key=>$value) { - unset($vars[$key]); -} - -// backwards compatibility code -if (isset($vars['internalname'])) { - //@todo put deprecated notice - $vars['name'] = $vars['internalname']; - unset($vars['internalname']); -} - -if (isset($vars['internalid'])) { - //@todo put deprecated notice - $vars['id'] = $vars['internalid']; - unset($vars['internalid']); -} - -$js = ''; -if (isset($vars['js'])) { - //@todo put deprecated notice - $js = $vars['js']; - unset($vars['js']); -} - -$tag = $vars['tag']; -unset($vars['tag']); - -$body = $vars['body']; -unset($vars['body']); - -//Build the input -$element = array(); - -$element[] = "<$tag"; -foreach ($vars as $attr => $val) { - if ($val === TRUE) { - $element[] = $attr; - } elseif (!empty($val)) { - $val = htmlspecialchars($val); - $element[] = "$attr=\"$val\""; - } -} - -if (!empty($js)) { - $element[] = $js; -} - -if (!isset($body)) { - $element[] = '/'; -} - -echo implode(" ", $element).">"; - -if (isset($body)) { - echo "$body</$tag>"; -}
\ No newline at end of file diff --git a/views/default/html/textarea.php b/views/default/html/textarea.php deleted file mode 100644 index 0c3813246..000000000 --- a/views/default/html/textarea.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php -$defaults = array( - 'body' => '', - 'class' => 'input-textarea', -); - -$overrides = array( - 'tag' => 'textarea', -); - -if (isset($vars['value'])) { - $vars['body'] = $vars['value']; - unset($vars['value']); -} - -echo elgg_view('html/tag', array_merge($defaults, $vars, $overrides));
\ No newline at end of file |