/** * Load the form */ private function loadForm() { //--Add image field $this->field = $this->frm->addFile('images'); $this->mediaItems['field_video'] = $this->frm->addText('video')->parse(); $this->mediaItems['field_video_type'] = $this->frm->addDropdown('video_type', array(0 => 'YouTube', 1 => 'Vimeo', 2 => 'Vine'))->parse(); //--Check if mediaItems is empty if (!empty($this->mediaItems['images'])) { //--Loop the images and create checkbox foreach ($this->mediaItems['images'] as &$row) { //$row['chkDelete'] = $this->frm->addCheckbox("image-" . $row["id"])->parse(); $row['txtText'] = $this->frm->addTextarea("text-" . $row["id"], $row['text'])->setAttribute('style', 'resize: none;')->parse(); } } //--Check if mediaItems is empty if (!empty($this->mediaItems['files'])) { //--Loop the images and create checkbox foreach ($this->mediaItems['files'] as &$row) { //$row['chkDelete'] = $this->frm->addCheckbox("file-" . $row["id"])->parse(); $row['txtText'] = $this->frm->addTextarea("text-" . $row["id"], $row['text'])->setAttribute('style', 'resize: none;')->parse(); } } if (!empty($this->mediaItems['videos'])) { //--Loop the images and create checkbox foreach ($this->mediaItems['videos'] as &$row) { //$row['chkDelete'] = $this->frm->addCheckbox("file-" . $row["id"])->parse(); $row['txtText'] = $this->frm->addTextarea("text-" . $row["id"], $row['text'])->setAttribute('style', 'resize: none;')->parse(); } } }
/** * Load the form */ private function loadForm() { //--Add image field $this->field = $this->frm->addFile('images'); //--Check if mediaItems is empty if (!empty($this->mediaItems['images'])) { //--Loop the images and create checkbox foreach ($this->mediaItems['images'] as &$row) { //$row['chkDelete'] = $this->frm->addCheckbox("image-" . $row["id"])->parse(); $row['txtText'] = $this->frm->addTextarea("text-" . $row["id"], $row['text'])->setAttribute('style', 'resize: none;')->parse(); } } //--Check if mediaItems is empty if (!empty($this->mediaItems['files'])) { //--Loop the images and create checkbox foreach ($this->mediaItems['files'] as &$row) { //$row['chkDelete'] = $this->frm->addCheckbox("file-" . $row["id"])->parse(); $row['txtText'] = $this->frm->addTextarea("text-" . $row["id"], $row['text'])->setAttribute('style', 'resize: none;')->parse(); } } }