aboutsummaryrefslogtreecommitdiff
path: root/mod/file/pages/file/edit.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/file/pages/file/edit.php')
-rw-r--r--mod/file/pages/file/edit.php40
1 files changed, 40 insertions, 0 deletions
diff --git a/mod/file/pages/file/edit.php b/mod/file/pages/file/edit.php
new file mode 100644
index 000000000..b396c6e9b
--- /dev/null
+++ b/mod/file/pages/file/edit.php
@@ -0,0 +1,40 @@
+<?php
+/**
+ * Edit a file
+ *
+ * @package ElggFile
+ */
+
+elgg_load_library('elgg:file');
+
+gatekeeper();
+
+$file_guid = (int) get_input('guid');
+$file = new FilePluginFile($file_guid);
+if (!$file) {
+ forward();
+}
+if (!$file->canEdit()) {
+ forward();
+}
+
+$title = elgg_echo('file:edit');
+
+elgg_push_breadcrumb(elgg_echo('file'), "file/all");
+elgg_push_breadcrumb($file->title, $file->getURL());
+elgg_push_breadcrumb($title);
+
+elgg_set_page_owner_guid($file->getContainerGUID());
+
+$form_vars = array('enctype' => 'multipart/form-data');
+$body_vars = file_prepare_form_vars($file);
+
+$content = elgg_view_form('file/upload', $form_vars, $body_vars);
+
+$body = elgg_view_layout('content', array(
+ 'content' => $content,
+ 'title' => $title,
+ 'filter' => '',
+));
+
+echo elgg_view_page($title, $body);