diff options
-rw-r--r-- | views/default/input/button.php | 9 | ||||
-rw-r--r-- | views/default/input/form.php | 2 | ||||
-rw-r--r-- | views/default/input/submit.php | 3 | ||||
-rw-r--r-- | views/default/input/text.php | 12 |
4 files changed, 16 insertions, 10 deletions
diff --git a/views/default/input/button.php b/views/default/input/button.php index 0a65feb82..0ad19a432 100644 --- a/views/default/input/button.php +++ b/views/default/input/button.php @@ -1,8 +1,9 @@ <?php /** * Create a input button - * Use this view for forms rather than creating a submit/reset button tag in the wild as it provides - * extra security which help prevent CSRF attacks. + * Use this view or submit view for forms rather than creating a + * submit/reset button tag in the wild as it provides extra security + * which help prevent CSRF attacks. * * @package Elgg * @subpackage Core @@ -21,11 +22,11 @@ global $CONFIG; if (isset($vars['class'])) { $class = $vars['class']; -} -if (!$class) { +} else { $class = "submit_button"; } +// defaults to submit button if (isset($vars['type'])) { $type = strtolower($vars['type']); } else { diff --git a/views/default/input/form.php b/views/default/input/form.php index 11fb485da..b5db3e55f 100644 --- a/views/default/input/form.php +++ b/views/default/input/form.php @@ -44,7 +44,7 @@ $method = strtolower($method); // Generate a security header $security_header = ""; -if ($vars['disable_security']!=true) { +if (!isset($vars['disable_security']) || $vars['disable_security'] != true) { $security_header = elgg_view('input/securitytoken'); } ?> diff --git a/views/default/input/submit.php b/views/default/input/submit.php index b0c72791f..377a86c8f 100644 --- a/views/default/input/submit.php +++ b/views/default/input/submit.php @@ -19,8 +19,7 @@ $vars['type'] = 'submit'; if (isset($vars['class'])) { $class = $vars['class']; -} -if (!$class) { +} else { $class = "submit_button"; } $vars['class'] = $class; diff --git a/views/default/input/text.php b/views/default/input/text.php index 1814e5801..e4d39e0ba 100644 --- a/views/default/input/text.php +++ b/views/default/input/text.php @@ -18,11 +18,17 @@ */ -$class = $vars['class']; -if (!$class) { +if (isset($vars['class'])) { + $class = $vars['class']; +} else { $class = "input-text"; } +$disabled = false; +if (isset($vars['disabled'])) { + $disabled = $vars['disabled']; +} + ?> -<input type="text" <?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="text" <?php if ($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 |