]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Refs #1208: Default input/button to 'button' type (rather than 'submit' type).
authorewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sun, 14 Nov 2010 06:39:03 +0000 (06:39 +0000)
committerewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sun, 14 Nov 2010 06:39:03 +0000 (06:39 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7307 36083f99-b078-4883-b0ff-0f9b5a30f544

views/default/input/button.php

index 63a14052431ad22d854f071eeee4b64f72091bab..906e41b4cdb30cbda20fad006891e68baa8d5b96 100644 (file)
@@ -22,19 +22,18 @@ if (isset($vars['class'])) {
        $class = "submit_button";
 }
 
-// defaults to submit button
 if (isset($vars['type'])) {
        $type = strtolower($vars['type']);
 } else {
-       $type = 'submit';
+       $type = 'button';
 }
 
 switch ($type) {
        case 'button' :
-               $type='button';
+               $type = 'button';
                break;
        case 'reset' :
-               $type='reset';
+               $type = 'reset';
                break;
        case 'submit':
        default:
@@ -53,8 +52,14 @@ if (isset($vars['src'])) {
        $src = "src=\"{$vars['src']}\"";
 }
 // blank src if trying to access an offsite image.
-if (strpos($src,$CONFIG->wwwroot)===false) {
+if (strpos($src, $CONFIG->wwwroot) === false) {
        $src = "";
 }
+
+$id = '';
+if (isset($vars['internalid'])) {
+       $id = "id=\"{$vars['internalid']}\"";
+}
+
 ?>
-<input name="<?php echo $name; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> type="<?php echo $type; ?>" class="<?php echo $class; ?>" <?php echo $vars['js']; ?> value="<?php echo $value; ?>" <?php echo $src; ?> />
\ No newline at end of file
+<input name="<?php echo $name; ?>" <?php echo $id; ?> type="<?php echo $type; ?>" class="<?php echo $class; ?>" <?php echo $vars['js']; ?> value="<?php echo $value; ?>" <?php echo $src; ?> />
\ No newline at end of file