aboutsummaryrefslogtreecommitdiff
path: root/views/default
diff options
context:
space:
mode:
authorewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-12 03:59:57 +0000
committerewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-12 03:59:57 +0000
commitc3cdb7635433b27a045bb8c17f5fb27a423974c5 (patch)
tree710cf056ff54ede2d15eb3bd5d2fe297c4d7ff5a /views/default
parent66ae062ed9420effec4661b62a5c06f13c1e69ea (diff)
downloadelgg-c3cdb7635433b27a045bb8c17f5fb27a423974c5.tar.gz
elgg-c3cdb7635433b27a045bb8c17f5fb27a423974c5.tar.bz2
Refs #2143: DRYed up input/file
git-svn-id: http://code.elgg.org/elgg/trunk@8141 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default')
-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