aboutsummaryrefslogtreecommitdiff
path: root/views/installation/input
diff options
context:
space:
mode:
Diffstat (limited to 'views/installation/input')
-rw-r--r--views/installation/input/access.php11
-rw-r--r--views/installation/input/button.php15
-rw-r--r--views/installation/input/checkbox.php8
-rw-r--r--views/installation/input/dropdown.php15
-rw-r--r--views/installation/input/form.php9
-rw-r--r--views/installation/input/password.php10
-rw-r--r--views/installation/input/text.php11
7 files changed, 31 insertions, 48 deletions
diff --git a/views/installation/input/access.php b/views/installation/input/access.php
index 7665d8bca..c3d4713bc 100644
--- a/views/installation/input/access.php
+++ b/views/installation/input/access.php
@@ -8,12 +8,7 @@
*
*/
-if (isset($vars['class'])) {
- $class = $vars['class'];
-}
-if (!$class) {
- $class = "elgg-input-access";
-}
+$class = "elgg-input-access";
if ((!isset($vars['options'])) || (!is_array($vars['options']))) {
$vars['options'] = array();
@@ -24,7 +19,7 @@ if (is_array($vars['options']) && sizeof($vars['options']) > 0) {
?>
- <select name="<?php echo $vars['name']; ?>" <?php if ((isset($vars['disabled'])) && ($vars['disabled'])) echo ' disabled="yes" '; ?> class="<?php echo $class; ?>">
+ <select name="<?php echo $vars['name']; ?>" class="<?php echo $class; ?>">
<?php
foreach($vars['options'] as $key => $option) {
@@ -40,4 +35,4 @@ if (is_array($vars['options']) && sizeof($vars['options']) > 0) {
<?php
-} \ No newline at end of file
+}
diff --git a/views/installation/input/button.php b/views/installation/input/button.php
index 29a37dd55..ec90fed9d 100644
--- a/views/installation/input/button.php
+++ b/views/installation/input/button.php
@@ -7,11 +7,18 @@
* @uses $vars['type'] submit or button.
*/
-$class = $vars['class'];
-if (!$class) {
+if (isset($vars['class'])) {
+ $class = $vars['class'];
+} else {
$class = "elgg-button-submit";
}
+if (isset($vars['name'])) {
+ $name = $vars['name'];
+} else {
+ $name = '';
+}
+
if (isset($vars['type'])) {
$type = strtolower($vars['type']);
} else {
@@ -28,6 +35,6 @@ switch ($type) {
}
$value = htmlentities($vars['value'], ENT_QUOTES, 'UTF-8');
-$name = $vars['name'];
+
?>
-<input type="<?php echo $type; ?>" <?php if (isset($vars['id'])) echo "id=\"{$vars['id']}\"";?> value="<?php echo $value; ?>" class="<?php echo $class; ?>" /> \ No newline at end of file
+<input type="<?php echo $type; ?>" value="<?php echo $value; ?>" class="<?php echo $class; ?>" /> \ No newline at end of file
diff --git a/views/installation/input/checkbox.php b/views/installation/input/checkbox.php
index 378eae6fd..6fbe25169 100644
--- a/views/installation/input/checkbox.php
+++ b/views/installation/input/checkbox.php
@@ -5,15 +5,9 @@
*
* @uses $var['name']
* @uses $vars['value']
- * @uses $vars['id']
* @uses $vars['class']
*/
-if (isset($vars['id'])) {
- $id = "id=\"{$vars['id']}\"";
-} else {
- $id = '';
-}
if (isset($vars['class'])) {
$id = "class=\"{$vars['class']}\"";
@@ -27,4 +21,4 @@ if (!isset($vars['value'])) {
?>
-<input type="checkbox" <?php echo $id; ?> <?php echo $class; ?> name="<?php echo $vars['name']; ?>" value="<?php echo $vars['value']; ?>" /> \ No newline at end of file
+<input type="checkbox" <?php echo $class; ?> name="<?php echo $vars['name']; ?>" value="<?php echo $vars['value']; ?>" /> \ No newline at end of file
diff --git a/views/installation/input/dropdown.php b/views/installation/input/dropdown.php
index 46e15c657..cf875492e 100644
--- a/views/installation/input/dropdown.php
+++ b/views/installation/input/dropdown.php
@@ -10,16 +10,13 @@
* the value displayed on the button. Replaces $vars['options'] when defined.
*/
+$class = "elgg-input-dropdown";
-$class = $vars['class'];
-if (!$class) {
- $class = "elgg-input-dropdown";
-}
?>
-<select name="<?php echo $vars['name']; ?>" <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> class="<?php echo $class; ?>">
+<select name="<?php echo $vars['name']; ?>" class="<?php echo $class; ?>">
<?php
-if ($vars['options_values']) {
- foreach($vars['options_values'] as $value => $option) {
+if (isset($vars['options_values'])) {
+ foreach ($vars['options_values'] as $value => $option) {
if ($value != $vars['value']) {
echo "<option value=\"$value\">{$option}</option>";
} else {
@@ -27,7 +24,7 @@ if ($vars['options_values']) {
}
}
} else {
- foreach($vars['options'] as $option) {
+ foreach ($vars['options'] as $option) {
if ($option != $vars['value']) {
echo "<option>{$option}</option>";
} else {
@@ -36,4 +33,4 @@ if ($vars['options_values']) {
}
}
?>
-</select> \ No newline at end of file
+</select>
diff --git a/views/installation/input/form.php b/views/installation/input/form.php
index f8730b4f5..3556413a8 100644
--- a/views/installation/input/form.php
+++ b/views/installation/input/form.php
@@ -5,20 +5,15 @@
* @uses $vars['body'] The body of the form (made up of other input/xxx views and html
* @uses $vars['action'] URL of the action being called
* @uses $vars['method'] Method (default POST)
- * @uses $vars['id'] Form id
* @uses $vars['name'] Form name
*/
-if (isset($vars['id'])) {
- $id = "id=\"{$vars['id']}\"";
-} else {
- $id = '';
-}
if (isset($vars['name'])) {
$name = "name=\"{$vars['name']}\"";
} else {
$name = '';
}
+
$body = $vars['body'];
$action = $vars['action'];
if (isset($vars['method'])) {
@@ -30,6 +25,6 @@ if (isset($vars['method'])) {
$method = strtolower($method);
?>
-<form <?php echo "$id $name"; ?> action="<?php echo $action; ?>" method="<?php echo $method; ?>">
+<form <?php echo $name; ?> action="<?php echo $action; ?>" method="<?php echo $method; ?>">
<?php echo $body; ?>
</form> \ No newline at end of file
diff --git a/views/installation/input/password.php b/views/installation/input/password.php
index 18811109b..2265ab117 100644
--- a/views/installation/input/password.php
+++ b/views/installation/input/password.php
@@ -8,10 +8,10 @@
*
*/
-$class = $vars['class'];
-if (!$class) {
- $class = "input-password";
-}
+$class = "input-password";
+
+$value = htmlentities($vars['value'], ENT_QUOTES, 'UTF-8');
+
?>
-<input type="password" <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> name="<?php echo $vars['name']; ?>" <?php if (isset($vars['id'])) echo "id=\"{$vars['id']}\""; ?> value="<?php echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?>" class="<?php echo $class; ?>" />
+<input type="password" name="<?php echo $vars['name']; ?>" value="<?php echo $value; ?>" class="<?php echo $class; ?>" />
diff --git a/views/installation/input/text.php b/views/installation/input/text.php
index ec8233461..375b91c44 100644
--- a/views/installation/input/text.php
+++ b/views/installation/input/text.php
@@ -6,20 +6,15 @@
* @uses $vars['value'] The current value, if any
* @uses $vars['name'] The name of the input field
* @uses $vars['class'] CSS class
- * @uses $vars['id'] CSS id
*/
if (isset($vars['class'])) {
$class = "class=\"{$vars['class']}\"";
} else {
- $class = "";
+ $class = "elgg-input-text";
}
-if (isset($vars['id'])) {
- $id = "id=\"{$vars['id']}\"";
-} else {
- $id = '';
-}
+$value = htmlentities($vars['value'], ENT_QUOTES, 'UTF-8');
?>
-<input type="text" name="<?php echo $vars['name']; ?>" value="<?php echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?>" <?php echo $class; ?> <?php echo $id; ?>/> \ No newline at end of file
+<input type="text" name="<?php echo $vars['name']; ?>" value="<?php echo $value; ?>" <?php echo $class; ?> /> \ No newline at end of file