function delete_courses_from_shop() { JRequest::checkToken() or jexit('Invalid Token'); $cid = JRequest::getVar('cid', array(), 'post', 'array'); if (count($cid) < 1) { JError::raiseError(500, JText::_('Select an item to delete')); } JoomdleHelperShop::delete_courses($cid); $this->setRedirect('index.php?option=com_joomdle&view=shop'); }