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

views/default/input/password.php

index 86bae9c7f048b1d39cdbd40c9df38f7bcad508cc..1bd70a419fe8edefdf159996b38170acf998523d 100644 (file)
  *
  */
 
-$class = $vars['class'];
-if (!$class) {
-       $class = "elgg-input-password";
-}
+$defaults = array(
+       'class' => 'elgg-input-password',
+       'disabled' => FALSE,
+       
+)
+
+$attrs = array_merge($defaults, $vars);
 ?>
 
-<input type="password" <?php if ($vars['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 htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?>" class="<?php echo $class; ?>" />
\ No newline at end of file
+<input type="password" <?php echo elgg_format_attributes($attrs); ?> />
\ No newline at end of file