public function output() { if (strlen($this->value) > 0) { $dir = custom_fields::get_image_dir($this->field['directory']); $file = $dir . $this->value; echo <<<EOS <tr> \t<th> \t\t<span class="faux-label">{$this->label}</span><br /> \t</th> \t<td> \t\t<input id="delete_{$this->name}" name="delete_{$this->name}" type="checkbox" /> <label for="delete_{$this->name}">Delete</label><br /> \t\t<a href="{$file}" target="_blank">View</a> \t</td> </tr> EOS; } else { echo <<<EOS <tr> \t<th> \t\t<label for="{$this->name}">{$this->label}</label><br /> \t</th> \t<td> \t\t<input type="file" id="{$this->name}" name="{$this->name}" /> \t\t<input type="button" value="Upload" onclick="document.post.enctype = 'multipart/form-data'; document.post.submit();" /> \t</td> </tr> EOS; } }