]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Refs #2143: DRYed up input/plaintext
authorewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sat, 12 Feb 2011 06:42:45 +0000 (06:42 +0000)
committerewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sat, 12 Feb 2011 06:42:45 +0000 (06:42 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@8145 36083f99-b078-4883-b0ff-0f9b5a30f544

views/default/input/plaintext.php

index 04ff2f1f0fc5052e1b2c4dff84f1cf41a598a265..a0a8a39497e5065139fc2e34b837d004a5a70019 100644 (file)
  *
  */
 
-$class = $vars['class'];
-if (!$class) {
-       $class = "elgg-input-textarea";
-}
+$defaults = array(
+       'class' => 'elgg-input-textarea'
+       'disabled' => FALSE,
+);
 
+$value = $vars['value'];
+unset($vars['value']);
+
+$attrs = array_merge($defaults, $vars);
 ?>
 
-<textarea class="<?php echo $class; ?>" name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> <?php echo $vars['js']; ?>><?php echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?></textarea>
\ No newline at end of file
+<textarea <?php echo elgg_format_attributes($attrs); ?>>
+       <?php echo htmlentities($value, ENT_QUOTES, 'UTF-8'); ?>
+</textarea>