diff options
Diffstat (limited to 'views/default/input/text.php')
| -rw-r--r-- | views/default/input/text.php | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/views/default/input/text.php b/views/default/input/text.php index a77956985..07ce5c710 100644 --- a/views/default/input/text.php +++ b/views/default/input/text.php @@ -5,36 +5,22 @@ * * @package Elgg * @subpackage Core - - * @author Curverider Ltd - - * @link http://elgg.org/ * - * @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['disabled'] If true then control is read-only - * @uses $vars['class'] Class override + * @uses $vars['class'] Additional CSS class */ - if (isset($vars['class'])) { - $class = $vars['class']; + $vars['class'] = "elgg-input-text {$vars['class']}"; } else { - $class = "input_text"; + $vars['class'] = "elgg-input-text"; } -$disabled = false; -if (isset($vars['disabled'])) { - $disabled = $vars['disabled']; -} +$defaults = array( + 'value' => '', + 'disabled' => false, +); -if (!isset($vars['value']) || $vars['value'] === FALSE) { - $vars['value'] = elgg_get_sticky_value($vars['internalname']); -} - -$value = htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); +$vars = array_merge($defaults, $vars); ?> - -<input type="text" <?php if ($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 $value; ?>" class="<?php echo $class ?>"/>
\ No newline at end of file +<input type="text" <?php echo elgg_format_attributes($vars); ?> />
\ No newline at end of file |
