From 4f5d7c0e9d231a9558cf9d4e681351f3bf1b20f2 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Fri, 21 Oct 2011 07:14:51 -0400 Subject: cleaned up input views for installation so that no notices are thrown --- views/installation/input/access.php | 11 +++-------- views/installation/input/button.php | 15 +++++++++++---- views/installation/input/checkbox.php | 8 +------- views/installation/input/dropdown.php | 15 ++++++--------- views/installation/input/form.php | 9 ++------- views/installation/input/password.php | 10 +++++----- views/installation/input/text.php | 11 +++-------- 7 files changed, 31 insertions(+), 48 deletions(-) (limited to 'views') 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) { ?> - $option) { @@ -40,4 +35,4 @@ if (is_array($vars['options']) && sizeof($vars['options']) > 0) { - value="" class="" /> \ No newline at end of file + \ 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'])) { ?> - name="" value="" /> \ No newline at end of file + name="" 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"; -} ?> - $option) { +if (isset($vars['options_values'])) { + foreach ($vars['options_values'] as $value => $option) { if ($value != $vars['value']) { echo ""; } 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 ""; } else { @@ -36,4 +33,4 @@ if ($vars['options_values']) { } } ?> - \ No newline at end of file + 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); ?> -
action="" method=""> + action="" method="">
\ 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'); + ?> - name="" value="" 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'); ?> - /> \ No newline at end of file + /> \ No newline at end of file -- cgit v1.2.3