aboutsummaryrefslogtreecommitdiff
path: root/mod/file/edit.php
blob: da22cacdf94de5f9c2c8b51e04a7390c9a9118d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
/**
 * Edit a file
 *
 * @package ElggFile
 */

gatekeeper();

$file_guid = (int) get_input('guid');
$file = get_entity($file_guid);
if (!$file) {
	forward();
}

elgg_push_breadcrumb(elgg_echo('file'), "pg/file/all/");
elgg_push_breadcrumb($file->title, $file->getURL());
elgg_push_breadcrumb(elgg_echo('file:edit'));

elgg_set_page_owner_guid($file->getContainerGUID());

if (!$file->canEdit()) {
	forward();
}

$title = elgg_echo('file:edit');
$content = elgg_view_title($title);
$content .= elgg_view("file/upload", array('entity' => $file));

$body = elgg_view_layout('content', array(
	'content' => $content,
	'title' => $title,
	'filter' => '',
	'header' => '',
));

echo elgg_view_page($title, $body);