Overview
Comment:Fix: created and modifed in web page
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | dev
Files: files | file ages | folders
SHA3-256: 04edbaad531e45b0a9003ca844e2829725a75d72346f569295aa60f08c59f313
User & Date: bohwaz on 2021-01-25 18:21:52
Other Links: branch diff | manifest | tags
Context
2021-01-25
18:22
Fix created and modified in pages check-in: 5d63d72138 user: bohwaz tags: dev
18:21
Fix: created and modifed in web page check-in: 04edbaad53 user: bohwaz tags: dev
00:37
Add future parameter check-in: 69cafdd8b2 user: bohwaz tags: dev
Changes

Modified src/www/admin/web/edit.php from [db80a2fc02] to [4cd5b9a1ef].

30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
}

$show_diff = false;

$form->runIf('save', function () use ($page, $editing_started, &$show_diff) {
	$editing_started = new \DateTime($editing_started);

	if ($editing_started < $page->modified) {
		$show_diff = true;
		throw new UserException('La page a été modifiée par quelqu\'un d\'autre pendant que vous éditiez le contenu.');
	}

	$page->importForm();

	$page->save();
}, $csrf_key, Utils::getSelfURI() . '#saved');

$parent = $page->parent_id ? [$page->parent_id => Web::get($page->parent_id)->title] : null;
$encrypted = f('encrypted') || $page->file()->type == File::FILE_TYPE_ENCRYPTED;

$old_content = f('content');
$new_content = $page->raw();
$created = $page->file()->created;

$tpl->assign(compact('created', 'page', 'parent', 'editing_started', 'encrypted', 'csrf_key', 'old_content', 'new_content', 'show_diff'));

$tpl->assign('custom_js', ['wiki_editor.js', 'wiki-encryption.js']);
$tpl->assign('custom_css', ['wiki.css', 'scripts/wiki_editor.css']);

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







|














|







30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
}

$show_diff = false;

$form->runIf('save', function () use ($page, $editing_started, &$show_diff) {
	$editing_started = new \DateTime($editing_started);

	if ($editing_started < $page->modified()) {
		$show_diff = true;
		throw new UserException('La page a été modifiée par quelqu\'un d\'autre pendant que vous éditiez le contenu.');
	}

	$page->importForm();

	$page->save();
}, $csrf_key, Utils::getSelfURI() . '#saved');

$parent = $page->parent_id ? [$page->parent_id => Web::get($page->parent_id)->title] : null;
$encrypted = f('encrypted') || $page->file()->type == File::FILE_TYPE_ENCRYPTED;

$old_content = f('content');
$new_content = $page->raw();
$created = $page->created();

$tpl->assign(compact('created', 'page', 'parent', 'editing_started', 'encrypted', 'csrf_key', 'old_content', 'new_content', 'show_diff'));

$tpl->assign('custom_js', ['wiki_editor.js', 'wiki-encryption.js']);
$tpl->assign('custom_css', ['wiki.css', 'scripts/wiki_editor.css']);

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