Ejemplo n.º 1
0
    function toHTML()
    {
        if ($this->class) {
            $class = ' class="' . $this->class . '"';
        } else {
            $class = '';
        }
        if ($this->tabindex) {
            $tabindex = ' tabindex="' . $this->tabindex . '"';
        } else {
            $tabindex = '';
        }
        $ret = '<span class="fileInputCluster">
<span class="fileInputObject">
    <input type="file" id="' . $this->name . '" name="' . $this->name . '"' . $class . $tabindex . ' />
</span>
';
        if ($this->existing_file) {
            $delete_check = new Checkbox('delete_' . $this->name, $this->class, 'true', new FormLabel('Delete'));
            if ($this->tabindex) {
                $delete_check->setTabindex($this->tabindex + 1);
            }
            $ret .= '<span class="' . $this->name . '_existingFile">
    Currently: ' . $this->existing_file . '
</span>
<span id="' . $this->name . '_existingFileObject" class="existingfileObject">
    ' . $delete_check->toHTML() . '
</span>
';
        }
        $ret = '
</span>';
        return $ret;
    }