aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/default/input/file.php21
1 files changed, 7 insertions, 14 deletions
diff --git a/views/default/input/file.php b/views/default/input/file.php
index 28ab54f94..4c42042e8 100644
--- a/views/default/input/file.php
+++ b/views/default/input/file.php
@@ -6,11 +6,6 @@
* @package Elgg
* @subpackage Core
*
- * @uses $vars['js'] Any Javascript to enter into the input tag
- * @uses $vars['internalname'] The name of the input field
- * @uses $vars['internalid'] The id of the input field
- * @uses $vars['class'] CSS class
- * @uses $vars['disabled'] Is the input field disabled?
* @uses $vars['value'] The current value if any
*
*/
@@ -19,15 +14,13 @@ if (!empty($vars['value'])) {
echo elgg_echo('fileexists') . "<br />";
}
-$class = "elgg-input-file";
-if (isset($vars['class'])) {
- $class = $vars['class'];
-}
+$defaults = array(
+ 'class' => 'elgg-input-file',
+ 'disabled' => FALSE,
+ 'size' => 30,
+);
-$disabled = false;
-if (isset($vars['disabled'])) {
- $disabled = $vars['disabled'];
-}
+$attrs = array_merge($defaults, $vars);
?>
-<input type="file" size="30" <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> <?php if ($disabled) echo ' disabled="yes" '; ?> class="<?php echo $class; ?>" /> \ No newline at end of file
+<input type="file" <?php echo elgg_format_attributes($attrs)?> /> \ No newline at end of file