aboutsummaryrefslogtreecommitdiff
path: root/views/default
diff options
context:
space:
mode:
Diffstat (limited to 'views/default')
-rw-r--r--views/default/input/text.php28
1 files changed, 6 insertions, 22 deletions
diff --git a/views/default/input/text.php b/views/default/input/text.php
index ea35efe2a..3e8de2c35 100644
--- a/views/default/input/text.php
+++ b/views/default/input/text.php
@@ -5,34 +5,18 @@
*
* @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['disabled'] If true then control is read-only
- * @uses $vars['class'] Class override
*/
+$defaults = array(
+ 'class' => 'input_text',
+ 'disabled' => FALSE,
+);
-if (isset($vars['class'])) {
- $class = $vars['class'];
-} else {
- $class = "input_text";
-}
-
-$disabled = false;
-if (isset($vars['disabled'])) {
- $disabled = $vars['disabled'];
-}
+$vars = array_merge($defaults, $vars);
if (!isset($vars['value']) || $vars['value'] === FALSE) {
$vars['value'] = elgg_get_sticky_value($vars['internalname']);
}
-
-$value = htmlentities($vars['value'], ENT_QUOTES, 'UTF-8');
-
?>
-<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