aboutsummaryrefslogtreecommitdiff
path: root/mod/externalpages/actions/edit.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/externalpages/actions/edit.php')
-rw-r--r--mod/externalpages/actions/edit.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/mod/externalpages/actions/edit.php b/mod/externalpages/actions/edit.php
new file mode 100644
index 000000000..edfffe168
--- /dev/null
+++ b/mod/externalpages/actions/edit.php
@@ -0,0 +1,25 @@
+<?php
+/**
+ * Elgg external pages: add/edit
+ *
+ */
+
+// Get input data
+$contents = get_input('expagescontent', '', false);
+$type = get_input('content_type');
+$previous_guid = get_input('expage_guid');
+
+// create object to hold the page details
+$expages = new ElggObject();
+$expages->subtype = $type;
+$expages->owner_guid = get_loggedin_userid();
+$expages->access_id = ACCESS_PUBLIC;
+$expages->title = $type;
+$expages->description = $contents;
+if (!$expages->save()) {
+ register_error(elgg_echo("expages:error"));
+ forward(REFERER);
+}
+
+system_message(elgg_echo("expages:posted"));
+forward(REFERER);