public function delete() { $jinput = JFactory::getApplication()->input; $id = $jinput->get('id', 0, 'integer'); $type = $jinput->get('type', '', 'string'); $result = false; $msg = ''; if ($id) { if ($type == 'prev') { $result = JDownloadsHelper::deletePreviewFile($id); } else { $result = JDownloadsHelper::deleteFile($id); } if ($result) { $msg = JText::_('COM_JDOWNLOADS_BACKEND_FILESEDIT_REMOVE_OK'); } else { $msg = JText::_('COM_JDOWNLOADS_BACKEND_FILESEDIT_REMOVE_ERROR'); } } // set redirect $this->setRedirect('index.php?option=com_jdownloads&task=download.edit&file_id=' . $id, $msg); }