| @@ 130-165 (lines=36) @@ | ||
| 127 | break; |
|
| 128 | } |
|
| 129 | ||
| 130 | if ($allowupload) { |
|
| 131 | if ('edit' === $op) { |
|
| 132 | $sfiles = new sFiles(); |
|
| 133 | $filesarr = []; |
|
| 134 | $filesarr = $sfiles->getAllbyStory($storyid); |
|
| 135 | if (count($filesarr) > 0) { |
|
| 136 | $upl_tray = new XoopsFormElementTray(_AM_UPLOAD_ATTACHFILE, '<br>'); |
|
| 137 | $upl_checkbox = new XoopsFormCheckBox('', 'delupload[]'); |
|
| 138 | ||
| 139 | foreach ($filesarr as $onefile) { |
|
| 140 | $link = sprintf("<a href='%s/%s' target='_blank'>%s</a>\n", XOOPS_UPLOAD_URL, $onefile->getDownloadname('S'), $onefile->getFileRealName('S')); |
|
| 141 | $upl_checkbox->addOption($onefile->getFileid(), $link); |
|
| 142 | } |
|
| 143 | $upl_tray->addElement($upl_checkbox, false); |
|
| 144 | $dellabel = new XoopsFormLabel(_AM_DELETE_SELFILES, ''); |
|
| 145 | $upl_tray->addElement($dellabel, false); |
|
| 146 | $sform->addElement($upl_tray); |
|
| 147 | } |
|
| 148 | } |
|
| 149 | $sform->addElement(new XoopsFormFile(_AM_SELFILE, 'attachedfile', $xoopsModuleConfig['maxuploadsize']), false); |
|
| 150 | if ('edit' === $op) { |
|
| 151 | if (isset($picture) && '' !== xoops_trim($picture)) { |
|
| 152 | $pictureTray = new XoopsFormElementTray(_NW_CURENT_PICTURE, '<br>'); |
|
| 153 | $pictureTray->addElement(new XoopsFormLabel('', "<img src='" . XOOPS_URL . '/uploads/news/image/' . $picture . "'>")); |
|
| 154 | $deletePicureCheckbox = new XoopsFormCheckBox('', 'deleteimage', 0); |
|
| 155 | $deletePicureCheckbox->addOption(1, _DELETE); |
|
| 156 | $pictureTray->addElement($deletePicureCheckbox); |
|
| 157 | $sform->addElement($pictureTray); |
|
| 158 | } |
|
| 159 | } |
|
| 160 | if (!isset($pictureinfo)) { |
|
| 161 | $pictureinfo = ''; |
|
| 162 | } |
|
| 163 | $sform->addElement(new XoopsFormFile(_NW_SELECT_IMAGE, 'attachedimage', $xoopsModuleConfig['maxuploadsize']), false); |
|
| 164 | $sform->addElement(new XoopsFormText(_NW_SELECT_IMAGE_DESC, 'pictureinfo', 50, 255, $pictureinfo), false); |
|
| 165 | } |
|
| 166 | ||
| 167 | $option_tray = new XoopsFormElementTray(_OPTIONS, '<br>'); |
|
| 168 | //Set date of publish/expiration |
|
| @@ 127-159 (lines=33) @@ | ||
| 124 | break; |
|
| 125 | } |
|
| 126 | ||
| 127 | if ($allowupload) { |
|
| 128 | if ('edit' === $op) { |
|
| 129 | $sfiles = new sFiles(); |
|
| 130 | $filesarr = []; |
|
| 131 | $filesarr = $sfiles->getAllbyStory($storyid); |
|
| 132 | if (count($filesarr) > 0) { |
|
| 133 | $upl_tray = new XoopsFormElementTray(_AM_UPLOAD_ATTACHFILE, '<br>'); |
|
| 134 | $upl_checkbox = new XoopsFormCheckBox('', 'delupload[]'); |
|
| 135 | ||
| 136 | foreach ($filesarr as $onefile) { |
|
| 137 | $link = sprintf("<a href='%s/%s' target='_blank'>%s</a>\n", XOOPS_UPLOAD_URL, $onefile->getDownloadname('S'), $onefile->getFileRealName('S')); |
|
| 138 | $upl_checkbox->addOption($onefile->getFileid(), $link); |
|
| 139 | } |
|
| 140 | $upl_tray->addElement($upl_checkbox, false); |
|
| 141 | $dellabel = new XoopsFormLabel(_AM_DELETE_SELFILES, ''); |
|
| 142 | $upl_tray->addElement($dellabel, false); |
|
| 143 | $sform->addElement($upl_tray); |
|
| 144 | } |
|
| 145 | } |
|
| 146 | $sform->addElement(new XoopsFormFile(_AM_SELFILE, 'attachedfile', $xoopsModuleConfig['maxuploadsize']), false); |
|
| 147 | if ('edit' === $op) { |
|
| 148 | if (isset($picture) && '' !== xoops_trim($picture)) { |
|
| 149 | $pictureTray = new XoopsFormElementTray(_NW_CURENT_PICTURE, '<br>'); |
|
| 150 | $pictureTray->addElement(new XoopsFormLabel('', "<img src='" . XOOPS_URL . '/uploads/news/image/' . $picture . "'>")); |
|
| 151 | $deletePicureCheckbox = new XoopsFormCheckBox('', 'deleteimage', 0); |
|
| 152 | $deletePicureCheckbox->addOption(1, _DELETE); |
|
| 153 | $pictureTray->addElement($deletePicureCheckbox); |
|
| 154 | $sform->addElement($pictureTray); |
|
| 155 | } |
|
| 156 | } |
|
| 157 | $sform->addElement(new XoopsFormFile(_NW_SELECT_IMAGE, 'attachedimage', $xoopsModuleConfig['maxuploadsize']), false); |
|
| 158 | $sform->addElement(new XoopsFormText(_NW_SELECT_IMAGE_DESC, 'pictureinfo', 50, 255, $pictureinfo), false); |
|
| 159 | } |
|
| 160 | ||
| 161 | $option_tray = new XoopsFormElementTray(_OPTIONS, '<br>'); |
|
| 162 | //Set date of publish/expiration |
|