diff options
Diffstat (limited to 'mod/file/edit.php')
-rw-r--r-- | mod/file/edit.php | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/mod/file/edit.php b/mod/file/edit.php index da22cacdf..aa4b60a83 100644 --- a/mod/file/edit.php +++ b/mod/file/edit.php @@ -5,33 +5,37 @@ * @package ElggFile */ +elgg_load_library('elgg:file'); + gatekeeper(); $file_guid = (int) get_input('guid'); -$file = get_entity($file_guid); +$file = new FilePluginFile($file_guid); if (!$file) { forward(); } +if (!$file->canEdit()) { + forward(); +} + +$title = elgg_echo('file:edit'); elgg_push_breadcrumb(elgg_echo('file'), "pg/file/all/"); elgg_push_breadcrumb($file->title, $file->getURL()); -elgg_push_breadcrumb(elgg_echo('file:edit')); +elgg_push_breadcrumb($title); 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)); +$form_vars = array('enctype' => 'multipart/form-data'); +$body_vars = file_prepare_form_vars($file); +var_dump($body_vars); +$content = elgg_view_form('file/upload', $form_vars, $body_vars); $body = elgg_view_layout('content', array( 'content' => $content, 'title' => $title, 'filter' => '', - 'header' => '', + 'buttons' => '', )); echo elgg_view_page($title, $body); |