X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2Fform%2FSubmit.class.php;h=5f8da37e5846e02e881057beb55d110e2d58da5b;hb=48ba99d8257be57e5e43a03e80ab5d8c782b5295;hp=91123c5519a34c4a8708f664069f2e0be5b6a8e1;hpb=cd5e077ecb497431decde4835138b877d63b261c;p=timetracker.git diff --git a/WEB-INF/lib/form/Submit.class.php b/WEB-INF/lib/form/Submit.class.php index 91123c55..5f8da37e 100644 --- a/WEB-INF/lib/form/Submit.class.php +++ b/WEB-INF/lib/form/Submit.class.php @@ -27,35 +27,25 @@ // +----------------------------------------------------------------------+ import('form.FormElement'); - + class Submit extends FormElement { - function __construct($name, $value = '') - { + function __construct($name) { $this->class = 'Submit'; $this->name = $name; - $this->value = $value; } function getHtml() { - - if ($this->id=="") $this->id = $this->name; - - $html = "\n\tname\" id=\"$this->id\""; - - if (!$this->isEnabled()) { - $html .= " disabled=\"true\""; - } - - $html .= " value=\"$this->value\""; - - if ($this->on_click) { - $html .= " onclick=\"".$this->on_click."\""; - } - - $html .= ">"; - - return $html; - } + if (empty($this->id)) + $this->id = $this->name; + + // Output HTML. + $html = "\n\tname\" id=\"$this->id\""; + $html .= " value=\"$this->value\""; + if ($this->on_click) $html .= " onclick=\"".$this->on_click."\""; + if (!$this->isEnabled()) $html .= " disabled"; + $html .= ">"; + + return $html; + } }