/** * Deletes an item through the frontend My Galleries part */ function deleteItem() { global $rsgAccess, $mainframe; $my = JFactory::getUser(); $database = JFactory::getDBO(); $id = rsgInstance::getInt('id', ''); if ($id) { //Get gallery id $gallery_id = galleryUtils::getCatidFromFileId($id); //Check if file deletion is allowed in this gallery if ($rsgAccess->checkGallery('del_img', $gallery_id)) { $filename = galleryUtils::getFileNameFromId($id); imgUtils::deleteImage($filename); $mainframe->redirect(JRoute::_("index.php?option=com_rsgallery2&rsgOption=myGalleries"), JText::_('Image is deleted')); } else { $mainframe->redirect(JRoute::_("index.php?option=com_rsgallery2&rsgOption=myGalleries"), JText::_('USERIMAGE_NOTOWNER')); } } else { //No ID sent, no delete possible, back to my galleries $mainframe->redirect(JRoute::_("index.php?option=com_rsgallery2&rsgOption=myGalleries"), JText::_('No Id provided. Contact component developer')); } }