aboutsummaryrefslogtreecommitdiff
path: root/views/default/input
diff options
context:
space:
mode:
authorewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-20 06:04:43 +0000
committerewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-20 06:04:43 +0000
commita8833f0ab81df477c8a19b221a9ae8a90294bdf8 (patch)
tree1a38a47a466a565d38df9b549ad727bd5f363b19 /views/default/input
parent2da8c3e8428f09bab7aefa39cadc0a4f2d6f7a80 (diff)
downloadelgg-a8833f0ab81df477c8a19b221a9ae8a90294bdf8.tar.gz
elgg-a8833f0ab81df477c8a19b221a9ae8a90294bdf8.tar.bz2
Refs #2143: Added elgg_format_attributes() for generating an attribute string from an associative array. DRYed up input/output url
git-svn-id: http://code.elgg.org/elgg/trunk@7354 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/input')
-rw-r--r--views/default/input/url.php17
1 files changed, 6 insertions, 11 deletions
diff --git a/views/default/input/url.php b/views/default/input/url.php
index 1271bd3be..29f5edb30 100644
--- a/views/default/input/url.php
+++ b/views/default/input/url.php
@@ -5,22 +5,17 @@
*
* @package Elgg
* @subpackage Core
- *
- * @uses $vars['value'] The current value, if any
- * @uses $vars['js'] Any Javascript to enter into the input tag
- * @uses $vars['internalname'] The name of the input field
- * @uses $vars['class'] Class override
*/
-$class = $vars['class'];
-if (!$class) {
- $class = "input_url";
-}
+$defaults = array(
+ 'class' => 'input_url',
+);
+
+$vars = array_merge($defaults, $vars);
if (!isset($vars['value']) || $vars['value'] === FALSE) {
$vars['value'] = elgg_get_sticky_value($vars['internalname']);
}
-
?>
-<input type="text" <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> value="<?php echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?>" class="<?php echo $class; ?>"/> \ No newline at end of file
+<input type="text" <?php echo elgg_format_attributes($vars); ?> />