diff options
author | Antonio Gallo <tonicucoz@gmail.com> | 2014-09-16 08:03:29 +0000 |
---|---|---|
committer | Antonio Gallo <tonicucoz@gmail.com> | 2014-09-16 08:03:29 +0000 |
commit | 11972639df8315753123ebccdadee1f596807ad0 (patch) | |
tree | 7c932d7e2f0d66afa55e603960f86cef7b00c5ff /h-source/Library/Html | |
parent | 6209923d6cfb2418ee926cccdc62a9383e14bd97 (diff) |
Integrated new EasyGiant Library
Diffstat (limited to 'h-source/Library/Html')
-rw-r--r-- | h-source/Library/Html/Form.php | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/h-source/Library/Html/Form.php b/h-source/Library/Html/Form.php index 64c501f..91b2aa0 100644 --- a/h-source/Library/Html/Form.php +++ b/h-source/Library/Html/Form.php @@ -2,7 +2,7 @@ // EasyGiant is a PHP framework for creating and managing dynamic content // -// Copyright (C) 2009 - 2011 Antonio Gallo +// Copyright (C) 2009 - 2014 Antonio Gallo (info@laboratoriolibero.com) // See COPYRIGHT.txt and LICENSE.txt. // // This file is part of EasyGiant @@ -70,10 +70,10 @@ class Html_Form { $a = $optionValue; } - if (strcmp($b,'optgroupOpen') === 0) + if (strcmp($optionValue,'optgroupOpen') === 0) { if ($flag === 1) $returnString .= "</optgroup>\n"; - $returnString .= "<optgroup label='" . $a . "'>\n"; + $returnString .= "<optgroup label='" . $optionName . "'>\n"; $flag = 1; } else @@ -83,7 +83,7 @@ class Html_Form { } } if ($flag === 1) $returnString .= "</optgroup>\n"; - $returnString .= "</select>\n"; + $returnString .= "</select>"; return $returnString; } @@ -97,7 +97,7 @@ class Html_Form { $strClass = isset($className) ? "class='".$className."'" : null; $idStr = isset($idName) ? "id='".$idName."'" : null; - $returnString ="<input $attributes ".$idStr." $strClass type='text' name='" .$name. "' value = '$value' />\n"; + $returnString ="<input $attributes ".$idStr." $strClass type='text' name='" .$name. "' value = '$value' />"; return $returnString; } @@ -110,7 +110,7 @@ class Html_Form { $strClass = isset($className) ? "class='".$className."'" : null; $idStr = isset($idName) ? "id='".$idName."'" : null; - $returnString ="<input $attributes ".$idStr." $strClass type='file' name='" .$name. "' />\n"; + $returnString ="<input $attributes ".$idStr." $strClass type='file' name='" .$name. "' />"; return $returnString; } @@ -126,7 +126,7 @@ class Html_Form { $idStr = isset($idName) ? "id='".$idName."'" : null; $str = (strcmp($value,$option) === 0) ? "checked = 'checked'" : null; - return "<input $attributes ".$idStr." $strClass type='checkbox' name='".$name."' value='".$option."' $str />\n"; + return "<input $attributes ".$idStr." $strClass type='checkbox' name='".$name."' value='".$option."' $str />"; } //return the HTML of a hidden entry @@ -137,7 +137,7 @@ class Html_Form { $strClass = isset($className) ? "class='".$className."'" : null; $idStr = isset($idName) ? "id='".$idName."'" : null; - return "<input $attributes ".$idStr." $strClass type='hidden' name='" .$name. "' value = '$value'>\n"; + return "<input $attributes ".$idStr." $strClass type='hidden' name='" .$name. "' value = '$value'>"; } //return the HTML of a password entry @@ -149,7 +149,7 @@ class Html_Form { $strClass = isset($className) ? "class='".$className."'" : null; $idStr = isset($idName) ? "id='".$idName."'" : null; - return "<input $attributes ".$idStr." $strClass type='password' name='" .$name. "' value='$value' />\n"; + return "<input $attributes ".$idStr." $strClass type='password' name='" .$name. "' value='$value' />"; } //return the HTML of a textarea @@ -161,7 +161,7 @@ class Html_Form { $strClass = isset($className) ? "class='".$className."'" : null; $idStr = isset($idName) ? "id='".$idName."'" : null; - return "<textarea $attributes ".$idStr." $strClass name='" .$name. "'>$value</textarea>\n"; + return "<textarea $attributes ".$idStr." $strClass name='" .$name. "'>$value</textarea>"; } //return the HTML of a radio button @@ -202,7 +202,7 @@ class Html_Form { } $str= (strcmp($value,$optionValue) === 0) ? "checked='checked'" : null; - $returnString .= "$before<input $attributes ".$idStr." $strClass type='radio' name='".$name."' value='".$optionValue."' $str />$after\n"; + $returnString .= "$before<input $attributes ".$idStr." $strClass type='radio' name='".$name."' value='".$optionValue."' $str />$after"; } return $returnString; @@ -222,12 +222,13 @@ class Html_Form { if (isset($image)) { - $returnString = "<input $attributes $idStr $strClass type='image' src='".$image."' value='$value'>\n"; - $returnString .= "<input type='hidden' name='".$name."' value='$value'>\n"; + $returnString = "<input $attributes $idStr $strClass type='image' src='".$image."' value='$value'>"; + $returnString .= "<input type='hidden' name='".$name."' value='$value'>"; } else { - $returnString ="<input $attributes $idStr $strClass type='submit' name='" .$name. "' value = '$value' />\n"; + $returnString = '<button '.$idStr.' '.$attributes.' '.$strClass.' type="submit" name="' .$name. '">'.$value.'</button>'; + $returnString .= "<input type='hidden' name='".$name."' value='$value'>"; } return $returnString; |