1 <?php
2
3 4 5 6 7
8
9 namespace nk2580\wordsmith\Inputs\Fields;
10
11 use nk2580\wordsmith\Inputs\Input as Input;
12
13 14 15 16 17
18 class GalleryField extends Input {
19
20 public function printField() {
21 echo '<div class="image-upload">';
22 if (!$this->readonly) {
23 echo "<input type='hidden' name='" . $this->name . '" id="' . $this->name . '" value="'.$this->value.'" />';
24 if(!empty($this->value)){
25 echo "<img id='" . $this->name . "' src='".$this->value."' class='image-preview' />";
26 }
27 echo "<a data-toggle='image' data-target='#" . $this->name . "'>Select image</a>";
28 } else {
29 echo "<img src='".$this->value."' class='image-preview' />";
30 }
31 echo '</div>';
32 echo '<br/>';
33 }
34
35 private function add_script() {
36
37 }
38
39 }
40
41 ?>