Differences From Artifact [fafcd7113d]:

To Artifact [011b7e1400]:


19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
}

$csrf_key = 'attach_' . $page->id();

$form->runIf('delete', function () use ($page) {
	$file = Files::get((int) f('delete'));

	if (!$file->getLinkedId($file::LINK_FILE) == $page->id()) {
		throw new UserException('Ce fichier n\'est pas lié à cette page');
	}

	$file->delete();
}, $csrf_key, Utils::getSelfURI());









|







19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
}

$csrf_key = 'attach_' . $page->id();

$form->runIf('delete', function () use ($page) {
	$file = Files::get((int) f('delete'));

	if (!$file->checkContext($file::CONTEXT_FILE, $page->id())) {
		throw new UserException('Ce fichier n\'est pas lié à cette page');
	}

	$file->delete();
}, $csrf_key, Utils::getSelfURI());


64
65
66
67
68
69
70
71

72
73
$files = $page->getAttachmentsGallery(true);
$images = $page->getImageGallery(true);
$max_size = Utils::getMaxUploadSize();

$tpl->assign(compact('page', 'files', 'images', 'max_size', 'csrf_key'));
$tpl->assign('sent', (bool)qg('sent'));

$tpl->assign('custom_js', ['upload_helper.js', 'wiki_fichiers.js']);


$tpl->display('web/_attach.tpl');







|
>


64
65
66
67
68
69
70
71
72
73
74
$files = $page->getAttachmentsGallery(true);
$images = $page->getImageGallery(true);
$max_size = Utils::getMaxUploadSize();

$tpl->assign(compact('page', 'files', 'images', 'max_size', 'csrf_key'));
$tpl->assign('sent', (bool)qg('sent'));

$tpl->assign('custom_js', ['upload_helper.min.js', 'wiki_fichiers.js']);
$tpl->assign('custom_css', ['!static/scripts/wiki_editor.css']);

$tpl->display('web/_attach.tpl');