You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							39 lines
						
					
					
						
							840 B
						
					
					
				
			
		
		
	
	
							39 lines
						
					
					
						
							840 B
						
					
					
				<?php
 | 
						|
 | 
						|
/* For licensing terms, see /license.txt */
 | 
						|
 | 
						|
use Chamilo\PluginBundle\Entity\XApi\ToolLaunch;
 | 
						|
use Symfony\Component\HttpFoundation\Request as HttpRequest;
 | 
						|
 | 
						|
require_once __DIR__.'/../../main/inc/global.inc.php';
 | 
						|
 | 
						|
api_protect_course_script(true);
 | 
						|
api_protect_teacher_script();
 | 
						|
 | 
						|
$request = HttpRequest::createFromGlobals();
 | 
						|
 | 
						|
$em = Database::getManager();
 | 
						|
 | 
						|
$toolLaunch = $em->find(
 | 
						|
    ToolLaunch::class,
 | 
						|
    $request->query->getInt('delete')
 | 
						|
);
 | 
						|
 | 
						|
if (null === $toolLaunch
 | 
						|
    || $toolLaunch->getCourse()->getId() !== api_get_course_entity()->getId()
 | 
						|
) {
 | 
						|
    api_not_allowed(true);
 | 
						|
}
 | 
						|
 | 
						|
$plugin = XApiPlugin::create();
 | 
						|
 | 
						|
$em = Database::getManager();
 | 
						|
$em->remove($toolLaunch);
 | 
						|
$em->flush();
 | 
						|
 | 
						|
Display::addFlash(
 | 
						|
    Display::return_message($plugin->get_lang('ActivityDeleted'), 'success')
 | 
						|
);
 | 
						|
 | 
						|
header('Location: '.api_get_course_url());
 | 
						|
exit;
 | 
						|
 |