]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
cleaned up input views for installation so that no notices are thrown
authorCash Costello <cash.costello@gmail.com>
Fri, 21 Oct 2011 11:14:51 +0000 (07:14 -0400)
committerCash Costello <cash.costello@gmail.com>
Fri, 21 Oct 2011 11:14:51 +0000 (07:14 -0400)
views/installation/input/access.php
views/installation/input/button.php
views/installation/input/checkbox.php
views/installation/input/dropdown.php
views/installation/input/form.php
views/installation/input/password.php
views/installation/input/text.php

index 7665d8bca81a782d97c21e053137622cac5035a9..c3d4713bc55bc5f84dd2f94fa69ddef0335b37c0 100644 (file)
@@ -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
+}
index 29a37dd553d2c777b9eaba1bd47eaa5e822dbc43..ec90fed9d43ef5b282ea0e7e04a3205c1f42819f 100644 (file)
@@ -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
index 378eae6fdcdb2da93733310bee2ab826b84653ed..6fbe251690055200b747f5210ddbffeb26d558c5 100644 (file)
@@ -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
index 46e15c657945ab506ee491ba08ec1634e94c8794..cf875492e852b003346c11c61393de87e69d4939 100644 (file)
  *                                                              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>
index f8730b4f59103e200c545e69e22b103692abac99..3556413a897984fa36a598d625a79e4df5e488a5 100644 (file)
@@ -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
index 18811109b22f029861382d559040adfaab828daf..2265ab117b24df56fd4c887c11f20b3f91fc2a77 100644 (file)
@@ -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; ?>" />
index ec8233461fe99e8a40074f1661038a9a491f42b6..375b91c44ff0ea721ced67b27bf21529f723a9e6 100644 (file)
@@ -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