diff options
author | Antonio Gallo <tonicucoz@gmail.com> | 2013-10-14 16:06:56 +0000 |
---|---|---|
committer | Antonio Gallo <tonicucoz@gmail.com> | 2013-10-14 16:06:56 +0000 |
commit | a93461b231fb94f3a6a9df09a30557732201ddcc (patch) | |
tree | f278951ee7746da2a618ec57043c57fafe779c1d /h-source/Library/Html/Form.php | |
parent | 6fa0219202ce4ccc5c4592e66031bb0f7f8be2b0 (diff) |
added new EasyGiant Library
Diffstat (limited to 'h-source/Library/Html/Form.php')
-rw-r--r-- | h-source/Library/Html/Form.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/h-source/Library/Html/Form.php b/h-source/Library/Html/Form.php index ec81cfb..64c501f 100644 --- a/h-source/Library/Html/Form.php +++ b/h-source/Library/Html/Form.php @@ -208,4 +208,29 @@ class Html_Form { return $returnString; } + //return the HTML of an <input type='submit' ...> + //$name: the name of the input + //$value: the value of the input + //$className: the class name of the input + //$idName: name of the id + //$image: url of the image (if it is an image button) + //$attributes: list of attributes + static public function submit($name, $value, $className = null, $idName = null, $image = null, $attributes = null) + { + $strClass = isset($className) ? "class='".$className."'" : null; + $idStr = isset($idName) ? "id='".$idName."'" : null; + + if (isset($image)) + { + $returnString = "<input $attributes $idStr $strClass type='image' src='".$image."' value='$value'>\n"; + $returnString .= "<input type='hidden' name='".$name."' value='$value'>\n"; + } + else + { + $returnString ="<input $attributes $idStr $strClass type='submit' name='" .$name. "' value = '$value' />\n"; + } + + return $returnString; + } + }
\ No newline at end of file |